@orchestrator-ui/orchestrator-ui-components 0.2.1 → 0.2.3
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/.storybook/main.js +28 -0
- package/.storybook/preview.js +14 -0
- package/.turbo/turbo-build.log +11 -0
- package/.turbo/turbo-lint.log +10 -0
- package/.turbo/turbo-test.log +17 -0
- package/CHANGELOG.md +12 -0
- package/dist/index.d.ts +751 -0
- package/dist/index.js +7019 -0
- package/package.json +18 -4
- package/src/components/{Badges/Badge/Badge.stories.tsx → WFOBadges/WFOBadge/WFOBadge.stories.tsx} +4 -4
- package/src/components/{Badges/Badge/Badge.tsx → WFOBadges/WFOBadge/WFOBadge.tsx} +2 -2
- package/src/components/WFOBadges/WFOBadge/index.ts +1 -0
- package/src/components/{Badges/EngineStatusBadge/EngineStatusBadge.stories.tsx → WFOBadges/WFOEngineStatusBadge/WFOEngineStatusBadge.stories.tsx} +4 -4
- package/src/components/{Badges/EngineStatusBadge/EngineStatusBadge.tsx → WFOBadges/WFOEngineStatusBadge/WFOEngineStatusBadge.tsx} +6 -6
- package/src/components/WFOBadges/WFOEngineStatusBadge/index.ts +1 -0
- package/src/components/{Badges/EnvironmentBadge/EnvironmentBadge.stories.tsx → WFOBadges/WFOEnvironmentBadge/WFOEnvironmentBadge.stories.tsx} +4 -4
- package/src/components/{Badges/EnvironmentBadge/EnvironmentBadge.tsx → WFOBadges/WFOEnvironmentBadge/WFOEnvironmentBadge.tsx} +6 -6
- package/src/components/WFOBadges/WFOEnvironmentBadge/index.ts +1 -0
- package/src/components/WFOBadges/WFOFailedTasksBadge/WFOFailedTasksBadge.stories.tsx +12 -0
- package/src/components/{Badges/FailedTasksBadge/FailedTasksBadge.tsx → WFOBadges/WFOFailedTasksBadge/WFOFailedTasksBadge.tsx} +6 -6
- package/src/components/WFOBadges/WFOFailedTasksBadge/index.ts +1 -0
- package/src/components/{Badges/HeaderBadge/HeaderBadge.stories.tsx → WFOBadges/WFOHeaderBadge/WFOHeaderBadge.stories.tsx} +4 -4
- package/src/components/{Badges/HeaderBadge/HeaderBadge.tsx → WFOBadges/WFOHeaderBadge/WFOHeaderBadge.tsx} +4 -4
- package/src/components/WFOBadges/WFOHeaderBadge/index.ts +1 -0
- package/src/components/WFOBadges/WFOProcessStatusBadge/WFOProcessStatusBadge.tsx +71 -0
- package/src/components/WFOBadges/WFOProcessStatusBadge/index.ts +1 -0
- package/src/components/{Badges → WFOBadges}/WFOProductBlockBadge/WFOProductBlockBadge.stories.tsx +1 -1
- package/src/components/{Badges → WFOBadges}/WFOProductBlockBadge/WFOProductBlockBadge.tsx +3 -3
- package/src/components/{Badges → WFOBadges}/WFOStatusBadge/WFOStatusBadge.stories.tsx +1 -1
- package/src/components/{Badges → WFOBadges}/WFOStatusBadge/WFOStatusBadge.tsx +3 -3
- package/src/components/WFOBadges/index.ts +8 -0
- package/src/components/{Breadcrumbs/Breadcrumbs.tsx → WFOBreadcrumbs/WFOBreadcrumbs.tsx} +1 -1
- package/src/components/WFOBreadcrumbs/index.ts +1 -0
- package/src/components/WFOFilterTabs/WFOFilterTabs.tsx +43 -0
- package/src/components/WFOFilterTabs/index.ts +1 -0
- package/src/components/WFOLoading/WFOLoading.tsx +2 -0
- package/src/components/WFOLoading/index.ts +1 -0
- package/src/components/{OrchestratorPageTemplate/OrchestratorPageHeader/OrchestratorPageHeader.stories.tsx → WFOPageTemplate/WFOPageHeader/WFOPageHeader.stories.tsx} +5 -14
- package/src/components/{OrchestratorPageTemplate/OrchestratorPageHeader/OrchestratorPageHeader.tsx → WFOPageTemplate/WFOPageHeader/WFOPageHeader.tsx} +10 -10
- package/src/components/WFOPageTemplate/WFOPageHeader/index.ts +1 -0
- package/src/components/WFOPageTemplate/WFOPageTemplate/WFOPageTemplate.stories.tsx +24 -0
- package/src/components/{OrchestratorPageTemplate/OrchestratorPageTemplate/OrchestratorPageTemplate.tsx → WFOPageTemplate/WFOPageTemplate/WFOPageTemplate.tsx} +6 -6
- package/src/components/WFOPageTemplate/WFOPageTemplate/index.ts +1 -0
- package/src/components/{OrchestratorPageTemplate/OrchestratorSidebar/OrchestratorSidebar.stories.tsx → WFOPageTemplate/WFOSidebar/WFOSidebar.stories.tsx} +4 -4
- package/src/components/{OrchestratorPageTemplate/OrchestratorSidebar/OrchestratorSidebar.tsx → WFOPageTemplate/WFOSidebar/WFOSidebar.tsx} +2 -14
- package/src/components/WFOPageTemplate/WFOSidebar/index.ts +1 -0
- package/src/components/WFOPageTemplate/index.ts +3 -0
- package/src/components/{SearchBar/SearchField.tsx → WFOSearchBar/WFOSearchField.tsx} +3 -3
- package/src/components/WFOSearchBar/index.ts +1 -0
- package/src/components/WFOSettingsModal/index.tsx +1 -0
- package/src/components/{SettingsPage/EngineStatusButton.tsx → WFOSettingsPage/WFOEngineStatusButton.tsx} +2 -2
- package/src/components/{SettingsPage/FlushSettings.tsx → WFOSettingsPage/WFOFlushSettings.tsx} +1 -1
- package/src/components/{SettingsPage/ModifySettings.tsx → WFOSettingsPage/WFOModifySettings.tsx} +4 -4
- package/src/components/{SettingsPage/Settings.tsx → WFOSettingsPage/WFOSettings.tsx} +7 -7
- package/src/components/{SettingsPage/Status.tsx → WFOSettingsPage/WFOStatus.tsx} +4 -4
- package/src/components/WFOSettingsPage/index.ts +1 -0
- package/src/components/{StartPage/FrequentlyUsed.stories.tsx → WFOStartPage/WFOFrequentlyUsed.stories.tsx} +4 -4
- package/src/components/{StartPage/FrequentlyUsed.tsx → WFOStartPage/WFOFrequentlyUsed.tsx} +2 -2
- package/src/components/{StartPage/ListItemStartPage.stories.tsx → WFOStartPage/WFOListItemStartPage.stories.tsx} +4 -4
- package/src/components/{StartPage/ListItemStartPage.tsx → WFOStartPage/WFOListItemStartPage.tsx} +10 -7
- package/src/components/{StartPage/ListStartPage.stories.tsx → WFOStartPage/WFOListStartPage.stories.tsx} +4 -4
- package/src/components/{StartPage/ListStartPage.tsx → WFOStartPage/WFOListStartPage.tsx} +9 -4
- package/src/components/{StartPage/MultiListSection.stories.tsx → WFOStartPage/WFOMultiListSection.stories.tsx} +4 -4
- package/src/components/{StartPage/MultiListSection.tsx → WFOStartPage/WFOMultiListSection.tsx} +5 -5
- package/src/components/WFOStartPage/WFONewProcessPanel.stories.tsx +12 -0
- package/src/components/{StartPage/NewProcessPanel.tsx → WFOStartPage/WFONewProcessPanel.tsx} +3 -3
- package/src/components/WFOStartPage/WFOStatCards.stories.tsx +12 -0
- package/src/components/{StartPage/StatCards.tsx → WFOStartPage/WFOStatCards.tsx} +1 -1
- package/src/components/WFOStartPage/index.ts +6 -0
- package/src/components/{Subscription/FixedInputBlock.tsx → WFOSubscription/WFOFixedInputBlock.tsx} +2 -2
- package/src/components/{Subscription/ProcessesTimeline.tsx → WFOSubscription/WFOProcessesTimeline.tsx} +4 -4
- package/src/components/{Subscription/ProductBlock.tsx → WFOSubscription/WFOProductBlock.tsx} +4 -1
- package/src/components/{Subscription/SubscriptionActions.tsx → WFOSubscription/WFOSubscriptionActions.tsx} +1 -1
- package/src/components/{Subscription/SubscriptionBlock.tsx → WFOSubscription/WFOSubscriptionBlock.tsx} +5 -5
- package/src/components/{Subscription/SubscriptionDetailTree.tsx → WFOSubscription/WFOSubscriptionDetailTree.tsx} +5 -5
- package/src/components/{Subscription/SubscriptionGeneral.tsx → WFOSubscription/WFOSubscriptionGeneral.tsx} +9 -6
- package/src/components/WFOSubscription/index.ts +7 -0
- package/src/components/{Table/DataGridTable/DataGridTable.stories.tsx → WFOTable/WFODataGridTable/WFODataGridTable.stories.tsx} +6 -6
- package/src/components/{Table/DataGridTable/DataGridTable.tsx → WFOTable/WFODataGridTable/WFODataGridTable.tsx} +13 -13
- package/src/components/{Table/DataGridTable/dataGridColumns.spec.ts → WFOTable/WFODataGridTable/WFOdataGridColumns.spec.ts} +6 -6
- package/src/components/{Table/DataGridTable/dataGridColumns.ts → WFOTable/WFODataGridTable/WFOdataGridColumns.ts} +6 -6
- package/src/components/{Table/SortDirectionIcon.tsx → WFOTable/WFOSortDirectionIcon.tsx} +6 -6
- package/src/components/{Table/Table.tsx → WFOTable/WFOTable.tsx} +13 -13
- package/src/components/{Table/TableHeaderCell.tsx → WFOTable/WFOTableHeaderCell.tsx} +4 -4
- package/src/components/{Table/TableSettingsModal/TableSettingsModal.tsx → WFOTable/WFOTableSettingsModal/WFOTableSettingsModal.tsx} +1 -1
- package/src/components/WFOTable/WFOTableSettingsModal/index.ts +1 -0
- package/src/components/{Table/TableWithFilter/TableWithFilter.tsx → WFOTable/WFOTableWithFilter/WFOTableWithFilter.tsx} +31 -24
- package/src/components/WFOTable/WFOTableWithFilter/index.ts +1 -0
- package/src/components/WFOTable/index.ts +14 -0
- package/src/components/{Table → WFOTable}/utils/columns.ts +10 -10
- package/src/components/WFOTable/utils/constants.ts +15 -0
- package/src/components/{Tree/Tree.tsx → WFOTree/WFOTree.tsx} +4 -4
- package/src/components/{Tree/TreeBranch.tsx → WFOTree/WFOTreeBranch.tsx} +9 -5
- package/src/components/{Tree/TreeNode.tsx → WFOTree/WFOTreeNode.tsx} +6 -2
- package/src/components/index.ts +11 -11
- package/src/graphqlQueries/index.ts +2 -0
- package/src/graphqlQueries/processListQuery.ts +53 -0
- package/src/graphqlQueries/productBlocksQuery.ts +0 -5
- package/src/graphqlQueries/productsQuery.ts +47 -0
- package/src/graphqlQueries/resourceTypesQuery.ts +35 -0
- package/src/graphqlQueries/workflowsQuery.ts +37 -0
- package/src/hooks/useProcessStatusCountsQuery.ts +1 -0
- package/src/hooks/useSubscriptionProcesses.ts +2 -1
- package/src/icons/{ArrowNarrowDown.tsx → WFOArrowNarrowDown.tsx} +2 -2
- package/src/icons/{ArrowNarrowUp.tsx → WFOArrowNarrowUp.tsx} +2 -2
- package/src/icons/WFOCheckmarkCircleFill.stories.tsx +12 -0
- package/src/icons/{CheckmarkCircleFill.tsx → WFOCheckmarkCircleFill.tsx} +2 -2
- package/src/icons/{ChevronDown.tsx → WFOChevronDown.tsx} +2 -2
- package/src/icons/{IconProps.ts → WFOIconProps.ts} +1 -1
- package/src/icons/WFOLogoutIcon.stories.tsx +12 -0
- package/src/icons/{LogoutIcon.tsx → WFOLogoutIcon.tsx} +2 -2
- package/src/icons/WFOMinusCircleOutline.stories.tsx +12 -0
- package/src/icons/{MinusCircleOutline.tsx → WFOMinusCircleOutline.tsx} +2 -2
- package/src/icons/WFOPlusCircleFill.stories.tsx +12 -0
- package/src/icons/{PlusCircleFill.tsx → WFOPlusCircleFill.tsx} +2 -2
- package/src/icons/WFOStatusDotIcon.stories.tsx +12 -0
- package/src/icons/{StatusDotIcon.tsx → WFOStatusDotIcon.tsx} +2 -2
- package/src/icons/WFOXCircleFill.stories.tsx +12 -0
- package/src/icons/{XCircleFill.tsx → WFOXCircleFill.tsx} +2 -2
- package/src/icons/index.ts +10 -10
- package/src/messages/en-US.json +34 -2
- package/src/messages/nl-NL.json +67 -3
- package/src/pages/index.ts +2 -0
- package/src/pages/metadata/WFOMetadataPageLayout.tsx +0 -5
- package/src/pages/metadata/WFOProductBlocksPage.tsx +13 -16
- package/src/pages/metadata/WFOProductsPage.tsx +169 -0
- package/src/pages/metadata/WFOResourceTypesPage.tsx +120 -0
- package/src/pages/metadata/WFOWorkflowsPage.tsx +251 -0
- package/src/pages/metadata/index.ts +3 -0
- package/src/pages/processes/WFOProcessListPage.tsx +209 -0
- package/src/pages/processes/WFOProcessesListSubscriptionsCell.tsx +28 -0
- package/src/pages/processes/getProcessListTabTypeFromString.ts +19 -0
- package/src/pages/processes/index.ts +4 -0
- package/src/pages/processes/tabConfig.ts +33 -0
- package/src/pages/processes/tableConfig.ts +22 -0
- package/src/pages/subscriptions/index.ts +2 -0
- package/src/pages/subscriptions/subscriptionListTabs.ts +71 -0
- package/src/pages/subscriptions/types.ts +13 -0
- package/src/stories/Button.jsx +54 -0
- package/src/stories/Button.stories.js +45 -0
- package/src/stories/Configure.mdx +446 -0
- package/src/stories/Header.jsx +59 -0
- package/src/stories/Header.stories.js +23 -0
- package/src/stories/Page.jsx +68 -0
- package/src/stories/Page.stories.js +24 -0
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +5 -0
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +15 -0
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +3 -0
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +12 -0
- package/src/stories/assets/youtube.svg +4 -0
- package/src/stories/button.css +30 -0
- package/src/stories/header.css +32 -0
- package/src/stories/page.css +69 -0
- package/src/types.ts +60 -11
- package/tsconfig.json +2 -4
- package/src/components/Badges/Badge/index.ts +0 -1
- package/src/components/Badges/EngineStatusBadge/index.ts +0 -1
- package/src/components/Badges/EnvironmentBadge/index.ts +0 -1
- package/src/components/Badges/FailedTasksBadge/FailedTasksBadge.stories.tsx +0 -12
- package/src/components/Badges/FailedTasksBadge/index.ts +0 -1
- package/src/components/Badges/HeaderBadge/index.ts +0 -1
- package/src/components/Badges/ProcessStatusBadge/ProcessStatusBadge.tsx +0 -46
- package/src/components/Badges/ProcessStatusBadge/index.ts +0 -1
- package/src/components/Badges/index.ts +0 -8
- package/src/components/Breadcrumbs/index.ts +0 -1
- package/src/components/Loading/Loading.tsx +0 -2
- package/src/components/Loading/index.ts +0 -1
- package/src/components/OrchestratorPageTemplate/OrchestratorPageHeader/index.ts +0 -1
- package/src/components/OrchestratorPageTemplate/OrchestratorPageTemplate/OrchestratorPageTemplate.stories.tsx +0 -33
- package/src/components/OrchestratorPageTemplate/OrchestratorPageTemplate/index.ts +0 -1
- package/src/components/OrchestratorPageTemplate/OrchestratorSidebar/index.ts +0 -1
- package/src/components/OrchestratorPageTemplate/index.ts +0 -3
- package/src/components/SearchBar/index.ts +0 -1
- package/src/components/SettingsModal/index.tsx +0 -1
- package/src/components/SettingsPage/index.ts +0 -1
- package/src/components/StartPage/NewProcessPanel.stories.tsx +0 -12
- package/src/components/StartPage/StatCards.stories.tsx +0 -12
- package/src/components/StartPage/index.ts +0 -6
- package/src/components/Subscription/index.ts +0 -7
- package/src/components/SubscriptionsTabs/SubscriptionsTabs.tsx +0 -90
- package/src/components/SubscriptionsTabs/getSubscriptionsTabTypeFromString.spec.ts +0 -34
- package/src/components/SubscriptionsTabs/getSubscriptionsTabTypeFromString.ts +0 -23
- package/src/components/SubscriptionsTabs/index.ts +0 -2
- package/src/components/Table/TableSettingsModal/index.ts +0 -1
- package/src/components/Table/TableWithFilter/index.ts +0 -1
- package/src/components/Table/index.ts +0 -14
- package/src/components/Table/utils/constants.ts +0 -5
- package/src/icons/CheckmarkCircleFill.stories.tsx +0 -12
- package/src/icons/LogoutIcon.stories.tsx +0 -12
- package/src/icons/MinusCircleOutline.stories.tsx +0 -12
- package/src/icons/PlusCircleFill.stories.tsx +0 -12
- package/src/icons/StatusDotIcon.stories.tsx +0 -12
- package/src/icons/XCircleFill.stories.tsx +0 -12
- /package/src/components/{Badges → WFOBadges}/WFOProductBlockBadge/index.ts +0 -0
- /package/src/components/{Badges → WFOBadges}/WFOStatusBadge/index.ts +0 -0
- /package/src/components/{SettingsModal/SettingsModal.tsx → WFOSettingsModal/WFOSettingsModal.tsx} +0 -0
- /package/src/components/{Subscription → WFOSubscription}/styles.ts +0 -0
- /package/src/components/{Table → WFOTable}/utils/columns.spec.ts +0 -0
- /package/src/components/{Table → WFOTable}/utils/tableConfigPersistence.spec.ts +0 -0
- /package/src/components/{Table → WFOTable}/utils/tableConfigPersistence.ts +0 -0
- /package/src/components/{Table → WFOTable}/utils/tableUtils.spec.ts +0 -0
- /package/src/components/{Table → WFOTable}/utils/tableUtils.ts +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { useTranslations } from 'next-intl';
|
|
3
3
|
import { ProductBlockBase, ResourceTypeBase, TreeBlock } from '../../types';
|
|
4
|
-
import {
|
|
4
|
+
import { WFOProductBlock } from './WFOProductBlock';
|
|
5
5
|
import {
|
|
6
6
|
SubscriptionContext,
|
|
7
7
|
SubscriptionContextType,
|
|
8
8
|
} from '../../contexts/SubscriptionContext';
|
|
9
|
-
import {
|
|
9
|
+
import { WFOTree } from '../WFOTree/WFOTree';
|
|
10
10
|
import { TreeContext, TreeContextType } from '../../contexts/TreeContext';
|
|
11
11
|
|
|
12
12
|
import {
|
|
@@ -40,7 +40,7 @@ function getProductBlockTitle(resourceType: ResourceTypeBase): string {
|
|
|
40
40
|
: resourceType.title;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
export const
|
|
43
|
+
export const WFOSubscriptionDetailTree = () => {
|
|
44
44
|
const t = useTranslations('subscriptions.detail');
|
|
45
45
|
const [expandAllActive, setExpandAllActive] = useState(false);
|
|
46
46
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -146,7 +146,7 @@ export const SubscriptionDetailTree = () => {
|
|
|
146
146
|
</EuiFlexItem>
|
|
147
147
|
<EuiFlexItem grow={true}>
|
|
148
148
|
{!tree && <EuiLoadingContent />}
|
|
149
|
-
{tree && <
|
|
149
|
+
{tree && <WFOTree data={[tree]} />}
|
|
150
150
|
</EuiFlexItem>
|
|
151
151
|
</EuiFlexGroup>
|
|
152
152
|
</EuiFlexItem>
|
|
@@ -170,7 +170,7 @@ export const SubscriptionDetailTree = () => {
|
|
|
170
170
|
selectedIds
|
|
171
171
|
.reverse()
|
|
172
172
|
.map((id, index) =>
|
|
173
|
-
|
|
173
|
+
WFOProductBlock(
|
|
174
174
|
subscriptionData.productBlocks[
|
|
175
175
|
selectedIds[index]
|
|
176
176
|
].resourceTypes,
|
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
} from '@elastic/eui';
|
|
9
9
|
// import { useTranslations } from 'next-intl';
|
|
10
10
|
import { SubscriptionContext } from '../../contexts/SubscriptionContext';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { WFOSubscriptionBlock } from './WFOSubscriptionBlock';
|
|
12
|
+
import { WFOFixedInputBlock } from './WFOFixedInputBlock';
|
|
13
13
|
|
|
14
14
|
/** TODO: Adding a useTranslations hook here leads to an hooks error. https://github.com/workfloworchestrator/orchestrator-ui/issues/177 */
|
|
15
15
|
|
|
16
|
-
export const
|
|
16
|
+
export const WFOSubscriptionGeneral = () => {
|
|
17
17
|
const { subscriptionData, loadingStatus } =
|
|
18
18
|
React.useContext(SubscriptionContext);
|
|
19
19
|
|
|
@@ -30,19 +30,22 @@ export const SubscriptionGeneral = () => {
|
|
|
30
30
|
<EuiFlexGrid direction={'row'}>
|
|
31
31
|
<>
|
|
32
32
|
<EuiFlexItem>
|
|
33
|
-
{
|
|
33
|
+
{WFOSubscriptionBlock(
|
|
34
34
|
'Subscription details',
|
|
35
35
|
subscriptionData,
|
|
36
36
|
)}
|
|
37
37
|
</EuiFlexItem>
|
|
38
38
|
<EuiFlexItem>
|
|
39
|
-
{
|
|
39
|
+
{WFOFixedInputBlock(
|
|
40
40
|
'Fixed Inputs',
|
|
41
41
|
subscriptionData.fixedInputs,
|
|
42
42
|
)}
|
|
43
43
|
</EuiFlexItem>
|
|
44
44
|
<EuiFlexItem>
|
|
45
|
-
{
|
|
45
|
+
{WFOFixedInputBlock(
|
|
46
|
+
'Product Info',
|
|
47
|
+
subscriptionData.product,
|
|
48
|
+
)}
|
|
46
49
|
</EuiFlexItem>
|
|
47
50
|
</>
|
|
48
51
|
</EuiFlexGrid>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './WFOFixedInputBlock';
|
|
2
|
+
export * from './WFOProcessesTimeline';
|
|
3
|
+
export * from './WFOProductBlock';
|
|
4
|
+
export * from './WFOSubscriptionActions';
|
|
5
|
+
export * from './WFOSubscriptionBlock';
|
|
6
|
+
export * from './WFOSubscriptionDetailTree';
|
|
7
|
+
export * from './WFOSubscriptionGeneral';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Meta } from '@storybook/react';
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { WFODataSorting } from '../utils/columns';
|
|
4
4
|
import { SortOrder } from '../../../types';
|
|
5
|
-
import {
|
|
5
|
+
import { WFODataGridTable } from './WFODataGridTable';
|
|
6
6
|
|
|
7
7
|
const extractedArr = (arr, start, howMany) =>
|
|
8
8
|
arr.filter((_, index) => index >= start && index < howMany + start);
|
|
@@ -32,7 +32,7 @@ const TableWithEvents = (args) => {
|
|
|
32
32
|
setPageSize(updatedPageSize);
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
const updateDataSorting = (dataSorting:
|
|
35
|
+
const updateDataSorting = (dataSorting: WFODataSorting<unknown>) => {
|
|
36
36
|
setSorting(dataSorting);
|
|
37
37
|
|
|
38
38
|
const sortData = args.data.sort((a, b) => {
|
|
@@ -46,7 +46,7 @@ const TableWithEvents = (args) => {
|
|
|
46
46
|
setData(extractedArr(sortData, pageIndex, pageIndex + pageSize));
|
|
47
47
|
};
|
|
48
48
|
return (
|
|
49
|
-
<
|
|
49
|
+
<WFODataGridTable
|
|
50
50
|
{...args}
|
|
51
51
|
data={data}
|
|
52
52
|
pagination={{
|
|
@@ -62,9 +62,9 @@ const TableWithEvents = (args) => {
|
|
|
62
62
|
);
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
-
const Story: Meta<typeof
|
|
65
|
+
const Story: Meta<typeof WFODataGridTable> = {
|
|
66
66
|
component: TableWithEvents,
|
|
67
|
-
title: 'Tables/
|
|
67
|
+
title: 'Tables/WFODataGridTable',
|
|
68
68
|
parameters: { actions: { argTypesRegex: '^on*' } },
|
|
69
69
|
};
|
|
70
70
|
export default Story;
|
|
@@ -7,15 +7,15 @@ import {
|
|
|
7
7
|
import { useRef, useState } from 'react';
|
|
8
8
|
import {
|
|
9
9
|
mapColumnSortToEuiDataGridSorting,
|
|
10
|
-
|
|
10
|
+
WFOControlColumn,
|
|
11
11
|
getInitialColumnOrder,
|
|
12
|
-
|
|
13
|
-
} from './
|
|
12
|
+
WFODataGridTableColumns,
|
|
13
|
+
} from './WFOdataGridColumns';
|
|
14
14
|
import {
|
|
15
15
|
EuiDataGridControlColumn,
|
|
16
16
|
EuiDataGridPaginationProps,
|
|
17
17
|
} from '@elastic/eui/src/components/datagrid/data_grid_types';
|
|
18
|
-
import {
|
|
18
|
+
import { WFODataSorting, TableColumnKeys } from '../utils/columns';
|
|
19
19
|
|
|
20
20
|
// Total height of grid button bar, table header and pagination bar
|
|
21
21
|
const EUI_DATA_GRID_HEIGHT_OFFSET = 103;
|
|
@@ -35,19 +35,19 @@ export type Pagination = EuiDataGridPaginationProps & {
|
|
|
35
35
|
totalRecords: number;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
export type
|
|
38
|
+
export type WFODataGridTableProps<T> = {
|
|
39
39
|
data: T[];
|
|
40
40
|
pagination: Pagination;
|
|
41
|
-
columns:
|
|
42
|
-
leadingControlColumns?:
|
|
43
|
-
trailingControlColumns?:
|
|
41
|
+
columns: WFODataGridTableColumns<T>;
|
|
42
|
+
leadingControlColumns?: WFOControlColumn<T>[];
|
|
43
|
+
trailingControlColumns?: WFOControlColumn<T>[];
|
|
44
44
|
initialColumnOrder: TableColumnKeys<T>;
|
|
45
|
-
dataSorting?:
|
|
45
|
+
dataSorting?: WFODataSorting<T>;
|
|
46
46
|
handleRowClick?: (row: T) => void;
|
|
47
|
-
updateDataSorting?: (updatedDataSorting:
|
|
47
|
+
updateDataSorting?: (updatedDataSorting: WFODataSorting<T>) => void;
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
-
export const
|
|
50
|
+
export const WFODataGridTable = <T,>({
|
|
51
51
|
data,
|
|
52
52
|
pagination,
|
|
53
53
|
columns,
|
|
@@ -57,7 +57,7 @@ export const DataGridTable = <T,>({
|
|
|
57
57
|
dataSorting,
|
|
58
58
|
handleRowClick,
|
|
59
59
|
updateDataSorting,
|
|
60
|
-
}:
|
|
60
|
+
}: WFODataGridTableProps<T>) => {
|
|
61
61
|
const initialColumnOrderRef = useRef(
|
|
62
62
|
getInitialColumnOrder(columns, initialColumnOrder),
|
|
63
63
|
);
|
|
@@ -96,7 +96,7 @@ export const DataGridTable = <T,>({
|
|
|
96
96
|
};
|
|
97
97
|
|
|
98
98
|
const mapControlColumnToEuiDataGridControlColumn: (
|
|
99
|
-
controlColumn:
|
|
99
|
+
controlColumn: WFOControlColumn<T>,
|
|
100
100
|
) => EuiDataGridControlColumn = ({ id, width, rowCellRender }) => ({
|
|
101
101
|
id,
|
|
102
102
|
width,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getInitialColumnOrder,
|
|
3
3
|
mapColumnSortToEuiDataGridSorting,
|
|
4
|
-
|
|
5
|
-
} from './
|
|
6
|
-
import {
|
|
4
|
+
WFODataGridTableColumns,
|
|
5
|
+
} from './WFOdataGridColumns';
|
|
6
|
+
import { WFODataSorting } from '../utils/columns';
|
|
7
7
|
import { SortOrder } from '../../../types';
|
|
8
8
|
|
|
9
9
|
interface TestColumn {
|
|
@@ -12,7 +12,7 @@ interface TestColumn {
|
|
|
12
12
|
date: string;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const columns:
|
|
15
|
+
const columns: WFODataGridTableColumns<TestColumn> = {
|
|
16
16
|
id: {
|
|
17
17
|
displayAsText: 'id',
|
|
18
18
|
initialWidth: 100,
|
|
@@ -94,11 +94,11 @@ describe('dataGridColumns', () => {
|
|
|
94
94
|
|
|
95
95
|
describe('columnSortToEuiDataGridSorting', () => {
|
|
96
96
|
it('should return sort dict with columns and onsort', () => {
|
|
97
|
-
const sortBy:
|
|
97
|
+
const sortBy: WFODataSorting<TestColumn> = {
|
|
98
98
|
field: 'id',
|
|
99
99
|
sortOrder: SortOrder.ASC,
|
|
100
100
|
};
|
|
101
|
-
const onSort = (dataSorting:
|
|
101
|
+
const onSort = (dataSorting: WFODataSorting<TestColumn>) => {
|
|
102
102
|
sortBy.field = dataSorting.field;
|
|
103
103
|
sortBy.sortOrder = dataSorting.sortOrder;
|
|
104
104
|
};
|
|
@@ -5,17 +5,17 @@ import {
|
|
|
5
5
|
EuiDataGridSorting,
|
|
6
6
|
} from '@elastic/eui/src/components/datagrid/data_grid_types';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { WFODataSorting, TableColumnKeys } from '../utils/columns';
|
|
9
9
|
import { SortOrder } from '../../../types';
|
|
10
10
|
|
|
11
|
-
export type
|
|
11
|
+
export type WFODataGridTableColumns<T> = {
|
|
12
12
|
[Property in keyof T]: Omit<EuiDataGridColumn, 'id'> & {
|
|
13
13
|
renderCell?: (cellValue: T[Property], row: T) => ReactNode;
|
|
14
14
|
isHiddenByDefault?: boolean;
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
export type
|
|
18
|
+
export type WFOControlColumn<T> = Omit<
|
|
19
19
|
EuiDataGridControlColumn,
|
|
20
20
|
| 'rowCellRender'
|
|
21
21
|
| 'headerCellRender'
|
|
@@ -27,7 +27,7 @@ export type ControlColumn<T> = Omit<
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
export const getInitialColumnOrder = <T>(
|
|
30
|
-
columns:
|
|
30
|
+
columns: WFODataGridTableColumns<T>,
|
|
31
31
|
initialColumnOrder: TableColumnKeys<T>,
|
|
32
32
|
) => {
|
|
33
33
|
const euiDataGridColumns: EuiDataGridColumn[] = Object.keys(columns).map(
|
|
@@ -53,8 +53,8 @@ export const getInitialColumnOrder = <T>(
|
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
export const mapColumnSortToEuiDataGridSorting = <T>(
|
|
56
|
-
columnSort?:
|
|
57
|
-
updateColumnSort?: (columnSort:
|
|
56
|
+
columnSort?: WFODataSorting<T>,
|
|
57
|
+
updateColumnSort?: (columnSort: WFODataSorting<T>) => void,
|
|
58
58
|
): EuiDataGridSorting => ({
|
|
59
59
|
columns: columnSort
|
|
60
60
|
? [
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
2
|
import { useOrchestratorTheme } from '../../hooks/useOrchestratorTheme';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { WFOArrowNarrowDown } from '../../icons/WFOArrowNarrowDown';
|
|
4
|
+
import { WFOArrowNarrowUp } from '../../icons/WFOArrowNarrowUp';
|
|
5
5
|
import { SortOrder } from '../../types';
|
|
6
6
|
|
|
7
|
-
export type
|
|
7
|
+
export type WFOSortDirectionIconProps = {
|
|
8
8
|
sortDirection: SortOrder;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
export const
|
|
11
|
+
export const WFOSortDirectionIcon: FC<WFOSortDirectionIconProps> = ({
|
|
12
12
|
sortDirection,
|
|
13
13
|
}) => {
|
|
14
14
|
const { theme } = useOrchestratorTheme();
|
|
15
15
|
|
|
16
16
|
return sortDirection === SortOrder.ASC ? (
|
|
17
|
-
<
|
|
17
|
+
<WFOArrowNarrowUp
|
|
18
18
|
color={theme.colors.subduedText}
|
|
19
19
|
height={24}
|
|
20
20
|
width={24}
|
|
21
21
|
/>
|
|
22
22
|
) : (
|
|
23
|
-
<
|
|
23
|
+
<WFOArrowNarrowDown
|
|
24
24
|
color={theme.colors.subduedText}
|
|
25
25
|
height={24}
|
|
26
26
|
width={24}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EuiBasicTable, EuiBasicTableColumn, Pagination } from '@elastic/eui';
|
|
3
3
|
import { Criteria } from '@elastic/eui/src/components/basic_table/basic_table';
|
|
4
|
-
import {
|
|
4
|
+
import { WFOTableHeaderCell } from './WFOTableHeaderCell';
|
|
5
5
|
|
|
6
6
|
import type {
|
|
7
|
-
|
|
7
|
+
WFODataSorting,
|
|
8
8
|
TableColumnKeys,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
WFOTableColumns,
|
|
10
|
+
WFOTableColumnsWithControlColumns,
|
|
11
11
|
} from './utils/columns';
|
|
12
12
|
|
|
13
|
-
export type
|
|
13
|
+
export type WFOTableProps<T> = {
|
|
14
14
|
data: T[];
|
|
15
|
-
columns:
|
|
15
|
+
columns: WFOTableColumnsWithControlColumns<T> | WFOTableColumns<T>;
|
|
16
16
|
hiddenColumns?: TableColumnKeys<T>;
|
|
17
|
-
dataSorting?:
|
|
17
|
+
dataSorting?: WFODataSorting<T>;
|
|
18
18
|
pagination: Pagination;
|
|
19
19
|
isLoading?: boolean;
|
|
20
20
|
onCriteriaChange: (criteria: Criteria<T>) => void;
|
|
21
21
|
onDataSort?: (columnId: keyof T) => void;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
export const
|
|
24
|
+
export const WFOTable = <T,>({
|
|
25
25
|
data,
|
|
26
26
|
columns,
|
|
27
27
|
hiddenColumns,
|
|
@@ -30,7 +30,7 @@ export const Table = <T,>({
|
|
|
30
30
|
isLoading,
|
|
31
31
|
onCriteriaChange,
|
|
32
32
|
onDataSort,
|
|
33
|
-
}:
|
|
33
|
+
}: WFOTableProps<T>) => (
|
|
34
34
|
<EuiBasicTable
|
|
35
35
|
items={data}
|
|
36
36
|
columns={mapTableColumnsToEuiColumns(
|
|
@@ -46,9 +46,9 @@ export const Table = <T,>({
|
|
|
46
46
|
);
|
|
47
47
|
|
|
48
48
|
function mapTableColumnsToEuiColumns<T>(
|
|
49
|
-
columns:
|
|
49
|
+
columns: WFOTableColumns<T>,
|
|
50
50
|
hiddenColumns?: TableColumnKeys<T>,
|
|
51
|
-
dataSorting?:
|
|
51
|
+
dataSorting?: WFODataSorting<T>,
|
|
52
52
|
onDataSort?: (columnId: keyof T) => void,
|
|
53
53
|
): EuiBasicTableColumn<T>[] {
|
|
54
54
|
function isVisibleColumn(columnKey: string) {
|
|
@@ -69,12 +69,12 @@ function mapTableColumnsToEuiColumns<T>(
|
|
|
69
69
|
...column,
|
|
70
70
|
field: typedColumnKey,
|
|
71
71
|
name: name && (
|
|
72
|
-
<
|
|
72
|
+
<WFOTableHeaderCell
|
|
73
73
|
sortDirection={sortDirection}
|
|
74
74
|
onClick={handleClick}
|
|
75
75
|
>
|
|
76
76
|
{name}
|
|
77
|
-
</
|
|
77
|
+
</WFOTableHeaderCell>
|
|
78
78
|
),
|
|
79
79
|
truncateText: true,
|
|
80
80
|
textOnly: true,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React, { FC, ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
import { SortOrder } from '../../types';
|
|
4
|
-
import {
|
|
4
|
+
import { WFOSortDirectionIcon } from './WFOSortDirectionIcon';
|
|
5
5
|
|
|
6
|
-
export type
|
|
6
|
+
export type WFOTableHeaderCellProps = {
|
|
7
7
|
sortDirection?: SortOrder;
|
|
8
8
|
onClick?: () => void;
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
export const
|
|
12
|
+
export const WFOTableHeaderCell: FC<WFOTableHeaderCellProps> = ({
|
|
13
13
|
sortDirection,
|
|
14
14
|
children,
|
|
15
15
|
onClick,
|
|
@@ -24,7 +24,7 @@ export const TableHeaderCell: FC<TableHeaderCellProps> = ({
|
|
|
24
24
|
>
|
|
25
25
|
<div>{children}</div>
|
|
26
26
|
{sortDirection ? (
|
|
27
|
-
<
|
|
27
|
+
<WFOSortDirectionIcon sortDirection={sortDirection} />
|
|
28
28
|
) : null}
|
|
29
29
|
</div>
|
|
30
30
|
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WFOTableSettingsModal';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Criteria,
|
|
4
4
|
EuiButton,
|
|
@@ -8,20 +8,20 @@ import {
|
|
|
8
8
|
Pagination,
|
|
9
9
|
} from '@elastic/eui';
|
|
10
10
|
import {
|
|
11
|
-
|
|
11
|
+
WFODataSorting,
|
|
12
12
|
TableColumnKeys,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
WFOTableColumns,
|
|
14
|
+
WFOTableColumnsWithControlColumns,
|
|
15
|
+
WFOTableControlColumnConfig,
|
|
16
|
+
WFOTableDataColumnConfig,
|
|
17
17
|
} from '../utils/columns';
|
|
18
18
|
import {
|
|
19
19
|
ColumnConfig,
|
|
20
20
|
TableConfig,
|
|
21
21
|
TableSettingsModal,
|
|
22
|
-
} from '../
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
22
|
+
} from '../WFOTableSettingsModal';
|
|
23
|
+
import { WFOSearchField } from '../../WFOSearchBar';
|
|
24
|
+
import { WFOTable } from '../WFOTable';
|
|
25
25
|
import { DEFAULT_PAGE_SIZES } from '../utils/constants';
|
|
26
26
|
import {
|
|
27
27
|
clearTableConfigFromLocalStorage,
|
|
@@ -29,13 +29,13 @@ import {
|
|
|
29
29
|
setTableConfigToLocalStorage,
|
|
30
30
|
} from '../utils/tableConfigPersistence';
|
|
31
31
|
|
|
32
|
-
export type
|
|
32
|
+
export type WFOTableWithFilterProps<T> = {
|
|
33
33
|
data: T[];
|
|
34
|
-
tableColumns:
|
|
35
|
-
leadingControlColumns?:
|
|
36
|
-
trailingControlColumns?:
|
|
34
|
+
tableColumns: WFOTableColumns<T>;
|
|
35
|
+
leadingControlColumns?: WFOTableControlColumnConfig<T>;
|
|
36
|
+
trailingControlColumns?: WFOTableControlColumnConfig<T>;
|
|
37
37
|
defaultHiddenColumns?: TableColumnKeys<T>;
|
|
38
|
-
dataSorting:
|
|
38
|
+
dataSorting: WFODataSorting<T>;
|
|
39
39
|
pagination: Pagination;
|
|
40
40
|
esQueryString?: string;
|
|
41
41
|
isLoading: boolean;
|
|
@@ -45,7 +45,7 @@ export type TableWithFilterProps<T> = {
|
|
|
45
45
|
onUpdateDataSort: (newSortColumnId: keyof T) => void;
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
export const
|
|
48
|
+
export const WFOTableWithFilter = <T,>({
|
|
49
49
|
data,
|
|
50
50
|
tableColumns,
|
|
51
51
|
leadingControlColumns,
|
|
@@ -59,7 +59,7 @@ export const TableWithFilter = <T,>({
|
|
|
59
59
|
onUpdateEsQueryString,
|
|
60
60
|
onUpdatePage,
|
|
61
61
|
onUpdateDataSort,
|
|
62
|
-
}:
|
|
62
|
+
}: WFOTableWithFilterProps<T>) => {
|
|
63
63
|
const defaultPageSize = pagination.pageSize;
|
|
64
64
|
const tableConfigFromLocalStorage =
|
|
65
65
|
getTableConfigFromLocalStorage<T>(localStorageKey);
|
|
@@ -72,14 +72,21 @@ export const TableWithFilter = <T,>({
|
|
|
72
72
|
|
|
73
73
|
const [showSettingsModal, setShowSettingsModal] = useState(false);
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
};
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
setHiddenColumns(
|
|
77
|
+
tableConfigFromLocalStorage?.hiddenColumns ?? defaultHiddenColumns,
|
|
78
|
+
);
|
|
79
|
+
}, [localStorageKey]);
|
|
80
|
+
|
|
81
|
+
const tableColumnsWithControlColumns: WFOTableColumnsWithControlColumns<T> =
|
|
82
|
+
{
|
|
83
|
+
...leadingControlColumns,
|
|
84
|
+
...tableColumns,
|
|
85
|
+
...trailingControlColumns,
|
|
86
|
+
};
|
|
80
87
|
|
|
81
88
|
const tableSettingsColumns: ColumnConfig<T>[] = Object.entries<
|
|
82
|
-
|
|
89
|
+
WFOTableDataColumnConfig<T, keyof T>
|
|
83
90
|
>(tableColumns).map((keyValuePair) => {
|
|
84
91
|
const { field, name } = keyValuePair[1];
|
|
85
92
|
return {
|
|
@@ -125,7 +132,7 @@ export const TableWithFilter = <T,>({
|
|
|
125
132
|
<>
|
|
126
133
|
<EuiFlexGroup>
|
|
127
134
|
<EuiFlexItem>
|
|
128
|
-
<
|
|
135
|
+
<WFOSearchField
|
|
129
136
|
esQueryString={esQueryString}
|
|
130
137
|
onUpdateEsQueryString={onUpdateEsQueryString}
|
|
131
138
|
/>
|
|
@@ -135,7 +142,7 @@ export const TableWithFilter = <T,>({
|
|
|
135
142
|
</EuiButton>
|
|
136
143
|
</EuiFlexGroup>
|
|
137
144
|
<EuiSpacer size="m" />
|
|
138
|
-
<
|
|
145
|
+
<WFOTable
|
|
139
146
|
data={data}
|
|
140
147
|
columns={tableColumnsWithControlColumns}
|
|
141
148
|
hiddenColumns={hiddenColumns}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WFOTableWithFilter';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './WFODataGridTable/WFODataGridTable';
|
|
2
|
+
export * from './WFODataGridTable/WFOdataGridColumns';
|
|
3
|
+
|
|
4
|
+
export * from './WFOTableSettingsModal';
|
|
5
|
+
|
|
6
|
+
export * from './utils/columns';
|
|
7
|
+
export * from './utils/constants';
|
|
8
|
+
|
|
9
|
+
export * from './utils/tableConfigPersistence';
|
|
10
|
+
export * from './utils/tableUtils';
|
|
11
|
+
|
|
12
|
+
export * from './WFOTable';
|
|
13
|
+
export * from './WFOTableWithFilter';
|
|
14
|
+
export * from './WFOTableHeaderCell';
|
|
@@ -4,41 +4,41 @@ import { SortOrder } from '../../../types';
|
|
|
4
4
|
|
|
5
5
|
// Todo need to Pick a few more props from EuiBasicTableColumn to prevent none-functioning props (truncateText)
|
|
6
6
|
// https://github.com/workfloworchestrator/orchestrator-ui/issues/130
|
|
7
|
-
export type
|
|
7
|
+
export type WFOBasicTableColumn<T> = Omit<EuiBasicTableColumn<T>, 'render'>;
|
|
8
8
|
|
|
9
|
-
export type
|
|
9
|
+
export type WFOTableDataColumnConfig<T, Property> = WFOBasicTableColumn<T> & {
|
|
10
10
|
field: Property;
|
|
11
11
|
name: string;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
// Todo need to Pick a few props from EuiBasicTableColumn to prevent none-functioning props (truncateText)
|
|
15
|
-
export type
|
|
15
|
+
export type WFOTableColumnsWithExtraNonDataFields<T> = WFOTableColumns<T> & {
|
|
16
16
|
[key: string]: EuiBasicTableColumn<T> & {
|
|
17
17
|
field: string;
|
|
18
18
|
name?: string;
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
export type
|
|
23
|
-
[Property in keyof T]:
|
|
22
|
+
export type WFOTableColumns<T> = {
|
|
23
|
+
[Property in keyof T]: WFOTableDataColumnConfig<T, Property> & {
|
|
24
24
|
render?: (cellValue: T[Property], row: T) => ReactNode;
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
export type
|
|
29
|
-
[key: string]:
|
|
28
|
+
export type WFOTableControlColumnConfig<T> = {
|
|
29
|
+
[key: string]: WFOBasicTableColumn<T> & {
|
|
30
30
|
field: string;
|
|
31
31
|
name?: string;
|
|
32
32
|
render: (row: T) => ReactNode;
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
export type
|
|
37
|
-
|
|
36
|
+
export type WFOTableColumnsWithControlColumns<T> = WFOTableColumns<T> &
|
|
37
|
+
WFOTableControlColumnConfig<T>;
|
|
38
38
|
|
|
39
39
|
export type TableColumnKeys<T> = Array<keyof T>;
|
|
40
40
|
|
|
41
|
-
export type
|
|
41
|
+
export type WFODataSorting<T> = {
|
|
42
42
|
field: keyof T;
|
|
43
43
|
sortOrder: SortOrder;
|
|
44
44
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const DEFAULT_PAGE_SIZES = [5, 10, 15, 20, 25, 100];
|
|
2
|
+
export const DEFAULT_PAGE_SIZE = 10;
|
|
3
|
+
|
|
4
|
+
export const ACTIVE_PROCESSES_LIST_TABLE_LOCAL_STORAGE_KEY =
|
|
5
|
+
'activeProcessesListTable';
|
|
6
|
+
export const COMPLETED_PROCESSES_LIST_TABLE_LOCAL_STORAGE_KEY =
|
|
7
|
+
'completedProcessesListTable';
|
|
8
|
+
|
|
9
|
+
export const METADATA_RESOURCE_TYPES_TABLE_LOCAL_STORAGE_KEY =
|
|
10
|
+
'metadataResourceTypesTable';
|
|
11
|
+
export const METADATA_PRODUCTBLOCKS_TABLE_LOCAL_STORAGE_KEY =
|
|
12
|
+
'metadataProductBlocksTable';
|
|
13
|
+
export const METADATA_PRODUCT_TABLE_LOCAL_STORAGE_KEY = 'metadataProductTable';
|
|
14
|
+
export const METADATA_WORKFLOWS_TABLE_LOCAL_STORAGE_KEY =
|
|
15
|
+
'metadataWorkflowsTable';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { WFOTreeBranch } from './WFOTreeBranch';
|
|
4
4
|
import { TreeBlock } from '../../types';
|
|
5
5
|
|
|
6
|
-
type
|
|
6
|
+
type WFOTreeProps = {
|
|
7
7
|
data: TreeBlock[];
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
-
export const
|
|
10
|
+
export const WFOTree: FC<WFOTreeProps> = ({ data }) => (
|
|
11
11
|
<div style={{ width: '500px' }}>
|
|
12
12
|
{data.map((item) => (
|
|
13
|
-
<
|
|
13
|
+
<WFOTreeBranch key={item.id} item={item} level={0} />
|
|
14
14
|
))}
|
|
15
15
|
</div>
|
|
16
16
|
);
|