@orchestrator-ui/orchestrator-ui-components 1.3.1 → 1.5.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.
- package/.turbo/turbo-build.log +5 -5
- package/.turbo/turbo-lint.log +7 -1
- package/.turbo/turbo-test.log +7 -7
- package/CHANGELOG.md +31 -2
- package/LICENSE.txt +202 -0
- package/README.md +22 -0
- package/dist/index.d.ts +531 -314
- package/dist/index.js +5120 -7384
- package/package.json +21 -4
- package/src/api/index.ts +4 -3
- package/src/api/types.ts +53 -0
- package/src/components/WfoDropdownButton/WfoDropdownButton.tsx +2 -0
- package/src/components/WfoForms/AutoFieldLoader.tsx +6 -6
- package/src/components/WfoForms/formFields/AcceptField.tsx +2 -1
- package/src/components/WfoForms/formFields/BoolField.tsx +2 -1
- package/src/components/WfoForms/formFields/DividerField.tsx +1 -1
- package/src/components/WfoForms/formFields/ErrorField.tsx +1 -1
- package/src/components/WfoForms/formFields/LabelField.tsx +1 -1
- package/src/components/WfoForms/formFields/ListAddField.tsx +2 -1
- package/src/components/WfoForms/formFields/ListDelField.tsx +2 -1
- package/src/components/WfoForms/formFields/LongTextField.tsx +1 -1
- package/src/components/WfoForms/formFields/NumField.tsx +1 -1
- package/src/components/WfoForms/formFields/ProductField.tsx +8 -7
- package/src/components/WfoForms/formFields/RadioField.tsx +1 -1
- package/src/components/WfoForms/formFields/SelectField.tsx +4 -2
- package/src/components/WfoForms/formFields/SubmitField.tsx +1 -1
- package/src/components/WfoForms/formFields/SubscriptionField.tsx +5 -4
- package/src/components/WfoForms/formFields/SubscriptionSummaryField.tsx +11 -15
- package/src/components/WfoForms/formFields/TextField.tsx +1 -1
- package/src/components/WfoForms/formFields/{ContactPersonAutocomplete.tsx → deprecated/ContactPersonAutocomplete.tsx} +4 -3
- package/src/components/WfoForms/formFields/{ContactPersonNameField.tsx → deprecated/ContactPersonNameField.tsx} +3 -2
- package/src/components/WfoForms/formFields/{ImsNodeIdField.tsx → deprecated/ImsNodeIdField.tsx} +4 -3
- package/src/components/WfoForms/formFields/{ImsPortIdField.tsx → deprecated/ImsPortIdField.tsx} +7 -4
- package/src/components/WfoForms/formFields/{IpNetworkField.tsx → deprecated/IpNetworkField.tsx} +4 -3
- package/src/components/WfoForms/formFields/{IpPrefixTableField.tsx → deprecated/IpPrefixTableField.tsx} +5 -4
- package/src/components/WfoForms/formFields/{SplitPrefix.tsx → deprecated/SplitPrefix.tsx} +3 -2
- package/src/components/WfoForms/formFields/{TimestampField.tsx → deprecated/TimestampField.tsx} +1 -1
- package/src/components/WfoForms/formFields/{VlanField.tsx → deprecated/VlanField.tsx} +5 -4
- package/src/components/WfoForms/formFields/deprecated/index.ts +13 -0
- package/src/components/WfoForms/formFields/{surf → deprecated}/types.ts +1 -1
- package/src/components/WfoForms/formFields/index.ts +1 -6
- package/src/components/WfoForms/formFields/utils.spec.ts +1 -1
- package/src/components/WfoForms/formFields/utils.ts +3 -2
- package/src/components/WfoPageTemplate/WfoSidebar/WfoSidebar.tsx +2 -2
- package/src/components/WfoProcessList/WfoProcessesList.tsx +16 -9
- package/src/components/WfoProcessList/processListObjectMappers.ts +6 -10
- package/src/components/WfoSettings/WfoModifySettings.tsx +29 -13
- package/src/components/WfoSettings/WfoResetTextSearchIndexButton.tsx +22 -0
- package/src/components/WfoSettings/index.ts +1 -0
- package/src/components/{WfoButtonComboBox/WfoButtonComboBox.tsx → WfoStartButton/WfoStartButtonComboBox.tsx} +11 -17
- package/src/components/WfoStartButton/WfoStartTaskComboBox.tsx +47 -0
- package/src/components/WfoStartButton/WfoStartWorkflowComboBox.tsx +49 -0
- package/src/components/WfoStartButton/index.ts +2 -0
- package/src/components/WfoSubscription/WfoRelatedSubscriptions.tsx +30 -36
- package/src/components/WfoSubscription/WfoSubscription.tsx +17 -20
- package/src/components/WfoSubscription/index.ts +6 -4
- package/src/components/WfoSubscriptionsList/WfoSubscriptionsList.tsx +12 -16
- package/src/components/WfoSubscriptionsList/subscriptionResultMappers.ts +10 -12
- package/src/components/index.ts +2 -1
- package/src/configuration/constants.ts +3 -0
- package/src/hooks/{surf → deprecated}/useGetSubscriptionDropdownOptions.ts +6 -13
- package/src/hooks/{surf → deprecated}/useIsTaggedPort.ts +6 -9
- package/src/hooks/index.ts +0 -1
- package/src/index.ts +0 -1
- package/src/messages/en-GB.json +3 -1
- package/src/messages/nl-NL.json +3 -1
- package/src/pages/metadata/WfoProductBlocksPage.tsx +27 -37
- package/src/pages/metadata/WfoProductsPage.tsx +11 -16
- package/src/pages/metadata/WfoResourceTypesPage.tsx +33 -35
- package/src/pages/metadata/WfoWorkflowsPage.tsx +42 -40
- package/src/pages/metadata/workflowListObjectMapper.ts +4 -7
- package/src/pages/processes/WfoStartProcessPage.tsx +0 -6
- package/src/pages/startPage/WfoStartPage.tsx +56 -68
- package/src/pages/subscriptions/WfoSubscriptionsListPage.tsx +6 -7
- package/src/rtk/api.ts +11 -3
- package/src/rtk/endpoints/index.ts +11 -2
- package/src/rtk/endpoints/metadata/index.ts +3 -0
- package/src/rtk/endpoints/metadata/productBlocks.ts +88 -0
- package/src/rtk/endpoints/metadata/resourceTypes.ts +78 -0
- package/src/rtk/endpoints/metadata/workflows.ts +73 -0
- package/src/rtk/endpoints/processList.ts +2 -1
- package/src/rtk/endpoints/processListSummary.ts +70 -0
- package/src/rtk/endpoints/products.ts +76 -0
- package/src/rtk/endpoints/productsSummary.ts +62 -0
- package/src/rtk/endpoints/relatedSubscriptions.ts +99 -0
- package/src/rtk/endpoints/settings.ts +10 -0
- package/src/rtk/endpoints/startOptions.ts +99 -0
- package/src/{graphqlQueries/subscriptionDetailQuery.ts → rtk/endpoints/subscriptionDetail.ts} +45 -11
- package/src/rtk/endpoints/subscriptionList.ts +86 -0
- package/src/rtk/endpoints/subscriptionListSummary.ts +70 -0
- package/src/rtk/endpoints/subscriptionsDropdownOptions.ts +72 -0
- package/src/types/types.ts +20 -0
- package/src/utils/index.ts +1 -0
- package/src/components/WfoPageTemplate/WfoSidebar/WfoStartCreateWorkflowButtonComboBox.tsx +0 -61
- package/src/components/WfoStartTaskButtonComboBox/WfoStartTaskButtonComboBox.tsx +0 -54
- package/src/components/WfoStartTaskButtonComboBox/index.ts +0 -1
- package/src/graphqlQueries/index.ts +0 -7
- package/src/graphqlQueries/processListQuery.ts +0 -101
- package/src/graphqlQueries/productBlocksQuery.ts +0 -59
- package/src/graphqlQueries/productsQuery.ts +0 -85
- package/src/graphqlQueries/relatedSubscriptionsQuery.ts +0 -65
- package/src/graphqlQueries/resourceTypesQuery.ts +0 -52
- package/src/graphqlQueries/subscriptionsDropdownOptionsQuery.ts +0 -48
- package/src/graphqlQueries/subscriptionsListQuery.ts +0 -101
- package/src/graphqlQueries/workflows/workflowsQuery.ts +0 -48
- package/src/graphqlQueries/workflows/workflowsQueryForDropdownList.ts +0 -38
- package/src/hooks/useQueryWithGraphql.ts +0 -72
- /package/src/components/WfoForms/formFields/{ContactPersonAutocompleteStyles.ts → deprecated/ContactPersonAutocompleteStyles.ts} +0 -0
- /package/src/components/WfoForms/formFields/{ImsPortIdFieldStyling.ts → deprecated/ImsPortIdFieldStyling.ts} +0 -0
- /package/src/components/WfoForms/formFields/{IpPrefixTableFieldStyling.ts → deprecated/IpPrefixTableFieldStyling.ts} +0 -0
- /package/src/components/WfoForms/formFields/{SplitPrefixStyling.ts → deprecated/SplitPrefixStyling.ts} +0 -0
- /package/src/components/WfoForms/formFields/{surf → deprecated}/utils.ts +0 -0
- /package/src/components/{WfoButtonComboBox → WfoStartButton}/styles.ts +0 -0
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { useContext } from 'react';
|
|
2
|
-
import { UseQueryOptions, useQuery } from 'react-query';
|
|
3
|
-
|
|
4
|
-
import { GraphQLClient } from 'graphql-request';
|
|
5
|
-
import type { Variables } from 'graphql-request/build/esm/types';
|
|
6
|
-
|
|
7
|
-
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
8
|
-
|
|
9
|
-
import { OrchestratorConfigContext } from '@/contexts';
|
|
10
|
-
|
|
11
|
-
import { useWfoSession } from './useWfoSession';
|
|
12
|
-
|
|
13
|
-
export const useQueryWithGraphql = <U, V extends Variables>(
|
|
14
|
-
query: TypedDocumentNode<U, V>,
|
|
15
|
-
queryVars: V,
|
|
16
|
-
cacheKeys: string[] | string,
|
|
17
|
-
options: UseQueryOptions<U> = {},
|
|
18
|
-
) => {
|
|
19
|
-
const { graphqlEndpointCore } = useContext(OrchestratorConfigContext);
|
|
20
|
-
const { session } = useWfoSession();
|
|
21
|
-
|
|
22
|
-
const graphQLClient = new GraphQLClient(graphqlEndpointCore);
|
|
23
|
-
|
|
24
|
-
const requestHeaders = {
|
|
25
|
-
Authorization: session ? `Bearer ${session.accessToken}` : '',
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const fetchFromGraphql = async () =>
|
|
29
|
-
// TS-Ignore because queryVars does not seem to be accepted by the client
|
|
30
|
-
// The props in this useQueryWithGraphql-hook ensures queryVars is indeed related to the query
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
32
|
-
// @ts-ignore
|
|
33
|
-
await graphQLClient.request<U, V>(query, queryVars, requestHeaders);
|
|
34
|
-
|
|
35
|
-
const queryKeys = [
|
|
36
|
-
...(typeof cacheKeys === 'string' ? [cacheKeys] : cacheKeys),
|
|
37
|
-
...Object.values(queryVars),
|
|
38
|
-
];
|
|
39
|
-
|
|
40
|
-
const { error, ...restWithoutError } = useQuery<U>({
|
|
41
|
-
queryKey: queryKeys,
|
|
42
|
-
queryFn: fetchFromGraphql,
|
|
43
|
-
...options,
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
if (error) {
|
|
47
|
-
console.error(error);
|
|
48
|
-
}
|
|
49
|
-
return restWithoutError;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export const useQueryWithGraphqlLazy = <U, V extends Variables>(
|
|
53
|
-
query: TypedDocumentNode<U, V>,
|
|
54
|
-
queryVars: V,
|
|
55
|
-
cacheKeys: string[] | string,
|
|
56
|
-
options: UseQueryOptions<U> = {},
|
|
57
|
-
) => {
|
|
58
|
-
// Disabling the query prevent the initial fetch
|
|
59
|
-
const queryWithGraphql = useQueryWithGraphql(query, queryVars, cacheKeys, {
|
|
60
|
-
...options,
|
|
61
|
-
enabled: false,
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
// Calling getData fetches the data
|
|
65
|
-
return {
|
|
66
|
-
getData: async () => {
|
|
67
|
-
const result = await queryWithGraphql.refetch();
|
|
68
|
-
return result.data;
|
|
69
|
-
},
|
|
70
|
-
...queryWithGraphql,
|
|
71
|
-
};
|
|
72
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|