-
Notifications
You must be signed in to change notification settings - Fork 2
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
Austenem/CAT-754 Refactor "My Lists" #3671
Open
austenem
wants to merge
57
commits into
main
Choose a base branch
from
austenem/cat-754-refactor-my-lists
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
a3d8db0
add ukv endpoint
austenem c175b6c
pull authenticated lists into my lists page
austenem f053c9e
implement add functionality
austenem 79e358b
refactor hooks
austenem 474e6ff
update deletion functionality
austenem 535979c
update lists functionality
austenem 72d9e54
fix typing
austenem b2721d8
add entity to list functionality
austenem f9a2919
edit and deletion functionality
austenem 8a4b318
liststobedeleted functionality
austenem 5ac2d16
remove savedlistscontent
austenem e0a60e1
update stores
austenem b0c654f
move logic to hooks
austenem 2ad59ef
typescript conversions and list page update
austenem 56476b0
adjust useeffect and language
austenem 5ab11ea
add documentation, minor updates
austenem c3a2e27
fix re-rendering issue
austenem 7a1b127
copy over local lists and entities
austenem 62be1cd
update local to remote copy logic
austenem d45d82d
update save entity logic
austenem 4f8b5e2
update alerts
austenem 5a86baa
continue adding alerts
austenem 2714c12
add save entities button to search page
austenem 65dd5ab
update saved items table, add button to table
austenem 6738147
adjust button tooltips
austenem 19f6c9b
add barrel files
austenem 8b6ca64
convert to ts
austenem b6f1209
continue conversions
austenem 972cba2
separate out api and store
austenem c994ddc
update tests
austenem c4126bc
fix minor uuid bug, adjust menu button
austenem da6a178
sort items
austenem 6d017c6
continue to add sorting
austenem 76511e4
clean up and add changelog
austenem 135fbf3
update list page
austenem 7be52bb
update isLoading bool to pass test
austenem dc73e1f
remove lists page for unauthenticated users
austenem 264190b
refactor alerts
austenem bbbc912
hide list buttons from unauthenticated users
austenem b5d114e
finish refactoring hooks
austenem 6f60d73
fix new list dialog
austenem b4091cb
minor updates and extend alerts
austenem 255339d
update jest test
austenem cdc7d18
update test and implement copy logic
austenem 5706f9b
update hook to use default export
austenem 7b60842
update storage description
austenem aa17827
minor cleanup
austenem e665d2f
finish deleting stores
austenem 71d431e
update logged out description
austenem d22059f
add save entity button to processed datasets
austenem 3acb253
review cleanup 1
austenem bc39893
update import
austenem 73bf0ef
Merge branch 'main' into austenem/cat-754-refactor-my-lists
austenem 471b152
update hooks
austenem add1bf4
Austenem/CAT-1135 Update /services (#3687)
austenem 6ee9dc2
memoize entity counts
austenem 8de28a8
Austenem/CAT-1113 Add list metrics (#3689)
austenem 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
- Add metrics for the "My Lists" feature. |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- Update "My Lists" feature to persist across devices for logged-in users. | ||
- Update "My Lists" UI and messaging. |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
- Update services page to include new UKV endpoint. |
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
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
24 changes: 0 additions & 24 deletions
24
context/app/static/js/components/detailPage/SaveEditEntityButton/SaveEditEntityButton.tsx
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
context/app/static/js/components/detailPage/SaveEditEntityButton/index.ts
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
context/app/static/js/components/detailPage/SaveEditEntityButton/style.ts
This file was deleted.
Oops, something went wrong.
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
47 changes: 47 additions & 0 deletions
47
...atic/js/components/detailPage/summary/SummarySaveEntityButton/SummarySaveEntityButton.tsx
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React, { useState } from 'react'; | ||
import { useAppContext } from 'js/components/Contexts'; | ||
import useSavedLists from 'js/components/savedLists/hooks'; | ||
import { Entity } from 'js/components/types'; | ||
import EditSavedStatusDialog from 'js/components/savedLists/EditSavedStatusDialog'; | ||
import { WhiteRectangularTooltipIconButton } from 'js/shared-styles/buttons/TooltipButton'; | ||
import { EditSavedEntityIcon, SaveEntityIcon } from 'js/shared-styles/icons'; | ||
|
||
function SaveEntityButton({ uuid }: Pick<Entity, 'uuid'>) { | ||
const { useHandleSaveEntity } = useSavedLists(); | ||
const handleSaveEntity = useHandleSaveEntity({ entityUUID: uuid }); | ||
|
||
return ( | ||
<WhiteRectangularTooltipIconButton onClick={handleSaveEntity} tooltip="Save to list"> | ||
<SaveEntityIcon color="primary" /> | ||
</WhiteRectangularTooltipIconButton> | ||
); | ||
} | ||
|
||
function EditSavedEntityButton({ uuid }: Pick<Entity, 'uuid'>) { | ||
const [dialogIsOpen, setDialogIsOpen] = useState(false); | ||
|
||
return ( | ||
<> | ||
<WhiteRectangularTooltipIconButton | ||
onClick={() => { | ||
setDialogIsOpen(true); | ||
}} | ||
tooltip="Edit saved status" | ||
> | ||
<EditSavedEntityIcon color="primary" /> | ||
</WhiteRectangularTooltipIconButton> | ||
<EditSavedStatusDialog dialogIsOpen={dialogIsOpen} setDialogIsOpen={setDialogIsOpen} uuid={uuid} /> | ||
</> | ||
); | ||
} | ||
|
||
export default function SummarySaveEntityButton({ uuid }: Pick<Entity, 'uuid'>) { | ||
const { savedEntities } = useSavedLists(); | ||
const { isAuthenticated } = useAppContext(); | ||
|
||
if (!isAuthenticated) { | ||
return null; | ||
} | ||
|
||
return uuid in savedEntities.savedEntities ? <EditSavedEntityButton uuid={uuid} /> : <SaveEntityButton uuid={uuid} />; | ||
} |
3 changes: 3 additions & 0 deletions
3
context/app/static/js/components/detailPage/summary/SummarySaveEntityButton/index.ts
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import SummarySaveEntityButton from './SummarySaveEntityButton'; | ||
|
||
export default SummarySaveEntityButton; |
Oops, something went wrong.
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.
Why rename the variables with prop*?
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 was to avoid naming the final description/creation info variables in the function body like
checkedDescription
- this way they get to keep their intended names (description
, etc) and there's a clear distinction between these and the optional prop variables.