-
Notifications
You must be signed in to change notification settings - Fork 29
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
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c815ebc
Adding, loading, and saving all work
dhochbaum-dcp c58371c
Updating the name works
dhochbaum-dcp b47ce42
Updates the dom correctly
dhochbaum-dcp 6ba0dc8
Added analytics
dhochbaum-dcp 086f0dc
Updated no bookmarks message and formatted input
dhochbaum-dcp 03cc093
Updated view for no saved layer sets
dhochbaum-dcp b7e8b62
# of bookmarks in menu badge now includes saved layer sets
dhochbaum-dcp 94cc054
Loading bookmarks updates URL, number updates correctly, fixed tracki…
dhochbaum-dcp 8aadc56
Moved array to a variable
dhochbaum-dcp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
import Component from '@ember/component'; | ||
import { inject as service } from '@ember/service'; | ||
import { computed } from '@ember/object'; | ||
import { tracked } from '@glimmer/tracking'; | ||
|
||
export default class MainHeaderComponent extends Component { | ||
@service('print') printSvc; | ||
|
||
@service() media; | ||
|
||
bookmarks; | ||
@tracked bookmarks; | ||
|
||
@tracked savedLayerSets; | ||
|
||
@computed('bookmarks.length', 'savedLayerSets.length') | ||
get totalBookmarks() { | ||
return this.bookmarks.length + this.savedLayerSets.length; | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
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-yThere was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.