@orchestrator-ui/orchestrator-ui-components 6.8.0 → 7.0.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 +9 -10
- package/CHANGELOG.md +19 -0
- package/dist/index.d.ts +164 -4306
- package/dist/index.js +1739 -5747
- package/dist/index.js.map +1 -1
- package/package.json +4 -8
- package/src/components/WfoPydanticForm/Footer.tsx +33 -6
- package/src/components/WfoPydanticForm/RenderFormErrors.tsx +2 -1
- package/src/components/WfoPydanticForm/Row.tsx +3 -1
- package/src/components/WfoPydanticForm/fields/WfoInteger.tsx +5 -1
- package/src/components/WfoPydanticForm/fields/WfoSummary.tsx +3 -5
- package/src/components/WfoPydanticForm/fields/styles.ts +72 -0
- package/src/components/WfoSearchPage/WfoSearch/WfoSearch.tsx +42 -54
- package/src/components/WfoSearchPage/utils.ts +9 -1
- package/src/components/WfoWorkflowSteps/WfoStep/WfoStep.tsx +10 -27
- package/src/components/WfoWorkflowSteps/WfoStep/WfoStepForm.tsx +1 -1
- package/src/components/index.ts +0 -1
- package/src/configuration/version.ts +1 -1
- package/src/contexts/OrchestratorConfigContext.tsx +0 -1
- package/src/hooks/useSearch.ts +12 -2
- package/src/hooks/useSearchPagination.ts +4 -0
- package/src/messages/en-GB.json +5 -3
- package/src/pages/processes/WfoStartProcessPage.tsx +5 -107
- package/src/rtk/endpoints/index.ts +0 -2
- package/src/rtk/endpoints/search.ts +13 -4
- package/src/types/index.ts +0 -1
- package/src/types/search.ts +7 -0
- package/src/types/types.ts +0 -1
- package/src/components/WfoForms/AutoFieldLoader.tsx +0 -118
- package/src/components/WfoForms/AutoFields.tsx +0 -49
- package/src/components/WfoForms/CreateForm.tsx +0 -75
- package/src/components/WfoForms/UserInputForm.tsx +0 -697
- package/src/components/WfoForms/UserInputFormStyling.ts +0 -80
- package/src/components/WfoForms/UserInputFormWizard.tsx +0 -127
- package/src/components/WfoForms/formFields/AcceptField.tsx +0 -243
- package/src/components/WfoForms/formFields/AcceptFieldStyling.ts +0 -35
- package/src/components/WfoForms/formFields/BoolField.tsx +0 -77
- package/src/components/WfoForms/formFields/BoolFieldStyling.ts +0 -64
- package/src/components/WfoForms/formFields/ConnectedSelectField.tsx +0 -19
- package/src/components/WfoForms/formFields/CustomerField.tsx +0 -77
- package/src/components/WfoForms/formFields/DateField.tsx +0 -72
- package/src/components/WfoForms/formFields/DividerField.tsx +0 -29
- package/src/components/WfoForms/formFields/ErrorField.tsx +0 -40
- package/src/components/WfoForms/formFields/ErrorsField.tsx +0 -34
- package/src/components/WfoForms/formFields/LabelField.tsx +0 -43
- package/src/components/WfoForms/formFields/ListAddField.tsx +0 -95
- package/src/components/WfoForms/formFields/ListDelField.tsx +0 -95
- package/src/components/WfoForms/formFields/ListField.tsx +0 -117
- package/src/components/WfoForms/formFields/ListItemField.tsx +0 -40
- package/src/components/WfoForms/formFields/ListSelectField.tsx +0 -95
- package/src/components/WfoForms/formFields/LocationCodeField.tsx +0 -60
- package/src/components/WfoForms/formFields/LongTextField.tsx +0 -68
- package/src/components/WfoForms/formFields/NestField.tsx +0 -107
- package/src/components/WfoForms/formFields/NumField.tsx +0 -85
- package/src/components/WfoForms/formFields/OptGroupField.tsx +0 -74
- package/src/components/WfoForms/formFields/RadioField.tsx +0 -87
- package/src/components/WfoForms/formFields/SelectField/SelectField.tsx +0 -177
- package/src/components/WfoForms/formFields/SelectField/index.ts +0 -1
- package/src/components/WfoForms/formFields/SelectField/styles.ts +0 -52
- package/src/components/WfoForms/formFields/SubmitField.tsx +0 -50
- package/src/components/WfoForms/formFields/SubscriptionSummaryField.tsx +0 -74
- package/src/components/WfoForms/formFields/SummaryField.tsx +0 -104
- package/src/components/WfoForms/formFields/SummaryFieldStyling.ts +0 -44
- package/src/components/WfoForms/formFields/TextField.tsx +0 -81
- package/src/components/WfoForms/formFields/commonStyles.ts +0 -32
- package/src/components/WfoForms/formFields/deprecated/ContactPersonAutocomplete.tsx +0 -99
- package/src/components/WfoForms/formFields/deprecated/ContactPersonAutocompleteStyles.ts +0 -41
- package/src/components/WfoForms/formFields/deprecated/ContactPersonNameField.tsx +0 -263
- package/src/components/WfoForms/formFields/deprecated/FileUploadField.tsx +0 -151
- package/src/components/WfoForms/formFields/deprecated/ImsNodeIdField.tsx +0 -109
- package/src/components/WfoForms/formFields/deprecated/ImsPortIdField.tsx +0 -233
- package/src/components/WfoForms/formFields/deprecated/ImsPortIdFieldStyling.ts +0 -17
- package/src/components/WfoForms/formFields/deprecated/IpNetworkField.tsx +0 -105
- package/src/components/WfoForms/formFields/deprecated/IpPrefixTableField.tsx +0 -390
- package/src/components/WfoForms/formFields/deprecated/IpPrefixTableFieldStyling.ts +0 -117
- package/src/components/WfoForms/formFields/deprecated/SplitPrefix.tsx +0 -138
- package/src/components/WfoForms/formFields/deprecated/SplitPrefixStyling.ts +0 -11
- package/src/components/WfoForms/formFields/deprecated/SubscriptionField.tsx +0 -263
- package/src/components/WfoForms/formFields/deprecated/SubscriptionFieldStyling.ts +0 -33
- package/src/components/WfoForms/formFields/deprecated/TimestampField.tsx +0 -110
- package/src/components/WfoForms/formFields/deprecated/VlanField.tsx +0 -300
- package/src/components/WfoForms/formFields/deprecated/index.ts +0 -15
- package/src/components/WfoForms/formFields/deprecated/types.ts +0 -74
- package/src/components/WfoForms/formFields/deprecated/utils.ts +0 -1
- package/src/components/WfoForms/formFields/index.ts +0 -30
- package/src/components/WfoForms/formFields/listFieldStyling.ts +0 -86
- package/src/components/WfoForms/formFields/types.ts +0 -41
- package/src/components/WfoForms/formFields/utils.spec.ts +0 -296
- package/src/components/WfoForms/formFields/utils.ts +0 -69
- package/src/components/WfoForms/index.ts +0 -5
- package/src/components/WfoWorkflowSteps/WfoStep/WfoStepFormOld.tsx +0 -67
- package/src/hooks/deprecated/useGetSurfSubcriptionDropdownOptions.ts +0 -37
- package/src/hooks/deprecated/useIsTaggedPort.ts +0 -25
- package/src/rtk/endpoints/deprecated/index.ts +0 -1
- package/src/rtk/endpoints/deprecated/surfSubscriptionDropdownOptions.ts +0 -53
- package/src/rtk/endpoints/formFields.ts +0 -131
- package/src/rtk/endpoints/ipam.ts +0 -54
- package/src/types/deprecated/SurfSubscriptionDropdownOptionsFilterParams.ts +0 -10
- package/src/types/deprecated/index.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orchestrator-ui/orchestrator-ui-components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Library of UI Components used to display the workflow orchestrator frontend",
|
|
6
6
|
"author": {
|
|
@@ -54,16 +54,13 @@
|
|
|
54
54
|
"next-query-params": "^5.0.0",
|
|
55
55
|
"object-hash": "^3.0.0",
|
|
56
56
|
"prism-themes": "^1.9.0",
|
|
57
|
-
"pydantic-forms": "^0.
|
|
57
|
+
"pydantic-forms": "^1.0.0",
|
|
58
58
|
"react-diff-view": "^3.2.0",
|
|
59
59
|
"react-draggable": "^4.4.6",
|
|
60
60
|
"react-redux": "^9.1.2",
|
|
61
61
|
"react-select": "^5.8.0",
|
|
62
62
|
"scroll-into-view": "^1.16.2",
|
|
63
63
|
"unidiff": "^1.0.4",
|
|
64
|
-
"uniforms": "^3.8.1",
|
|
65
|
-
"uniforms-bridge-json-schema": "^3.8.1",
|
|
66
|
-
"uniforms-unstyled": "^3.8.1",
|
|
67
64
|
"use-query-params": "2.2.1"
|
|
68
65
|
},
|
|
69
66
|
"devDependencies": {
|
|
@@ -82,11 +79,10 @@
|
|
|
82
79
|
"jest-environment-jsdom": "^30.2.0",
|
|
83
80
|
"jest-watch-typeahead": "^3.0.1",
|
|
84
81
|
"tsup": "^8.5.0",
|
|
85
|
-
"typescript": "^5.5.2"
|
|
86
|
-
"uniforms-bridge-simple-schema-2": "^3.8.1"
|
|
82
|
+
"typescript": "^5.5.2"
|
|
87
83
|
},
|
|
88
84
|
"peerDependencies": {
|
|
89
|
-
"next": "^15.5.
|
|
85
|
+
"next": "^15.5.9",
|
|
90
86
|
"react": "^18.3.1",
|
|
91
87
|
"react-dom": "^18.3.1"
|
|
92
88
|
},
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Form footer component
|
|
5
5
|
*/
|
|
6
|
-
import React, { useContext } from 'react';
|
|
6
|
+
import React, { useContext, useEffect } from 'react';
|
|
7
7
|
|
|
8
8
|
import { useTranslations } from 'next-intl';
|
|
9
9
|
import type { PydanticFormFooterProps } from 'pydantic-forms';
|
|
@@ -21,6 +21,10 @@ type FooterProps = PydanticFormFooterProps & {
|
|
|
21
21
|
isTask?: boolean;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
+
const submitButtonId = 'button-submit-form-submit';
|
|
25
|
+
const previousButtonId = 'button-submit-form-previous';
|
|
26
|
+
const cancelButtonId = 'button-submit-form-cancel';
|
|
27
|
+
|
|
24
28
|
export const Footer = ({
|
|
25
29
|
onCancel,
|
|
26
30
|
onPrevious,
|
|
@@ -44,6 +48,29 @@ export const Footer = ({
|
|
|
44
48
|
|
|
45
49
|
const { next, previous } = buttons || {};
|
|
46
50
|
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
const handleKeyDown = (event: KeyboardEvent) => {
|
|
53
|
+
const isPrimary = event.metaKey || event.ctrlKey;
|
|
54
|
+
|
|
55
|
+
if (isPrimary && event.key === 'ArrowLeft') {
|
|
56
|
+
event.preventDefault();
|
|
57
|
+
|
|
58
|
+
if (hasPrevious) {
|
|
59
|
+
onPrevious?.();
|
|
60
|
+
} else {
|
|
61
|
+
handlePrevious();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (isPrimary && event.key === 'ArrowRight') {
|
|
66
|
+
event.preventDefault();
|
|
67
|
+
document.getElementById(submitButtonId)?.click();
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
71
|
+
return () => window.removeEventListener('keydown', handleKeyDown);
|
|
72
|
+
}, [hasPrevious, hasNext, onPrevious, onCancel, handlePrevious]);
|
|
73
|
+
|
|
47
74
|
const PreviousButton = () => {
|
|
48
75
|
const previousButtonColor =
|
|
49
76
|
theme.colors[
|
|
@@ -53,8 +80,8 @@ export const Footer = ({
|
|
|
53
80
|
|
|
54
81
|
return (
|
|
55
82
|
<EuiButton
|
|
56
|
-
data-testid=
|
|
57
|
-
id=
|
|
83
|
+
data-testid={previousButtonId}
|
|
84
|
+
id={previousButtonId}
|
|
58
85
|
tabIndex={0}
|
|
59
86
|
fill
|
|
60
87
|
onClick={() => {
|
|
@@ -76,7 +103,7 @@ export const Footer = ({
|
|
|
76
103
|
|
|
77
104
|
const CancelButton = () => (
|
|
78
105
|
<div
|
|
79
|
-
data-testid=
|
|
106
|
+
data-testid={cancelButtonId}
|
|
80
107
|
onClick={handlePrevious}
|
|
81
108
|
css={{
|
|
82
109
|
cursor: 'pointer',
|
|
@@ -120,8 +147,8 @@ export const Footer = ({
|
|
|
120
147
|
|
|
121
148
|
return (
|
|
122
149
|
<EuiButton
|
|
123
|
-
data-testid=
|
|
124
|
-
id=
|
|
150
|
+
data-testid={submitButtonId}
|
|
151
|
+
id={submitButtonId}
|
|
125
152
|
tabIndex={0}
|
|
126
153
|
fill
|
|
127
154
|
css={{
|
|
@@ -8,9 +8,10 @@ import React from 'react';
|
|
|
8
8
|
import { useTranslations } from 'next-intl';
|
|
9
9
|
import { useGetValidationErrors } from 'pydantic-forms';
|
|
10
10
|
|
|
11
|
-
import { getCommonFormFieldStyles } from '@/components';
|
|
12
11
|
import { useWithOrchestratorTheme } from '@/hooks';
|
|
13
12
|
|
|
13
|
+
import { getCommonFormFieldStyles } from './fields/styles';
|
|
14
|
+
|
|
14
15
|
export const RenderFormErrors = () => {
|
|
15
16
|
const { errorStyle } = useWithOrchestratorTheme(getCommonFormFieldStyles);
|
|
16
17
|
|
|
@@ -4,9 +4,11 @@ import type { RowRenderComponent } from 'pydantic-forms';
|
|
|
4
4
|
|
|
5
5
|
import { EuiFormRow, EuiText } from '@elastic/eui';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { getDataTestId } from '@/components';
|
|
8
8
|
import { useWithOrchestratorTheme } from '@/hooks';
|
|
9
9
|
|
|
10
|
+
import { getCommonFormFieldStyles } from './fields/styles';
|
|
11
|
+
|
|
10
12
|
export const Row: RowRenderComponent = ({
|
|
11
13
|
title,
|
|
12
14
|
description,
|
|
@@ -47,7 +47,11 @@ export const WfoInteger: PydanticFormControlledElement = ({
|
|
|
47
47
|
data-testid={pydanticFormField.id}
|
|
48
48
|
css={formFieldBaseStyle}
|
|
49
49
|
name={pydanticFormField.id}
|
|
50
|
-
onChange={(event) =>
|
|
50
|
+
onChange={(event) =>
|
|
51
|
+
onChange(
|
|
52
|
+
event.target.value ? parseInt(event.target.value) : null,
|
|
53
|
+
)
|
|
54
|
+
}
|
|
51
55
|
value={fieldValue}
|
|
52
56
|
disabled={disabled}
|
|
53
57
|
/>
|
|
@@ -5,14 +5,12 @@ import type { PydanticFormElement } from 'pydantic-forms';
|
|
|
5
5
|
|
|
6
6
|
import { EuiFlexItem, EuiFormRow, EuiText } from '@elastic/eui';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
getCommonFormFieldStyles,
|
|
10
|
-
getNestedSummaryLabel,
|
|
11
|
-
summaryFieldStyles,
|
|
12
|
-
} from '@/components';
|
|
13
8
|
import { useWithOrchestratorTheme } from '@/hooks';
|
|
14
9
|
import { snakeToHuman } from '@/utils';
|
|
15
10
|
|
|
11
|
+
import { getCommonFormFieldStyles, summaryFieldStyles } from './styles';
|
|
12
|
+
import { getNestedSummaryLabel } from './wfoPydanticFormUtils';
|
|
13
|
+
|
|
16
14
|
export const WfoSummary: PydanticFormElement = ({ pydanticFormField }) => {
|
|
17
15
|
const { summaryFieldStyle } = useWithOrchestratorTheme(summaryFieldStyles);
|
|
18
16
|
const { formRowStyle } = useWithOrchestratorTheme(getCommonFormFieldStyles);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
|
|
3
|
+
import type { WfoTheme } from '@/hooks';
|
|
4
|
+
|
|
3
5
|
export const getWfoObjectFieldStyles = () => {
|
|
4
6
|
const wfoObjectFieldStyles = css({
|
|
5
7
|
width: '100%',
|
|
@@ -11,3 +13,73 @@ export const getWfoObjectFieldStyles = () => {
|
|
|
11
13
|
wfoObjectFieldStyles,
|
|
12
14
|
};
|
|
13
15
|
};
|
|
16
|
+
|
|
17
|
+
export const getCommonFormFieldStyles = ({ theme }: WfoTheme) => {
|
|
18
|
+
const formRowStyle = css({
|
|
19
|
+
marginBottom: theme.base * 2,
|
|
20
|
+
|
|
21
|
+
'.euiText': {
|
|
22
|
+
color: theme.colors.text,
|
|
23
|
+
},
|
|
24
|
+
'.euiFormLabel': {
|
|
25
|
+
color: theme.colors.text,
|
|
26
|
+
cursor: 'text',
|
|
27
|
+
'&.euiFormLabel-isFocused': {
|
|
28
|
+
color: theme.colors.primaryText,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
'.euiFormRow__labelWrapper': {
|
|
32
|
+
display: 'flex',
|
|
33
|
+
flexDirection: 'column',
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const errorStyle = css({
|
|
38
|
+
color: theme.colors.dangerText,
|
|
39
|
+
});
|
|
40
|
+
return {
|
|
41
|
+
errorStyle,
|
|
42
|
+
formRowStyle,
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const summaryFieldStyles = ({ theme }: WfoTheme) => {
|
|
47
|
+
const summaryFieldStyle = css({
|
|
48
|
+
'div.emailMessage': {
|
|
49
|
+
td: {
|
|
50
|
+
color: theme.colors.textParagraph,
|
|
51
|
+
},
|
|
52
|
+
p: {
|
|
53
|
+
color: theme.colors.textParagraph,
|
|
54
|
+
},
|
|
55
|
+
html: {
|
|
56
|
+
marginLeft: '-10px',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
'section.table-summary': {
|
|
60
|
+
marginTop: '20px',
|
|
61
|
+
width: '100%',
|
|
62
|
+
td: {
|
|
63
|
+
padding: '10px',
|
|
64
|
+
verticalAlign: 'top',
|
|
65
|
+
},
|
|
66
|
+
'td:not(:first-child):not(:last-child)': {
|
|
67
|
+
borderRight: `1px solid ${theme.colors.borderBasePlain}`,
|
|
68
|
+
},
|
|
69
|
+
'.label': {
|
|
70
|
+
fontWeight: 'bold',
|
|
71
|
+
color: theme.colors.backgroundBaseSubdued,
|
|
72
|
+
backgroundColor: theme.colors.primary,
|
|
73
|
+
borderRight: `2px solid ${theme.colors.borderBasePlain}`,
|
|
74
|
+
borderBottom: `1px solid ${theme.colors.borderBasePlain}`,
|
|
75
|
+
},
|
|
76
|
+
'.value': {
|
|
77
|
+
backgroundColor: theme.colors.backgroundBasePrimary,
|
|
78
|
+
borderBottom: `1px solid ${theme.colors.borderBasePlain}`,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
return {
|
|
83
|
+
summaryFieldStyle: summaryFieldStyle,
|
|
84
|
+
};
|
|
85
|
+
};
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
EuiFlexGroup,
|
|
10
10
|
EuiFlexItem,
|
|
11
11
|
EuiPanel,
|
|
12
|
+
EuiSelect,
|
|
12
13
|
EuiSpacer,
|
|
13
14
|
EuiTab,
|
|
14
15
|
EuiTabs,
|
|
@@ -17,19 +18,14 @@ import {
|
|
|
17
18
|
|
|
18
19
|
import { WfoSubscription } from '@/components';
|
|
19
20
|
import { WfoAvailabilityCheck } from '@/components/WfoAvailabilityCheck';
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
ENTITY_TABS,
|
|
23
|
-
isSubscriptionSearchResult,
|
|
24
|
-
} from '@/components/WfoSearchPage/utils';
|
|
21
|
+
import { ENTITY_TABS } from '@/components/WfoSearchPage/utils';
|
|
25
22
|
import { TreeProvider } from '@/contexts';
|
|
26
|
-
import { useOrchestratorTheme } from '@/hooks';
|
|
27
23
|
import { useSearchAvailability } from '@/hooks/useBackendAvailability';
|
|
28
24
|
import { useDebounce } from '@/hooks/useDebounce';
|
|
29
25
|
import { useSearch } from '@/hooks/useSearch';
|
|
30
26
|
import { useSearchPagination } from '@/hooks/useSearchPagination';
|
|
31
27
|
import { useUrlParams } from '@/hooks/useUrlParams';
|
|
32
|
-
import { EntityKind, Group } from '@/types';
|
|
28
|
+
import { EntityKind, Group, RetrieverType } from '@/types';
|
|
33
29
|
|
|
34
30
|
import { FilterGroup } from '../WfoFilterGroup';
|
|
35
31
|
import { WfoSearchResults } from '../WfoSearchResults';
|
|
@@ -44,7 +40,6 @@ import {
|
|
|
44
40
|
|
|
45
41
|
export const WfoSearch = () => {
|
|
46
42
|
const t = useTranslations('search.page');
|
|
47
|
-
const { theme } = useOrchestratorTheme();
|
|
48
43
|
const searchAvailability = useSearchAvailability();
|
|
49
44
|
|
|
50
45
|
const {
|
|
@@ -69,6 +64,9 @@ export const WfoSearch = () => {
|
|
|
69
64
|
});
|
|
70
65
|
|
|
71
66
|
const [showDetailPanel, setShowDetailPanel] = useState<boolean>(false);
|
|
67
|
+
const [retrieverType, setRetrieverType] = useState<RetrieverType>(
|
|
68
|
+
RetrieverType.Auto,
|
|
69
|
+
);
|
|
72
70
|
|
|
73
71
|
const debouncedQuery = useDebounce(query, DEFAULT_DEBOUNCE_DELAY);
|
|
74
72
|
const { results, loading, setResults } = useSearch(
|
|
@@ -76,6 +74,7 @@ export const WfoSearch = () => {
|
|
|
76
74
|
selectedEntityTab,
|
|
77
75
|
filterGroup,
|
|
78
76
|
pageSize,
|
|
77
|
+
retrieverType,
|
|
79
78
|
);
|
|
80
79
|
|
|
81
80
|
const [hasSearchBeenAttempted, setHasSearchBeenAttempted] = useState(false);
|
|
@@ -109,6 +108,7 @@ export const WfoSearch = () => {
|
|
|
109
108
|
pageSize,
|
|
110
109
|
results,
|
|
111
110
|
setResults,
|
|
111
|
+
retrieverType,
|
|
112
112
|
);
|
|
113
113
|
|
|
114
114
|
const [searchValue, setSearchValue] = useState(() => {
|
|
@@ -195,9 +195,11 @@ export const WfoSearch = () => {
|
|
|
195
195
|
|
|
196
196
|
useEffect(() => {
|
|
197
197
|
setShowDetailPanel(
|
|
198
|
-
results?.data?.length > 0 &&
|
|
198
|
+
results?.data?.length > 0 &&
|
|
199
|
+
selectedRecordIndex >= 0 &&
|
|
200
|
+
selectedEntityTab === 'SUBSCRIPTION',
|
|
199
201
|
);
|
|
200
|
-
}, [results?.data?.length, selectedRecordIndex]);
|
|
202
|
+
}, [results?.data?.length, selectedRecordIndex, selectedEntityTab]);
|
|
201
203
|
|
|
202
204
|
useEffect(() => {
|
|
203
205
|
resetPagination();
|
|
@@ -250,6 +252,35 @@ export const WfoSearch = () => {
|
|
|
250
252
|
{showFilters ? t('hideFilters') : t('showFilters')}
|
|
251
253
|
</EuiButton>
|
|
252
254
|
</EuiFlexItem>
|
|
255
|
+
<EuiFlexItem grow={true} />
|
|
256
|
+
<EuiFlexItem grow={false}>
|
|
257
|
+
<EuiSelect
|
|
258
|
+
options={[
|
|
259
|
+
{
|
|
260
|
+
value: RetrieverType.Auto,
|
|
261
|
+
text: t('retrieverAuto'),
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
value: RetrieverType.Fuzzy,
|
|
265
|
+
text: t('retrieverFuzzy'),
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
value: RetrieverType.Semantic,
|
|
269
|
+
text: t('retrieverSemantic'),
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
value: RetrieverType.Hybrid,
|
|
273
|
+
text: t('retrieverHybrid'),
|
|
274
|
+
},
|
|
275
|
+
]}
|
|
276
|
+
value={retrieverType}
|
|
277
|
+
onChange={(e) =>
|
|
278
|
+
setRetrieverType(e.target.value as RetrieverType)
|
|
279
|
+
}
|
|
280
|
+
compressed
|
|
281
|
+
prepend={t('retrieval')}
|
|
282
|
+
/>
|
|
283
|
+
</EuiFlexItem>
|
|
253
284
|
</EuiFlexGroup>
|
|
254
285
|
|
|
255
286
|
{showFilters && (
|
|
@@ -389,11 +420,7 @@ export const WfoSearch = () => {
|
|
|
389
420
|
hasShadow={false}
|
|
390
421
|
color="transparent"
|
|
391
422
|
>
|
|
392
|
-
{
|
|
393
|
-
results.data[selectedRecordIndex] &&
|
|
394
|
-
isSubscriptionSearchResult(
|
|
395
|
-
results.data[selectedRecordIndex],
|
|
396
|
-
) ? (
|
|
423
|
+
{results.data[selectedRecordIndex] && (
|
|
397
424
|
<TreeProvider>
|
|
398
425
|
<WfoSubscription
|
|
399
426
|
subscriptionId={
|
|
@@ -403,45 +430,6 @@ export const WfoSearch = () => {
|
|
|
403
430
|
}
|
|
404
431
|
/>
|
|
405
432
|
</TreeProvider>
|
|
406
|
-
) : (
|
|
407
|
-
<>
|
|
408
|
-
<EuiText>
|
|
409
|
-
<h4>{t('details')}</h4>
|
|
410
|
-
</EuiText>
|
|
411
|
-
<EuiSpacer size="m" />
|
|
412
|
-
<EuiText
|
|
413
|
-
color={theme.colors.textSubdued}
|
|
414
|
-
>
|
|
415
|
-
<p>
|
|
416
|
-
{t(
|
|
417
|
-
'showingDetailsForResult',
|
|
418
|
-
{
|
|
419
|
-
resultNumber:
|
|
420
|
-
selectedRecordIndex +
|
|
421
|
-
1,
|
|
422
|
-
},
|
|
423
|
-
)}
|
|
424
|
-
</p>
|
|
425
|
-
<EuiSpacer size="s" />
|
|
426
|
-
<WfoBadge
|
|
427
|
-
color={theme.colors.primary}
|
|
428
|
-
textColor={
|
|
429
|
-
theme.colors.ghost
|
|
430
|
-
}
|
|
431
|
-
>
|
|
432
|
-
{selectedEntityTab} #
|
|
433
|
-
{selectedRecordIndex + 1}
|
|
434
|
-
</WfoBadge>
|
|
435
|
-
<EuiSpacer size="m" />
|
|
436
|
-
<p>
|
|
437
|
-
<em>
|
|
438
|
-
{t(
|
|
439
|
-
'selectResultInstruction',
|
|
440
|
-
)}
|
|
441
|
-
</em>
|
|
442
|
-
</p>
|
|
443
|
-
</EuiText>
|
|
444
|
-
</>
|
|
445
433
|
)}
|
|
446
434
|
</EuiPanel>
|
|
447
435
|
</EuiFlexItem>
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Condition,
|
|
3
|
+
EntityKind,
|
|
4
|
+
Group,
|
|
5
|
+
RetrieverType,
|
|
6
|
+
SearchResult,
|
|
7
|
+
} from '@/types';
|
|
2
8
|
|
|
3
9
|
export function isSubscriptionSearchResult(item: SearchResult): boolean {
|
|
4
10
|
return item.entity_type === 'SUBSCRIPTION';
|
|
@@ -155,6 +161,7 @@ export const buildSearchParams = (
|
|
|
155
161
|
selectedEntityTab: EntityKind,
|
|
156
162
|
filterGroup: Group,
|
|
157
163
|
pageSize: number,
|
|
164
|
+
retriever?: Exclude<RetrieverType, 'auto'>,
|
|
158
165
|
) => {
|
|
159
166
|
const queryText =
|
|
160
167
|
typeof debouncedQuery === 'string'
|
|
@@ -167,5 +174,6 @@ export const buildSearchParams = (
|
|
|
167
174
|
query: queryText || '',
|
|
168
175
|
filters: filterGroup?.children.length > 0 ? filterGroup : undefined,
|
|
169
176
|
limit: pageSize,
|
|
177
|
+
retriever,
|
|
170
178
|
};
|
|
171
179
|
};
|
|
@@ -9,16 +9,10 @@ import {
|
|
|
9
9
|
WfoMonacoCodeBlock,
|
|
10
10
|
WfoTableCodeBlock,
|
|
11
11
|
} from '@/components';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
useGetOrchestratorConfig,
|
|
15
|
-
useOrchestratorTheme,
|
|
16
|
-
useWithOrchestratorTheme,
|
|
17
|
-
} from '@/hooks';
|
|
12
|
+
import { useOrchestratorTheme, useWithOrchestratorTheme } from '@/hooks';
|
|
18
13
|
import { WfoChevronDown, WfoChevronUp } from '@/icons';
|
|
19
|
-
import type { EmailState } from '@/types';
|
|
14
|
+
import type { EmailState, FormUserPermissions } from '@/types';
|
|
20
15
|
import { StepStatus } from '@/types';
|
|
21
|
-
import { FormUserPermissions } from '@/types/forms';
|
|
22
16
|
import { calculateTimeDifference, formatDate } from '@/utils';
|
|
23
17
|
|
|
24
18
|
import { WfoStepStatusIcon } from '../WfoStepStatusIcon';
|
|
@@ -55,8 +49,6 @@ export const WfoStep = React.forwardRef(
|
|
|
55
49
|
}: WfoStepProps,
|
|
56
50
|
ref: LegacyRef<HTMLDivElement>,
|
|
57
51
|
) => {
|
|
58
|
-
const config = useGetOrchestratorConfig();
|
|
59
|
-
const usePydanticForms: boolean = config.activatePydanticForms ?? false;
|
|
60
52
|
const { isExpanded, step, userInputForm } = stepListItem;
|
|
61
53
|
const [codeView, setCodeView] = useState<CodeView>(CodeView.JSON);
|
|
62
54
|
|
|
@@ -213,23 +205,14 @@ export const WfoStep = React.forwardRef(
|
|
|
213
205
|
)}
|
|
214
206
|
</div>
|
|
215
207
|
)}
|
|
216
|
-
{step.status === StepStatus.SUSPEND &&
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
/>
|
|
225
|
-
) : (
|
|
226
|
-
<WfoStepFormOld
|
|
227
|
-
userInputForm={userInputForm}
|
|
228
|
-
isTask={isTask}
|
|
229
|
-
processId={processId}
|
|
230
|
-
userPermissions={userPermissions}
|
|
231
|
-
/>
|
|
232
|
-
))}
|
|
208
|
+
{step.status === StepStatus.SUSPEND && userInputForm && (
|
|
209
|
+
<WfoStepForm
|
|
210
|
+
userInputForm={userInputForm}
|
|
211
|
+
isTask={isTask}
|
|
212
|
+
processId={processId ?? ''}
|
|
213
|
+
userPermissions={userPermissions}
|
|
214
|
+
/>
|
|
215
|
+
)}
|
|
233
216
|
</EuiPanel>
|
|
234
217
|
</div>
|
|
235
218
|
);
|
|
@@ -9,7 +9,7 @@ import { StepFormFooter } from '@/components/WfoWorkflowSteps/WfoStep/WfoStepFor
|
|
|
9
9
|
import { useOrchestratorTheme } from '@/hooks';
|
|
10
10
|
import { HttpStatus } from '@/rtk';
|
|
11
11
|
import { useResumeProcessMutation } from '@/rtk/endpoints/forms';
|
|
12
|
-
import { FormUserPermissions, InputForm } from '@/types
|
|
12
|
+
import { FormUserPermissions, InputForm } from '@/types';
|
|
13
13
|
|
|
14
14
|
interface WfoStepFormProps {
|
|
15
15
|
userInputForm: InputForm;
|
package/src/components/index.ts
CHANGED
|
@@ -14,7 +14,6 @@ export * from './WfoTable';
|
|
|
14
14
|
export * from './WfoTimeline';
|
|
15
15
|
export * from './WfoLoading';
|
|
16
16
|
export * from './WfoToastsList';
|
|
17
|
-
export * from './WfoForms';
|
|
18
17
|
export * from './WfoDateTime';
|
|
19
18
|
export * from './WfoAuth';
|
|
20
19
|
export * from './WfoDropdownButton';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ORCHESTRATOR_UI_LIBRARY_VERSION = '
|
|
1
|
+
export const ORCHESTRATOR_UI_LIBRARY_VERSION = '7.0.1';
|
|
@@ -18,7 +18,6 @@ export const emptyOrchestratorConfig: OrchestratorConfig = {
|
|
|
18
18
|
supportMenuItemUrl: '',
|
|
19
19
|
enableAoStackStatus: false,
|
|
20
20
|
aoStackStatusUrl: '',
|
|
21
|
-
activatePydanticForms: false,
|
|
22
21
|
};
|
|
23
22
|
|
|
24
23
|
export const OrchestratorConfigContext = createContext<OrchestratorConfig>(
|
package/src/hooks/useSearch.ts
CHANGED
|
@@ -3,13 +3,19 @@ import { useEffect, useState } from 'react';
|
|
|
3
3
|
import { Query } from '@elastic/eui';
|
|
4
4
|
|
|
5
5
|
import { useSearchMutation } from '@/rtk/endpoints';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
EntityKind,
|
|
8
|
+
Group,
|
|
9
|
+
PaginatedSearchResults,
|
|
10
|
+
RetrieverType,
|
|
11
|
+
} from '@/types';
|
|
7
12
|
|
|
8
13
|
export const useSearch = (
|
|
9
14
|
query: Query | string,
|
|
10
15
|
entityType: EntityKind,
|
|
11
16
|
filterGroup?: Group,
|
|
12
17
|
limit?: number,
|
|
18
|
+
retriever: RetrieverType = RetrieverType.Auto,
|
|
13
19
|
) => {
|
|
14
20
|
const [results, setResults] = useState<PaginatedSearchResults>({
|
|
15
21
|
data: [],
|
|
@@ -44,6 +50,10 @@ export const useSearch = (
|
|
|
44
50
|
? filterGroup
|
|
45
51
|
: undefined,
|
|
46
52
|
limit: limit,
|
|
53
|
+
retriever:
|
|
54
|
+
retriever === RetrieverType.Auto
|
|
55
|
+
? undefined
|
|
56
|
+
: retriever,
|
|
47
57
|
}).unwrap();
|
|
48
58
|
|
|
49
59
|
setResults({
|
|
@@ -71,7 +81,7 @@ export const useSearch = (
|
|
|
71
81
|
};
|
|
72
82
|
|
|
73
83
|
performSearch();
|
|
74
|
-
}, [query, entityType, filterGroup, limit, triggerSearch]);
|
|
84
|
+
}, [query, entityType, filterGroup, limit, retriever, triggerSearch]);
|
|
75
85
|
|
|
76
86
|
return {
|
|
77
87
|
results,
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
EntityKind,
|
|
9
9
|
Group,
|
|
10
10
|
PaginatedSearchResults,
|
|
11
|
+
RetrieverType,
|
|
11
12
|
SearchResult,
|
|
12
13
|
} from '@/types';
|
|
13
14
|
|
|
@@ -35,6 +36,7 @@ export const useSearchPagination = (
|
|
|
35
36
|
pageSize: number,
|
|
36
37
|
results: PaginatedSearchResults,
|
|
37
38
|
setResults: (results: PaginatedSearchResults) => void,
|
|
39
|
+
retriever?: RetrieverType,
|
|
38
40
|
): UseSearchPaginationReturn => {
|
|
39
41
|
const [currentPage, setCurrentPage] = useState<number>(1);
|
|
40
42
|
const [pageHistory, setPageHistory] = useState<PageHistoryItem[]>([]);
|
|
@@ -65,6 +67,7 @@ export const useSearchPagination = (
|
|
|
65
67
|
selectedEntityTab,
|
|
66
68
|
filterGroup,
|
|
67
69
|
pageSize,
|
|
70
|
+
retriever === RetrieverType.Auto ? undefined : retriever,
|
|
68
71
|
);
|
|
69
72
|
|
|
70
73
|
const res = await triggerSearchPagination({
|
|
@@ -105,6 +108,7 @@ export const useSearchPagination = (
|
|
|
105
108
|
selectedEntityTab,
|
|
106
109
|
filterGroup,
|
|
107
110
|
pageSize,
|
|
111
|
+
retriever,
|
|
108
112
|
setResults,
|
|
109
113
|
triggerSearchPagination,
|
|
110
114
|
],
|
package/src/messages/en-GB.json
CHANGED
|
@@ -562,10 +562,12 @@
|
|
|
562
562
|
"hideFilters": "Hide filters",
|
|
563
563
|
"showFilters": "Show filters",
|
|
564
564
|
"structuredFilters": "Structured filters",
|
|
565
|
+
"retrieval": "Retrieval",
|
|
566
|
+
"retrieverAuto": "Auto",
|
|
567
|
+
"retrieverFuzzy": "Fuzzy",
|
|
568
|
+
"retrieverSemantic": "Semantic",
|
|
569
|
+
"retrieverHybrid": "Hybrid",
|
|
565
570
|
"searchError": "Error",
|
|
566
|
-
"selectResultInstruction": "Detail content will be implemented here...",
|
|
567
|
-
"showingDetailsForResult": "Showing details for result #{resultNumber}",
|
|
568
|
-
"details": "Details",
|
|
569
571
|
"dismiss": "Dismiss",
|
|
570
572
|
"searchPlaceholder": "Search for {entityType}…",
|
|
571
573
|
"noResults": "No Results",
|