Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Bookmarking Sets of Layers #1185

Merged
merged 9 commits into from
May 8, 2024
Merged

Add Bookmarking Sets of Layers #1185

merged 9 commits into from
May 8, 2024

Conversation

dhochbaum-dcp
Copy link
Contributor

@dhochbaum-dcp dhochbaum-dcp commented Mar 22, 2024

This PR allows users to bookmark the current layers, and access their bookmarked layers in the saved menu.

image

Completes #1192

Copy link

netlify bot commented Mar 22, 2024

Deploy Preview for labs-zola ready!

Name Link
🔨 Latest commit 8aadc56
🔍 Latest deploy log https://app.netlify.com/sites/labs-zola/deploys/6627c4a56aad8a0008ed54f7
😎 Deploy Preview https://deploy-preview-1185--labs-zola.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@dhochbaum-dcp dhochbaum-dcp marked this pull request as ready for review April 16, 2024 18:24
@dhochbaum-dcp dhochbaum-dcp requested a review from a team as a code owner April 16, 2024 18:24
app/controllers/bookmarks.js Outdated Show resolved Hide resolved
@@ -6,6 +7,25 @@ import { Promise } from 'rsvp';
export default Controller.extend({
mainMap: service(),
metrics: service(),
router: service(),

savedLayerSets: window.localStorage['saved-layer-sets']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be more trouble than it's worth but did you consider making an Ember model for these bookmarkable layer sets, similar to how we have a bookmark model already? This approach isn't bad but using a model might be more Ember-y

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered it, but abandoned the idea after looking at the way the bookmarks were set up and finding the abstraction was a little much for me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about you spend another day or two on that approach? We already use LocalStorageSerializer in the serializer for bookmarks and you may be able to take advantage of the existing layer group model for a property on your new model.

Keeping all of this in a controller feels like breaking Ember's conventions which tends to lead to tech debt. I'm more comfortable taking on debt in this repo than I would be in a newer thing, but I think this situation warrants spending a little more time trying to do it the "ideal" way.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dhochbaum-dcp Have you spent any more time on the approach I described here? If you have and are still hitting a wall, I won't hold up the PR over it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I spent another day on it and got nowhere.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I'll take another look at the PR as is and leave a review.

@@ -6,6 +7,25 @@ import { Promise } from 'rsvp';
export default Controller.extend({
mainMap: service(),
metrics: service(),
router: service(),

savedLayerSets: window.localStorage['saved-layer-sets']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about you spend another day or two on that approach? We already use LocalStorageSerializer in the serializer for bookmarks and you may be able to take advantage of the existing layer group model for a property on your new model.

Keeping all of this in a controller feels like breaking Ember's conventions which tends to lead to tech debt. I'm more comfortable taking on debt in this repo than I would be in a newer thing, but I think this situation warrants spending a little more time trying to do it the "ideal" way.

@dhochbaum-dcp dhochbaum-dcp merged commit 86b65eb into develop May 8, 2024
4 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants