@reltio/dashboard 1.4.1584 → 1.4.1586-mui5
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/.DS_Store +0 -0
- package/index.ts +12 -0
- package/package.json +42 -25
- package/public/bundle.js +205 -0
- package/public/bundle.js.LICENSE.txt +59 -0
- package/public/package.json +26 -0
- package/public/types/components/DashboardConfigItem/styles.d.ts +1 -0
- package/{types → public/types}/components/DashboardError/styles.d.ts +1 -1
- package/public/types/components/DashboardLayout/styles.d.ts +1 -0
- package/public/types/components/DashboardLayoutItem/styles.d.ts +1 -0
- package/public/types/components/DashboardLayoutPanel/styles.d.ts +1 -0
- package/public/types/components/DashboardLinearLoader/styles.d.ts +1 -0
- package/{types → public/types}/components/DashboardNoData/styles.d.ts +1 -1
- package/public/types/components/DashboardPerspectiveHeader/styles.d.ts +2 -0
- package/{types → public/types}/components/DashboardPopupMenu/DashboardPopupMenu.d.ts +1 -1
- package/public/types/components/DashboardPopupMenu/styles.d.ts +1 -0
- package/public/types/components/EntityTable/cell-renderers/styles.d.ts +1 -0
- package/{types → public/types}/components/EntityTable/styles.d.ts +1 -1
- package/public/types/components/LayoutItemContent/styles.d.ts +1 -0
- package/public/types/components/LayoutItemHeader/styles.d.ts +1 -0
- package/public/types/components/LayoutItemView/styles.d.ts +1 -0
- package/public/types/components/StatsChart/customized/styles.d.ts +1 -0
- package/public/types/components/WorkflowTaskItem/styles.d.ts +1 -0
- package/public/types/perspective/styles.d.ts +1 -0
- package/public/types/views/chartBased/styles.d.ts +1 -0
- package/public/types/views/custom/styles.d.ts +1 -0
- package/public/types/views/tableBased/styles.d.ts +1 -0
- package/scripts/build/index.js +21 -0
- package/src/HOCs/withPagination.tsx +39 -0
- package/src/components/DashboardConfigItem/DashboardConfigItem.tsx +101 -0
- package/src/components/DashboardConfigItem/__tests__/DashboardConfigItem.specs.tsx +81 -0
- package/src/components/DashboardConfigItem/icons/barChart.svg +12 -0
- package/src/components/DashboardConfigItem/icons/bubbleChart.svg +18 -0
- package/src/components/DashboardConfigItem/icons/customChart.svg +66 -0
- package/src/components/DashboardConfigItem/icons/donutChart.svg +33 -0
- package/src/components/DashboardConfigItem/icons/geomap.svg +23 -0
- package/src/components/DashboardConfigItem/icons/lineChart.svg +16 -0
- package/src/components/DashboardConfigItem/icons/pieChart.svg +27 -0
- package/src/components/DashboardConfigItem/icons/tableWithBars.svg +27 -0
- package/src/components/DashboardConfigItem/icons/treemap.svg +15 -0
- package/src/components/DashboardConfigItem/icons/wordCloud.svg +27 -0
- package/src/components/DashboardConfigItem/styles.ts +56 -0
- package/src/components/DashboardError/DashboardError.tsx +34 -0
- package/src/components/DashboardError/__tests__/DashboardError.test.js +34 -0
- package/src/components/DashboardError/icons/error.svg +113 -0
- package/src/components/DashboardError/styles.ts +30 -0
- package/src/components/DashboardLayout/DashboardLayout.tsx +59 -0
- package/src/components/DashboardLayout/__tests__/DashboardLayout.specs.tsx +56 -0
- package/src/components/DashboardLayout/styles.ts +30 -0
- package/src/components/DashboardLayoutItem/DashboardLayoutItem.tsx +59 -0
- package/src/components/DashboardLayoutItem/__tests__/DashboardLayoutItem.specs.tsx +145 -0
- package/src/components/DashboardLayoutItem/styles.ts +10 -0
- package/src/components/DashboardLayoutPanel/DashboardLayoutPanel.tsx +59 -0
- package/src/components/DashboardLayoutPanel/__tests__/DashboardLayoutPanel.specs.tsx +58 -0
- package/src/components/DashboardLayoutPanel/styles.ts +43 -0
- package/src/components/DashboardLinearLoader/DashboardLinearLoader.tsx +10 -0
- package/src/components/DashboardLinearLoader/__tests__/DashboardLinearLoader.test.js +12 -0
- package/src/components/DashboardLinearLoader/styles.ts +11 -0
- package/src/components/DashboardNoData/.DS_Store +0 -0
- package/src/components/DashboardNoData/DashboardNoData.tsx +21 -0
- package/src/components/DashboardNoData/__tests__/DashboardNoData.test.js +15 -0
- package/src/components/DashboardNoData/icons/noData.svg +68 -0
- package/src/components/DashboardNoData/styles.ts +21 -0
- package/src/components/DashboardPerspectiveHeader/DashboardPerspectiveHeader.tsx +43 -0
- package/src/components/DashboardPerspectiveHeader/__tests__/DashboardPerspectiveHeader.specs.tsx +41 -0
- package/src/components/DashboardPerspectiveHeader/styles.ts +24 -0
- package/src/components/DashboardPopupMenu/DashboardPopupMenu.tsx +75 -0
- package/src/components/DashboardPopupMenu/__tests__/DashboardPopupMenu.test.tsx +51 -0
- package/src/components/DashboardPopupMenu/styles.ts +20 -0
- package/src/components/EntityTable/EntityTable.tsx +49 -0
- package/src/components/EntityTable/__tests__/EntityTable.test.tsx +33 -0
- package/src/components/EntityTable/cell-renderers/EntityLabelRenderer.tsx +24 -0
- package/src/components/EntityTable/cell-renderers/HeadCellRenderer.tsx +34 -0
- package/src/components/EntityTable/cell-renderers/__tests__/EntityLabelRenderer.test.tsx +25 -0
- package/src/components/EntityTable/cell-renderers/styles.ts +46 -0
- package/src/components/EntityTable/styles.ts +19 -0
- package/src/components/LayoutItemContent/LayoutItemContent.tsx +63 -0
- package/src/components/LayoutItemContent/__tests__/LayoutItemContent.test.tsx +71 -0
- package/src/components/LayoutItemContent/styles.ts +36 -0
- package/src/components/LayoutItemHeader/LayoutItemHeader.tsx +86 -0
- package/src/components/LayoutItemHeader/__tests__/LayoutItemHeader.specs.tsx +48 -0
- package/src/components/LayoutItemHeader/styles.ts +44 -0
- package/src/components/LayoutItemView/LayoutItemView.tsx +24 -0
- package/src/components/LayoutItemView/styles.ts +11 -0
- package/src/components/StatsChart/StatsChart.tsx +77 -0
- package/src/components/StatsChart/__tests__/StatsChart.test.tsx +106 -0
- package/src/components/StatsChart/customized/CustomAxisTick.tsx +28 -0
- package/src/components/StatsChart/customized/CustomLegend.tsx +37 -0
- package/src/components/StatsChart/customized/CustomTooltip.tsx +41 -0
- package/src/components/StatsChart/customized/styles.ts +53 -0
- package/src/components/StatsChart/getStatsChartSettings.ts +65 -0
- package/src/components/WorkflowTaskItem/WorkflowTaskItem.tsx +67 -0
- package/src/components/WorkflowTaskItem/WorkflowTaskObject.tsx +54 -0
- package/src/components/WorkflowTaskItem/__tests__/WorkflowTaskItem.test.tsx +73 -0
- package/src/components/WorkflowTaskItem/__tests__/WorkflowTaskObject.test.tsx +95 -0
- package/src/components/WorkflowTaskItem/styles.ts +74 -0
- package/src/components/WorkflowTasksList/WorkflowTasksList.tsx +34 -0
- package/src/components/WorkflowTasksList/__tests__/WorkflowTasksList.test.tsx +98 -0
- package/src/components/index.ts +8 -0
- package/src/contexts/DashboardViewIdContext/index.ts +5 -0
- package/src/hooks/__tests__/useActivititesRequest.specs.tsx +106 -0
- package/src/hooks/__tests__/useEntityByTypeRequest.specs.tsx +280 -0
- package/src/hooks/__tests__/useFacetRequest.specs.tsx +437 -0
- package/src/hooks/__tests__/useFilteredEntitiesRequest.specs.tsx +103 -0
- package/src/hooks/__tests__/useSavedSearchesRequest.specs.tsx +201 -0
- package/src/hooks/__tests__/useStatsRequest.specs.tsx +212 -0
- package/src/hooks/__tests__/useWorkflowTasksRequest.specs.tsx +388 -0
- package/src/hooks/useActivitiesRequest.ts +50 -0
- package/src/hooks/useEntityByTypeRequest.ts +67 -0
- package/src/hooks/useFacetRequest.ts +117 -0
- package/src/hooks/useFilteredEntitiesRequest.ts +57 -0
- package/src/hooks/useSavedSearchesRequest.ts +82 -0
- package/src/hooks/useStatsRequest.ts +47 -0
- package/src/hooks/useWorkflowTasksRequest.ts +66 -0
- package/src/index.ts +25 -0
- package/src/perspective/DashboardPerspectiveView.tsx +132 -0
- package/src/perspective/__tests__/DashboardPerspectiveView.specs.tsx +276 -0
- package/src/perspective/__tests__/data/metadata.data.ts +33 -0
- package/src/perspective/__tests__/data/store.data.ts +15 -0
- package/src/perspective/__tests__/helpers.specs.ts +33 -0
- package/src/perspective/helpers.ts +19 -0
- package/src/perspective/index.tsx +65 -0
- package/src/perspective/styles.ts +16 -0
- package/src/services/__tests__/facets.specs.ts +42 -0
- package/src/services/__tests__/filters.specs.ts +60 -0
- package/src/services/__tests__/period.test.ts +33 -0
- package/src/services/__tests__/stats.test.ts +319 -0
- package/src/services/entityTypes.ts +66 -0
- package/src/services/facets.ts +178 -0
- package/src/services/filters.ts +87 -0
- package/src/services/period.ts +33 -0
- package/src/services/savedSearches.ts +20 -0
- package/src/services/stats.ts +191 -0
- package/src/services/workflowTasks.ts +116 -0
- package/src/types/ActivitiesViewFacetConfig.ts +5 -0
- package/src/types/CustomActionViewFacetConfig.ts +5 -0
- package/src/types/DashboardPerspectiveConfig.ts +18 -0
- package/src/types/DashboardSavedState.ts +7 -0
- package/src/types/EntityByTypeViewFacetConfig.ts +7 -0
- package/src/types/EntityData.ts +4 -0
- package/src/types/FilteredEntitiesFacetConfig.ts +6 -0
- package/src/types/FilteredSavedSearchesFacetConfig.ts +6 -0
- package/src/types/PeriodStep.ts +4 -0
- package/src/types/SavedSearchData.ts +6 -0
- package/src/types/SearchOptions.ts +10 -0
- package/src/types/StatsData.ts +14 -0
- package/src/types/WorkflowTasks.ts +26 -0
- package/src/types/index.ts +14 -0
- package/src/views/ViewsFactory.tsx +79 -0
- package/src/views/__tests__/ViewsFactory.specs.tsx +70 -0
- package/src/views/chartBased/DashboardFacet.tsx +71 -0
- package/src/views/chartBased/EntitiesByTypeViewFacet.tsx +60 -0
- package/src/views/chartBased/ProfileStatsFacet.tsx +54 -0
- package/src/views/chartBased/__tests__/DashboardFacet.specs.tsx +358 -0
- package/src/views/chartBased/__tests__/EntitiesByTypeViewFacet.specs.tsx +101 -0
- package/src/views/chartBased/__tests__/ProfileStatsFacet.specs.tsx +106 -0
- package/src/views/chartBased/styles.ts +13 -0
- package/src/views/custom/CustomActionViewFacet.tsx +36 -0
- package/src/views/custom/NotificationInboxFacet.tsx +86 -0
- package/src/views/custom/__tests__/CustomActionViewFacet.specs.tsx +35 -0
- package/src/views/custom/__tests__/NotificationInboxFacet.specs.tsx +144 -0
- package/src/views/custom/styles.ts +31 -0
- package/src/views/tableBased/ActivitiesViewFacet.tsx +79 -0
- package/src/views/tableBased/FilteredEntitiesViewFacet.tsx +67 -0
- package/src/views/tableBased/FilteredSavedSearchesFacet.tsx +85 -0
- package/src/views/tableBased/__tests__/ActivitiesViewFacet.specs.tsx +113 -0
- package/src/views/tableBased/__tests__/FIlteredEntitiesViewFacet.specs.tsx +90 -0
- package/src/views/tableBased/__tests__/FilteredSavedSearchesFacet.specs.tsx +133 -0
- package/src/views/tableBased/helpers.ts +8 -0
- package/src/views/tableBased/styles.ts +7 -0
- package/stories/Dashboards.stories.js +118 -0
- package/stories/utils/dashboardPerspectiveConfig.js +78 -0
- package/stories/utils/dashboardsViewConfig.js +17 -0
- package/stories/utils/mdmStore.js +73 -0
- package/stories/utils/responses.js +10 -0
- package/tsconfig.json +14 -0
- package/webpack.config.js +10 -0
- package/bundle.js +0 -2
- package/bundle.js.LICENSE.txt +0 -22
- package/types/components/DashboardConfigItem/styles.d.ts +0 -1
- package/types/components/DashboardLayout/styles.d.ts +0 -1
- package/types/components/DashboardLayoutItem/styles.d.ts +0 -1
- package/types/components/DashboardLayoutPanel/styles.d.ts +0 -1
- package/types/components/DashboardLinearLoader/styles.d.ts +0 -1
- package/types/components/DashboardPerspectiveHeader/styles.d.ts +0 -2
- package/types/components/DashboardPopupMenu/styles.d.ts +0 -1
- package/types/components/EntityTable/cell-renderers/styles.d.ts +0 -1
- package/types/components/LayoutItemContent/styles.d.ts +0 -1
- package/types/components/LayoutItemHeader/styles.d.ts +0 -1
- package/types/components/LayoutItemView/styles.d.ts +0 -1
- package/types/components/StatsChart/customized/styles.d.ts +0 -1
- package/types/components/WorkflowTaskItem/styles.d.ts +0 -1
- package/types/perspective/styles.d.ts +0 -1
- package/types/views/chartBased/styles.d.ts +0 -1
- package/types/views/custom/styles.d.ts +0 -1
- package/types/views/tableBased/styles.d.ts +0 -1
- /package/{types → public/types}/HOCs/withPagination.d.ts +0 -0
- /package/{types → public/types}/components/DashboardConfigItem/DashboardConfigItem.d.ts +0 -0
- /package/{types → public/types}/components/DashboardError/DashboardError.d.ts +0 -0
- /package/{types → public/types}/components/DashboardLayout/DashboardLayout.d.ts +0 -0
- /package/{types → public/types}/components/DashboardLayoutItem/DashboardLayoutItem.d.ts +0 -0
- /package/{types → public/types}/components/DashboardLayoutPanel/DashboardLayoutPanel.d.ts +0 -0
- /package/{types → public/types}/components/DashboardLinearLoader/DashboardLinearLoader.d.ts +0 -0
- /package/{types → public/types}/components/DashboardNoData/DashboardNoData.d.ts +0 -0
- /package/{types → public/types}/components/DashboardPerspectiveHeader/DashboardPerspectiveHeader.d.ts +0 -0
- /package/{types → public/types}/components/EntityTable/EntityTable.d.ts +0 -0
- /package/{types → public/types}/components/EntityTable/cell-renderers/EntityLabelRenderer.d.ts +0 -0
- /package/{types → public/types}/components/EntityTable/cell-renderers/HeadCellRenderer.d.ts +0 -0
- /package/{types → public/types}/components/LayoutItemContent/LayoutItemContent.d.ts +0 -0
- /package/{types → public/types}/components/LayoutItemHeader/LayoutItemHeader.d.ts +0 -0
- /package/{types → public/types}/components/LayoutItemView/LayoutItemView.d.ts +0 -0
- /package/{types → public/types}/components/StatsChart/StatsChart.d.ts +0 -0
- /package/{types → public/types}/components/StatsChart/customized/CustomAxisTick.d.ts +0 -0
- /package/{types → public/types}/components/StatsChart/customized/CustomLegend.d.ts +0 -0
- /package/{types → public/types}/components/StatsChart/customized/CustomTooltip.d.ts +0 -0
- /package/{types → public/types}/components/StatsChart/getStatsChartSettings.d.ts +0 -0
- /package/{types → public/types}/components/WorkflowTaskItem/WorkflowTaskItem.d.ts +0 -0
- /package/{types → public/types}/components/WorkflowTaskItem/WorkflowTaskObject.d.ts +0 -0
- /package/{types → public/types}/components/WorkflowTasksList/WorkflowTasksList.d.ts +0 -0
- /package/{types → public/types}/components/index.d.ts +0 -0
- /package/{types → public/types}/contexts/DashboardViewIdContext/index.d.ts +0 -0
- /package/{types → public/types}/hooks/useActivitiesRequest.d.ts +0 -0
- /package/{types → public/types}/hooks/useEntityByTypeRequest.d.ts +0 -0
- /package/{types → public/types}/hooks/useFacetRequest.d.ts +0 -0
- /package/{types → public/types}/hooks/useFilteredEntitiesRequest.d.ts +0 -0
- /package/{types → public/types}/hooks/useSavedSearchesRequest.d.ts +0 -0
- /package/{types → public/types}/hooks/useStatsRequest.d.ts +0 -0
- /package/{types → public/types}/hooks/useWorkflowTasksRequest.d.ts +0 -0
- /package/{types → public/types}/index.d.ts +0 -0
- /package/{types → public/types}/perspective/DashboardPerspectiveView.d.ts +0 -0
- /package/{types → public/types}/perspective/helpers.d.ts +0 -0
- /package/{types → public/types}/perspective/index.d.ts +0 -0
- /package/{types → public/types}/services/entityTypes.d.ts +0 -0
- /package/{types → public/types}/services/facets.d.ts +0 -0
- /package/{types → public/types}/services/filters.d.ts +0 -0
- /package/{types → public/types}/services/period.d.ts +0 -0
- /package/{types → public/types}/services/savedSearches.d.ts +0 -0
- /package/{types → public/types}/services/stats.d.ts +0 -0
- /package/{types → public/types}/services/workflowTasks.d.ts +0 -0
- /package/{types → public/types}/types/ActivitiesViewFacetConfig.d.ts +0 -0
- /package/{types → public/types}/types/CustomActionViewFacetConfig.d.ts +0 -0
- /package/{types → public/types}/types/DashboardPerspectiveConfig.d.ts +0 -0
- /package/{types → public/types}/types/DashboardSavedState.d.ts +0 -0
- /package/{types → public/types}/types/EntityByTypeViewFacetConfig.d.ts +0 -0
- /package/{types → public/types}/types/EntityData.d.ts +0 -0
- /package/{types → public/types}/types/FilteredEntitiesFacetConfig.d.ts +0 -0
- /package/{types → public/types}/types/FilteredSavedSearchesFacetConfig.d.ts +0 -0
- /package/{types → public/types}/types/PeriodStep.d.ts +0 -0
- /package/{types → public/types}/types/SavedSearchData.d.ts +0 -0
- /package/{types → public/types}/types/SearchOptions.d.ts +0 -0
- /package/{types → public/types}/types/StatsData.d.ts +0 -0
- /package/{types → public/types}/types/WorkflowTasks.d.ts +0 -0
- /package/{types → public/types}/types/index.d.ts +0 -0
- /package/{types → public/types}/views/ViewsFactory.d.ts +0 -0
- /package/{types → public/types}/views/chartBased/DashboardFacet.d.ts +0 -0
- /package/{types → public/types}/views/chartBased/EntitiesByTypeViewFacet.d.ts +0 -0
- /package/{types → public/types}/views/chartBased/ProfileStatsFacet.d.ts +0 -0
- /package/{types → public/types}/views/custom/CustomActionViewFacet.d.ts +0 -0
- /package/{types → public/types}/views/custom/NotificationInboxFacet.d.ts +0 -0
- /package/{types → public/types}/views/tableBased/ActivitiesViewFacet.d.ts +0 -0
- /package/{types → public/types}/views/tableBased/FilteredEntitiesViewFacet.d.ts +0 -0
- /package/{types → public/types}/views/tableBased/FilteredSavedSearchesFacet.d.ts +0 -0
- /package/{types → public/types}/views/tableBased/helpers.d.ts +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {WorkflowTaskData} from '@reltio/mdm-sdk';
|
|
2
|
+
|
|
3
|
+
export enum WorkflowTasksCategories {
|
|
4
|
+
MY = 'my',
|
|
5
|
+
TEAM = 'team'
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
type WorkflowTaskEntityData = {
|
|
9
|
+
uri: string;
|
|
10
|
+
label: string;
|
|
11
|
+
type: string;
|
|
12
|
+
};
|
|
13
|
+
type WorkflowTaskRelationData = {
|
|
14
|
+
uri: string;
|
|
15
|
+
type: string;
|
|
16
|
+
startObjectUri: string;
|
|
17
|
+
endObjectUri: string;
|
|
18
|
+
startObjectLabel: string;
|
|
19
|
+
endObjectLabel: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type WorkflowTaskObjectData = WorkflowTaskEntityData | WorkflowTaskRelationData;
|
|
23
|
+
|
|
24
|
+
export type EnrichedWorkflowTaskData = WorkflowTaskData & {
|
|
25
|
+
objects?: WorkflowTaskObjectData[];
|
|
26
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type {CustomActionViewFacetConfig} from './CustomActionViewFacetConfig';
|
|
2
|
+
export type {ActivitiesViewFacetConfig} from './ActivitiesViewFacetConfig';
|
|
3
|
+
export type {DashboardPerspectiveLegacyConfig, DashboardView} from './DashboardPerspectiveConfig';
|
|
4
|
+
export type {DashboardSavedState} from './DashboardSavedState';
|
|
5
|
+
export type {EntityByTypeViewFacetConfig} from './EntityByTypeViewFacetConfig';
|
|
6
|
+
export type {EntityData} from './EntityData';
|
|
7
|
+
export type {FilteredEntitiesFacetConfig} from './FilteredEntitiesFacetConfig';
|
|
8
|
+
export type {FilteredSavedSearchesFacetConfig} from './FilteredSavedSearchesFacetConfig';
|
|
9
|
+
export type {PeriodStep} from './PeriodStep';
|
|
10
|
+
export type {SavedSearchData} from './SavedSearchData';
|
|
11
|
+
export type {SearchOptions, GlobalSearchRequestOptions} from './SearchOptions';
|
|
12
|
+
export type {StatsData, StatsEventData} from './StatsData';
|
|
13
|
+
export type {EnrichedWorkflowTaskData, WorkflowTaskObjectData, WorkflowTasksCategories} from './WorkflowTasks';
|
|
14
|
+
export {ViewStatus} from './DashboardPerspectiveConfig';
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import FilteredSavedSearchesFacet from './tableBased/FilteredSavedSearchesFacet';
|
|
3
|
+
import DashboardFacet from './chartBased/DashboardFacet';
|
|
4
|
+
import FilteredEntitiesViewFacet from './tableBased/FilteredEntitiesViewFacet';
|
|
5
|
+
import ProfileStatsFacet from './chartBased/ProfileStatsFacet';
|
|
6
|
+
import EntitiesByTypeViewFacet from './chartBased/EntitiesByTypeViewFacet';
|
|
7
|
+
import CustomActionViewFacet from './custom/CustomActionViewFacet';
|
|
8
|
+
import {ChartTypes, DashboardFacetConfig, DashboardView, DashboardViewTypes} from '@reltio/mdm-sdk';
|
|
9
|
+
import NotificationInboxFacet from './custom/NotificationInboxFacet';
|
|
10
|
+
import ActivitiesViewFacet from './tableBased/ActivitiesViewFacet';
|
|
11
|
+
import {
|
|
12
|
+
ActivitiesViewFacetConfig,
|
|
13
|
+
CustomActionViewFacetConfig,
|
|
14
|
+
EntityByTypeViewFacetConfig,
|
|
15
|
+
FilteredSavedSearchesFacetConfig,
|
|
16
|
+
FilteredEntitiesFacetConfig
|
|
17
|
+
} from '../types';
|
|
18
|
+
|
|
19
|
+
type Props = {
|
|
20
|
+
config:
|
|
21
|
+
| ActivitiesViewFacetConfig
|
|
22
|
+
| CustomActionViewFacetConfig
|
|
23
|
+
| DashboardFacetConfig
|
|
24
|
+
| EntityByTypeViewFacetConfig
|
|
25
|
+
| FilteredEntitiesFacetConfig
|
|
26
|
+
| FilteredSavedSearchesFacetConfig
|
|
27
|
+
| DashboardView;
|
|
28
|
+
type: string;
|
|
29
|
+
onToggleFullscreen: (id: string) => void;
|
|
30
|
+
isUpdated?: boolean;
|
|
31
|
+
isFullscreen: boolean;
|
|
32
|
+
onRemove?: (id: string) => void;
|
|
33
|
+
};
|
|
34
|
+
class ViewsFactory {
|
|
35
|
+
static ViewTypes = DashboardViewTypes;
|
|
36
|
+
|
|
37
|
+
static getComponent = ({config, type, isUpdated, isFullscreen, onToggleFullscreen, onRemove}: Props) => {
|
|
38
|
+
const props = {
|
|
39
|
+
isUpdated,
|
|
40
|
+
isFullscreen,
|
|
41
|
+
onToggleFullscreen,
|
|
42
|
+
onRemove
|
|
43
|
+
};
|
|
44
|
+
switch (type) {
|
|
45
|
+
case ViewsFactory.ViewTypes.ActivitiesViewFacet:
|
|
46
|
+
return <ActivitiesViewFacet config={config} {...props} />;
|
|
47
|
+
case ViewsFactory.ViewTypes.CustomActionViewFacet:
|
|
48
|
+
return <CustomActionViewFacet config={config as CustomActionViewFacetConfig} {...props} />;
|
|
49
|
+
case ViewsFactory.ViewTypes.DashboardFacet:
|
|
50
|
+
return <DashboardFacet config={config as DashboardFacetConfig} {...props} />;
|
|
51
|
+
case ViewsFactory.ViewTypes.EntitiesByTypeViewFacet:
|
|
52
|
+
return <EntitiesByTypeViewFacet config={config as EntityByTypeViewFacetConfig} {...props} />;
|
|
53
|
+
case ViewsFactory.ViewTypes.FilteredSavedSearchesFacet:
|
|
54
|
+
return <FilteredSavedSearchesFacet config={config} {...props} />;
|
|
55
|
+
case ViewsFactory.ViewTypes.FilteredEntitiesViewFacet:
|
|
56
|
+
return <FilteredEntitiesViewFacet config={config} {...props} />;
|
|
57
|
+
case ViewsFactory.ViewTypes.NotificationInboxFacet:
|
|
58
|
+
return <NotificationInboxFacet config={config} {...props} />;
|
|
59
|
+
case ViewsFactory.ViewTypes.ProfileStatsFacet:
|
|
60
|
+
return <ProfileStatsFacet config={config} {...props} />;
|
|
61
|
+
default:
|
|
62
|
+
return <div>NOT IMPLEMENTED</div>;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
static getChartType = (view: DashboardView & {chartType?: string}): string => {
|
|
67
|
+
const typeConverters = {
|
|
68
|
+
[ViewsFactory.ViewTypes.EntitiesByTypeViewFacet]: ChartTypes.TREE,
|
|
69
|
+
[ViewsFactory.ViewTypes.FilteredSavedSearchesFacet]: ChartTypes.TABLE,
|
|
70
|
+
[ViewsFactory.ViewTypes.FilteredEntitiesViewFacet]: ChartTypes.TABLE,
|
|
71
|
+
[ViewsFactory.ViewTypes.ProfileStatsFacet]: ChartTypes.LINE,
|
|
72
|
+
[ViewsFactory.ViewTypes.NotificationInboxFacet]: ChartTypes.TABLE,
|
|
73
|
+
[ViewsFactory.ViewTypes.ActivitiesViewFacet]: ChartTypes.TABLE
|
|
74
|
+
};
|
|
75
|
+
return view.chartType || typeConverters[view.component];
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export default ViewsFactory;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import {ChartTypes} from '@reltio/mdm-sdk';
|
|
2
|
+
import ViewsFactory from '../ViewsFactory';
|
|
3
|
+
|
|
4
|
+
describe('ViewsFactory tests', () => {
|
|
5
|
+
describe('getChartType tests', () => {
|
|
6
|
+
it('should return chartType property if view has chartType', () => {
|
|
7
|
+
const view = {
|
|
8
|
+
id: 'ViewID',
|
|
9
|
+
component: 'DashboardFacet',
|
|
10
|
+
chartType: 'bar',
|
|
11
|
+
title: 'Title'
|
|
12
|
+
};
|
|
13
|
+
expect(ViewsFactory.getChartType(view)).toBe(view.chartType);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('should return ChartTypes.TREE for EntitiesByTypeViewFacet', () => {
|
|
17
|
+
const view = {
|
|
18
|
+
id: 'ViewID',
|
|
19
|
+
component: 'EntitiesByTypeViewFacet',
|
|
20
|
+
title: 'Title'
|
|
21
|
+
};
|
|
22
|
+
expect(ViewsFactory.getChartType(view)).toBe(ChartTypes.TREE);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('should return ChartTypes.TABLE for FilteredSavedSearchesFacet', () => {
|
|
26
|
+
const view = {
|
|
27
|
+
id: 'ViewID',
|
|
28
|
+
component: 'FilteredSavedSearchesFacet',
|
|
29
|
+
title: 'Title'
|
|
30
|
+
};
|
|
31
|
+
expect(ViewsFactory.getChartType(view)).toBe(ChartTypes.TABLE);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('should return ChartTypes.TABLE for FilteredEntitiesViewFacet', () => {
|
|
35
|
+
const view = {
|
|
36
|
+
id: 'ViewID',
|
|
37
|
+
component: 'FilteredEntitiesViewFacet',
|
|
38
|
+
title: 'Title'
|
|
39
|
+
};
|
|
40
|
+
expect(ViewsFactory.getChartType(view)).toBe(ChartTypes.TABLE);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('should return ChartTypes.LINE for ProfileStatsFacet', () => {
|
|
44
|
+
const view = {
|
|
45
|
+
id: 'ViewID',
|
|
46
|
+
component: 'ProfileStatsFacet',
|
|
47
|
+
title: 'Title'
|
|
48
|
+
};
|
|
49
|
+
expect(ViewsFactory.getChartType(view)).toBe(ChartTypes.LINE);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('should return undefined for CustomActionViewFacet', () => {
|
|
53
|
+
const view = {
|
|
54
|
+
id: 'ViewID',
|
|
55
|
+
component: 'CustomActionViewFacet',
|
|
56
|
+
title: 'Title'
|
|
57
|
+
};
|
|
58
|
+
expect(ViewsFactory.getChartType(view)).toBeUndefined();
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('should return undefined for unknown facet without chartType property', () => {
|
|
62
|
+
const view = {
|
|
63
|
+
id: 'ViewID',
|
|
64
|
+
component: 'SomeNewFacet',
|
|
65
|
+
title: 'Title'
|
|
66
|
+
};
|
|
67
|
+
expect(ViewsFactory.getChartType(view)).toBeUndefined();
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React, {memo, useContext, useMemo} from 'react';
|
|
2
|
+
import {useDispatch, useSelector} from 'react-redux';
|
|
3
|
+
import {ChartsFactory, SearchFiltersContext, useReloadFacet} from '@reltio/components';
|
|
4
|
+
import {useFacetRequest} from '../../hooks/useFacetRequest';
|
|
5
|
+
import {ChartTypes, DashboardFacetConfig, SearchFilter} from '@reltio/mdm-sdk';
|
|
6
|
+
import LayoutItemView from '../../components/LayoutItemView/LayoutItemView';
|
|
7
|
+
import LayoutItemHeader from '../../components/LayoutItemHeader/LayoutItemHeader';
|
|
8
|
+
import LayoutItemContent from '../../components/LayoutItemContent/LayoutItemContent';
|
|
9
|
+
import mdmModule, {ui} from '@reltio/mdm-module';
|
|
10
|
+
import {concat, pipe} from 'ramda';
|
|
11
|
+
import {facetFiltersToSearchState, getFiltersForFacet, getFiltersForFacetItem} from '../../services/facets';
|
|
12
|
+
import {convertSearchFilterToDashboardConfigFilter} from '../../services/filters';
|
|
13
|
+
|
|
14
|
+
type DashboardFacetProps = {
|
|
15
|
+
config: DashboardFacetConfig;
|
|
16
|
+
onToggleFullscreen: (id: string) => void;
|
|
17
|
+
isUpdated?: boolean;
|
|
18
|
+
isFullscreen: boolean;
|
|
19
|
+
onRemove?: (id: string) => void;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const DashboardFacet = ({config, onToggleFullscreen, isUpdated, isFullscreen, onRemove}: DashboardFacetProps) => {
|
|
23
|
+
const {id, title, filters, attributeUri, count, orderType, chartType, showOthers, ...options} = config;
|
|
24
|
+
const pageSize = chartType === ChartTypes.MAP ? 100 : 8;
|
|
25
|
+
const {data, state, reload} = useFacetRequest({
|
|
26
|
+
filters,
|
|
27
|
+
attributeUri,
|
|
28
|
+
pageSize: count || pageSize,
|
|
29
|
+
orderType,
|
|
30
|
+
options: {showOthers}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
useReloadFacet({state, reload});
|
|
34
|
+
|
|
35
|
+
const dispatch = useDispatch();
|
|
36
|
+
const metadata = useSelector(mdmModule.selectors.getMetadata);
|
|
37
|
+
|
|
38
|
+
const searchFilters = useContext<SearchFilter[]>(SearchFiltersContext);
|
|
39
|
+
const allFilters = useMemo(
|
|
40
|
+
() => searchFilters.map(convertSearchFilterToDashboardConfigFilter).concat(filters || []),
|
|
41
|
+
[searchFilters, filters]
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const onItemClick = pipe(
|
|
45
|
+
getFiltersForFacetItem(attributeUri, data),
|
|
46
|
+
concat(getFiltersForFacet(attributeUri, allFilters)),
|
|
47
|
+
facetFiltersToSearchState(metadata, attributeUri),
|
|
48
|
+
ui.actions.openSearch,
|
|
49
|
+
dispatch
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<LayoutItemView id={id}>
|
|
54
|
+
<LayoutItemHeader
|
|
55
|
+
title={title}
|
|
56
|
+
onToggleFullscreen={onToggleFullscreen}
|
|
57
|
+
isUpdated={isUpdated}
|
|
58
|
+
isFullscreen={isFullscreen}
|
|
59
|
+
onRefresh={reload}
|
|
60
|
+
onRemove={onRemove}
|
|
61
|
+
/>
|
|
62
|
+
<LayoutItemContent loadingState={state} onRefresh={reload} data={data}>
|
|
63
|
+
{({data, width = 0, height = 0}) => {
|
|
64
|
+
return ChartsFactory.build(chartType, {data, width, height, options, onItemClick});
|
|
65
|
+
}}
|
|
66
|
+
</LayoutItemContent>
|
|
67
|
+
</LayoutItemView>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export default memo(DashboardFacet);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React, {memo} from 'react';
|
|
2
|
+
import {useDispatch, useSelector} from 'react-redux';
|
|
3
|
+
import {TreeChart, useReloadFacet} from '@reltio/components';
|
|
4
|
+
import {useEntityByTypeRequest} from '../../hooks/useEntityByTypeRequest';
|
|
5
|
+
import LayoutItemView from '../../components/LayoutItemView/LayoutItemView';
|
|
6
|
+
import LayoutItemHeader from '../../components/LayoutItemHeader/LayoutItemHeader';
|
|
7
|
+
import LayoutItemContent from '../../components/LayoutItemContent/LayoutItemContent';
|
|
8
|
+
import {EntityByTypeViewFacetConfig} from '../../types/EntityByTypeViewFacetConfig';
|
|
9
|
+
import {entityTypeNameToFilters} from '../../services/entityTypes';
|
|
10
|
+
import {facetFiltersToSearchState} from '../../services/facets';
|
|
11
|
+
import mdmModule, {ui} from '@reltio/mdm-module';
|
|
12
|
+
import {pipe} from 'ramda';
|
|
13
|
+
|
|
14
|
+
type Props = {
|
|
15
|
+
config: EntityByTypeViewFacetConfig;
|
|
16
|
+
onToggleFullscreen: (id: string) => void;
|
|
17
|
+
isUpdated?: boolean;
|
|
18
|
+
isFullscreen: boolean;
|
|
19
|
+
onRemove?: (id: string) => void;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const EntitiesByTypeViewFacet = ({config, onToggleFullscreen, isUpdated, isFullscreen, onRemove}: Props) => {
|
|
23
|
+
const {id, title, hideEmpty, orderType, inheritChildren} = config;
|
|
24
|
+
const {data, state, reload} = useEntityByTypeRequest({
|
|
25
|
+
hideEmpty,
|
|
26
|
+
orderType,
|
|
27
|
+
inheritChildren
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
useReloadFacet({state, reload});
|
|
31
|
+
|
|
32
|
+
const dispatch = useDispatch();
|
|
33
|
+
const metadata = useSelector(mdmModule.selectors.getMetadata);
|
|
34
|
+
const onTypeClick = pipe(
|
|
35
|
+
entityTypeNameToFilters,
|
|
36
|
+
facetFiltersToSearchState(metadata, 'type'),
|
|
37
|
+
ui.actions.openSearch,
|
|
38
|
+
dispatch
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<LayoutItemView id={id}>
|
|
43
|
+
<LayoutItemHeader
|
|
44
|
+
title={title}
|
|
45
|
+
onToggleFullscreen={onToggleFullscreen}
|
|
46
|
+
isUpdated={isUpdated}
|
|
47
|
+
isFullscreen={isFullscreen}
|
|
48
|
+
onRefresh={reload}
|
|
49
|
+
onRemove={onRemove}
|
|
50
|
+
/>
|
|
51
|
+
<LayoutItemContent loadingState={state} onRefresh={reload} data={data}>
|
|
52
|
+
{({data, width, height}) => {
|
|
53
|
+
return <TreeChart width={width} height={height} data={data} onItemClick={onTypeClick} />;
|
|
54
|
+
}}
|
|
55
|
+
</LayoutItemContent>
|
|
56
|
+
</LayoutItemView>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export default memo(EntitiesByTypeViewFacet);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React, {memo, useState} from 'react';
|
|
2
|
+
import {DashboardView, DatePeriod, DateRangeValue, getDateRangeOptions} from '@reltio/mdm-sdk';
|
|
3
|
+
import {useReloadFacet, DateRangeEditor} from '@reltio/components';
|
|
4
|
+
import LayoutItemView from '../../components/LayoutItemView/LayoutItemView';
|
|
5
|
+
import LayoutItemHeader from '../../components/LayoutItemHeader/LayoutItemHeader';
|
|
6
|
+
import LayoutItemContent from '../../components/LayoutItemContent/LayoutItemContent';
|
|
7
|
+
import StatsChart from '../../components/StatsChart/StatsChart';
|
|
8
|
+
import {useStatsRequest} from '../../hooks/useStatsRequest';
|
|
9
|
+
import {getValuesDateRange} from '../../services/period';
|
|
10
|
+
|
|
11
|
+
import {useStyles} from './styles';
|
|
12
|
+
|
|
13
|
+
type Props = {
|
|
14
|
+
config: DashboardView;
|
|
15
|
+
onToggleFullscreen: (id: string) => void;
|
|
16
|
+
isUpdated?: boolean;
|
|
17
|
+
isFullscreen: boolean;
|
|
18
|
+
onRemove?: (id: string) => void;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const ProfileStatsFacet = ({config, onToggleFullscreen, isUpdated, isFullscreen, onRemove}: Props) => {
|
|
22
|
+
const styles = useStyles();
|
|
23
|
+
|
|
24
|
+
const {id, title} = config;
|
|
25
|
+
const [period, setPeriod] = useState<DatePeriod>(DateRangeValue.LAST_WEEK);
|
|
26
|
+
const {state, data, step, reload} = useStatsRequest(period);
|
|
27
|
+
useReloadFacet({state, reload});
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<LayoutItemView id={id}>
|
|
31
|
+
<LayoutItemHeader
|
|
32
|
+
title={title}
|
|
33
|
+
onToggleFullscreen={onToggleFullscreen}
|
|
34
|
+
isUpdated={isUpdated}
|
|
35
|
+
isFullscreen={isFullscreen}
|
|
36
|
+
onRefresh={reload}
|
|
37
|
+
onRemove={onRemove}
|
|
38
|
+
>
|
|
39
|
+
<DateRangeEditor
|
|
40
|
+
values={period}
|
|
41
|
+
options={getDateRangeOptions()}
|
|
42
|
+
getValuesDateRange={getValuesDateRange}
|
|
43
|
+
onChange={setPeriod}
|
|
44
|
+
className={styles.periodSelector}
|
|
45
|
+
/>
|
|
46
|
+
</LayoutItemHeader>
|
|
47
|
+
<LayoutItemContent loadingState={state} onRefresh={reload} data={data}>
|
|
48
|
+
{({data, width, height}) => <StatsChart data={data} width={width} height={height} step={step} />}
|
|
49
|
+
</LayoutItemContent>
|
|
50
|
+
</LayoutItemView>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default memo(ProfileStatsFacet);
|