@orchestrator-ui/orchestrator-ui-components 0.2.7 → 0.3.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 (120) hide show
  1. package/.turbo/turbo-build.log +6 -6
  2. package/.turbo/turbo-lint.log +0 -6
  3. package/.turbo/turbo-test.log +10 -9
  4. package/CHANGELOG.md +6 -0
  5. package/dist/index.d.ts +1005 -123
  6. package/dist/index.js +33849 -6199
  7. package/package.json +14 -12
  8. package/src/api/index.ts +55 -0
  9. package/src/components/WfoDiff/WfoDiff.tsx +119 -0
  10. package/src/components/WfoDiff/index.ts +1 -0
  11. package/src/components/WfoDiff/unidiff.d.ts +1 -0
  12. package/src/components/WfoForms/AutoFieldLoader.tsx +5 -1
  13. package/src/components/WfoForms/CreateForm.tsx +1 -0
  14. package/src/components/WfoForms/UserInputForm.tsx +75 -44
  15. package/src/components/WfoForms/UserInputFormWizard.tsx +11 -4
  16. package/src/components/WfoForms/formFields/AcceptField.tsx +8 -5
  17. package/src/components/WfoForms/formFields/BoolField.tsx +1 -1
  18. package/src/components/WfoForms/formFields/ImsNodeIdField.tsx +2 -2
  19. package/src/components/WfoForms/formFields/ImsPortIdField.tsx +238 -0
  20. package/src/components/WfoForms/formFields/ImsPortIdFieldStyling.ts +17 -0
  21. package/src/components/WfoForms/formFields/ListAddField.tsx +1 -1
  22. package/src/components/WfoForms/formFields/ListDelField.tsx +1 -1
  23. package/src/components/WfoForms/formFields/OptGroupField.tsx +1 -1
  24. package/src/components/WfoForms/formFields/SubscriptionField.tsx +2 -1
  25. package/src/components/WfoForms/formFields/SummaryField.tsx +103 -0
  26. package/src/components/WfoForms/formFields/SummaryFieldStyling.ts +46 -0
  27. package/src/components/WfoForms/formFields/VlanField.tsx +10 -10
  28. package/src/components/WfoForms/formFields/index.ts +2 -0
  29. package/src/components/WfoForms/formFields/surf/types.ts +26 -0
  30. package/src/components/WfoForms/formFields/utils.spec.ts +1 -0
  31. package/src/components/WfoJsonCodeBlock/index.ts +1 -0
  32. package/src/components/WfoPageTemplate/WfoPageHeader/WfoPageHeader.tsx +4 -3
  33. package/src/components/WfoPageTemplate/WfoSidebar/WfoSidebar.tsx +14 -14
  34. package/src/components/WfoPageTemplate/WfoSidebar/WfoStartCreateWorkflowButtonComboBox.tsx +15 -9
  35. package/src/components/WfoPageTemplate/paths.ts +3 -2
  36. package/src/components/{WfoProcessesList → WfoProcessList}/WfoProcessList.tsx +18 -14
  37. package/src/components/WfoProcessList/index.ts +1 -0
  38. package/src/components/{WfoProcessesList → WfoProcessList}/processListObjectMappers.ts +4 -2
  39. package/src/components/WfoSearchBar/WfoSearchField.tsx +27 -37
  40. package/src/components/{WfoSettingsPage → WfoSettings}/WfoEngineStatusButton.tsx +7 -4
  41. package/src/components/{WfoSettingsPage → WfoSettings}/WfoFlushSettings.tsx +13 -12
  42. package/src/components/WfoSettings/WfoModifySettings.tsx +38 -0
  43. package/src/components/WfoSettings/WfoSettings.tsx +40 -0
  44. package/src/components/{WfoSettingsPage → WfoSettings}/WfoStatus.tsx +21 -14
  45. package/src/components/WfoStartPage/WfoListStartPage.tsx +3 -3
  46. package/src/components/WfoStartTaskButtonComboBox/WfoStartTaskButtonComboBox.tsx +14 -8
  47. package/src/components/WfoSubscription/WfoProcessesTimeline.tsx +11 -18
  48. package/src/components/WfoSubscription/WfoSubscription.tsx +1 -1
  49. package/src/components/WfoSubscription/WfoSubscriptionActions.tsx +41 -33
  50. package/src/components/WfoSubscription/WfoSubscriptionDetailTree.tsx +32 -22
  51. package/src/components/WfoSubscription/WfoSubscriptionProductBlock.tsx +94 -90
  52. package/src/components/WfoSubscription/WfoTargetTypeIcon.tsx +26 -0
  53. package/src/components/WfoSubscription/utils/utils.spec.ts +24 -0
  54. package/src/components/WfoSubscription/utils/utils.ts +16 -0
  55. package/src/components/WfoSubscriptionsList/WfoSubscriptionsList.tsx +17 -37
  56. package/src/components/WfoTable/WfoTableWithFilter/WfoTableWithFilter.tsx +20 -19
  57. package/src/components/WfoTable/WfoTableWithFilter/updateQueryString.spec.ts +95 -0
  58. package/src/components/WfoTable/WfoTableWithFilter/updateQueryString.ts +60 -0
  59. package/src/components/WfoTable/utils/tableUtils.ts +3 -3
  60. package/src/components/WfoTextAnchor/WfoTextAnchor.stories.tsx +18 -0
  61. package/src/components/WfoTextAnchor/WfoTextAnchor.tsx +22 -0
  62. package/src/components/WfoTextAnchor/index.ts +1 -0
  63. package/src/components/WfoTextAnchor/styles.ts +17 -0
  64. package/src/components/WfoTimeline/styles.ts +10 -4
  65. package/src/components/WfoWorkflowSteps/WfoStep/WfoStep.tsx +39 -24
  66. package/src/components/WfoWorkflowSteps/WfoStep/WfoStepForm.tsx +48 -0
  67. package/src/components/WfoWorkflowSteps/WfoStepList/WfoStepList.tsx +10 -10
  68. package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoStepListHeader.tsx +22 -23
  69. package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoWorkflowStepList.tsx +97 -17
  70. package/src/components/WfoWorkflowSteps/stepListUtils.ts +1 -28
  71. package/src/components/confirmationDialog/WfoConfirmationDialog.tsx +3 -3
  72. package/src/components/index.ts +6 -1
  73. package/src/contexts/ConfirmationDialogProvider.tsx +2 -2
  74. package/src/contexts/TreeContext.tsx +5 -0
  75. package/src/graphqlQueries/index.ts +1 -0
  76. package/src/graphqlQueries/processDetailQuery.ts +8 -0
  77. package/src/graphqlQueries/processListQuery.ts +7 -6
  78. package/src/graphqlQueries/processStepsQuery.ts +22 -0
  79. package/src/graphqlQueries/productBlocksQuery.ts +9 -5
  80. package/src/graphqlQueries/productsQuery.ts +7 -3
  81. package/src/graphqlQueries/relatedSubscriptionsQuery.ts +2 -2
  82. package/src/graphqlQueries/resourceTypesQuery.ts +8 -4
  83. package/src/graphqlQueries/subscriptionDetailQuery.ts +1 -0
  84. package/src/graphqlQueries/subscriptionsListQuery.ts +5 -3
  85. package/src/graphqlQueries/workflows/workflowsQuery.ts +8 -4
  86. package/src/graphqlQueries/workflows/workflowsQueryForDropdownList.ts +2 -2
  87. package/src/hooks/DataFetchHooks.ts +9 -4
  88. package/src/hooks/index.ts +3 -0
  89. package/src/hooks/useCheckEngineStatus.ts +30 -0
  90. package/src/hooks/useDataDisplayParams.ts +3 -3
  91. package/src/hooks/useEngineStatusQuery.ts +9 -7
  92. package/src/hooks/useMutateProcess.ts +96 -0
  93. package/src/messages/{en-US.json → en-GB.json} +85 -37
  94. package/src/messages/getTranslationMessages.spec.ts +25 -40
  95. package/src/messages/index.ts +1 -1
  96. package/src/messages/nl-NL.json +95 -48
  97. package/src/messages/useGetTranslationMessages.ts +51 -0
  98. package/src/pages/metadata/WfoProductBlocksPage.tsx +12 -10
  99. package/src/pages/metadata/WfoProductsPage.tsx +24 -25
  100. package/src/pages/metadata/WfoResourceTypesPage.tsx +12 -10
  101. package/src/pages/metadata/WfoWorkflowsPage.tsx +12 -10
  102. package/src/pages/processes/WfoProcessDetail.tsx +96 -79
  103. package/src/pages/processes/WfoProcessDetailPage.tsx +5 -3
  104. package/src/pages/{workflow/WfoStartWorkflowPage.tsx → processes/WfoStartProcessPage.tsx} +100 -50
  105. package/src/pages/processes/index.ts +1 -3
  106. package/src/pages/settings/WfoSettingsPage.tsx +30 -0
  107. package/src/pages/settings/index.ts +1 -0
  108. package/src/pages/tasks/WfoTaskListPage.tsx +35 -9
  109. package/src/pages/{processes/WfoProcessListPage.tsx → workflow/WfoWorkflowListPage.tsx} +22 -23
  110. package/src/pages/workflow/getWorkflowListTabTypeFromString.ts +19 -0
  111. package/src/pages/workflow/index.ts +1 -1
  112. package/src/pages/{processes → workflow}/tabConfig.ts +6 -6
  113. package/src/types/types.ts +33 -3
  114. package/src/utils/getDefaultTableConfig.ts +1 -1
  115. package/src/components/WfoSettingsPage/WfoModifySettings.tsx +0 -33
  116. package/src/components/WfoSettingsPage/WfoSettings.tsx +0 -40
  117. package/src/hooks/ProcessesHooks/useDeleteProcess.ts +0 -37
  118. package/src/messages/getTranslationMessages.ts +0 -26
  119. package/src/pages/processes/getProcessListTabTypeFromString.ts +0 -19
  120. /package/src/components/{WfoSettingsPage → WfoSettings}/index.ts +0 -0
