-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Austenem/CAT-754 Refactor "My Lists" (#3671)
* add ukv endpoint * pull authenticated lists into my lists page * implement add functionality * refactor hooks * update deletion functionality * update lists functionality * fix typing * add entity to list functionality * edit and deletion functionality * liststobedeleted functionality * remove savedlistscontent * update stores * move logic to hooks * typescript conversions and list page update * adjust useeffect and language * add documentation, minor updates * fix re-rendering issue * copy over local lists and entities * update local to remote copy logic * update save entity logic * update alerts * continue adding alerts * add save entities button to search page * update saved items table, add button to table * adjust button tooltips * add barrel files * convert to ts * continue conversions * separate out api and store * update tests * fix minor uuid bug, adjust menu button * sort items * continue to add sorting * clean up and add changelog * update list page * update isLoading bool to pass test * remove lists page for unauthenticated users * refactor alerts * hide list buttons from unauthenticated users * finish refactoring hooks * fix new list dialog * minor updates and extend alerts * update jest test * update test and implement copy logic * update hook to use default export * update storage description * minor cleanup * finish deleting stores * update logged out description * add save entity button to processed datasets * review cleanup 1 * update import * update hooks * Austenem/CAT-1135 Update /services (#3687) * add ukv service * remove logs * add changelog * memoize entity counts * Austenem/CAT-1113 Add list metrics (#3689) * add categories and update organ page table * finish adding tracking * finish adding tested tracking * consolidate save entity tracking * update imports * add changelog * add ref * add additional check * separate out save entity hook
- Loading branch information
Showing
81 changed files
with
1,504 additions
and
731 deletions.
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.