@orchestrator-ui/orchestrator-ui-components 1.24.0 → 1.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/.turbo/turbo-build.log +4 -4
  2. package/.turbo/turbo-lint.log +1 -1
  3. package/.turbo/turbo-test.log +7 -7
  4. package/CHANGELOG.md +24 -0
  5. package/dist/index.d.ts +16 -13
  6. package/dist/index.js +1600 -1520
  7. package/package.json +1 -1
  8. package/src/components/WfoBadges/WfoWebsocketStatusBadge/WfoWebsocketStatusBadge.tsx +1 -1
  9. package/src/components/WfoForms/formFields/utils.spec.ts +24 -6
  10. package/src/components/WfoKeyValueTable/styles.ts +0 -1
  11. package/src/components/WfoSettingsModal/WfoSettingsModal.tsx +28 -22
  12. package/src/components/WfoSubscription/WfoInUseByRelations.tsx +1 -1
  13. package/src/components/WfoSubscription/WfoRelatedSubscriptions.tsx +2 -1
  14. package/src/components/WfoSubscription/WfoSubscriptionDetailTree.tsx +4 -24
  15. package/src/components/WfoSubscription/WfoSubscriptionProductBlock/WfoProductBlockKeyValueRow.tsx +2 -3
  16. package/src/components/WfoSubscription/WfoSubscriptionProductBlock/WfoSubscriptionProductBlock.tsx +93 -36
  17. package/src/components/WfoSubscription/WfoSubscriptionProductBlock/styles.ts +16 -10
  18. package/src/components/WfoTable/WfoTableSettingsModal/WfoTableSettingsModal.tsx +5 -2
  19. package/src/components/WfoTable/WfoTableWithFilter/WfoTableWithFilter.tsx +4 -4
  20. package/src/components/WfoTree/treeUtils.spec.ts +20 -4
  21. package/src/components/WfoWorkflowSteps/WfoStep/WfoStepForm.tsx +20 -6
  22. package/src/messages/en-GB.json +5 -1
  23. package/src/messages/nl-NL.json +5 -1
  24. package/src/pages/processes/WfoProcessDetailPage.tsx +23 -70
  25. package/src/pages/processes/WfoStartProcessPage.tsx +30 -3
  26. package/src/rtk/api.ts +2 -2
  27. package/src/rtk/endpoints/processDetail.ts +15 -4
  28. package/src/rtk/endpoints/processList.ts +1 -1
  29. package/src/rtk/endpoints/streamMessages.ts +25 -10
  30. package/src/rtk/endpoints/subscriptionDetail.ts +4 -1
  31. package/src/types/types.ts +1 -1
  32. package/src/utils/date.ts +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orchestrator-ui/orchestrator-ui-components",
