@databiosphere/findable-ui 48.1.0 → 49.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/release-please.yml +0 -22
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +39 -0
- package/backend/main.py +0 -1
- package/lib/common/ai/config/types.d.ts +22 -0
- package/lib/common/ai/config/types.js +1 -0
- package/lib/common/ai/constants.d.ts +3 -0
- package/lib/common/ai/constants.js +3 -0
- package/lib/common/categories/config/types.d.ts +2 -1
- package/lib/common/chart/sort/constants.d.ts +5 -0
- package/lib/common/chart/sort/constants.js +9 -0
- package/lib/common/chart/sort/types.d.ts +16 -0
- package/lib/common/chart/sort/types.js +8 -0
- package/lib/common/chart/sort/utils.d.ts +7 -0
- package/lib/common/chart/sort/utils.js +19 -0
- package/lib/common/chart/types.d.ts +5 -0
- package/lib/common/chart/types.js +1 -0
- package/lib/common/entities.d.ts +2 -1
- package/lib/components/Export/components/DownloadCurlCommand/downloadCurlCommand.d.ts +0 -2
- package/lib/components/Export/components/ExportToTerra/exportToTerra.d.ts +0 -2
- package/lib/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/manifestDownloadEntity.d.ts +0 -2
- package/lib/components/Export/components/ManifestDownload/manifestDownload.d.ts +0 -2
- package/lib/components/Filter/components/FilterLabel/filterLabel.js +1 -1
- package/lib/components/Filter/components/FilterLabel/filterLabel.stories.d.ts +3 -0
- package/lib/components/Filter/components/FilterLabel/filterLabel.stories.js +5 -0
- package/lib/components/Filter/components/Filters/stories/constants.js +21 -1
- package/lib/components/Filter/components/SearchAllFilters/searchAllFilters.styles.js +2 -0
- package/lib/components/Filter/components/adapters/tanstack/ColumnFiltersAdapter/utils.js +1 -1
- package/lib/components/Index/components/EntityView/components/views/ChartView/chartView.js +2 -1
- package/lib/components/Index/components/EntityView/components/views/ChartView/components/Chart/hooks/UsePlotOptions/hook.js +2 -7
- package/lib/components/Index/components/EntityView/components/views/ChartView/components/Chart/stories/args.js +12 -12
- package/lib/components/Index/components/EntityView/components/views/ChartView/stories/args.js +3 -3
- package/lib/components/Index/components/EntityView/components/views/ChartView/utils.js +1 -1
- package/lib/components/Layout/components/Sidebar/components/SidebarTools/sidebarTools.styles.d.ts +4 -0
- package/lib/components/Layout/components/Sidebar/components/SidebarTools/sidebarTools.styles.js +4 -0
- package/lib/components/common/Chip/components/Beta/beta.d.ts +10 -0
- package/lib/components/common/Chip/components/Beta/beta.js +12 -0
- package/lib/components/common/Chip/components/Beta/beta.styles.d.ts +3 -0
- package/lib/components/common/Chip/components/Beta/beta.styles.js +14 -0
- package/lib/components/common/Chip/components/Beta/stories/beta.stories.d.ts +6 -0
- package/lib/components/common/Chip/components/Beta/stories/beta.stories.js +6 -0
- package/lib/components/common/CustomIcon/components/UpArrowIcon/upArrowIcon.d.ts +6 -0
- package/lib/components/common/CustomIcon/components/UpArrowIcon/upArrowIcon.js +8 -0
- package/lib/components/common/Tabs/tabs.js +1 -1
- package/lib/components/common/ToggleButtonGroup/provider/context.d.ts +2 -0
- package/lib/components/common/ToggleButtonGroup/provider/context.js +5 -0
- package/lib/components/common/ToggleButtonGroup/provider/hook.d.ts +7 -0
- package/lib/components/common/ToggleButtonGroup/provider/hook.js +9 -0
- package/lib/components/common/ToggleButtonGroup/provider/provider.d.ts +12 -0
- package/lib/components/common/ToggleButtonGroup/provider/provider.js +22 -0
- package/lib/components/common/ToggleButtonGroup/provider/types.d.ts +9 -0
- package/lib/components/common/ToggleButtonGroup/provider/types.js +1 -0
- package/lib/config/entities.d.ts +2 -0
- package/lib/hooks/ai/useAiRoutes/hook.d.ts +6 -0
- package/lib/hooks/ai/useAiRoutes/hook.js +18 -0
- package/lib/hooks/useCategoryFilter.js +1 -1
- package/lib/hooks/useFileManifest/common/entities.d.ts +0 -9
- package/lib/hooks/useFileManifest/common/entities.js +1 -9
- package/lib/styles/common/mui/drawer.d.ts +9 -0
- package/lib/styles/common/mui/drawer.js +15 -0
- package/lib/styles/common/mui/inputBase.d.ts +13 -0
- package/lib/styles/common/mui/inputBase.js +25 -0
- package/lib/styles/common/mui/stack.d.ts +11 -0
- package/lib/styles/common/mui/stack.js +22 -0
- package/lib/tests/testIds.d.ts +3 -0
- package/lib/tests/testIds.js +3 -0
- package/lib/views/EntityDetailView/entityDetailView.js +2 -2
- package/lib/views/ExploreView/entityList/filters/components/ToggleButtonGroup/toggleButtonGroup.d.ts +7 -0
- package/lib/views/ExploreView/entityList/filters/components/ToggleButtonGroup/toggleButtonGroup.js +18 -0
- package/lib/views/ExploreView/entityList/filters/components/ToggleButtonGroup/toggleButtonGroup.styles.d.ts +6 -0
- package/lib/views/ExploreView/entityList/filters/components/ToggleButtonGroup/toggleButtonGroup.styles.js +23 -0
- package/lib/views/ExploreView/entityList/filters/filters.styles.d.ts +7 -0
- package/lib/views/ExploreView/entityList/filters/filters.styles.js +17 -0
- package/lib/views/ExploreView/exploreView.js +3 -2
- package/lib/views/ResearchView/adapter/useAdapter.d.ts +6 -0
- package/lib/views/ResearchView/adapter/useAdapter.js +15 -0
- package/lib/views/ResearchView/assistant/assistant.d.ts +6 -0
- package/lib/views/ResearchView/assistant/assistant.js +18 -0
- package/lib/views/ResearchView/assistant/components/Drawer/drawer.d.ts +9 -0
- package/lib/views/ResearchView/assistant/components/Drawer/drawer.js +15 -0
- package/lib/views/ResearchView/assistant/components/Drawer/drawer.styles.d.ts +4 -0
- package/lib/views/ResearchView/assistant/components/Drawer/drawer.styles.js +21 -0
- package/lib/views/ResearchView/assistant/components/Drawer/types.d.ts +4 -0
- package/lib/views/ResearchView/assistant/components/Drawer/types.js +1 -0
- package/lib/views/ResearchView/assistant/components/Form/constants.d.ts +3 -0
- package/lib/views/ResearchView/assistant/components/Form/constants.js +3 -0
- package/lib/views/ResearchView/assistant/components/Form/form.d.ts +12 -0
- package/lib/views/ResearchView/assistant/components/Form/form.js +40 -0
- package/lib/views/ResearchView/assistant/components/Form/form.styles.d.ts +4 -0
- package/lib/views/ResearchView/assistant/components/Form/form.styles.js +7 -0
- package/lib/views/ResearchView/assistant/components/Form/types.d.ts +4 -0
- package/lib/views/ResearchView/assistant/components/Form/types.js +1 -0
- package/lib/views/ResearchView/assistant/components/Form/utils.d.ts +16 -0
- package/lib/views/ResearchView/assistant/components/Form/utils.js +41 -0
- package/lib/views/ResearchView/assistant/components/Input/constants.d.ts +2 -0
- package/lib/views/ResearchView/assistant/components/Input/constants.js +14 -0
- package/lib/views/ResearchView/assistant/components/Input/hooks/UseKeyShortCuts/constants.d.ts +7 -0
- package/lib/views/ResearchView/assistant/components/Input/hooks/UseKeyShortCuts/constants.js +7 -0
- package/lib/views/ResearchView/assistant/components/Input/hooks/UseKeyShortCuts/hook.d.ts +6 -0
- package/lib/views/ResearchView/assistant/components/Input/hooks/UseKeyShortCuts/hook.js +32 -0
- package/lib/views/ResearchView/assistant/components/Input/hooks/UseKeyShortCuts/types.d.ts +8 -0
- package/lib/views/ResearchView/assistant/components/Input/hooks/UseKeyShortCuts/types.js +1 -0
- package/lib/views/ResearchView/assistant/components/Input/hooks/UseKeyShortCuts/utils.d.ts +32 -0
- package/lib/views/ResearchView/assistant/components/Input/hooks/UseKeyShortCuts/utils.js +74 -0
- package/lib/views/ResearchView/assistant/components/Input/input.d.ts +9 -0
- package/lib/views/ResearchView/assistant/components/Input/input.js +19 -0
- package/lib/views/ResearchView/assistant/components/Input/input.styles.d.ts +8 -0
- package/lib/views/ResearchView/assistant/components/Input/input.styles.js +19 -0
- package/lib/views/ResearchView/assistant/components/Input/stories/input.stories.d.ts +6 -0
- package/lib/views/ResearchView/assistant/components/Input/stories/input.stories.js +11 -0
- package/lib/views/ResearchView/assistant/components/Input/types.d.ts +2 -0
- package/lib/views/ResearchView/assistant/components/Input/types.js +1 -0
- package/lib/views/ResearchView/assistant/components/Input/utils.d.ts +9 -0
- package/lib/views/ResearchView/assistant/components/Input/utils.js +25 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/AssistantMessage/assistantMessage.d.ts +9 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/AssistantMessage/assistantMessage.js +15 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/AssistantMessage/types.d.ts +4 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/AssistantMessage/types.js +1 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/AssistantMessage/utils.d.ts +13 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/AssistantMessage/utils.js +25 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/ErrorMessage/errorMessage.d.ts +9 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/ErrorMessage/errorMessage.js +12 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/ErrorMessage/types.d.ts +4 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/ErrorMessage/types.js +1 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/PromptMessage/components/Chips/chips.d.ts +3 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/PromptMessage/components/Chips/chips.js +10 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/PromptMessage/components/Chips/chips.styles.d.ts +3 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/PromptMessage/components/Chips/chips.styles.js +26 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/PromptMessage/components/Chips/types.d.ts +5 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/PromptMessage/components/Chips/types.js +1 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/PromptMessage/promptMessage.d.ts +10 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/PromptMessage/promptMessage.js +14 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/PromptMessage/types.d.ts +5 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/PromptMessage/types.js +1 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/UserMessage/types.d.ts +4 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/UserMessage/types.js +1 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/UserMessage/useMessage.styles.d.ts +5 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/UserMessage/useMessage.styles.js +10 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/UserMessage/userMessage.d.ts +9 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/UserMessage/userMessage.js +13 -0
- package/lib/views/ResearchView/assistant/components/Messages/hooks/UseScroll/hook.d.ts +7 -0
- package/lib/views/ResearchView/assistant/components/Messages/hooks/UseScroll/hook.js +17 -0
- package/lib/views/ResearchView/assistant/components/Messages/messages.d.ts +9 -0
- package/lib/views/ResearchView/assistant/components/Messages/messages.js +16 -0
- package/lib/views/ResearchView/assistant/components/Messages/messages.styles.d.ts +3 -0
- package/lib/views/ResearchView/assistant/components/Messages/messages.styles.js +9 -0
- package/lib/views/ResearchView/assistant/components/Messages/selector/messageSelector.d.ts +17 -0
- package/lib/views/ResearchView/assistant/components/Messages/selector/messageSelector.js +32 -0
- package/lib/views/ResearchView/assistant/components/Messages/selector/types.d.ts +5 -0
- package/lib/views/ResearchView/assistant/components/Messages/selector/types.js +1 -0
- package/lib/views/ResearchView/assistant/components/Messages/stories/args.d.ts +3 -0
- package/lib/views/ResearchView/assistant/components/Messages/stories/args.js +109 -0
- package/lib/views/ResearchView/assistant/components/Messages/stories/messages.stories.d.ts +6 -0
- package/lib/views/ResearchView/assistant/components/Messages/stories/messages.stories.js +14 -0
- package/lib/views/ResearchView/assistant/components/Messages/types.d.ts +4 -0
- package/lib/views/ResearchView/assistant/components/Messages/types.js +1 -0
- package/lib/views/ResearchView/assistant/components/ToggleButtonGroup/stories/toggleButtonGroup.stories.d.ts +6 -0
- package/lib/views/ResearchView/assistant/components/ToggleButtonGroup/stories/toggleButtonGroup.stories.js +12 -0
- package/lib/views/ResearchView/assistant/components/ToggleButtonGroup/toggleButtonGroup.d.ts +7 -0
- package/lib/views/ResearchView/assistant/components/ToggleButtonGroup/toggleButtonGroup.js +17 -0
- package/lib/views/ResearchView/assistant/components/ToggleButtonGroup/toggleButtonGroup.styles.d.ts +6 -0
- package/lib/views/ResearchView/assistant/components/ToggleButtonGroup/toggleButtonGroup.styles.js +20 -0
- package/lib/views/ResearchView/assistant/stories/args.d.ts +4 -0
- package/lib/views/ResearchView/assistant/stories/args.js +30 -0
- package/lib/views/ResearchView/assistant/stories/assistant.stories.d.ts +6 -0
- package/lib/views/ResearchView/assistant/stories/assistant.stories.js +23 -0
- package/lib/views/ResearchView/query/constants.d.ts +5 -0
- package/lib/views/ResearchView/query/constants.js +5 -0
- package/lib/views/ResearchView/query/fetch.d.ts +17 -0
- package/lib/views/ResearchView/query/fetch.js +44 -0
- package/lib/views/ResearchView/query/types.d.ts +31 -0
- package/lib/views/ResearchView/query/types.js +1 -0
- package/lib/views/ResearchView/query/useQuery.d.ts +7 -0
- package/lib/views/ResearchView/query/useQuery.js +44 -0
- package/lib/views/ResearchView/researchView.d.ts +10 -0
- package/lib/views/ResearchView/researchView.js +13 -0
- package/lib/views/ResearchView/state/actions/setError/action.d.ts +10 -0
- package/lib/views/ResearchView/state/actions/setError/action.js +17 -0
- package/lib/views/ResearchView/state/actions/setError/dispatch.d.ts +7 -0
- package/lib/views/ResearchView/state/actions/setError/dispatch.js +12 -0
- package/lib/views/ResearchView/state/actions/setError/types.d.ts +14 -0
- package/lib/views/ResearchView/state/actions/setError/types.js +1 -0
- package/lib/views/ResearchView/state/actions/setMessage/action.d.ts +10 -0
- package/lib/views/ResearchView/state/actions/setMessage/action.js +21 -0
- package/lib/views/ResearchView/state/actions/setMessage/dispatch.d.ts +7 -0
- package/lib/views/ResearchView/state/actions/setMessage/dispatch.js +12 -0
- package/lib/views/ResearchView/state/actions/setMessage/types.d.ts +15 -0
- package/lib/views/ResearchView/state/actions/setMessage/types.js +1 -0
- package/lib/views/ResearchView/state/actions/setQuery/action.d.ts +10 -0
- package/lib/views/ResearchView/state/actions/setQuery/action.js +17 -0
- package/lib/views/ResearchView/state/actions/setQuery/dispatch.d.ts +7 -0
- package/lib/views/ResearchView/state/actions/setQuery/dispatch.js +12 -0
- package/lib/views/ResearchView/state/actions/setQuery/types.d.ts +14 -0
- package/lib/views/ResearchView/state/actions/setQuery/types.js +1 -0
- package/lib/views/ResearchView/state/actions/setStatus/action.d.ts +10 -0
- package/lib/views/ResearchView/state/actions/setStatus/action.js +13 -0
- package/lib/views/ResearchView/state/actions/setStatus/dispatch.d.ts +7 -0
- package/lib/views/ResearchView/state/actions/setStatus/dispatch.js +12 -0
- package/lib/views/ResearchView/state/actions/setStatus/types.d.ts +14 -0
- package/lib/views/ResearchView/state/actions/setStatus/types.js +1 -0
- package/lib/views/ResearchView/state/actions/types.d.ts +17 -0
- package/lib/views/ResearchView/state/actions/types.js +10 -0
- package/lib/views/ResearchView/state/constants.d.ts +5 -0
- package/lib/views/ResearchView/state/constants.js +7 -0
- package/lib/views/ResearchView/state/context.d.ts +5 -0
- package/lib/views/ResearchView/state/context.js +9 -0
- package/lib/views/ResearchView/state/guards/guards.d.ts +33 -0
- package/lib/views/ResearchView/state/guards/guards.js +41 -0
- package/lib/views/ResearchView/state/hooks/UseChatDispatch/hook.d.ts +6 -0
- package/lib/views/ResearchView/state/hooks/UseChatDispatch/hook.js +26 -0
- package/lib/views/ResearchView/state/hooks/UseChatDispatch/types.d.ts +10 -0
- package/lib/views/ResearchView/state/hooks/UseChatDispatch/types.js +1 -0
- package/lib/views/ResearchView/state/hooks/UseChatReducer/hook.d.ts +8 -0
- package/lib/views/ResearchView/state/hooks/UseChatReducer/hook.js +12 -0
- package/lib/views/ResearchView/state/hooks/UseChatState/hook.d.ts +7 -0
- package/lib/views/ResearchView/state/hooks/UseChatState/hook.js +11 -0
- package/lib/views/ResearchView/state/initializer/initializer.d.ts +8 -0
- package/lib/views/ResearchView/state/initializer/initializer.js +22 -0
- package/lib/views/ResearchView/state/initializer/types.d.ts +2 -0
- package/lib/views/ResearchView/state/initializer/types.js +1 -0
- package/lib/views/ResearchView/state/provider.d.ts +16 -0
- package/lib/views/ResearchView/state/provider.js +17 -0
- package/lib/views/ResearchView/state/reducer.d.ts +10 -0
- package/lib/views/ResearchView/state/reducer.js +32 -0
- package/lib/views/ResearchView/state/types.d.ts +125 -0
- package/lib/views/ResearchView/state/types.js +22 -0
- package/package.json +1 -1
- package/src/common/ai/config/types.ts +25 -0
- package/src/common/ai/constants.ts +3 -0
- package/src/common/categories/config/types.ts +2 -1
- package/src/common/chart/sort/constants.ts +13 -0
- package/src/common/chart/sort/types.ts +22 -0
- package/src/common/chart/sort/utils.ts +22 -0
- package/src/common/chart/types.ts +6 -0
- package/src/common/entities.ts +2 -1
- package/src/components/Export/components/DownloadCurlCommand/downloadCurlCommand.tsx +0 -2
- package/src/components/Export/components/ExportToTerra/exportToTerra.tsx +0 -2
- package/src/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/manifestDownloadEntity.tsx +0 -2
- package/src/components/Export/components/ManifestDownload/manifestDownload.tsx +0 -2
- package/src/components/Filter/components/FilterLabel/filterLabel.stories.tsx +6 -0
- package/src/components/Filter/components/FilterLabel/filterLabel.tsx +6 -1
- package/src/components/Filter/components/Filters/stories/constants.ts +25 -1
- package/src/components/Filter/components/SearchAllFilters/searchAllFilters.styles.ts +2 -0
- package/src/components/Filter/components/adapters/tanstack/ColumnFiltersAdapter/utils.ts +1 -1
- package/src/components/Index/components/EntityView/components/views/ChartView/chartView.tsx +8 -2
- package/src/components/Index/components/EntityView/components/views/ChartView/components/Chart/hooks/UsePlotOptions/hook.ts +2 -7
- package/src/components/Index/components/EntityView/components/views/ChartView/components/Chart/stories/args.ts +12 -12
- package/src/components/Index/components/EntityView/components/views/ChartView/stories/args.ts +3 -3
- package/src/components/Index/components/EntityView/components/views/ChartView/utils.ts +1 -1
- package/src/components/Layout/components/Sidebar/components/SidebarTools/sidebarTools.styles.ts +4 -0
- package/src/components/common/Chip/components/Beta/beta.styles.ts +15 -0
- package/src/components/common/Chip/components/Beta/beta.tsx +25 -0
- package/src/components/common/Chip/components/Beta/stories/beta.stories.tsx +12 -0
- package/src/components/common/CustomIcon/components/UpArrowIcon/upArrowIcon.tsx +21 -0
- package/src/components/common/Tabs/tabs.tsx +5 -1
- package/src/components/common/ToggleButtonGroup/provider/context.ts +9 -0
- package/src/components/common/ToggleButtonGroup/provider/hook.ts +16 -0
- package/src/components/common/ToggleButtonGroup/provider/provider.tsx +37 -0
- package/src/components/common/ToggleButtonGroup/provider/types.ts +17 -0
- package/src/config/entities.ts +2 -0
- package/src/hooks/ai/useAiRoutes/hook.ts +22 -0
- package/src/hooks/useCategoryFilter.ts +1 -1
- package/src/hooks/useFileManifest/common/entities.ts +0 -11
- package/src/styles/common/mui/drawer.ts +24 -0
- package/src/styles/common/mui/inputBase.ts +38 -0
- package/src/styles/common/mui/stack.ts +33 -0
- package/src/tests/testIds.ts +3 -0
- package/src/views/EntityDetailView/entityDetailView.tsx +1 -3
- package/src/views/ExploreView/entityList/filters/components/ToggleButtonGroup/toggleButtonGroup.styles.ts +25 -0
- package/src/views/ExploreView/entityList/filters/components/ToggleButtonGroup/toggleButtonGroup.tsx +31 -0
- package/src/views/ExploreView/entityList/filters/filters.styles.ts +19 -0
- package/src/views/ExploreView/exploreView.tsx +16 -12
- package/src/views/ResearchView/adapter/useAdapter.ts +19 -0
- package/src/views/ResearchView/assistant/assistant.tsx +30 -0
- package/src/views/ResearchView/assistant/components/Drawer/drawer.styles.ts +24 -0
- package/src/views/ResearchView/assistant/components/Drawer/drawer.tsx +26 -0
- package/src/views/ResearchView/assistant/components/Drawer/types.ts +5 -0
- package/src/views/ResearchView/assistant/components/Form/constants.ts +3 -0
- package/src/views/ResearchView/assistant/components/Form/form.styles.ts +8 -0
- package/src/views/ResearchView/assistant/components/Form/form.tsx +55 -0
- package/src/views/ResearchView/assistant/components/Form/types.ts +11 -0
- package/src/views/ResearchView/assistant/components/Form/utils.ts +51 -0
- package/src/views/ResearchView/assistant/components/Input/constants.ts +16 -0
- package/src/views/ResearchView/assistant/components/Input/hooks/UseKeyShortCuts/constants.ts +7 -0
- package/src/views/ResearchView/assistant/components/Input/hooks/UseKeyShortCuts/hook.ts +45 -0
- package/src/views/ResearchView/assistant/components/Input/hooks/UseKeyShortCuts/types.ts +10 -0
- package/src/views/ResearchView/assistant/components/Input/hooks/UseKeyShortCuts/utils.ts +93 -0
- package/src/views/ResearchView/assistant/components/Input/input.styles.ts +21 -0
- package/src/views/ResearchView/assistant/components/Input/input.tsx +37 -0
- package/src/views/ResearchView/assistant/components/Input/stories/input.stories.tsx +21 -0
- package/src/views/ResearchView/assistant/components/Input/types.ts +3 -0
- package/src/views/ResearchView/assistant/components/Input/utils.ts +34 -0
- package/src/views/ResearchView/assistant/components/Messages/components/AssistantMessage/assistantMessage.tsx +49 -0
- package/src/views/ResearchView/assistant/components/Messages/components/AssistantMessage/types.ts +5 -0
- package/src/views/ResearchView/assistant/components/Messages/components/AssistantMessage/utils.ts +31 -0
- package/src/views/ResearchView/assistant/components/Messages/components/ErrorMessage/errorMessage.tsx +21 -0
- package/src/views/ResearchView/assistant/components/Messages/components/ErrorMessage/types.ts +5 -0
- package/src/views/ResearchView/assistant/components/Messages/components/PromptMessage/components/Chips/chips.styles.ts +27 -0
- package/src/views/ResearchView/assistant/components/Messages/components/PromptMessage/components/Chips/chips.tsx +31 -0
- package/src/views/ResearchView/assistant/components/Messages/components/PromptMessage/components/Chips/types.ts +6 -0
- package/src/views/ResearchView/assistant/components/Messages/components/PromptMessage/promptMessage.tsx +26 -0
- package/src/views/ResearchView/assistant/components/Messages/components/PromptMessage/types.ts +6 -0
- package/src/views/ResearchView/assistant/components/Messages/components/UserMessage/types.ts +5 -0
- package/src/views/ResearchView/assistant/components/Messages/components/UserMessage/useMessage.styles.ts +11 -0
- package/src/views/ResearchView/assistant/components/Messages/components/UserMessage/userMessage.tsx +21 -0
- package/src/views/ResearchView/assistant/components/Messages/hooks/UseScroll/hook.ts +22 -0
- package/src/views/ResearchView/assistant/components/Messages/messages.styles.ts +10 -0
- package/src/views/ResearchView/assistant/components/Messages/messages.tsx +29 -0
- package/src/views/ResearchView/assistant/components/Messages/selector/messageSelector.tsx +37 -0
- package/src/views/ResearchView/assistant/components/Messages/selector/types.ts +6 -0
- package/src/views/ResearchView/assistant/components/Messages/stories/args.ts +115 -0
- package/src/views/ResearchView/assistant/components/Messages/stories/messages.stories.tsx +24 -0
- package/src/views/ResearchView/assistant/components/Messages/types.ts +5 -0
- package/src/views/ResearchView/assistant/components/ToggleButtonGroup/stories/toggleButtonGroup.stories.tsx +22 -0
- package/src/views/ResearchView/assistant/components/ToggleButtonGroup/toggleButtonGroup.styles.ts +22 -0
- package/src/views/ResearchView/assistant/components/ToggleButtonGroup/toggleButtonGroup.tsx +30 -0
- package/src/views/ResearchView/assistant/stories/args.ts +36 -0
- package/src/views/ResearchView/assistant/stories/assistant.stories.tsx +39 -0
- package/src/views/ResearchView/query/constants.ts +5 -0
- package/src/views/ResearchView/query/fetch.ts +58 -0
- package/src/views/ResearchView/query/types.ts +37 -0
- package/src/views/ResearchView/query/useQuery.ts +60 -0
- package/src/views/ResearchView/researchView.tsx +19 -0
- package/src/views/ResearchView/state/actions/setError/action.ts +22 -0
- package/src/views/ResearchView/state/actions/setError/dispatch.ts +14 -0
- package/src/views/ResearchView/state/actions/setError/types.ts +16 -0
- package/src/views/ResearchView/state/actions/setMessage/action.ts +26 -0
- package/src/views/ResearchView/state/actions/setMessage/dispatch.ts +14 -0
- package/src/views/ResearchView/state/actions/setMessage/types.ts +19 -0
- package/src/views/ResearchView/state/actions/setQuery/action.ts +22 -0
- package/src/views/ResearchView/state/actions/setQuery/dispatch.ts +14 -0
- package/src/views/ResearchView/state/actions/setQuery/types.ts +16 -0
- package/src/views/ResearchView/state/actions/setStatus/action.ts +19 -0
- package/src/views/ResearchView/state/actions/setStatus/dispatch.ts +14 -0
- package/src/views/ResearchView/state/actions/setStatus/types.ts +16 -0
- package/src/views/ResearchView/state/actions/types.ts +23 -0
- package/src/views/ResearchView/state/constants.ts +9 -0
- package/src/views/ResearchView/state/context.ts +11 -0
- package/src/views/ResearchView/state/guards/guards.ts +58 -0
- package/src/views/ResearchView/state/hooks/UseChatDispatch/hook.ts +46 -0
- package/src/views/ResearchView/state/hooks/UseChatDispatch/types.ts +11 -0
- package/src/views/ResearchView/state/hooks/UseChatReducer/hook.ts +15 -0
- package/src/views/ResearchView/state/hooks/UseChatState/hook.ts +14 -0
- package/src/views/ResearchView/state/initializer/initializer.ts +23 -0
- package/src/views/ResearchView/state/initializer/types.ts +3 -0
- package/src/views/ResearchView/state/provider.tsx +27 -0
- package/src/views/ResearchView/state/reducer.ts +34 -0
- package/src/views/ResearchView/state/types.ts +149 -0
- package/tests/chartSortUtils.test.ts +119 -0
- package/tests/research.assistantMessageUtils.test.ts +149 -0
- package/tests/research.chatState.test.ts +463 -0
- package/tests/research.fetchResponse.test.ts +164 -0
- package/tests/research.useKeyShortCuts.test.ts +254 -0
- package/tests/research.useQuery.test.ts +165 -0
- package/tests/toggleButtonGroupProvider.test.tsx +125 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { setErrorAction } from "./actions/setError/action";
|
|
2
|
+
import { setMessageAction } from "./actions/setMessage/action";
|
|
3
|
+
import { setQueryAction } from "./actions/setQuery/action";
|
|
4
|
+
import { setStatusAction } from "./actions/setStatus/action";
|
|
5
|
+
import { ChatActionKind } from "./actions/types";
|
|
6
|
+
/**
|
|
7
|
+
* Reducer for the Chat state.
|
|
8
|
+
*
|
|
9
|
+
* @param state - State.
|
|
10
|
+
* @param action - Action.
|
|
11
|
+
* @returns State.
|
|
12
|
+
*/
|
|
13
|
+
export function chatReducer(state, action) {
|
|
14
|
+
const { payload, type } = action;
|
|
15
|
+
switch (type) {
|
|
16
|
+
case ChatActionKind.SetError: {
|
|
17
|
+
return setErrorAction(state, payload);
|
|
18
|
+
}
|
|
19
|
+
case ChatActionKind.SetMessage: {
|
|
20
|
+
return setMessageAction(state, payload);
|
|
21
|
+
}
|
|
22
|
+
case ChatActionKind.SetQuery: {
|
|
23
|
+
return setQueryAction(state, payload);
|
|
24
|
+
}
|
|
25
|
+
case ChatActionKind.SetStatus: {
|
|
26
|
+
return setStatusAction(state, payload);
|
|
27
|
+
}
|
|
28
|
+
default: {
|
|
29
|
+
return state;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { Dispatch } from "react";
|
|
2
|
+
import { ChatAction } from "./actions/types";
|
|
3
|
+
/**
|
|
4
|
+
* Assistant message in the chat.
|
|
5
|
+
*/
|
|
6
|
+
export interface AssistantMessage<R extends MessageResponse = MessageResponse> extends BaseMessage {
|
|
7
|
+
response: R;
|
|
8
|
+
type: MESSAGE_TYPE.ASSISTANT;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Base message type for chat messages.
|
|
12
|
+
*/
|
|
13
|
+
export interface BaseMessage {
|
|
14
|
+
createdAt: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Context value for the Chat state provider.
|
|
18
|
+
*/
|
|
19
|
+
export interface ChatContextValue {
|
|
20
|
+
dispatch: Dispatch<ChatAction>;
|
|
21
|
+
state: ChatState;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* State for the Chat feature.
|
|
25
|
+
*/
|
|
26
|
+
export interface ChatState {
|
|
27
|
+
messages: Message[];
|
|
28
|
+
status: Status;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Error message in the chat.
|
|
32
|
+
*/
|
|
33
|
+
export interface ErrorMessage extends BaseMessage {
|
|
34
|
+
error: string;
|
|
35
|
+
type: MESSAGE_TYPE.ERROR;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Intent values for the research API response.
|
|
39
|
+
*/
|
|
40
|
+
export declare const INTENT: {
|
|
41
|
+
readonly AUTO: "auto";
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Intent type for the research API response.
|
|
45
|
+
*/
|
|
46
|
+
export type Intent = (typeof INTENT)[keyof typeof INTENT] | (string & {});
|
|
47
|
+
/**
|
|
48
|
+
* Union type for messages in the chat.
|
|
49
|
+
*/
|
|
50
|
+
export type Message<R extends MessageResponse = MessageResponse> = AssistantMessage<R> | ErrorMessage | PromptMessage | UserMessage;
|
|
51
|
+
/**
|
|
52
|
+
* Message types for the chat.
|
|
53
|
+
*/
|
|
54
|
+
export declare enum MESSAGE_TYPE {
|
|
55
|
+
ASSISTANT = "ASSISTANT",
|
|
56
|
+
ERROR = "ERROR",
|
|
57
|
+
PROMPT = "PROMPT",
|
|
58
|
+
USER = "USER"
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Mention extracted from the user query.
|
|
62
|
+
*/
|
|
63
|
+
export interface Mention {
|
|
64
|
+
exclude: boolean;
|
|
65
|
+
facet: string;
|
|
66
|
+
originalText: string;
|
|
67
|
+
values: string[];
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Response from the research API.
|
|
71
|
+
*/
|
|
72
|
+
export interface MessageResponse {
|
|
73
|
+
intent: Intent;
|
|
74
|
+
message: string | null;
|
|
75
|
+
query: {
|
|
76
|
+
mentions: Mention[];
|
|
77
|
+
message: string | null;
|
|
78
|
+
};
|
|
79
|
+
timing: {
|
|
80
|
+
lookupMs: number;
|
|
81
|
+
pipelineMs: number;
|
|
82
|
+
totalMs: number;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Prompt message in the chat, initiated by the system.
|
|
87
|
+
*/
|
|
88
|
+
export interface PromptMessage extends BaseMessage {
|
|
89
|
+
initial?: boolean;
|
|
90
|
+
inputPlaceholder?: string;
|
|
91
|
+
suggestions?: PromptSuggestion[];
|
|
92
|
+
text: string;
|
|
93
|
+
type: MESSAGE_TYPE.PROMPT;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Suggestion within a prompt message.
|
|
97
|
+
*/
|
|
98
|
+
export interface PromptSuggestion {
|
|
99
|
+
label: string;
|
|
100
|
+
query: string;
|
|
101
|
+
variant: SuggestionVariant;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Status of the chat interaction, such as loading state.
|
|
105
|
+
*/
|
|
106
|
+
export interface Status {
|
|
107
|
+
loading: boolean;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Suggestion variant values for rendering suggestions.
|
|
111
|
+
*/
|
|
112
|
+
export declare const SUGGESTION_VARIANT: {
|
|
113
|
+
readonly CHIP: "CHIP";
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Suggestion variant type.
|
|
117
|
+
*/
|
|
118
|
+
export type SuggestionVariant = (typeof SUGGESTION_VARIANT)[keyof typeof SUGGESTION_VARIANT];
|
|
119
|
+
/**
|
|
120
|
+
* User message in the chat.
|
|
121
|
+
*/
|
|
122
|
+
export interface UserMessage extends BaseMessage {
|
|
123
|
+
text: string;
|
|
124
|
+
type: MESSAGE_TYPE.USER;
|
|
125
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Intent values for the research API response.
|
|
3
|
+
*/
|
|
4
|
+
export const INTENT = {
|
|
5
|
+
AUTO: "auto",
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Message types for the chat.
|
|
9
|
+
*/
|
|
10
|
+
export var MESSAGE_TYPE;
|
|
11
|
+
(function (MESSAGE_TYPE) {
|
|
12
|
+
MESSAGE_TYPE["ASSISTANT"] = "ASSISTANT";
|
|
13
|
+
MESSAGE_TYPE["ERROR"] = "ERROR";
|
|
14
|
+
MESSAGE_TYPE["PROMPT"] = "PROMPT";
|
|
15
|
+
MESSAGE_TYPE["USER"] = "USER";
|
|
16
|
+
})(MESSAGE_TYPE || (MESSAGE_TYPE = {}));
|
|
17
|
+
/**
|
|
18
|
+
* Suggestion variant values for rendering suggestions.
|
|
19
|
+
*/
|
|
20
|
+
export const SUGGESTION_VARIANT = {
|
|
21
|
+
CHIP: "CHIP",
|
|
22
|
+
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI configuration.
|
|
3
|
+
*/
|
|
4
|
+
export interface AiConfig {
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
prompt?: AiPrompt;
|
|
7
|
+
routes: {
|
|
8
|
+
research: string;
|
|
9
|
+
search: string;
|
|
10
|
+
};
|
|
11
|
+
url: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface AiPrompt {
|
|
15
|
+
inputPlaceholder?: string;
|
|
16
|
+
suggestions?: AiSuggestions[];
|
|
17
|
+
text: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface AiSuggestions {
|
|
21
|
+
label: string;
|
|
22
|
+
query: string;
|
|
23
|
+
// For now, we only have one variant, but this allows for future expansion.
|
|
24
|
+
variant: "CHIP";
|
|
25
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Chart } from "../../chart/types";
|
|
1
2
|
import {
|
|
2
3
|
CategoryKey,
|
|
3
4
|
DataDictionaryAnnotation,
|
|
@@ -33,7 +34,7 @@ export interface RangeCategoryConfig
|
|
|
33
34
|
*/
|
|
34
35
|
export interface SelectCategoryConfig
|
|
35
36
|
extends CommonCategoryConfig, SelectViewKind {
|
|
36
|
-
|
|
37
|
+
chart?: Chart;
|
|
37
38
|
mapSelectCategoryValue?: (
|
|
38
39
|
selectCategoryValue: SelectCategoryValueView,
|
|
39
40
|
) => SelectCategoryValueView;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
sortCategoryValueViewsAlpha,
|
|
3
|
+
sortCategoryValueViewsCount,
|
|
4
|
+
} from "../../filters/sort/models/utils";
|
|
5
|
+
import { CHART_SORT, ChartSortFn } from "./types";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Map of chart sort options to their corresponding sort functions.
|
|
9
|
+
*/
|
|
10
|
+
export const CHART_SORT_FN: Record<CHART_SORT, ChartSortFn> = {
|
|
11
|
+
[CHART_SORT.ALPHA]: sortCategoryValueViewsAlpha,
|
|
12
|
+
[CHART_SORT.COUNT]: sortCategoryValueViewsCount,
|
|
13
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SelectCategoryValueView } from "../../entities";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Chart sorting options for select categories.
|
|
5
|
+
*/
|
|
6
|
+
export enum CHART_SORT {
|
|
7
|
+
ALPHA = "ALPHA",
|
|
8
|
+
COUNT = "COUNT",
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Sorting function type for select category values.
|
|
13
|
+
*/
|
|
14
|
+
export type ChartSortFn = (
|
|
15
|
+
a: SelectCategoryValueView,
|
|
16
|
+
b: SelectCategoryValueView,
|
|
17
|
+
) => number;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Chart sort options - either a preset (ALPHA, COUNT) or a custom sort function.
|
|
21
|
+
*/
|
|
22
|
+
export type ChartSortOptions = CHART_SORT | ChartSortFn;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CHART_SORT_FN } from "./constants";
|
|
2
|
+
import { CHART_SORT, ChartSortOptions, ChartSortFn } from "./types";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Resolves chart sort options to a sorting function.
|
|
6
|
+
* @param chartSortOptions - Chart sort option (ALPHA, COUNT, or custom function).
|
|
7
|
+
* @returns Sorting function to use for chart data.
|
|
8
|
+
*/
|
|
9
|
+
export function getChartSortFn(
|
|
10
|
+
chartSortOptions?: ChartSortOptions,
|
|
11
|
+
): ChartSortFn {
|
|
12
|
+
// Default to COUNT sort if not specified.
|
|
13
|
+
if (!chartSortOptions) {
|
|
14
|
+
return CHART_SORT_FN[CHART_SORT.COUNT];
|
|
15
|
+
}
|
|
16
|
+
// If it's a custom function, return it directly.
|
|
17
|
+
if (typeof chartSortOptions === "function") {
|
|
18
|
+
return chartSortOptions;
|
|
19
|
+
}
|
|
20
|
+
// Otherwise, look up the function from the map.
|
|
21
|
+
return CHART_SORT_FN[chartSortOptions];
|
|
22
|
+
}
|
package/src/common/entities.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RowData, TableOptions } from "@tanstack/react-table";
|
|
2
|
+
import { Chart } from "./chart/types";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Model of a value of a metadata class.
|
|
@@ -152,7 +153,7 @@ export interface SelectCategoryValueView {
|
|
|
152
153
|
*/
|
|
153
154
|
export interface SelectCategoryView {
|
|
154
155
|
annotation?: DataDictionaryAnnotation;
|
|
155
|
-
|
|
156
|
+
chart?: Chart;
|
|
156
157
|
isDisabled?: boolean;
|
|
157
158
|
key: CategoryKey;
|
|
158
159
|
label: string;
|
|
@@ -2,7 +2,6 @@ import { JSX, ElementType, useState } from "react";
|
|
|
2
2
|
import { MANIFEST_DOWNLOAD_FORMAT } from "../../../../apis/azul/common/entities";
|
|
3
3
|
import { Filters } from "../../../../common/entities";
|
|
4
4
|
import { useExploreState } from "../../../../hooks/useExploreState";
|
|
5
|
-
import { FileManifestType } from "../../../../hooks/useFileManifest/common/entities";
|
|
6
5
|
import { useFileManifest } from "../../../../hooks/useFileManifest/useFileManifest";
|
|
7
6
|
import { useFileManifestFileCount } from "../../../../hooks/useFileManifest/useFileManifestFileCount";
|
|
8
7
|
import {
|
|
@@ -26,7 +25,6 @@ interface DownloadCurlCommandProps {
|
|
|
26
25
|
DownloadCurlStart: ElementType;
|
|
27
26
|
DownloadCurlSuccess: ElementType;
|
|
28
27
|
fileManifestState: FileManifestState;
|
|
29
|
-
fileManifestType: FileManifestType;
|
|
30
28
|
fileSummaryFacetName: string;
|
|
31
29
|
filters: Filters; // Initializes bulk download filters.
|
|
32
30
|
formFacet: FormFacet;
|
|
@@ -2,7 +2,6 @@ import { JSX, ElementType } from "react";
|
|
|
2
2
|
import { Filters } from "../../../../common/entities";
|
|
3
3
|
import { useExploreState } from "../../../../hooks/useExploreState";
|
|
4
4
|
import { useExportToTerraResponseURL } from "../../../../hooks/useExportToTerraResponseURL";
|
|
5
|
-
import { FileManifestType } from "../../../../hooks/useFileManifest/common/entities";
|
|
6
5
|
import { useFileManifest } from "../../../../hooks/useFileManifest/useFileManifest";
|
|
7
6
|
import { useFileManifestFileCount } from "../../../../hooks/useFileManifest/useFileManifestFileCount";
|
|
8
7
|
import { useFileManifestFormat } from "../../../../hooks/useFileManifest/useFileManifestFormat";
|
|
@@ -19,7 +18,6 @@ export interface ExportToTerraProps {
|
|
|
19
18
|
ExportToTerraStart: ElementType;
|
|
20
19
|
ExportToTerraSuccess: ElementType;
|
|
21
20
|
fileManifestState: FileManifestState;
|
|
22
|
-
fileManifestType: FileManifestType;
|
|
23
21
|
fileSummaryFacetName: string;
|
|
24
22
|
filters: Filters; // Initializes export to terra filters.
|
|
25
23
|
formFacet: FormFacet;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { JSX } from "react";
|
|
2
2
|
import { Filters } from "../../../../../../common/entities";
|
|
3
|
-
import { FileManifestType } from "../../../../../../hooks/useFileManifest/common/entities";
|
|
4
3
|
import { useFileManifest } from "../../../../../../hooks/useFileManifest/useFileManifest";
|
|
5
4
|
import { ManifestDownloadFormat } from "../../../../common/entities";
|
|
6
5
|
import { FileManifestDownload } from "./components/FileManifestDownload/fileManifestDownload";
|
|
7
6
|
import { FileManifestSpreadsheet } from "./components/FileManifestSpreadsheet/fileManifestSpreadsheet";
|
|
8
7
|
|
|
9
8
|
export interface ManifestDownloadEntityProps {
|
|
10
|
-
fileManifestType: FileManifestType;
|
|
11
9
|
filters: Filters; // Initializes manifest download filters.
|
|
12
10
|
manifestDownloadFormat?: ManifestDownloadFormat;
|
|
13
11
|
metadataFilters: Filters; // Metadata filters filters.
|
|
@@ -2,7 +2,6 @@ import { JSX, ElementType } from "react";
|
|
|
2
2
|
import { MANIFEST_DOWNLOAD_FORMAT } from "../../../../apis/azul/common/entities";
|
|
3
3
|
import { Filters } from "../../../../common/entities";
|
|
4
4
|
import { useExploreState } from "../../../../hooks/useExploreState";
|
|
5
|
-
import { FileManifestType } from "../../../../hooks/useFileManifest/common/entities";
|
|
6
5
|
import { useFileManifest } from "../../../../hooks/useFileManifest/useFileManifest";
|
|
7
6
|
import { useFileManifestFileCount } from "../../../../hooks/useFileManifest/useFileManifestFileCount";
|
|
8
7
|
import {
|
|
@@ -18,7 +17,6 @@ import { ManifestDownloadReady } from "./components/ManifestDownloadReady/manife
|
|
|
18
17
|
|
|
19
18
|
export interface ManifestDownloadProps {
|
|
20
19
|
fileManifestState: FileManifestState;
|
|
21
|
-
fileManifestType: FileManifestType;
|
|
22
20
|
fileSummaryFacetName: string;
|
|
23
21
|
filters: Filters; // Initializes manifest download filters.
|
|
24
22
|
formFacet: FormFacet;
|
|
@@ -5,6 +5,7 @@ import { FilterLabel } from "./filterLabel";
|
|
|
5
5
|
|
|
6
6
|
const meta = {
|
|
7
7
|
argTypes: {
|
|
8
|
+
annotation: { control: "object" },
|
|
8
9
|
count: { control: "number" },
|
|
9
10
|
disabled: { control: "boolean" },
|
|
10
11
|
isOpen: { control: "boolean" },
|
|
@@ -27,6 +28,11 @@ type Story = StoryObj<typeof meta>;
|
|
|
27
28
|
|
|
28
29
|
export const FilterLabelStory: Story = {
|
|
29
30
|
args: {
|
|
31
|
+
annotation: {
|
|
32
|
+
description:
|
|
33
|
+
"This is a description of the filter label that provides additional context to the user.",
|
|
34
|
+
label: "Label",
|
|
35
|
+
},
|
|
30
36
|
count: 123,
|
|
31
37
|
disabled: false,
|
|
32
38
|
isOpen: false,
|
|
@@ -26,7 +26,12 @@ export const FilterLabel = ({
|
|
|
26
26
|
}: FilterLabelProps): JSX.Element => {
|
|
27
27
|
const filterLabel = count ? `${label}\xa0(${count})` : label; // When the count is present, a non-breaking space is used to prevent it from being on its own line
|
|
28
28
|
return (
|
|
29
|
-
<Tooltip
|
|
29
|
+
<Tooltip
|
|
30
|
+
description={annotation?.description}
|
|
31
|
+
enterDelay={300}
|
|
32
|
+
placement="right"
|
|
33
|
+
title={annotation?.label}
|
|
34
|
+
>
|
|
30
35
|
<StyledButton
|
|
31
36
|
color="inherit"
|
|
32
37
|
disabled={disabled}
|
|
@@ -105,6 +105,11 @@ const PROCESSED = {
|
|
|
105
105
|
* Biological Sex select category view
|
|
106
106
|
*/
|
|
107
107
|
export const BIOLOGICAL_SEX: SelectCategoryView = {
|
|
108
|
+
annotation: {
|
|
109
|
+
description:
|
|
110
|
+
"The biological sex of the donor organism, typically determined by chromosomal composition.",
|
|
111
|
+
label: "Biological Sex",
|
|
112
|
+
},
|
|
108
113
|
key: "biologicalSex",
|
|
109
114
|
label: "Biological Sex",
|
|
110
115
|
values: [MALE, FEMALE],
|
|
@@ -114,6 +119,11 @@ export const BIOLOGICAL_SEX: SelectCategoryView = {
|
|
|
114
119
|
* Genus Species select category view
|
|
115
120
|
*/
|
|
116
121
|
export const GENUS_SPECIES: SelectCategoryView = {
|
|
122
|
+
annotation: {
|
|
123
|
+
description:
|
|
124
|
+
"The scientific name of the organism from which the sample was derived.",
|
|
125
|
+
label: "Genus Species",
|
|
126
|
+
},
|
|
117
127
|
key: "genusSpecies",
|
|
118
128
|
label: "Genus Species",
|
|
119
129
|
values: [HOMO_SAPIENS, MUS_MUSCLES],
|
|
@@ -123,7 +133,11 @@ export const GENUS_SPECIES: SelectCategoryView = {
|
|
|
123
133
|
* Donor Count range category view
|
|
124
134
|
*/
|
|
125
135
|
export const DONOR_COUNT: RangeCategoryView = {
|
|
126
|
-
|
|
136
|
+
annotation: {
|
|
137
|
+
description: "The number of unique donors contributing to the dataset.",
|
|
138
|
+
label: "Donor Count",
|
|
139
|
+
},
|
|
140
|
+
key: "donorCount",
|
|
127
141
|
label: "Donor Count",
|
|
128
142
|
max: 200,
|
|
129
143
|
min: 10,
|
|
@@ -135,6 +149,11 @@ export const DONOR_COUNT: RangeCategoryView = {
|
|
|
135
149
|
* File Format select category view
|
|
136
150
|
*/
|
|
137
151
|
export const FILE_FORMAT: SelectCategoryView = {
|
|
152
|
+
annotation: {
|
|
153
|
+
description:
|
|
154
|
+
"The format of the file, such as BAM, CSV, FASTQ, or TSV, indicating how the data is structured.",
|
|
155
|
+
label: "File Format",
|
|
156
|
+
},
|
|
138
157
|
key: "fileFormat",
|
|
139
158
|
label: "File Format",
|
|
140
159
|
values: [BAM, CSV, FASTQ, TSV],
|
|
@@ -144,6 +163,11 @@ export const FILE_FORMAT: SelectCategoryView = {
|
|
|
144
163
|
* File Type select category view
|
|
145
164
|
*/
|
|
146
165
|
export const FILE_TYPE: SelectCategoryView = {
|
|
166
|
+
annotation: {
|
|
167
|
+
description:
|
|
168
|
+
"The type of file, indicating whether the data is raw or has been processed.",
|
|
169
|
+
label: "File Type",
|
|
170
|
+
},
|
|
147
171
|
isDisabled: true,
|
|
148
172
|
key: "fileType",
|
|
149
173
|
label: "File Type",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Typography } from "@mui/material";
|
|
2
2
|
import { Fragment, JSX } from "react";
|
|
3
|
+
import { getChartSortFn } from "../../../../../../../common/chart/sort/utils";
|
|
3
4
|
import { TYPOGRAPHY_PROPS } from "../../../../../../../styles/common/mui/typography";
|
|
4
5
|
import {
|
|
5
6
|
Loading,
|
|
@@ -33,12 +34,17 @@ export const ChartView = ({
|
|
|
33
34
|
panelStyle={LOADING_PANEL_STYLE.INHERIT}
|
|
34
35
|
/>
|
|
35
36
|
<StyledGrid data-testid={testId} ref={chartViewRef}>
|
|
36
|
-
{selectCategoryViews.map(({ key, label, values }) => (
|
|
37
|
+
{selectCategoryViews.map(({ chart, key, label, values }) => (
|
|
37
38
|
<StyledGridPaperSection key={key}>
|
|
38
39
|
<Typography variant={TYPOGRAPHY_PROPS.VARIANT.HEADING_SMALL}>
|
|
39
40
|
{entityName} by {label}
|
|
40
41
|
</Typography>
|
|
41
|
-
<Chart
|
|
42
|
+
<Chart
|
|
43
|
+
selectCategoryValueViews={[...values].sort(
|
|
44
|
+
getChartSortFn(chart?.sortBy),
|
|
45
|
+
)}
|
|
46
|
+
width={width}
|
|
47
|
+
/>
|
|
42
48
|
</StyledGridPaperSection>
|
|
43
49
|
))}
|
|
44
50
|
</StyledGrid>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
2
|
import { SelectCategoryValueView } from "../../../../../../../../../../../common/entities";
|
|
3
|
-
import { sortCategoryValueViewsCount } from "../../../../../../../../../../../common/filters/sort/models/utils";
|
|
4
3
|
import { getPlotOptions } from "../../barX/plot";
|
|
5
4
|
import { getCategoryTotalCount } from "../../barX/utils";
|
|
6
5
|
import { UsePlotOptions } from "./types";
|
|
@@ -10,12 +9,8 @@ export const usePlotOptions = (
|
|
|
10
9
|
width: number,
|
|
11
10
|
barCount: number | undefined,
|
|
12
11
|
): UsePlotOptions => {
|
|
13
|
-
//
|
|
14
|
-
const data = selectCategoryValueViews
|
|
15
|
-
// Sort the category values by count and label.
|
|
16
|
-
.sort(sortCategoryValueViewsCount)
|
|
17
|
-
// Slice the category values to the number of bars to display.
|
|
18
|
-
.slice(0, barCount);
|
|
12
|
+
// Slice the category values to the number of bars to display.
|
|
13
|
+
const data = selectCategoryValueViews.slice(0, barCount);
|
|
19
14
|
|
|
20
15
|
// Build the plot options.
|
|
21
16
|
const options = useMemo(
|
|
@@ -15,12 +15,6 @@ export const CHART_ARGS: ComponentProps<typeof Chart> = {
|
|
|
15
15
|
label: "male",
|
|
16
16
|
selected: false,
|
|
17
17
|
},
|
|
18
|
-
{
|
|
19
|
-
count: 240,
|
|
20
|
-
key: "mixed",
|
|
21
|
-
label: "mixed",
|
|
22
|
-
selected: false,
|
|
23
|
-
},
|
|
24
18
|
{
|
|
25
19
|
count: 78715,
|
|
26
20
|
key: "unknown",
|
|
@@ -33,6 +27,12 @@ export const CHART_ARGS: ComponentProps<typeof Chart> = {
|
|
|
33
27
|
label: "Unspecified",
|
|
34
28
|
selected: false,
|
|
35
29
|
},
|
|
30
|
+
{
|
|
31
|
+
count: 240,
|
|
32
|
+
key: "mixed",
|
|
33
|
+
label: "mixed",
|
|
34
|
+
selected: false,
|
|
35
|
+
},
|
|
36
36
|
],
|
|
37
37
|
width: 800,
|
|
38
38
|
};
|
|
@@ -51,12 +51,6 @@ export const SELECT_CHART_ARGS: ComponentProps<typeof Chart> = {
|
|
|
51
51
|
label: "male",
|
|
52
52
|
selected: true,
|
|
53
53
|
},
|
|
54
|
-
{
|
|
55
|
-
count: 240,
|
|
56
|
-
key: "mixed",
|
|
57
|
-
label: "mixed",
|
|
58
|
-
selected: false,
|
|
59
|
-
},
|
|
60
54
|
{
|
|
61
55
|
count: 78715,
|
|
62
56
|
key: "unknown",
|
|
@@ -69,6 +63,12 @@ export const SELECT_CHART_ARGS: ComponentProps<typeof Chart> = {
|
|
|
69
63
|
label: "Unspecified",
|
|
70
64
|
selected: true,
|
|
71
65
|
},
|
|
66
|
+
{
|
|
67
|
+
count: 240,
|
|
68
|
+
key: "mixed",
|
|
69
|
+
label: "mixed",
|
|
70
|
+
selected: false,
|
|
71
|
+
},
|
|
72
72
|
],
|
|
73
73
|
width: 800,
|
|
74
74
|
};
|
package/src/components/Index/components/EntityView/components/views/ChartView/stories/args.ts
CHANGED
|
@@ -6,7 +6,7 @@ export const CHART_VIEW_ARGS: ComponentProps<typeof ChartView> = {
|
|
|
6
6
|
{
|
|
7
7
|
categoryViews: [
|
|
8
8
|
{
|
|
9
|
-
|
|
9
|
+
chart: { enable: true },
|
|
10
10
|
key: "biological-sex",
|
|
11
11
|
label: "Biological Sex",
|
|
12
12
|
values: [
|
|
@@ -43,7 +43,7 @@ export const CHART_VIEW_ARGS: ComponentProps<typeof ChartView> = {
|
|
|
43
43
|
],
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
|
-
|
|
46
|
+
chart: { enable: true },
|
|
47
47
|
key: "genusSpecies",
|
|
48
48
|
label: "Genus Species",
|
|
49
49
|
values: [
|
|
@@ -74,7 +74,7 @@ export const CHART_VIEW_ARGS: ComponentProps<typeof ChartView> = {
|
|
|
74
74
|
],
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
|
-
|
|
77
|
+
chart: { enable: false },
|
|
78
78
|
key: "pairedEnd",
|
|
79
79
|
label: "Paired End",
|
|
80
80
|
values: [
|
|
@@ -13,7 +13,7 @@ export function getSelectCategoryViews(
|
|
|
13
13
|
return categoryFilters
|
|
14
14
|
.flatMap(({ categoryViews }) => categoryViews)
|
|
15
15
|
.filter(isSelectCategoryView)
|
|
16
|
-
.filter(({
|
|
16
|
+
.filter(({ chart }) => chart?.enable !== false)
|
|
17
17
|
.filter(({ values }) => values.length > 0);
|
|
18
18
|
}
|
|
19
19
|
|
package/src/components/Layout/components/Sidebar/components/SidebarTools/sidebarTools.styles.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
2
|
import { bpUpMd } from "../../../../../../styles/common/mixins/breakpoints";
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Container for sidebar tools, including the mode toggle and filter controls.
|
|
6
|
+
* @deprecated - This styled component is deprecated and will be removed in a future release.
|
|
7
|
+
*/
|
|
4
8
|
export const SidebarTools = styled.div`
|
|
5
9
|
display: grid;
|
|
6
10
|
gap: 8px 0;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
import { Chip } from "@mui/material";
|
|
3
|
+
import { PALETTE } from "../../../../../styles/common/constants/palette";
|
|
4
|
+
import { FONT } from "../../../../../styles/common/constants/font";
|
|
5
|
+
|
|
6
|
+
export const StyledChip = styled(Chip)`
|
|
7
|
+
background-color: ${PALETTE.PRIMARY_LIGHTEST};
|
|
8
|
+
border-radius: 4px;
|
|
9
|
+
color: ${PALETTE.PRIMARY_MAIN};
|
|
10
|
+
|
|
11
|
+
.MuiChip-label {
|
|
12
|
+
font: ${FONT.BODY_SMALL_500};
|
|
13
|
+
padding: 0 5px;
|
|
14
|
+
}
|
|
15
|
+
`;
|