This repository was archived by the owner on Nov 14, 2023. It is now read-only.
forked from hypertrace/hypertrace-ui
-
Notifications
You must be signed in to change notification settings - Fork 2
feat: save Explorer queries to localStorage #32
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
35f2534
chore: update package-lock to v2
b3cbe7f
feat: add save icon
1e8be48
feat: add Save Query button to Explorer
92850f4
chore: lint fixes
d87177a
feat: replace localStorage with preferenceService
b1f036e
feat: add feature flag for saved queries
fcbbbfe
refactor: replace localStorage with preferenceService for reading pre…
5a1184a
test: show notification when query saved successfully
09fc481
test: fix mock return values
9530f65
feat: move save query button above filter bar
2813e6e
feat: add scope to saved queries
36cc884
test: add null check for failing test
0297ff8
refactor: move subscription to constructor
bee810c
refactor: replace metadata.scope with currentContext
bb34e51
chore: remove scope from filter attributes interface
fb9b228
refactor: filters to filterUrlStrings
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| export const enum ApplicationFeature { | ||
| PageTimeRange = 'ui.page-time-range' | ||
| PageTimeRange = 'ui.page-time-range', | ||
| SavedQueries = 'ui.saved-queries' | ||
| } |
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
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
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
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
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
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.
I think we can make a do without having this
currentContextvariable here.As to how, we can change the
contextChangeSubject(notcurrentContext$) fromSubjecttoBehaviorSubject.BehaviorSubjectareSubjectwhich directly give us their current value without being subscribed to. Given both of them are referring to typeExplorerGeneratedDashboardContext, we can docontextChangeSubject.getValue(). That will also facilitate setting the initial value :)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.
Also, it's more of a nitpick comment, so you can ignore it if you want.
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 tried changing the Subject to BehaviourSubject by changing
to
But TypeScript is going crazy with errors:
Am I doing something wrong?
Uh oh!
There was an error while loading. Please reload this page.
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.
@cseas
Ohh, there are two ways to handle this, that would resolve everything. You can bake it in future PRs if it makes sense.
OR
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.
That worked. Thanks!
Change added to the next PR in the below commit:
ae6eea6
But changing
SubjecttoBehaviorSubjectstarted failing an existing test, couldn't figure out why so I reverted the change.Here's the failing test:
https://github.com/razorpay/hypertrace-ui/runs/6450485969?check_suite_focus=true#step:4:1235