@@ -0,0 +1,238 @@
1
+ /*
2
+ * Copyright 2019-2023 SURF.
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ *
8
+ * Unless required by applicable law or agreed to in writing, software
9
+ * distributed under the License is distributed on an "AS IS" BASIS,
10
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ * See the License for the specific language governing permissions and
12
+ * limitations under the License.
13
+ *
14
+ */
15
+ import React, { useCallback, useEffect, useState } from 'react';
16
+ import ReactSelect, { SingleValue } from 'react-select';
17
+
18
+ import { useTranslations } from 'next-intl';
19
+ import { connectField, filterDOMProps } from 'uniforms';
20
+
21
+ import { EuiFlexItem, EuiFormRow, EuiText } from '@elastic/eui';
22
+
23
+ import { getReactSelectInnerComponentStyles } from '@/components/WfoForms/formFields/reactSelectStyles';
24
+ import { useOrchestratorTheme } from '@/hooks';
25
+
26
+ import { useAxiosApiClient } from '../useAxiosApiClient';
27
+ import { imsPortIdFieldStyling } from './ImsPortIdFieldStyling';
28
+ import { ImsNode, ImsPort, NodeSubscription } from './surf/types';
29
+ import { FieldProps, Option } from './types';
30
+
31
+ export type ImsPortFieldProps = FieldProps<
32
+ number,
33
+ {
34
+ nodeSubscriptionId?: string;
35
+ interfaceSpeed: number | string;
36
+ imsPortMode?: 'patched' | 'unpatched' | 'all';
37
+ nodeStatuses?: ('active' | 'provisioning')[];
38
+ }
39
+ >;
40
+
41
+ function nodeToOptionCorelink(node: NodeSubscription): Option {
42
+ return {
43
+ value: node.subscription_id,
44
+ label: `${node.subscription_id.substring(0, 8)} ${
45
+ node.description.trim() || '<No description>'
46
+ }`,
47
+ };
48
+ }
49
+
50
+ declare module 'uniforms' {
51
+ interface FilterDOMProps {
52
+ nodeSubscriptionId: never;
53
+ interfaceSpeed: never;
54
+ nodeStatuses: never;
55
+ imsPortMode: never;
56
+ }
57
+ }
58
+ filterDOMProps.register(
59
+ 'nodeSubscriptionId',
60
+ 'interfaceSpeed',
61
+ 'nodeStatuses',
62
+ 'imsPortMode',
63
+ );
64
+
65
+ function ImsPortId({
66
+ id,
67
+ name,
68
+ label,
69
+ description,
70
+ onChange,
71
+ value,
72
+ disabled,
73
+ readOnly,
74
+ error,
75
+ showInlineError,
76
+ errorMessage,
77
+ nodeSubscriptionId,
78
+ interfaceSpeed,
79
+ imsPortMode = 'all',
80
+ nodeStatuses,
81
+ ...props
82
+ }: ImsPortFieldProps) {
83
+ const apiClient = useAxiosApiClient();
84
+ const t = useTranslations('pydanticForms');
85
+ const { theme } = useOrchestratorTheme();
86
+ // React select allows callbacks to supply style for innercomponents: https://react-select.com/styles#inner-components
87
+ const reactSelectInnerComponentStyles =
88
+ getReactSelectInnerComponentStyles(theme);
89
+
90
+ const [nodes, setNodes] = useState<ImsNode[] | NodeSubscription[]>([]);
91
+ const [nodeId, setNodeId] = useState<number | string | undefined>(
92
+ nodeSubscriptionId,
93
+ );
94
+ const [ports, setPorts] = useState<ImsPort[]>([]);
95
+ const [loading, setLoading] = useState(true);
96
+
97
+ const onChangeNodes = useCallback(
98
+ (option: SingleValue<Option>) => {
99
+ const value = option?.value;
100
+
101
+ if (value === undefined) {
102
+ return;
103
+ }
104
+
105
+ setLoading(true);
106
+ setNodeId(value);
107
+ setPorts([]);
108
+
109
+ apiClient
110
+ .getFreePortsByNodeSubscriptionIdAndSpeed(
111
+ value as string,
112
+ interfaceSpeed as number,
113
+ imsPortMode,
114
+ )
115
+ .then((result) => {
116
+ setPorts(result);
117
+ setLoading(false);
118
+ });
119
+ },
120
+ [interfaceSpeed, imsPortMode, apiClient],
121
+ );
122
+
123
+ useEffect(() => {
124
+ setLoading(true);
125
+
126
+ const nodesPromise = apiClient.nodeSubscriptions(
127
+ nodeStatuses ?? ['active'],
128
+ );
129
+ if (nodeSubscriptionId) {
130
+ nodesPromise.then((result) => {
131
+ setNodes(
132
+ result.filter(
133
+ (subscription) =>
134
+ subscription.subscription_id === nodeSubscriptionId,
135
+ ),
136
+ );
137
+ setLoading(false);
138
+ onChangeNodes({ value: nodeSubscriptionId } as Option);
139
+ });
140
+ } else {
141
+ nodesPromise.then((result) => {
142
+ setNodes(result);
143
+ setLoading(false);
144
+ });
145
+ }
146
+ }, [onChangeNodes, nodeStatuses, nodeSubscriptionId, apiClient]);
147
+ const nodesPlaceholder = loading
148
+ ? t('widgets.nodePort.loadingNodes')
149
+ : t('widgets.nodePort.selectNode');
150
+
151
+ const portPlaceholder = loading
152
+ ? t('widgets.nodePort.loadingPorts')
153
+ : nodeId
154
+ ? t('widgets.nodePort.selectPort')
155
+ : t('widgets.nodePort.selectNodeFirst');
156
+
157
+ const node_options: Option[] = (nodes as NodeSubscription[]).map(
158
+ nodeToOptionCorelink,
159
+ );
160
+
161
+ node_options.sort((x, y) => x.label.localeCompare(y.label));
162
+ const node_value = node_options.find(
163
+ (option) => option.value === nodeId?.toString(),
164
+ );
165
+
166
+ const port_options: Option<number>[] = ports
167
+ .map((aPort) => ({
168
+ value: aPort.id,
169
+ label: `${aPort.port} (${aPort.status}) (${aPort.iface_type})`,
170
+ }))
171
+ .sort((x, y) => x.label.localeCompare(y.label));
172
+ const port_value = port_options.find((option) => option.value === value);
173
+
174
+ return (
175
+ <EuiFlexItem css={imsPortIdFieldStyling}>
176
+ <section {...filterDOMProps(props)}>
177
+ <EuiFormRow
178
+ label={label}
179
+ labelAppend={<EuiText size="m">{description}</EuiText>}
180
+ error={showInlineError ? errorMessage : false}
181
+ isInvalid={error}
182
+ id={id}
183
+ fullWidth
184
+ >
185
+ <section className="node-port">
186
+ <div className="node-select">
187
+ <EuiFormRow
188
+ label="Node"
189
+ id={`${id}.node`}
190
+ fullWidth
191
+ >
192
+ <ReactSelect<Option, false>
193
+ inputId={`${id}.node.search`}
194
+ name={`${name}.node`}
195
+ onChange={onChangeNodes}
196
+ options={node_options}
197
+ placeholder={nodesPlaceholder}
198
+ value={node_value}
199
+ isSearchable={true}
200
+ isDisabled={
201
+ disabled ||
202
+ readOnly ||
203
+ !!nodeSubscriptionId ||
204
+ nodes.length === 0
205
+ }
206
+ styles={reactSelectInnerComponentStyles}
207
+ />
208
+ </EuiFormRow>
209
+ </div>
210
+ <div className="port-select">
211
+ <EuiFormRow label="Port" id={id} fullWidth>
212
+ <ReactSelect<Option<number>, false>
213
+ inputId={`${id}.search`}
214
+ name={name}
215
+ onChange={(selected) => {
216
+ onChange(selected?.value);
217
+ }}
218
+ options={port_options}
219
+ placeholder={portPlaceholder}
220
+ value={port_value}
221
+ isSearchable={true}
222
+ isDisabled={
223
+ disabled ||
224
+ readOnly ||
225
+ ports.length === 0
226
+ }
227
+ styles={reactSelectInnerComponentStyles}
228
+ />
229
+ </EuiFormRow>
230
+ </div>
231
+ </section>
232
+ </EuiFormRow>
233
+ </section>
234
+ </EuiFlexItem>
235
+ );
236
+ }
237
+
238
+ export const ImsPortIdField = connectField(ImsPortId, { kind: 'leaf' });
@@ -0,0 +1,17 @@
1
+ import { css } from '@emotion/react';
2
+
3
+ export const imsPortIdFieldStyling = css`
4
+ section.node-port {
5
+ display: flex;
6
+ flex-direction: row;
7
+ flex-wrap: wrap;
8
+
9
+ div.node-select {
10
+ width: 50%;
11
+ }
12
+ div.port-select {
13
+ width: 50%;
14
+ padding-left: 5px;
15
+ }
16
+ }
17
+ `;
@@ -39,7 +39,7 @@ function ListAdd({
39
39
  ...props
40
40
  }: ListAddFieldProps) {
41
41
  const { theme } = useOrchestratorTheme();
42
- const t = useTranslations('pydanticForms.fields');
42
+ const t = useTranslations('pydanticForms.backendTranslations');
43
43
 
44
44
  const nameParts = joinName(null, name);
45
45
  const parentName = joinName(nameParts.slice(0, -1));
@@ -37,7 +37,7 @@ function ListDel({
37
37
  ...props
38
38
  }: ListDelFieldProps) {
39
39
  const { theme } = useOrchestratorTheme();
40
- const t = useTranslations('pydanticForms.fields');
40
+ const t = useTranslations('pydanticForms.backendTranslations');
41
41
 
42
42
  const nameParts = joinName(null, name);
43
43
  const nameIndex = +nameParts[nameParts.length - 1];
@@ -38,7 +38,7 @@ function OptGroup({
38
38
  className = '',
39
39
  ...props
40
40
  }: OptGroupFieldProps) {
41
- const t = useTranslations('pydanticForms.fields');
41
+ const t = useTranslations('pydanticForms.backendTranslations');
42
42
  const enabled = useField('enabled', {})[0].value;
43
43
 
44
44
  return (
@@ -250,7 +250,8 @@ function SubscriptionFieldDefinition({
250
250
  if (parentName !== name) {
251
251
  if (
252
252
  parent.fieldType === Array &&
253
- // @ts-ignore
253
+ // @ts-expect-error Parent field can have the uniqueItems boolean property but this is not part of JSONSchema6 type
254
+ // TODO: Figure out why this is so
254
255
  parent.uniqueItems
255
256
  ) {
256
257
  const allValues: string[] = get(model, parentName, []);
@@ -0,0 +1,103 @@
1
+ /*
2
+ * Copyright 2019-2023 SURF.
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ *
8
+ * Unless required by applicable law or agreed to in writing, software
9
+ * distributed under the License is distributed on an "AS IS" BASIS,
10
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ * See the License for the specific language governing permissions and
12
+ * limitations under the License.
13
+ *
14
+ */
15
+ import React from 'react';
16
+
17
+ import { FieldProps, connectField, filterDOMProps } from 'uniforms';
18
+
19
+ import { EuiFlexItem, EuiFormRow, EuiText } from '@elastic/eui';
20
+
21
+ import { getStyles } from '@/components/WfoForms/formFields/SummaryFieldStyling';
22
+ import { useWithOrchestratorTheme } from '@/hooks';
23
+
24
+ export type SummaryFieldProps = FieldProps<
25
+ null,
26
+ {
27
+ description?: string;
28
+ data?: { headers: string[]; labels: string[]; columns: string[][] };
29
+ }
30
+ >;
31
+
32
+ // onChange not used on purpose
33
+ function Summary({
34
+ id,
35
+ label,
36
+ description,
37
+ data,
38
+ ...props
39
+ }: SummaryFieldProps) {
40
+ const { summaryFieldStyle } = useWithOrchestratorTheme(getStyles);
41
+
42
+ if (!data) {
43
+ return null;
44
+ }
45
+
46
+ const { headers, labels, columns } = data;
47
+
48
+ const extraColumnsData = columns.filter((_, index) => index !== 0);
49
+
50
+ const rows = columns[0].map((row, index) => (
51
+ <tr key={index}>
52
+ {labels && <td className={`label`}>{labels[index]}</td>}
53
+ <td className={`value`}>
54
+ {row.includes('<!doctype html>') ? (
55
+ <div
56
+ className="emailMessage"
57
+ dangerouslySetInnerHTML={{ __html: row }}
58
+ ></div>
59
+ ) : (
60
+ row
61
+ )}
62
+ </td>
63
+ {extraColumnsData &&
64
+ extraColumnsData.map((_, idx) => (
65
+ <td className={`value`} key={idx}>
66
+ {extraColumnsData[idx][index]}
67
+ </td>
68
+ ))}
69
+ </tr>
70
+ ));
71
+
72
+ const tableHeader =
73
+ !headers || headers.length === 0 ? null : (
74
+ <tr>
75
+ {labels && <th />}
76
+ {headers.map((header, idx) => (
77
+ <th key={idx}>{header}</th>
78
+ ))}
79
+ </tr>
80
+ );
81
+
82
+ return (
83
+ <EuiFlexItem css={summaryFieldStyle}>
84
+ <section {...filterDOMProps(props)}>
85
+ <EuiFormRow
86
+ label={label}
87
+ labelAppend={<EuiText size="m">{description}</EuiText>}
88
+ id={id}
89
+ fullWidth
90
+ >
91
+ <section className="table-summary">
92
+ <table id={`${id}-table`}>
93
+ <thead>{tableHeader}</thead>
94
+ <tbody>{rows}</tbody>
95
+ </table>
96
+ </section>
97
+ </EuiFormRow>
98
+ </section>
99
+ </EuiFlexItem>
100
+ );
101
+ }
102
+
103
+ export const SummaryField = connectField(Summary, { kind: 'leaf' });
@@ -0,0 +1,46 @@
1
+ import { tint } from '@elastic/eui';
2
+ import { EuiThemeComputed } from '@elastic/eui/src/services/theme/types';
3
+ import { css } from '@emotion/react';
4
+
5
+ export const getStyles = (theme: EuiThemeComputed) => {
6
+ const toShadeColor = (color: string) => tint(color, 0.9);
7
+
8
+ const summaryFieldStyle = css({
9
+ 'div.emailMessage': {
10
+ td: {
11
+ color: theme.colors.text,
12
+ },
13
+ p: {
14
+ color: theme.colors.text,
15
+ },
16
+ html: {
17
+ marginLeft: '-10px',
18
+ },
19
+ },
20
+ 'section.table-summary': {
21
+ marginTop: '20px',
22
+ width: '100%',
23
+ td: {
24
+ padding: '10px',
25
+ verticalAlign: 'top',
26
+ },
27
+ 'td:not(:first-child):not(:last-child)': {
28
+ borderRight: `1px solid ${theme.colors.lightestShade}`,
29
+ },
30
+ '.label': {
31
+ fontWeight: 'bold',
32
+ color: theme.colors.lightestShade,
33
+ backgroundColor: theme.colors.primary,
34
+ borderRight: `2px solid ${theme.colors.lightestShade}`,
35
+ borderBottom: `1px solid ${theme.colors.lightestShade}`,
36
+ },
37
+ '.value': {
38
+ backgroundColor: toShadeColor(theme.colors.primary),
39
+ borderBottom: `1px solid ${theme.colors.lightestShade}`,
40
+ },
41
+ },
42
+ });
43
+ return {
44
+ summaryFieldStyle: summaryFieldStyle,
45
+ };
46
+ };
@@ -210,20 +210,20 @@ function Vlan({
210
210
  const placeholder = imsIsLoading
211
211
  ? t('widgets.vlan.loadingIms')
212
212
  : subscriptionId
213
- ? t('widgets.vlan.placeholder')
214
- : t('widgets.vlan.placeholderNoServicePort');
213
+ ? t('widgets.vlan.placeholder')
214
+ : t('widgets.vlan.placeholderNoServicePort');
215
215
 
216
216
  const errorMessageExtra = missingInIms
217
217
  ? t('widgets.vlan.missingInIms')
218
218
  : !validFormat
219
- ? t('widgets.vlan.invalidVlan')
220
- : vlansInUse.length
221
- ? vlansInUse.length >= 1 && vlansInUse[0] === 0
222
- ? t('widgets.vlan.untaggedPortInUse')
223
- : t('widgets.vlan.vlansInUseError', {
224
- vlans: vlanRangeFromNumbers(vlansInUse),
225
- })
226
- : undefined;
219
+ ? t('widgets.vlan.invalidVlan')
220
+ : vlansInUse.length
221
+ ? vlansInUse.length >= 1 && vlansInUse[0] === 0
222
+ ? t('widgets.vlan.untaggedPortInUse')
223
+ : t('widgets.vlan.vlansInUseError', {
224
+ vlans: vlanRangeFromNumbers(vlansInUse),
225
+ })
226
+ : undefined;
227
227
 
228
228
  let message = '';
229
229
  if (!imsIsLoading) {
@@ -21,9 +21,11 @@ export * from './TimestampField';
21
21
  export * from './OrganisationField';
22
22
  export * from './ContactPersonNameField';
23
23
  export * from './ImsNodeIdField';
24
+ export * from './ImsPortIdField';
24
25
  export * from './LocationCodeField';
25
26
  export * from './VlanField';
26
27
  export * from './NestField';
27
28
  export * from './OptGroupField';
28
29
  export * from './SubscriptionField';
29
30
  export * from './IpNetworkField';
31
+ export * from './SummaryField';
@@ -1,3 +1,19 @@
1
+ import { ProductDefinition } from '../../../../types';
2
+
3
+ export interface NodeSubscription {
4
+ name: string;
5
+ subscription_id: string;
6
+ description: string;
7
+ product: ProductDefinition;
8
+ product_id: string;
9
+ status: string;
10
+ insync: boolean;
11
+ customer_id: string;
12
+ start_date: number;
13
+ end_date: number;
14
+ note: string;
15
+ }
16
+
1
17
  export interface ServicePort {
2
18
  subscription_id?: string;
3
19
  vlan?: string;
@@ -22,6 +38,16 @@ export enum ProductTag {
22
38
  AGGSPNL = 'AGGSPNL',
23
39
  }
24
40
 
41
+ export interface ImsPort {
42
+ id: number;
43
+ line_name: string;
44
+ node: string;
45
+ port: string;
46
+ iface_type: string;
47
+ patchposition: string;
48
+ status: string;
49
+ }
50
+
25
51
  export interface ImsNode {
26
52
  id: number;
27
53
  name: string;
@@ -51,6 +51,7 @@ const testSubscriptionDetail: SubscriptionDetail = {
51
51
  createdBy: 'Test',
52
52
  workflowTarget: WorkflowTarget.CREATE,
53
53
  workflowName: 'Test workflow name',
54
+ isTask: false,
54
55
  },
55
56
  ],
56
57
  },
@@ -0,0 +1 @@
1
+ export * from './WfoJsonCodeBlock';
@@ -54,7 +54,6 @@ export const WfoPageHeader: FC<WfoPageHeaderProps> = ({
54
54
  <WfoLogoutIcon color={theme.colors.emptyShade} />
55
55
  )}
56
56
  css={{ width: 48, height: 48, marginLeft: 10 }}
57
- color="ghost"
58
57
  onClick={handleSideMenuClick}
59
58
  />
60
59
  </EuiHeaderSection>
@@ -72,8 +71,10 @@ export const WfoPageHeader: FC<WfoPageHeaderProps> = ({
72
71
  iconType={() => (
73
72
  <WfoLogoutIcon color={theme.colors.emptyShade} />
74
73
  )}
75
- css={{ width: 48, height: 48 }}
76
- color="ghost"
74
+ css={{
75
+ width: 48,
76
+ height: 48,
77
+ }}
77
78
  onClick={handleLogoutClick}
78
79
  />
79
80
  </EuiHeaderSectionItem>
@@ -12,11 +12,11 @@ import {
12
12
  PATH_METADATA_PRODUCT_BLOCKS,
13
13
  PATH_METADATA_RESOURCE_TYPES,
14
14
  PATH_METADATA_WORKFLOWS,
15
- PATH_PROCESSES,
16
15
  PATH_SETTINGS,
17
16
  PATH_START,
18
17
  PATH_SUBSCRIPTIONS,
19
18
  PATH_TASKS,
19
+ PATH_WORKFLOWS,
20
20
  } from '../paths';
21
21
  import { WfoStartCreateWorkflowButtonComboBox } from './WfoStartCreateWorkflowButtonComboBox';
22
22
 
@@ -37,7 +37,7 @@ export const WfoSidebar: FC<WfoSidebarProps> = ({ overrideMenuItems }) => {
37
37
 
38
38
  const defaultMenuItems: EuiSideNavItemType<object>[] = [
39
39
  {
40
- name: 'Start',
40
+ name: t('start'),
41
41
  id: '2',
42
42
  isSelected: router.pathname === PATH_START,
43
43
  onClick: (e) => {
@@ -46,17 +46,17 @@ export const WfoSidebar: FC<WfoSidebarProps> = ({ overrideMenuItems }) => {
46
46
  },
47
47
  },
48
48
  {
49
- name: 'Processes',
49
+ name: t('workflows'),
50
50
  id: '3',
51
- isSelected: router.pathname === PATH_PROCESSES,
52
- href: PATH_PROCESSES,
51
+ isSelected: router.pathname === PATH_WORKFLOWS,
52
+ href: PATH_WORKFLOWS,
53
53
  onClick: (e) => {
54
54
  e.preventDefault();
55
- router.push(PATH_PROCESSES);
55
+ router.push(PATH_WORKFLOWS);
56
56
  },
57
57
  },
58
58
  {
59
- name: 'Subscriptions',
59
+ name: t('subscriptions'),
60
60
  id: '4',
61
61
  isSelected: router.pathname === PATH_SUBSCRIPTIONS,
62
62
  href: PATH_SUBSCRIPTIONS,
@@ -66,14 +66,14 @@ export const WfoSidebar: FC<WfoSidebarProps> = ({ overrideMenuItems }) => {
66
66
  },
67
67
  },
68
68
  {
69
- name: 'Metadata',
69
+ name: t('metadata'),
70
70
  id: '5',
71
71
  onClick: () => {
72
72
  router.push(PATH_METADATA);
73
73
  },
74
74
  items: [
75
75
  {
76
- name: 'Products',
76
+ name: t('metadataProducts'),
77
77
  id: '5.1',
78
78
  isSelected: router.pathname === PATH_METADATA_PRODUCTS,
79
79
  onClick: (e) => {
@@ -82,7 +82,7 @@ export const WfoSidebar: FC<WfoSidebarProps> = ({ overrideMenuItems }) => {
82
82
  },
83
83
  },
84
84
  {
85
- name: 'Product blocks',
85
+ name: t('metadataProductblocks'),
86
86
  id: '5.2',
87
87
  isSelected:
88
88
  router.pathname === PATH_METADATA_PRODUCT_BLOCKS,
@@ -92,7 +92,7 @@ export const WfoSidebar: FC<WfoSidebarProps> = ({ overrideMenuItems }) => {
92
92
  },
93
93
  },
94
94
  {
95
- name: 'Resource types',
95
+ name: t('metadataResourceTypes'),
96
96
  id: '5.3',
97
97
  isSelected:
98
98
  router.pathname === PATH_METADATA_RESOURCE_TYPES,
@@ -102,7 +102,7 @@ export const WfoSidebar: FC<WfoSidebarProps> = ({ overrideMenuItems }) => {
102
102
  },
103
103
  },
104
104
  {
105
- name: 'Workflows',
105
+ name: t('metadataWorkflows'),
106
106
  id: '5.4',
107
107
  isSelected: router.pathname === PATH_METADATA_WORKFLOWS,
108
108
  onClick: (e) => {
@@ -113,7 +113,7 @@ export const WfoSidebar: FC<WfoSidebarProps> = ({ overrideMenuItems }) => {
113
113
  ],
114
114
  },
115
115
  {
116
- name: 'Tasks',
116
+ name: t('tasks'),
117
117
  isSelected: router.pathname === PATH_TASKS,
118
118
  id: '6',
119
119
  onClick: (e) => {
@@ -123,7 +123,7 @@ export const WfoSidebar: FC<WfoSidebarProps> = ({ overrideMenuItems }) => {
123
123
  href: PATH_TASKS,
124
124
  },
125
125
  {
126
- name: 'Settings',
126
+ name: t('settings'),
127
127
  isSelected: router.pathname === PATH_SETTINGS,
128
128
  id: '7',
129
129
  onClick: (e) => {