Conversation
annehaley
force-pushed
the
proj-scope-default-style
branch
from
September 18, 2026 19:20
7682bb3 to
4e12413
Compare
Deploying geodatalytics with
|
| Latest commit: |
4e12413
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://bfe17178.geodatalytics.pages.dev |
| Branch Preview URL: | https://proj-scope-default-style.geodatalytics.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #491. With these changes, you can now have the same dataset added to two different projects, and the styles created for that dataset's layers in one project will not affect the other project.
This PR removes the
default_stylefield from the Layer object. That field was mixing the Layer scope (dataset-based) with the LayerStyle scope (project-based). Instead, this PR adds back theis_defaultboolean field on the LayerStyle. A Layer can have more than one LayerStyle whereis_defaultis True, but only one per project.When the client fetches the available layers for a dataset, it now sends the project ID as a query parameter. The LayerSerializer will include the default style for that project. If a project ID is not provided in the query parameters, then the default style will be None.
This PR also adds a test for the various behaviors relating to the scope of a default style. The test checks the following behaviors:
is_default=Trueexist for the layer in the provided project.is_default=Trueis created in that project for that layer, then style B will be the new default style for that layer in that project, and style A will have itsis_defaultvalue set to False.is_defaultback to True, then style A will be the default again and style B will have itsis_defaultvalue set to False.is_defaultvalue set back to True again.