3
- "version": "1.24.0",
3
+ "version": "1.26.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Library of UI Components used to display the workflow orchestrator frontend",
6
6
  "author": {
@@ -42,7 +42,7 @@ export const WfoWebsocketStatusBadge = () => {
42
42
  websocketConnected ? (
43
43
  <WfoBoltFill color={theme.colors.success} />
44
44
  ) : (
45
- <WfoBoltSlashFill color="yellow" />
45
+ <WfoBoltSlashFill color={theme.colors.warning} />
46
46
  )
47
47
  }
48
48
  css={websocketConnected ? connectedStyle : disconnectedStyle}
@@ -17,11 +17,14 @@ const getProductBlockInstance = (
17
17
  instanceProperties: Partial<ProductBlockInstance> = {},
18
18
  ): ProductBlockInstance => ({
19
19
  id: 1,
20
- ownerSubscriptionId: 'ProductBlockInstanceId 1',
21
20
  parent: 0,
22
21
  productBlockInstanceValues: [],
23
22
  subscriptionInstanceId: 'testId',
24
23
  inUseByRelations: [],
24
+ subscription: {
25
+ subscriptionId: 'OwnerSubscriptionId',
26
+ description: 'OwnerSubscription description',
27
+ },
25
28
  ...instanceProperties,
26
29
  });
27
30
 
@@ -128,11 +131,14 @@ describe('formField utils', () => {
128
131
  ...testProductBlockInstances,
129
132
  {
130
133
  id: 1,
131
- ownerSubscriptionId: 'ProductBlockInstanceId 1',
132
134
  parent: 0,
133
135
  productBlockInstanceValues: [],
134
136
  subscriptionInstanceId: 'testId',
135
137
  inUseByRelations: [],
138
+ subscription: {
139
+ subscriptionId: 'OwnerSubscriptionId',
140
+ description: 'OwnerSubscription description',
141
+ },
136
142
  },
137
143
  ]);
138
144
  expect(result).toEqual(undefined);
@@ -152,11 +158,14 @@ describe('formField utils', () => {
152
158
  productBlockInstances: [
153
159
  {
154
160
  id: 1,
155
- ownerSubscriptionId: 'ProductBlockInstanceId 1',
156
161
  parent: 0,
157
162
  productBlockInstanceValues: [],
158
163
  subscriptionInstanceId: 'testId',
159
164
  inUseByRelations: [],
165
+ subscription: {
166
+ subscriptionId: 'OwnerSubscriptionId 1',
167
+ description: 'OwnerSubscriptionId description',
168
+ },
160
169
  },
161
170
  ],
162
171
  };
@@ -171,10 +180,13 @@ describe('formField utils', () => {
171
180
  productBlockInstances: [
172
181
  {
173
182
  id: 1,
174
- ownerSubscriptionId: 'ProductBlockInstanceId 1',
175
183
  parent: 0,
176
184
  subscriptionInstanceId: 'testId',
177
185
  inUseByRelations: [],
186
+ subscription: {
187
+ subscriptionId: 'OwnerSubscriptionId 1',
188
+ description: 'OwnerSubscriptionId description',
189
+ },
178
190
  productBlockInstanceValues: [
179
191
  {
180
192
  field: 'key1',
@@ -198,10 +210,13 @@ describe('formField utils', () => {
198
210
  productBlockInstances: [
199
211
  {
200
212
  id: 1,
201
- ownerSubscriptionId: 'ProductBlockInstanceId 1',
202
213
  parent: 0,
203
214
  subscriptionInstanceId: 'testId',
204
215
  inUseByRelations: [],
216
+ subscription: {
217
+ subscriptionId: 'OwnerSubscriptionId 1',
218
+ description: 'OwnerSubscriptionId description',
219
+ },
205
220
  productBlockInstanceValues: [
206
221
  {
207
222
  field: 'key1',
@@ -225,10 +240,13 @@ describe('formField utils', () => {
225
240
  productBlockInstances: [
226
241
  {
227
242
  id: 1,
228
- ownerSubscriptionId: 'ProductBlockInstanceId 1',
229
243
  parent: 0,
230
244
  subscriptionInstanceId: 'testId',
231
245
  inUseByRelations: [],
246
+ subscription: {
247
+ subscriptionId: 'OwnerSubscriptionId 1',
248
+ description: 'OwnerSubscriptionId description',
249
+ },
232
250
  productBlockInstanceValues: [
233
251
  {
234
252
  field: 'key1',
@@ -31,7 +31,6 @@ export const getStyles = ({ theme }: WfoTheme) => {
31
31
  });
32
32
 
33
33
  const valueColumnStyle = css({
34
- padding: padding,
35
34
  borderTopRightRadius: radius,
36
35
  borderBottomRightRadius: radius,
37
36
  display: 'flex',
@@ -1,5 +1,7 @@
1
1
  import React, { FC, ReactNode } from 'react';
2
2
 
3
+ import { useTranslations } from 'next-intl';
4
+
3
5
  import {
4
6
  EuiButton,
5
7
  EuiButtonEmpty,
@@ -26,25 +28,29 @@ export const WfoSettingsModal: FC<WfoSettingsModalProps> = ({
26
28
  onResetToDefaults,
27
29
  onUpdateTableConfig,
28
30
  children,
29
- }) => (
30
- <EuiModal onClose={onClose} maxWidth={400}>
31
- <EuiModalHeader>
32
- <EuiModalHeaderTitle size="xs">{title}</EuiModalHeaderTitle>
33
- </EuiModalHeader>
34
-
35
- <EuiSpacer size="s" />
36
-
37
- <EuiModalBody>{children}</EuiModalBody>
38
-
39
- <EuiModalFooter>
40
- <EuiFlexGroup justifyContent="spaceBetween">
41
- <EuiButtonEmpty onClick={onResetToDefaults} flush="left">
42
- Reset to default
43
- </EuiButtonEmpty>
44
- <EuiButton onClick={onUpdateTableConfig} fill>
45
- Save preference
46
- </EuiButton>
47
- </EuiFlexGroup>
48
- </EuiModalFooter>
49
- </EuiModal>
50
- );
31
+ }) => {
32
+ const t = useTranslations('main');
33
+
34
+ return (
35
+ <EuiModal onClose={onClose} maxWidth={400}>
36
+ <EuiModalHeader>
37
+ <EuiModalHeaderTitle size="xs">{title}</EuiModalHeaderTitle>
38
+ </EuiModalHeader>
39
+
40
+ <EuiSpacer size="s" />
41
+
42
+ <EuiModalBody>{children}</EuiModalBody>
43
+
44
+ <EuiModalFooter>
45
+ <EuiFlexGroup justifyContent="spaceBetween">
46
+ <EuiButtonEmpty onClick={onResetToDefaults} flush="left">
47
+ {t('resetToDefault')}
48
+ </EuiButtonEmpty>
49
+ <EuiButton onClick={onUpdateTableConfig} fill>
50
+ {t('savePreferences')}
51
+ </EuiButton>
52
+ </EuiFlexGroup>
53
+ </EuiModalFooter>
54
+ </EuiModal>
55
+ );
56
+ };
@@ -58,7 +58,7 @@ export const WfoInUseByRelations = ({
58
58
  key: t('description'),
59
59
  value: (
60
60
  <Link
61
- href={`/${PATH_SUBSCRIPTIONS}/${inUseByRelationDetails.subscriptionId}`}
61
+ href={`${PATH_SUBSCRIPTIONS}/${inUseByRelationDetails.subscriptionId}`}
62
62
  target="_blank"
63
63
  >
64
64
  {inUseByRelationDetails.description}
@@ -19,6 +19,7 @@ import {
19
19
  getDataSortHandler,
20
20
  getPageChangeHandler,
21
21
  } from '@/components';
22
+ import { PATH_SUBSCRIPTIONS } from '@/components';
22
23
  import { useDataDisplayParams, useOrchestratorTheme } from '@/hooks';
23
24
  import { WfoSearchStrikethrough } from '@/icons';
24
25
  import { useGetRelatedSubscriptionsQuery } from '@/rtk';
@@ -83,7 +84,7 @@ export const WfoRelatedSubscriptions = ({
83
84
  render: (value, record) => (
84
85
  <Link
85
86
  target="_blank"
86
- href={`/subscriptions/${record.subscriptionId}`}
87
+ href={`${PATH_SUBSCRIPTIONS}/${record.subscriptionId}`}
87
88
  >
88
89
  {value}
89
90
  </Link>
@@ -47,7 +47,8 @@ export const WfoSubscriptionDetailTree = ({
47
47
  callback: () => {},
48
48
  children: [],
49
49
  isOutsideCurrentSubscription:
50
- productBlockInstance.ownerSubscriptionId !== subscriptionId,
50
+ productBlockInstance.subscription.subscriptionId !==
51
+ subscriptionId,
51
52
  };
52
53
 
53
54
  // Does this node have a parent?
@@ -153,32 +154,11 @@ export const WfoSubscriptionDetailTree = ({
153
154
  selectedIds.map((id, index) => {
154
155
  const block = idToNodeMap[selectedIds[index]];
155
156
 
156
- const inUseByRelationsWithoutCurrentSubscription =
157
- block.inUseByRelations.filter(
158
- (inUseByRelation) =>
159
- inUseByRelation.subscription_id !==
160
- subscriptionId,
161
- );
162
-
163
157
  return (
164
158
  <WfoSubscriptionProductBlock
165
159
  key={index}
166
- ownerSubscriptionId={
167
- block.ownerSubscriptionId
168
- }
169
- subscriptionInstanceId={
170
- block.subscriptionInstanceId
171
- }
172
- productBlockInstanceValues={
173
- block.productBlockInstanceValues
174
- }
175
- inUseByRelations={
176
- inUseByRelationsWithoutCurrentSubscription
177
- }
178
- isOutsideCurrentSubscription={
179
- block.isOutsideCurrentSubscription
180
- }
181
- id={id}
160
+ subscriptionId={subscriptionId}
161
+ productBlock={block}
182
162
  />
183
163
  );
184
164
  })}
@@ -16,8 +16,7 @@ export type WfoProductBlockKeyValueRowProps = {
16
16
  export const WfoProductBlockKeyValueRow: FC<
17
17
  WfoProductBlockKeyValueRowProps
18
18
  > = ({ fieldValue }) => {
19
- const { leftColumnStyle, rightColumnStyle, rowStyle } =
20
- useWithOrchestratorTheme(getStyles);
19
+ const { leftColumnStyle, rowStyle } = useWithOrchestratorTheme(getStyles);
21
20
  const { getOverriddenValue } = useSubscriptionDetailValueOverride();
22
21
 
23
22
  const { field, value } = fieldValue;
@@ -36,7 +35,7 @@ export const WfoProductBlockKeyValueRow: FC<
36
35
  <td css={leftColumnStyle}>
37
36
  <b>{camelToHuman(field)}</b>
38
37
  </td>
39
- <td css={rightColumnStyle}>
38
+ <td>
40
39
  {getOverriddenValue(fieldValue) ?? (
41
40
  <WfoProductBlockValue value={value} />
42
41
  )}
@@ -13,9 +13,14 @@ import {
13
13
  EuiText,
14
14
  } from '@elastic/eui';
15
15
 
16
- import { PATH_SUBSCRIPTIONS, WfoProductBlockKeyValueRow } from '@/components';
16
+ import {
17
+ PATH_SUBSCRIPTIONS,
18
+ WfoProductBlockKeyValueRow,
19
+ WfoValueCell,
20
+ } from '@/components';
17
21
  import { useOrchestratorTheme, useWithOrchestratorTheme } from '@/hooks';
18
- import { FieldValue, InUseByRelation } from '@/types';
22
+ import { ProductBlockInstance, Subscription } from '@/types';
23
+ import { getFirstUuidPart } from '@/utils';
19
24
 
20
25
  import { WfoInUseByRelations } from '../WfoInUseByRelations';
21
26
  import {
@@ -25,22 +30,15 @@ import {
25
30
  import { getStyles } from './styles';
26
31
 
27
32
  interface WfoSubscriptionProductBlockProps {
28
- ownerSubscriptionId: string;
29
- subscriptionInstanceId: string;
30
- productBlockInstanceValues: FieldValue[];
31
- inUseByRelations: InUseByRelation[];
32
- id: number;
33
- isOutsideCurrentSubscription?: boolean;
33
+ productBlock: ProductBlockInstance;
34
+ subscriptionId: Subscription['subscriptionId'];
34
35
  }
35
36
 
36
37
  export const HIDDEN_KEYS = ['title', 'name', 'label'];
37
38
 
38
39
  export const WfoSubscriptionProductBlock = ({
39
- ownerSubscriptionId,
40
- subscriptionInstanceId,
41
- productBlockInstanceValues,
42
- inUseByRelations,
43
- isOutsideCurrentSubscription = false,
40
+ productBlock,
41
+ subscriptionId,
44
42
  }: WfoSubscriptionProductBlockProps) => {
45
43
  const t = useTranslations('subscriptions.detail');
46
44
  const { theme } = useOrchestratorTheme();
@@ -49,13 +47,24 @@ export const WfoSubscriptionProductBlock = ({
49
47
  panelStyle,
50
48
  panelStyleOutsideCurrentSubscription,
51
49
  leftColumnStyle,
52
- rightColumnStyle,
50
+ leftColumnStyleWithAlignSelf,
51
+ outsideSubscriptionIdTextStyle,
53
52
  rowStyle,
54
53
  } = useWithOrchestratorTheme(getStyles);
55
54
 
56
55
  const [showDetails, setShowDetails] = useState(false);
56
+
57
+ const ownerSubscriptionId = productBlock.subscription.subscriptionId;
58
+ const isOutsideCurrentSubscription = ownerSubscriptionId !== subscriptionId;
59
+ const inUseByRelations = productBlock.inUseByRelations.filter(
60
+ (inUseByRelation) => inUseByRelation.subscription_id !== subscriptionId,
61
+ );
57
62
  const showProductBlockValues = !isOutsideCurrentSubscription || showDetails;
58
63
 
64
+ const isEmpty = (value: unknown) => {
65
+ return value === null || value === undefined || value === '';
66
+ };
67
+
59
68
  return (
60
69
  <>
61
70
  <EuiSpacer size={'m'}></EuiSpacer>
@@ -81,13 +90,13 @@ export const WfoSubscriptionProductBlock = ({
81
90
  <EuiText grow={true}>
82
91
  <h3>
83
92
  {getProductBlockTitle(
84
- productBlockInstanceValues,
93
+ productBlock.productBlockInstanceValues,
85
94
  )}
86
95
  </h3>
87
96
  </EuiText>
88
97
  <EuiText size="s">
89
98
  {getFieldFromProductBlockInstanceValues(
90
- productBlockInstanceValues,
99
+ productBlock.productBlockInstanceValues,
91
100
  'name',
92
101
  )}
93
102
  </EuiText>
@@ -113,16 +122,39 @@ export const WfoSubscriptionProductBlock = ({
113
122
  <tbody>
114
123
  {isOutsideCurrentSubscription && (
115
124
  <tr key={-1} css={rowStyle}>
116
- <td css={leftColumnStyle}>
125
+ <td css={leftColumnStyleWithAlignSelf}>
117
126
  <b>{t('ownerSubscriptionId')}</b>
118
127
  </td>
119
- <td css={rightColumnStyle}>
120
- <a
121
- href={`${PATH_SUBSCRIPTIONS}/${ownerSubscriptionId}`}
122
- target="_blank"
123
- >
124
- {ownerSubscriptionId}
125
- </a>
128
+ <td>
129
+ <WfoValueCell
130
+ value={
131
+ <>
132
+ <a
133
+ href={`${PATH_SUBSCRIPTIONS}/${ownerSubscriptionId}`}
134
+ target="_blank"
135
+ >
136
+ {
137
+ productBlock
138
+ .subscription
139
+ .description
140
+ }
141
+ </a>
142
+ <EuiText
143
+ css={
144
+ outsideSubscriptionIdTextStyle
145
+ }
146
+ >
147
+ -
148
+ </EuiText>
149
+ {getFirstUuidPart(
150
+ ownerSubscriptionId,
151
+ )}
152
+ </>
153
+ }
154
+ textToCopy={ownerSubscriptionId}
155
+ rowNumber={-1}
156
+ enableCopyIcon={true}
157
+ />
126
158
  </td>
127
159
  </tr>
128
160
  )}
@@ -132,8 +164,10 @@ export const WfoSubscriptionProductBlock = ({
132
164
  <td css={leftColumnStyle}>
133
165
  <b>{t('subscriptionInstanceId')}</b>
134
166
  </td>
135
- <td css={rightColumnStyle}>
136
- {subscriptionInstanceId}
167
+ <td>
168
+ {
169
+ productBlock.subscriptionInstanceId
170
+ }
137
171
  </td>
138
172
  </tr>
139
173
  {!isOutsideCurrentSubscription && (
@@ -143,7 +177,7 @@ export const WfoSubscriptionProductBlock = ({
143
177
  {t('ownerSubscriptionId')}
144
178
  </b>
145
179
  </td>
146
- <td css={rightColumnStyle}>
180
+ <td>
147
181
  <>
148
182
  <EuiBadge>
149
183
  {t('self')}
@@ -156,7 +190,7 @@ export const WfoSubscriptionProductBlock = ({
156
190
  <td css={leftColumnStyle}>
157
191
  <b>{t('inUseByRelations')}</b>
158
192
  </td>
159
- <td css={rightColumnStyle}>
193
+ <td>
160
194
  {(inUseByRelations.length === 0 &&
161
195
  'None') || (
162
196
  <WfoInUseByRelations
@@ -171,21 +205,44 @@ export const WfoSubscriptionProductBlock = ({
171
205
  )}
172
206
 
173
207
  {showProductBlockValues &&
174
- productBlockInstanceValues
208
+ productBlock.productBlockInstanceValues
175
209
  .filter(
176
210
  (productBlockInstanceValue) =>
177
211
  !HIDDEN_KEYS.includes(
178
212
  productBlockInstanceValue.field,
179
213
  ),
180
214
  )
181
- .map((productBlockInstanceValue, index) => (
182
- <WfoProductBlockKeyValueRow
183
- fieldValue={
184
- productBlockInstanceValue
215
+ .sort(
216
+ (
217
+ { field: fieldNameA },
218
+ { field: fieldNameB },
219
+ ) => {
220
+ if (fieldNameA < fieldNameB) {
221
+ return -1;
185
222
  }
186
- key={index}
187
- />
188
- ))}
223
+ if (fieldNameA > fieldNameB) {
224
+ return 1;
225
+ }
226
+ return 0;
227
+ },
228
+ )
229
+ .map((productBlockInstanceValue, index) => {
230
+ if (
231
+ productBlockInstanceValue &&
232
+ !isEmpty(
233
+ productBlockInstanceValue.value,
234
+ )
235
+ ) {
236
+ return (
237
+ <WfoProductBlockKeyValueRow
238
+ fieldValue={
239
+ productBlockInstanceValue
240
+ }
241
+ key={index}
242
+ />
243
+ );
244
+ }
245
+ })}
189
246
  </tbody>
190
247
  </table>
191
248
  }
@@ -23,6 +23,10 @@ export const getStyles = (wfoTheme: WfoTheme) => {
23
23
  });
24
24
 
25
25
  const rowStyle = css({
26
+ display: 'flex',
27
+ flexDirection: 'row',
28
+ alignItems: 'flex-start',
29
+ padding: `${theme.base / 2}px 0`,
26
30
  borderBottom: `solid 1px ${theme.colors.lightShade}`,
27
31
  '&:first-child': {
28
32
  borderTop: `solid 1px ${theme.colors.lightShade}`,
@@ -30,26 +34,28 @@ export const getStyles = (wfoTheme: WfoTheme) => {
30
34
  });
31
35
 
32
36
  const leftColumnStyle = css({
33
- verticalAlign: 'top',
34
37
  width: 250,
35
- paddingLeft: 0,
36
- paddingTop: 10,
37
- paddingBottom: 10,
38
+ flexShrink: 0,
39
+ paddingTop: `${theme.base / 4}px`,
38
40
  });
39
41
 
40
- const rightColumnStyle = css({
41
- verticalAlign: 'top',
42
- paddingLeft: 0,
43
- paddingTop: 10,
44
- paddingBottom: 10,
42
+ const leftColumnStyleWithAlignSelf = css({
43
+ width: 250,
44
+ flexShrink: 0,
45
+ alignSelf: 'center',
46
+ });
47
+
48
+ const outsideSubscriptionIdTextStyle = css({
49
+ padding: `${theme.size.xs}px 0`,
45
50
  });
46
51
 
47
52
  return {
48
53
  iconStyle,
49
54
  panelStyle,
50
55
  leftColumnStyle,
51
- rightColumnStyle,
56
+ leftColumnStyleWithAlignSelf,
52
57
  rowStyle,
53
58
  panelStyleOutsideCurrentSubscription,
59
+ outsideSubscriptionIdTextStyle,
54
60
  };
55
61
  };
@@ -1,5 +1,7 @@
1
1
  import React, { useState } from 'react';
2
2
 
3
+ import { useTranslations } from 'next-intl';
4
+
3
5
  import {
4
6
  EuiForm,
5
7
  EuiFormRow,
@@ -39,6 +41,7 @@ export const TableSettingsModal = <T,>({
39
41
  onResetToDefaults,
40
42
  onClose,
41
43
  }: TableSettingsModalProps<T>) => {
44
+ const t = useTranslations('main');
42
45
  const { formRowStyle, selectFieldStyle } = useWithOrchestratorTheme(
43
46
  getWfoTableSettingsModalStyles,
44
47
  );
@@ -67,7 +70,7 @@ export const TableSettingsModal = <T,>({
67
70
 
68
71
  return (
69
72
  <WfoSettingsModal
70
- title="Table settings"
73
+ title={t('tableSettings')}
71
74
  onClose={onClose}
72
75
  onResetToDefaults={onResetToDefaults}
73
76
  onUpdateTableConfig={() =>
@@ -103,7 +106,7 @@ export const TableSettingsModal = <T,>({
103
106
  <EuiFormRow
104
107
  css={formRowStyle}
105
108
  hasEmptyLabelSpace
106
- label="Number of Rows"
109
+ label={t('numberOfRows')}
107
110
  display="columnCompressed"
108
111
  >
109
112
  <EuiSelect
@@ -16,6 +16,7 @@ import {
16
16
  import { WfoError } from '@/components';
17
17
  import { useOrchestratorTheme } from '@/hooks';
18
18
  import { WfoArrowsExpand } from '@/icons';
19
+ import { getDefaultTableConfig } from '@/utils/getDefaultTableConfig';
19
20
 
20
21
  import { getTypedFieldFromObject } from '../../../utils';
21
22
  import {
@@ -89,8 +90,6 @@ export const WfoTableWithFilter = <T extends object>({
89
90
  exportDataIsLoading = false,
90
91
  }: WfoTableWithFilterProps<T>) => {
91
92
  const { theme } = useOrchestratorTheme();
92
-
93
- const defaultPageSize = pagination.pageSize;
94
93
  const [hiddenColumns, setHiddenColumns] =
95
94
  useState<TableColumnKeys<T>>(defaultHiddenColumns);
96
95
  const [showSettingsModal, setShowSettingsModal] = useState(false);
@@ -184,12 +183,13 @@ export const WfoTableWithFilter = <T extends object>({
184
183
  };
185
184
 
186
185
  const handleResetToDefaults = () => {
187
- setHiddenColumns(defaultHiddenColumns);
186
+ const defaultTableConfig = getDefaultTableConfig<T>(localStorageKey);
187
+ setHiddenColumns(defaultTableConfig.hiddenColumns);
188
188
  setShowSettingsModal(false);
189
189
  clearTableConfigFromLocalStorage(localStorageKey);
190
190
  onUpdatePage({
191
191
  index: 0,
192
- size: defaultPageSize ?? DEFAULT_PAGE_SIZE,
192
+ size: defaultTableConfig.selectedPageSize ?? DEFAULT_PAGE_SIZE,
193
193
  });
194
194
  };
195
195