@orchestrator-ui/orchestrator-ui-components 7.1.1 → 7.2.1
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/.turbo/turbo-build.log +8 -8
- package/.turbo/turbo-lint.log +5 -2
- package/.turbo/turbo-test.log +6 -6
- package/CHANGELOG.md +13 -0
- package/dist/index.d.ts +2892 -24
- package/dist/index.js +2929 -2478
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
- package/src/components/WfoAgent/ExportButton/styles.ts +9 -9
- package/src/components/WfoAgent/ToolProgress/SetFilterTreeDisplay.styles.ts +5 -5
- package/src/components/WfoAgent/ToolProgress/styles.ts +7 -7
- package/src/components/WfoAgent/WfoAgentChart/WfoAgentLineChart.tsx +2 -2
- package/src/components/WfoAgent/WfoAgentChart/WfoAgentPieChart.tsx +2 -2
- package/src/components/WfoBadges/WfoEngineStatusBadge/WfoEngineStatusBadge.tsx +2 -2
- package/src/components/WfoBadges/WfoFailedTasksBadge/WfoFailedTasksBadge.tsx +21 -29
- package/src/components/WfoBadges/WfoProcessStatusBadge/WfoProcessStatusBadge.tsx +12 -12
- package/src/components/WfoBadges/WfoProductBlockBadge/WfoProductBlockBadge.tsx +12 -12
- package/src/components/WfoBadges/WfoProductStatusBadge/WfoProductStatusBadge.tsx +8 -8
- package/src/components/WfoBadges/WfoScheduledTasksBadges/WfoScheduledTasksBadges.tsx +38 -0
- package/src/components/WfoBadges/WfoScheduledTasksBadges/WfoScheduledTasksBadgesContainer.tsx +27 -0
- package/src/components/WfoBadges/WfoScheduledTasksBadges/index.ts +2 -0
- package/src/components/WfoBadges/WfoSubscriptionStatusBadge/WfoSubscriptionStatusBadge.tsx +8 -8
- package/src/components/WfoBadges/WfoSubscriptionSyncStatusBadge/WfoSubscriptionSyncStatusBadge.tsx +5 -4
- package/src/components/WfoBadges/WfoWebsocketStatusBadge/styles.ts +5 -3
- package/src/components/WfoBadges/WfoWorkflowTargetBadge/WfoWorkflowTargetBadge.tsx +14 -13
- package/src/components/WfoBadges/index.ts +1 -0
- package/src/components/WfoButtonComboBox/styles.ts +6 -6
- package/src/components/WfoDiff/styles.ts +6 -6
- package/src/components/WfoError/WfoError.tsx +1 -1
- package/src/components/WfoExpandableField/styles.ts +2 -2
- package/src/components/WfoFilterTabs/styles.ts +2 -2
- package/src/components/WfoJsonCodeBlock/styles.ts +2 -2
- package/src/components/WfoKeyValueTable/WfoValueCell.tsx +1 -1
- package/src/components/WfoKeyValueTable/styles.ts +6 -6
- package/src/components/WfoLogoSpinner/styles.ts +6 -0
- package/src/components/WfoMonacoCodeBlock/WfoMonacoCodeBlock.tsx +7 -7
- package/src/components/WfoMonacoCodeBlock/styles.ts +5 -3
- package/src/components/WfoNoResults/styles.ts +3 -3
- package/src/components/WfoPageTemplate/WfoBreadcrumbs/WfoBreadcrumbs.tsx +1 -1
- package/src/components/WfoPageTemplate/WfoPageHeader/WfoHamburgerMenu.tsx +3 -7
- package/src/components/WfoPageTemplate/WfoPageHeader/WfoPageHeader.tsx +6 -6
- package/src/components/WfoPageTemplate/WfoPageHeader/styles.ts +3 -3
- package/src/components/WfoPageTemplate/WfoPageTemplate/WfoPageTemplate.tsx +56 -8
- package/src/components/WfoPageTemplate/WfoPageTemplate/styles.ts +4 -4
- package/src/components/WfoPageTemplate/WfoSidebar/WfoSidebar.tsx +19 -0
- package/src/components/WfoPageTemplate/WfoSidebar/styles.ts +26 -24
- package/src/components/WfoPageTemplate/paths.ts +1 -0
- package/src/components/WfoPydanticForm/Footer.tsx +5 -5
- package/src/components/WfoPydanticForm/fields/WfoArrayField/WfoArrayField.tsx +4 -3
- package/src/components/WfoPydanticForm/fields/WfoArrayField/styles.ts +4 -2
- package/src/components/WfoPydanticForm/fields/WfoInteger.tsx +5 -5
- package/src/components/WfoPydanticForm/fields/WfoLabel.tsx +1 -1
- package/src/components/WfoPydanticForm/fields/WfoReactSelect/styles.ts +36 -13
- package/src/components/WfoPydanticForm/fields/styles.ts +8 -8
- package/src/components/WfoSearchPage/WfoConditionRow/WfoPathChips.tsx +1 -1
- package/src/components/WfoSearchPage/WfoConditionRow/WfoSelectedPathDisplay.tsx +8 -5
- package/src/components/WfoSearchPage/WfoFilterGroup/WfoFilterGroup.tsx +1 -1
- package/src/components/WfoSettings/styles.ts +5 -6
- package/src/components/WfoStartButton/WfoStartButtonComboBox.tsx +4 -7
- package/src/components/WfoStartButton/styles.ts +6 -6
- package/src/components/WfoSubscription/WfoSubscriptionActions/styles.ts +3 -3
- package/src/components/WfoSubscription/WfoSubscriptionProductBlock/styles.ts +8 -9
- package/src/components/WfoSubscription/WfoTargetTypeIcon.tsx +4 -2
- package/src/components/WfoSubscription/styles.ts +9 -4
- package/src/components/WfoSubscription/utils/utils.spec.ts +8 -8
- package/src/components/WfoSubscription/utils/utils.ts +4 -4
- package/src/components/WfoSummary/WfoSummaryCardHeader/WfoSummaryCardHeader.tsx +5 -1
- package/src/components/WfoSummary/WfoSummaryCardHeader/styles.ts +2 -2
- package/src/components/WfoSummary/WfoSummaryCardList/WfoSummaryCardListItem.tsx +3 -1
- package/src/components/WfoSummary/WfoSummaryCardList/styles.ts +4 -3
- package/src/components/WfoSummary/styles.ts +2 -2
- package/src/components/WfoTable/WfoAdvancedTable/WfoAdvancedTable.tsx +17 -11
- package/src/components/WfoTable/WfoFirstPartUUID/WfoFirstPartUUID.tsx +1 -1
- package/src/components/WfoTable/WfoFirstPartUUID/styles.ts +2 -2
- package/src/components/WfoTable/WfoSortButtons/WfoSortButton.tsx +5 -1
- package/src/components/WfoTable/WfoStatusColorField/styles.ts +2 -2
- package/src/components/WfoTable/WfoTable/WfoGroupedTable/styles.ts +3 -3
- package/src/components/WfoTable/WfoTable/WfoTable.tsx +9 -3
- package/src/components/WfoTable/WfoTable/WfoTableHeaderCell/WfoSortDirectionIcon.tsx +3 -3
- package/src/components/WfoTable/WfoTable/WfoTableHeaderCell/styles.ts +10 -10
- package/src/components/WfoTable/WfoTable/styles.ts +13 -14
- package/src/components/WfoTable/WfoTable/utils.ts +29 -1
- package/src/components/WfoTable/WfoTableSettingsModal/styles.ts +6 -6
- package/src/components/WfoTable/utils/constants.ts +1 -0
- package/src/components/WfoTable/utils/tableUtils.ts +0 -1
- package/src/components/WfoTableCodeBlock/styles.ts +2 -2
- package/src/components/WfoTextAnchor/styles.ts +2 -2
- package/src/components/WfoTimeline/styles.ts +8 -8
- package/src/components/WfoTree/styles.ts +5 -6
- package/src/components/WfoWorkflowSteps/WfoStep/WfoStep.tsx +6 -2
- package/src/components/WfoWorkflowSteps/WfoStepStatusIcon/WfoStepStatusIcon.tsx +12 -9
- package/src/components/WfoWorkflowSteps/WfoTraceback/styles.ts +2 -2
- package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoStepListHeader.tsx +1 -1
- package/src/components/WfoWorkflowSteps/styles.ts +9 -6
- package/src/components/confirmationDialog/WfoConfirmationDialog.tsx +1 -1
- package/src/configuration/constants.ts +1 -0
- package/src/configuration/version.ts +1 -1
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useGetSchedulesForWorkflow.tsx +30 -0
- package/src/hooks/useGetWorkflowNameById.tsx +23 -0
- package/src/hooks/useOrchestratorTheme.ts +20 -18
- package/src/hooks/useWithOrchestratorTheme.ts +4 -4
- package/src/icons/heroicons/WfoScheduledTaskOnce.tsx +32 -0
- package/src/icons/heroicons/WfoScheduledTaskRecurring.tsx +32 -0
- package/src/icons/heroicons/index.ts +2 -0
- package/src/messages/en-GB.json +11 -1
- package/src/messages/nl-NL.json +10 -1
- package/src/pages/metadata/WfoMetadataPageLayout.tsx +6 -1
- package/src/pages/metadata/WfoScheduledTasksPage.tsx +223 -0
- package/src/pages/metadata/WfoTasksPage.tsx +20 -3
- package/src/pages/metadata/index.ts +1 -0
- package/src/pages/metadata/taskListObjectMapper.ts +3 -0
- package/src/pages/processes/WfoProcessDetail.tsx +3 -3
- package/src/pages/processes/WfoProcessListSubscriptionsCell.tsx +1 -1
- package/src/pages/processes/WfoProductInformationWithLink.tsx +1 -1
- package/src/pages/processes/WfoStartProcessPage.tsx +6 -1
- package/src/pages/settings/WfoSettingsPage.tsx +2 -1
- package/src/pages/tasks/WfoTasksListPage.tsx +1 -1
- package/src/rtk/endpoints/metadata/index.ts +1 -0
- package/src/rtk/endpoints/metadata/scheduledTasks.ts +66 -0
- package/src/rtk/endpoints/metadata/tasks.ts +1 -1
- package/src/theme/baseStyles/formFieldsBaseStyle.ts +8 -6
- package/src/theme/index.ts +1 -1
- package/src/theme/wfoThemeModifications.ts +117 -0
- package/src/types/types.ts +18 -3
- package/src/theme/defaultOrchestratorTheme.ts +0 -129
|
@@ -103,27 +103,27 @@ describe('flattenArrayProps', () => {
|
|
|
103
103
|
});
|
|
104
104
|
|
|
105
105
|
describe('getWorkflowTargetColor', () => {
|
|
106
|
-
it('should return
|
|
106
|
+
it('should return textSuccess color for CREATE', () => {
|
|
107
107
|
const theme = {
|
|
108
108
|
colors: {
|
|
109
|
-
|
|
109
|
+
textSuccess: 'textSuccessColor',
|
|
110
110
|
},
|
|
111
111
|
} as EuiThemeComputed;
|
|
112
112
|
|
|
113
113
|
expect(getWorkflowTargetColor(WorkflowTarget.CREATE, theme)).toBe(
|
|
114
|
-
'
|
|
114
|
+
'textSuccessColor',
|
|
115
115
|
);
|
|
116
116
|
});
|
|
117
117
|
|
|
118
|
-
it('should return
|
|
118
|
+
it('should return textPrimary color for MODIFY', () => {
|
|
119
119
|
const theme = {
|
|
120
120
|
colors: {
|
|
121
|
-
|
|
121
|
+
textPrimary: 'textPrimaryColor',
|
|
122
122
|
},
|
|
123
123
|
} as EuiThemeComputed;
|
|
124
124
|
|
|
125
125
|
expect(getWorkflowTargetColor(WorkflowTarget.MODIFY, theme)).toBe(
|
|
126
|
-
'
|
|
126
|
+
'textPrimaryColor',
|
|
127
127
|
);
|
|
128
128
|
});
|
|
129
129
|
|
|
@@ -154,14 +154,14 @@ describe('getWorkflowTargetColor', () => {
|
|
|
154
154
|
it('should return body color for unknown targets', () => {
|
|
155
155
|
const theme = {
|
|
156
156
|
colors: {
|
|
157
|
-
|
|
157
|
+
backgroundBaseDisabled: 'gray',
|
|
158
158
|
},
|
|
159
159
|
} as EuiThemeComputed;
|
|
160
160
|
|
|
161
161
|
// Test with an unknown target
|
|
162
162
|
expect(
|
|
163
163
|
getWorkflowTargetColor('UNKNOWN_TARGET' as WorkflowTarget, theme),
|
|
164
|
-
).toBe('
|
|
164
|
+
).toBe('gray');
|
|
165
165
|
});
|
|
166
166
|
});
|
|
167
167
|
|
|
@@ -68,9 +68,9 @@ export const getWorkflowTargetColor = (
|
|
|
68
68
|
// Data returned from graphql can't always be depended on to be lowercase
|
|
69
69
|
switch (workflowTarget.toLocaleLowerCase()) {
|
|
70
70
|
case WorkflowTarget.CREATE:
|
|
71
|
-
return theme.colors.
|
|
71
|
+
return theme.colors.textSuccess;
|
|
72
72
|
case WorkflowTarget.MODIFY:
|
|
73
|
-
return theme.colors.
|
|
73
|
+
return theme.colors.textPrimary;
|
|
74
74
|
case WorkflowTarget.SYSTEM:
|
|
75
75
|
case WorkflowTarget.VALIDATE:
|
|
76
76
|
return theme.colors.warning;
|
|
@@ -78,9 +78,9 @@ export const getWorkflowTargetColor = (
|
|
|
78
78
|
return theme.colors.accent;
|
|
79
79
|
case WorkflowTarget.TERMINATE:
|
|
80
80
|
return theme.colors.danger;
|
|
81
|
+
default:
|
|
82
|
+
return theme.colors.backgroundBaseDisabled;
|
|
81
83
|
}
|
|
82
|
-
|
|
83
|
-
return theme.colors.body;
|
|
84
84
|
};
|
|
85
85
|
|
|
86
86
|
export const getWorkflowTargetIconContent = (
|
|
@@ -35,7 +35,11 @@ export const WfoSummaryCardHeader: FC<WfoSummaryCardHeaderProps> = ({
|
|
|
35
35
|
|
|
36
36
|
return (
|
|
37
37
|
<EuiFlexItem grow={0}>
|
|
38
|
-
<EuiPanel
|
|
38
|
+
<EuiPanel
|
|
39
|
+
hasShadow={false}
|
|
40
|
+
css={{ backgroundColor: theme.colors.backgroundBaseSubdued }}
|
|
41
|
+
paddingSize="l"
|
|
42
|
+
>
|
|
39
43
|
<EuiFlexGroup alignItems="center">
|
|
40
44
|
<EuiAvatar
|
|
41
45
|
iconSize="l"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { WfoThemeHelpers } from '@/hooks';
|
|
4
4
|
|
|
5
|
-
export const getWfoSummaryCardHeaderStyles = ({ theme }:
|
|
5
|
+
export const getWfoSummaryCardHeaderStyles = ({ theme }: WfoThemeHelpers) => {
|
|
6
6
|
const avatarStyle = css({
|
|
7
7
|
maxHeight: theme.base * 3,
|
|
8
8
|
maxWidth: theme.base * 3,
|
|
@@ -37,7 +37,9 @@ export const WfoSummaryCardListItem: FC<WfoSummaryCardListItemProps> = ({
|
|
|
37
37
|
<EuiFlexGroup css={listItemContainerStyle} gutterSize="none">
|
|
38
38
|
<EuiFlexItem>
|
|
39
39
|
<EuiTextColor
|
|
40
|
-
color={
|
|
40
|
+
color={
|
|
41
|
+
url ? theme.colors.link : theme.colors.textHeading
|
|
42
|
+
}
|
|
41
43
|
css={listItemTitleStyle}
|
|
42
44
|
>
|
|
43
45
|
{title}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { WfoThemeHelpers } from '@/hooks';
|
|
4
4
|
|
|
5
|
-
export const getWfoSummaryCardListStyles = ({ theme }:
|
|
5
|
+
export const getWfoSummaryCardListStyles = ({ theme }: WfoThemeHelpers) => {
|
|
6
6
|
const listContainerStyle = css({
|
|
7
7
|
display: 'flex',
|
|
8
8
|
flexDirection: 'column',
|
|
9
9
|
justifyContent: 'space-between',
|
|
10
10
|
flexGrow: 1,
|
|
11
|
-
borderColor: theme.colors.
|
|
11
|
+
borderColor: theme.colors.borderBaseSubdued,
|
|
12
|
+
backgroundColor: theme.colors.backgroundBaseNeutral,
|
|
12
13
|
});
|
|
13
14
|
|
|
14
15
|
const listHeaderStyle = css({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { WfoThemeHelpers } from '@/hooks';
|
|
4
4
|
|
|
5
|
-
export const getWfoSummaryCardsStyles = ({ theme }:
|
|
5
|
+
export const getWfoSummaryCardsStyles = ({ theme }: WfoThemeHelpers) => {
|
|
6
6
|
const cardContainerStyle = css({
|
|
7
7
|
height: theme.base * 36,
|
|
8
8
|
minWidth: theme.base * 25,
|
|
@@ -50,6 +50,7 @@ export type WfoAdvancedTableProps<T extends object> = Omit<
|
|
|
50
50
|
error?: WfoGraphqlError[];
|
|
51
51
|
onUpdateQueryString: (queryString: string) => void;
|
|
52
52
|
onExportData?: () => void;
|
|
53
|
+
disableSearch?: boolean;
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
export const WfoAdvancedTable = <T extends object>({
|
|
@@ -63,6 +64,7 @@ export const WfoAdvancedTable = <T extends object>({
|
|
|
63
64
|
error,
|
|
64
65
|
onUpdateQueryString,
|
|
65
66
|
onExportData,
|
|
67
|
+
disableSearch = false,
|
|
66
68
|
...tableProps
|
|
67
69
|
}: WfoAdvancedTableProps<T>) => {
|
|
68
70
|
const { theme } = useOrchestratorTheme();
|
|
@@ -92,7 +94,7 @@ export const WfoAdvancedTable = <T extends object>({
|
|
|
92
94
|
css={{ cursor: 'pointer' }}
|
|
93
95
|
onClick={() => setSelectedDataForDetailModal(row)}
|
|
94
96
|
>
|
|
95
|
-
<WfoArrowsExpand color={theme.colors.
|
|
97
|
+
<WfoArrowsExpand color={theme.colors.borderBasePlain} />
|
|
96
98
|
</EuiFlexItem>
|
|
97
99
|
),
|
|
98
100
|
},
|
|
@@ -159,18 +161,22 @@ export const WfoAdvancedTable = <T extends object>({
|
|
|
159
161
|
<>
|
|
160
162
|
<EuiFlexGroup alignItems="center">
|
|
161
163
|
<EuiFlexItem>
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
{!disableSearch && (
|
|
165
|
+
<WfoSearchField
|
|
166
|
+
queryString={queryString}
|
|
167
|
+
onUpdateQueryString={onUpdateQueryString}
|
|
168
|
+
/>
|
|
169
|
+
)}
|
|
166
170
|
</EuiFlexItem>
|
|
167
171
|
<EuiFlexItem grow={false}>
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
{!disableSearch && (
|
|
173
|
+
<EuiButtonIcon
|
|
174
|
+
onClick={() => setShowSearchModal(true)}
|
|
175
|
+
iconSize={'xl'}
|
|
176
|
+
iconType={'info'}
|
|
177
|
+
aria-label={t('searchModalTitle')}
|
|
178
|
+
/>
|
|
179
|
+
)}
|
|
174
180
|
</EuiFlexItem>
|
|
175
181
|
<EuiButton onClick={() => setShowSettingsModal(true)}>
|
|
176
182
|
{t('editColumns')}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { WfoThemeHelpers } from '@/hooks';
|
|
4
4
|
|
|
5
5
|
export const COPY_ICON_CLASS = 'copyIcon';
|
|
6
6
|
|
|
7
|
-
export const getStyles = ({ theme }:
|
|
7
|
+
export const getStyles = ({ theme }: WfoThemeHelpers) => {
|
|
8
8
|
const uuidFieldStyle = css({
|
|
9
9
|
fontWeight: theme.font.weight.medium,
|
|
10
10
|
display: 'flex',
|
|
@@ -24,7 +24,11 @@ export const WfoSortButton: FC<WfoSortButtonProps> = ({
|
|
|
24
24
|
onClick={() => isActive && onClick?.()}
|
|
25
25
|
>
|
|
26
26
|
<WfoIconComponent
|
|
27
|
-
color={
|
|
27
|
+
color={
|
|
28
|
+
isActive
|
|
29
|
+
? theme.colors.textHeading
|
|
30
|
+
: theme.colors.borderBaseSubdued
|
|
31
|
+
}
|
|
28
32
|
/>
|
|
29
33
|
</button>
|
|
30
34
|
);
|
|
@@ -2,9 +2,9 @@ import { tint } from '@elastic/eui';
|
|
|
2
2
|
import { css } from '@emotion/react';
|
|
3
3
|
|
|
4
4
|
import { TABLE_ROW_HEIGHT } from '@/components';
|
|
5
|
-
import {
|
|
5
|
+
import { WfoThemeHelpers } from '@/hooks';
|
|
6
6
|
|
|
7
|
-
export const getWfoStatusColorFieldStyles = ({ theme }:
|
|
7
|
+
export const getWfoStatusColorFieldStyles = ({ theme }: WfoThemeHelpers) => {
|
|
8
8
|
const toStatusColorFieldColor = (color: string) => tint(color, 0.3);
|
|
9
9
|
|
|
10
10
|
const getStatusColorFieldStyle = (color: string) =>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { WfoThemeHelpers } from '@/hooks';
|
|
4
4
|
|
|
5
|
-
export const getWfoGroupedTableStyles = ({ theme }:
|
|
5
|
+
export const getWfoGroupedTableStyles = ({ theme }: WfoThemeHelpers) => {
|
|
6
6
|
// Matches the default width of a EuiButtonIcon component
|
|
7
7
|
const expandRowButtonWidth = '24px';
|
|
8
8
|
const marginBetweenButtonAndGroupLabel = theme.size.m;
|
|
@@ -10,7 +10,7 @@ export const getWfoGroupedTableStyles = ({ theme }: WfoTheme) => {
|
|
|
10
10
|
const innerTableHeaderStyle = css({
|
|
11
11
|
fontSize: theme.size.m,
|
|
12
12
|
textAlign: 'left',
|
|
13
|
-
backgroundColor: theme.colors.
|
|
13
|
+
backgroundColor: theme.colors.backgroundBaseSubdued,
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
const expandableRowContainerStyle = css({
|
|
@@ -18,7 +18,11 @@ import { getPageCount } from '../utils/tableUtils';
|
|
|
18
18
|
import { WfoTableDataRows } from './WfoTableDataRows';
|
|
19
19
|
import { WfoTableHeaderRow } from './WfoTableHeaderRow';
|
|
20
20
|
import { getWfoTableStyles } from './styles';
|
|
21
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
getColumnWidthsFromConfig,
|
|
23
|
+
getSortedVisibleColumns,
|
|
24
|
+
usePageIndexBoundsGuard,
|
|
25
|
+
} from './utils';
|
|
22
26
|
|
|
23
27
|
export type Pagination = {
|
|
24
28
|
pageSize: number;
|
|
@@ -133,6 +137,8 @@ export const WfoTable = <T extends object>({
|
|
|
133
137
|
}: WfoTableProps<T>) => {
|
|
134
138
|
const [localColumnWidths, setLocalColumnWidths] =
|
|
135
139
|
useState<LocalColumnWidths>(getColumnWidthsFromConfig(columnConfig));
|
|
140
|
+
const dataLength = data.length;
|
|
141
|
+
usePageIndexBoundsGuard({ dataLength, isLoading, pagination });
|
|
136
142
|
|
|
137
143
|
const parentRef = useRef<HTMLDivElement>(null);
|
|
138
144
|
|
|
@@ -191,7 +197,7 @@ export const WfoTable = <T extends object>({
|
|
|
191
197
|
}, {} as WfoTableColumnConfig<T>);
|
|
192
198
|
|
|
193
199
|
const rowVirtualizer = useVirtualizer({
|
|
194
|
-
count:
|
|
200
|
+
count: dataLength,
|
|
195
201
|
getScrollElement: () => parentRef.current,
|
|
196
202
|
estimateSize: () => ROW_HEIGHT,
|
|
197
203
|
overscan: 10,
|
|
@@ -231,7 +237,7 @@ export const WfoTable = <T extends object>({
|
|
|
231
237
|
/>
|
|
232
238
|
</thead>
|
|
233
239
|
)}
|
|
234
|
-
{
|
|
240
|
+
{dataLength === 0 ? (
|
|
235
241
|
<tbody css={isLoading && bodyLoadingStyle}>
|
|
236
242
|
<tr css={rowStyle}>
|
|
237
243
|
<td
|
|
@@ -22,14 +22,14 @@ export const WfoSortDirectionIcon: FC<WfoSortDirectionIconProps> = ({
|
|
|
22
22
|
width={16}
|
|
23
23
|
className={SORTABLE_ICON_CLASS}
|
|
24
24
|
css={{ visibility: 'hidden' }}
|
|
25
|
-
color={theme.colors.
|
|
25
|
+
color={theme.colors.textSubdued}
|
|
26
26
|
/>
|
|
27
27
|
);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
return sortDirection === SortOrder.ASC ? (
|
|
31
|
-
<WfoArrowUp color={theme.colors.
|
|
31
|
+
<WfoArrowUp color={theme.colors.textSubdued} />
|
|
32
32
|
) : (
|
|
33
|
-
<WfoArrowDown color={theme.colors.
|
|
33
|
+
<WfoArrowDown color={theme.colors.textSubdued} />
|
|
34
34
|
);
|
|
35
35
|
};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { WfoThemeHelpers } from '@/hooks';
|
|
4
4
|
import { SortOrder } from '@/types';
|
|
5
5
|
|
|
6
6
|
export const HEADER_CELL_TITLE_BUTTON_CLASS = 'headerCellTitleButton';
|
|
7
7
|
export const HEADER_CELL_SORT_BUTTON_CLASS = 'headerCellSortButton';
|
|
8
8
|
export const SORTABLE_ICON_CLASS = 'sortableIcon';
|
|
9
9
|
|
|
10
|
-
export const getWfoBasicTableStyles = ({ theme }:
|
|
10
|
+
export const getWfoBasicTableStyles = ({ theme }: WfoThemeHelpers) => {
|
|
11
11
|
const radius = theme.border.radius.medium;
|
|
12
12
|
|
|
13
13
|
const basicTableStyle = css({
|
|
14
14
|
table: {
|
|
15
|
-
backgroundColor: theme.colors.
|
|
15
|
+
backgroundColor: theme.colors.backgroundBaseNeutral,
|
|
16
16
|
},
|
|
17
17
|
|
|
18
18
|
// The lines between rows
|
|
19
19
|
'tr>td': {
|
|
20
|
-
borderColor: theme.colors.
|
|
20
|
+
borderColor: theme.colors.borderBaseSubdued,
|
|
21
21
|
},
|
|
22
22
|
|
|
23
23
|
'.euiTableCellContent__text': {
|
|
24
24
|
display: 'flex',
|
|
25
|
-
color: theme.colors.
|
|
25
|
+
color: theme.colors.textParagraph,
|
|
26
26
|
},
|
|
27
27
|
thead: {
|
|
28
|
-
backgroundColor: theme.colors.
|
|
28
|
+
backgroundColor: theme.colors.borderBaseSubdued,
|
|
29
29
|
'tr>:first-child': {
|
|
30
30
|
borderTopLeftRadius: radius,
|
|
31
31
|
},
|
|
@@ -35,7 +35,7 @@ export const getWfoBasicTableStyles = ({ theme }: WfoTheme) => {
|
|
|
35
35
|
},
|
|
36
36
|
tbody: {
|
|
37
37
|
'tr.euiTableRow:hover': {
|
|
38
|
-
backgroundColor: theme.colors.
|
|
38
|
+
backgroundColor: theme.colors.backgroundBasePlain,
|
|
39
39
|
},
|
|
40
40
|
},
|
|
41
41
|
});
|
|
@@ -55,7 +55,7 @@ export const getWfoBasicTableStyles = ({ theme }: WfoTheme) => {
|
|
|
55
55
|
|
|
56
56
|
const dropDownTableStyle = css({
|
|
57
57
|
thead: {
|
|
58
|
-
backgroundColor: theme.colors.
|
|
58
|
+
backgroundColor: theme.colors.backgroundBasePlain,
|
|
59
59
|
'tr>:first-child': {
|
|
60
60
|
borderTopLeftRadius: 0,
|
|
61
61
|
},
|
|
@@ -64,7 +64,7 @@ export const getWfoBasicTableStyles = ({ theme }: WfoTheme) => {
|
|
|
64
64
|
},
|
|
65
65
|
},
|
|
66
66
|
tbody: {
|
|
67
|
-
backgroundColor: theme.colors.
|
|
67
|
+
backgroundColor: theme.colors.backgroundBasePlain,
|
|
68
68
|
},
|
|
69
69
|
});
|
|
70
70
|
|
|
@@ -72,7 +72,7 @@ export const getWfoBasicTableStyles = ({ theme }: WfoTheme) => {
|
|
|
72
72
|
basicTableStyle,
|
|
73
73
|
{
|
|
74
74
|
'tr.euiTableRow-isExpandedRow': {
|
|
75
|
-
backgroundColor: theme.colors.
|
|
75
|
+
backgroundColor: theme.colors.backgroundBasePlain,
|
|
76
76
|
},
|
|
77
77
|
},
|
|
78
78
|
]);
|
|
@@ -2,7 +2,7 @@ import { CSSProperties } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { css, keyframes } from '@emotion/react';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { WfoThemeHelpers } from '@/hooks';
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
8
|
HEADER_CELL_TITLE_BUTTON_CLASS,
|
|
@@ -10,7 +10,10 @@ import {
|
|
|
10
10
|
} from './WfoTableHeaderCell/styles';
|
|
11
11
|
import { TABLE_ROW_HEIGHT } from './constants';
|
|
12
12
|
|
|
13
|
-
export const getWfoTableStyles = ({
|
|
13
|
+
export const getWfoTableStyles = ({
|
|
14
|
+
theme,
|
|
15
|
+
isDarkModeActive,
|
|
16
|
+
}: WfoThemeHelpers) => {
|
|
14
17
|
const radius = theme.border.radius.medium;
|
|
15
18
|
|
|
16
19
|
const tableLoadingLineKeyframes = keyframes({
|
|
@@ -41,13 +44,9 @@ export const getWfoTableStyles = ({ theme, isDarkThemeActive }: WfoTheme) => {
|
|
|
41
44
|
});
|
|
42
45
|
|
|
43
46
|
const headerStyle = css({
|
|
44
|
-
|
|
45
|
-
top: 0,
|
|
46
|
-
zIndex: 3,
|
|
47
|
-
backgroundColor: theme.colors.lightShade,
|
|
47
|
+
backgroundColor: theme.colors.borderBaseSubdued,
|
|
48
48
|
fontSize: theme.size.m,
|
|
49
49
|
textAlign: 'left',
|
|
50
|
-
|
|
51
50
|
'tr>:first-child': {
|
|
52
51
|
borderTopLeftRadius: radius,
|
|
53
52
|
},
|
|
@@ -73,23 +72,23 @@ export const getWfoTableStyles = ({ theme, isDarkThemeActive }: WfoTheme) => {
|
|
|
73
72
|
height: TABLE_ROW_HEIGHT,
|
|
74
73
|
borderStyle: 'solid',
|
|
75
74
|
borderWidth: '0 0 1px 0',
|
|
76
|
-
borderColor: theme.colors.
|
|
75
|
+
borderColor: theme.colors.borderBaseSubdued,
|
|
77
76
|
position: 'relative',
|
|
78
77
|
});
|
|
79
78
|
|
|
80
79
|
const dataRowStyle = css({
|
|
81
80
|
'&:hover': {
|
|
82
|
-
backgroundColor: theme.colors.
|
|
81
|
+
backgroundColor: theme.colors.backgroundBasePlain,
|
|
83
82
|
},
|
|
84
83
|
});
|
|
85
84
|
|
|
86
85
|
const expandedRowStyle = css({
|
|
87
|
-
backgroundColor: theme.colors.
|
|
86
|
+
backgroundColor: theme.colors.backgroundBaseSubdued,
|
|
88
87
|
});
|
|
89
88
|
|
|
90
89
|
const sortableHeaderCellStyle = css({
|
|
91
90
|
paddingRight: 0,
|
|
92
|
-
|
|
91
|
+
[`&:hover`]: {
|
|
93
92
|
[`.${SORTABLE_ICON_CLASS}`]: {
|
|
94
93
|
visibility: 'visible',
|
|
95
94
|
},
|
|
@@ -142,8 +141,8 @@ export const getWfoTableStyles = ({ theme, isDarkThemeActive }: WfoTheme) => {
|
|
|
142
141
|
zIndex: theme.levels.menu,
|
|
143
142
|
'&:active, &:focus': {
|
|
144
143
|
transition: 'background-color 0.15s',
|
|
145
|
-
backgroundColor:
|
|
146
|
-
? theme.colors.
|
|
144
|
+
backgroundColor: isDarkModeActive
|
|
145
|
+
? theme.colors.textHeading
|
|
147
146
|
: theme.colors.header,
|
|
148
147
|
},
|
|
149
148
|
'&::after': {
|
|
@@ -151,7 +150,7 @@ export const getWfoTableStyles = ({ theme, isDarkThemeActive }: WfoTheme) => {
|
|
|
151
150
|
paddingTop: theme.base - (theme.base / 16) * 2,
|
|
152
151
|
content: `"|"`, // Inserts a vertical line
|
|
153
152
|
fontSize: theme.size.m,
|
|
154
|
-
color: theme.colors.
|
|
153
|
+
color: theme.colors.backgroundBaseAccent,
|
|
155
154
|
cursor: 'col-resize',
|
|
156
155
|
opacity: 0.6,
|
|
157
156
|
zIndex: theme.levels.navigation,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
import { LocalColumnWidths, Pagination, TableColumnKeys } from '@/components';
|
|
2
4
|
import { SortOrder } from '@/types';
|
|
3
5
|
import { toObjectWithSortedKeys } from '@/utils';
|
|
4
6
|
|
|
@@ -93,3 +95,29 @@ export const getColumnWidthsFromConfig = <T extends object>(
|
|
|
93
95
|
return columnWidths;
|
|
94
96
|
}, {} as LocalColumnWidths);
|
|
95
97
|
};
|
|
98
|
+
|
|
99
|
+
export const usePageIndexBoundsGuard = ({
|
|
100
|
+
dataLength,
|
|
101
|
+
isLoading,
|
|
102
|
+
pagination,
|
|
103
|
+
}: {
|
|
104
|
+
dataLength: number;
|
|
105
|
+
isLoading: boolean;
|
|
106
|
+
pagination?: Pagination;
|
|
107
|
+
}) => {
|
|
108
|
+
useEffect(() => {
|
|
109
|
+
if (!pagination) return;
|
|
110
|
+
|
|
111
|
+
const { pageIndex, pageSize, totalItemCount, onChangePage } =
|
|
112
|
+
pagination;
|
|
113
|
+
|
|
114
|
+
const maxPage = Math.max(
|
|
115
|
+
0,
|
|
116
|
+
Math.floor(((totalItemCount ?? 1) - 1) / pageSize),
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
if (!isLoading && dataLength === 0 && pageIndex > maxPage) {
|
|
120
|
+
onChangePage?.(maxPage);
|
|
121
|
+
}
|
|
122
|
+
}, [dataLength, isLoading, pagination]);
|
|
123
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { WfoThemeHelpers } from '@/hooks';
|
|
4
4
|
import { getFormFieldsBaseStyle } from '@/theme';
|
|
5
5
|
|
|
6
|
-
export const getWfoTableSettingsModalStyles = (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const {
|
|
6
|
+
export const getWfoTableSettingsModalStyles = (
|
|
7
|
+
wfoThemeHelpers: WfoThemeHelpers,
|
|
8
|
+
) => {
|
|
9
|
+
const { formFieldBaseStyle } = getFormFieldsBaseStyle(wfoThemeHelpers);
|
|
10
10
|
|
|
11
11
|
const formRowStyle = css({
|
|
12
12
|
justifyContent: 'space-between',
|
|
13
13
|
'.euiFormLabel': {
|
|
14
|
-
color: theme.colors.
|
|
14
|
+
color: wfoThemeHelpers.theme.colors.textParagraph,
|
|
15
15
|
},
|
|
16
16
|
});
|
|
17
17
|
|
|
@@ -15,6 +15,7 @@ export const METADATA_RESOURCE_TYPES_TABLE_LOCAL_STORAGE_KEY =
|
|
|
15
15
|
export const METADATA_PRODUCT_BLOCKS_TABLE_LOCAL_STORAGE_KEY =
|
|
16
16
|
'metadataProductBlocksTable';
|
|
17
17
|
export const METADATA_PRODUCT_TABLE_LOCAL_STORAGE_KEY = 'metadataProductTable';
|
|
18
|
+
export const METADATA_SCHEDULES_LOCAL_STORAGE_KEY = 'metadataScheduleTable';
|
|
18
19
|
export const METADATA_WORKFLOWS_TABLE_LOCAL_STORAGE_KEY =
|
|
19
20
|
'metadataWorkflowsTable';
|
|
20
21
|
export const METADATA_TASKS_TABLE_LOCAL_STORAGE_KEY = 'metadataTasksTable';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { WfoThemeHelpers } from '@/hooks';
|
|
4
4
|
|
|
5
|
-
export const getStyles = ({ theme }:
|
|
5
|
+
export const getStyles = ({ theme }: WfoThemeHelpers) => {
|
|
6
6
|
const tableCodeBlockMarginStyle = css({
|
|
7
7
|
margin: theme.size.base,
|
|
8
8
|
marginTop: theme.size.l,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { WfoThemeHelpers } from '@/hooks';
|
|
4
4
|
|
|
5
|
-
export const getStyles = ({ theme }:
|
|
5
|
+
export const getStyles = ({ theme }: WfoThemeHelpers) => {
|
|
6
6
|
const textAnchorStyle = css({
|
|
7
7
|
marginTop: theme.size.xxs,
|
|
8
8
|
marginLeft: 0,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { WfoThemeHelpers } from '@/hooks';
|
|
4
4
|
import { StepStatus } from '@/types';
|
|
5
5
|
|
|
6
6
|
import { TimelinePosition } from './WfoTimeline';
|
|
7
7
|
|
|
8
|
-
export const getTimelineStyles = ({ theme }:
|
|
8
|
+
export const getTimelineStyles = ({ theme }: WfoThemeHelpers) => {
|
|
9
9
|
const TIMELINE_HEIGHT = theme.base * 2.5;
|
|
10
10
|
const TIMELINE_OUTLINE_WIDTH = theme.base * 0.75;
|
|
11
11
|
|
|
@@ -30,7 +30,7 @@ export const getTimelineStyles = ({ theme }: WfoTheme) => {
|
|
|
30
30
|
case StepStatus.RUNNING:
|
|
31
31
|
case StepStatus.PENDING:
|
|
32
32
|
default:
|
|
33
|
-
return theme.colors.
|
|
33
|
+
return theme.colors.textDisabled;
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
|
|
@@ -44,9 +44,9 @@ export const getTimelineStyles = ({ theme }: WfoTheme) => {
|
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
const timelinePanelStyle = css({
|
|
47
|
-
backgroundColor: theme.colors.
|
|
47
|
+
backgroundColor: theme.colors.backgroundBaseSubdued,
|
|
48
48
|
borderRadius: theme.border.radius.medium,
|
|
49
|
-
outline: `${timelineOutlineWidthPx} solid ${theme.colors.
|
|
49
|
+
outline: `${timelineOutlineWidthPx} solid ${theme.colors.backgroundBaseNeutral}`,
|
|
50
50
|
height: timelineHeightPx,
|
|
51
51
|
marginTop: timelineOutlineWidthPx,
|
|
52
52
|
marginBottom: timelineOutlineWidthPx,
|
|
@@ -90,7 +90,7 @@ export const getTimelineStyles = ({ theme }: WfoTheme) => {
|
|
|
90
90
|
return theme.colors.primary;
|
|
91
91
|
case TimelinePosition.FUTURE:
|
|
92
92
|
default:
|
|
93
|
-
return theme.colors.
|
|
93
|
+
return theme.colors.borderBaseSubdued;
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
96
|
|
|
@@ -101,7 +101,7 @@ export const getTimelineStyles = ({ theme }: WfoTheme) => {
|
|
|
101
101
|
case TimelinePosition.CURRENT:
|
|
102
102
|
case TimelinePosition.FUTURE:
|
|
103
103
|
default:
|
|
104
|
-
return theme.colors.
|
|
104
|
+
return theme.colors.borderBaseSubdued;
|
|
105
105
|
}
|
|
106
106
|
};
|
|
107
107
|
|
|
@@ -129,7 +129,7 @@ export const getTimelineStyles = ({ theme }: WfoTheme) => {
|
|
|
129
129
|
justifyContent: 'center',
|
|
130
130
|
alignItems: 'center',
|
|
131
131
|
borderRadius: '50%',
|
|
132
|
-
backgroundColor: theme.colors.
|
|
132
|
+
backgroundColor: theme.colors.backgroundBaseNeutral,
|
|
133
133
|
height: hasContent
|
|
134
134
|
? stepWithValueOuterDiameter
|
|
135
135
|
: emptyStepOuterDiameter,
|