@orchestrator-ui/orchestrator-ui-components 1.3.0 → 1.4.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 +1 -1
- package/.turbo/turbo-test.log +7 -7
- package/CHANGELOG.md +25 -0
- package/dist/index.d.ts +417 -288
- package/dist/index.js +3338 -5612
- package/package.json +1 -3
- package/src/components/WfoForms/UserInputForm.tsx +7 -1
- package/src/components/WfoForms/formFields/SubscriptionSummaryField.tsx +11 -15
- 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/index.ts +0 -1
- package/src/hooks/surf/useGetSubscriptionDropdownOptions.ts +6 -13
- package/src/hooks/surf/useIsTaggedPort.ts +6 -9
- 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 +9 -21
- 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 -1
- 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/processSteps.ts +50 -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 -8
- package/src/graphqlQueries/processListQuery.ts +0 -101
- package/src/graphqlQueries/processStepsQuery.ts +0 -22
- 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/{WfoButtonComboBox → WfoStartButton}/styles.ts +0 -0
package/src/types/types.ts
CHANGED
|
@@ -109,6 +109,9 @@ export interface ProductDefinition {
|
|
|
109
109
|
fixedInputs: Pick<FixedInputDefinition, 'name' | 'value'>[];
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
+
export type ProductsSummary = Pick<ProductDefinition, 'name'> &
|
|
113
|
+
SubscriptionsResult<never>;
|
|
114
|
+
|
|
112
115
|
export enum WorkflowTarget {
|
|
113
116
|
CREATE = 'create',
|
|
114
117
|
MODIFY = 'modify',
|
|
@@ -333,6 +336,10 @@ export interface WorkflowDefinitionsResult<T = WorkflowDefinition> {
|
|
|
333
336
|
workflows: GraphQlResultPage<T>;
|
|
334
337
|
}
|
|
335
338
|
|
|
339
|
+
export interface StartOptionsResult<T> {
|
|
340
|
+
workflows: GraphQlSinglePage<T>;
|
|
341
|
+
}
|
|
342
|
+
|
|
336
343
|
export interface RelatedSubscriptionsResult {
|
|
337
344
|
subscriptions: GraphQlSinglePage<
|
|
338
345
|
Pick<Subscription, 'subscriptionId'> & {
|
|
@@ -341,6 +348,14 @@ export interface RelatedSubscriptionsResult {
|
|
|
341
348
|
>;
|
|
342
349
|
}
|
|
343
350
|
|
|
351
|
+
export type StartComboBoxOption = {
|
|
352
|
+
data: {
|
|
353
|
+
workflowName: string;
|
|
354
|
+
productId?: string;
|
|
355
|
+
};
|
|
356
|
+
label: string;
|
|
357
|
+
};
|
|
358
|
+
|
|
344
359
|
interface GraphQlResultPage<T> {
|
|
345
360
|
page: T[];
|
|
346
361
|
pageInfo: GraphQLPageInfo;
|
|
@@ -382,6 +397,11 @@ export type Subscription = {
|
|
|
382
397
|
customer: Pick<Customer, 'fullname' | 'shortcode'>;
|
|
383
398
|
};
|
|
384
399
|
|
|
400
|
+
export type SubscriptionSummary = Pick<
|
|
401
|
+
Subscription,
|
|
402
|
+
'subscriptionId' | 'description' | 'startDate'
|
|
403
|
+
>;
|
|
404
|
+
|
|
385
405
|
export type SubscriptionDropdownOption = {
|
|
386
406
|
description: Subscription['description'];
|
|
387
407
|
subscriptionId: Subscription['subscriptionId'];
|
package/src/utils/index.ts
CHANGED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { useTranslations } from 'next-intl';
|
|
4
|
-
import { useRouter } from 'next/router';
|
|
5
|
-
|
|
6
|
-
import { GET_WORKFLOWS_FOR_DROPDOWN_LIST_GRAPHQL_QUERY } from '@/graphqlQueries/workflows/workflowsQueryForDropdownList';
|
|
7
|
-
import { useCheckEngineStatus, useQueryWithGraphql } from '@/hooks';
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
WfoButtonComboBox,
|
|
11
|
-
WorkflowComboBoxOption,
|
|
12
|
-
} from '../../WfoButtonComboBox/WfoButtonComboBox';
|
|
13
|
-
import { PATH_START_NEW_WORKFLOW } from '../paths';
|
|
14
|
-
|
|
15
|
-
export const WfoStartCreateWorkflowButtonComboBox = () => {
|
|
16
|
-
const router = useRouter();
|
|
17
|
-
const t = useTranslations('common');
|
|
18
|
-
const { isEngineRunningNow } = useCheckEngineStatus();
|
|
19
|
-
|
|
20
|
-
const { data } = useQueryWithGraphql(
|
|
21
|
-
GET_WORKFLOWS_FOR_DROPDOWN_LIST_GRAPHQL_QUERY,
|
|
22
|
-
{
|
|
23
|
-
filterBy: [{ field: 'target', value: 'CREATE' }],
|
|
24
|
-
},
|
|
25
|
-
'createWorkflows',
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
const productList: WorkflowComboBoxOption[] =
|
|
29
|
-
data?.workflows.page
|
|
30
|
-
.flatMap(({ name: workflowName, products }) =>
|
|
31
|
-
products.map(({ productId, name: productName }) => ({
|
|
32
|
-
label: productName,
|
|
33
|
-
data: {
|
|
34
|
-
workflowName,
|
|
35
|
-
productId,
|
|
36
|
-
},
|
|
37
|
-
})),
|
|
38
|
-
)
|
|
39
|
-
.sort((a, b) => a.label.localeCompare(b.label)) ?? [];
|
|
40
|
-
|
|
41
|
-
const handleOptionChange = async (
|
|
42
|
-
selectedProduct: WorkflowComboBoxOption,
|
|
43
|
-
) => {
|
|
44
|
-
if (await isEngineRunningNow()) {
|
|
45
|
-
const { workflowName, productId } = selectedProduct.data;
|
|
46
|
-
router.push({
|
|
47
|
-
pathname: `${PATH_START_NEW_WORKFLOW}/${workflowName}`,
|
|
48
|
-
query: { productId },
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<WfoButtonComboBox
|
|
55
|
-
buttonText={t('newSubscription')}
|
|
56
|
-
options={productList}
|
|
57
|
-
onOptionChange={handleOptionChange}
|
|
58
|
-
isProcess
|
|
59
|
-
/>
|
|
60
|
-
);
|
|
61
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { useTranslations } from 'next-intl';
|
|
4
|
-
import { useRouter } from 'next/router';
|
|
5
|
-
|
|
6
|
-
import { PATH_START_NEW_TASK } from '@/components';
|
|
7
|
-
import { GET_WORKFLOWS_FOR_DROPDOWN_LIST_GRAPHQL_QUERY } from '@/graphqlQueries/workflows/workflowsQueryForDropdownList';
|
|
8
|
-
import { useCheckEngineStatus, useQueryWithGraphql } from '@/hooks';
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
WfoButtonComboBox,
|
|
12
|
-
WorkflowComboBoxOption,
|
|
13
|
-
} from '../WfoButtonComboBox/WfoButtonComboBox';
|
|
14
|
-
|
|
15
|
-
export const WfoStartTaskButtonComboBox = () => {
|
|
16
|
-
const router = useRouter();
|
|
17
|
-
const t = useTranslations('common');
|
|
18
|
-
const { isEngineRunningNow } = useCheckEngineStatus();
|
|
19
|
-
|
|
20
|
-
const { data } = useQueryWithGraphql(
|
|
21
|
-
GET_WORKFLOWS_FOR_DROPDOWN_LIST_GRAPHQL_QUERY,
|
|
22
|
-
{
|
|
23
|
-
filterBy: [{ field: 'target', value: 'SYSTEM' }],
|
|
24
|
-
},
|
|
25
|
-
'taskWorkflows',
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
const taskList: WorkflowComboBoxOption[] = (data?.workflows.page || [])
|
|
29
|
-
.map(({ name, description }) => ({
|
|
30
|
-
label: description ?? '',
|
|
31
|
-
data: { workflowName: name },
|
|
32
|
-
}))
|
|
33
|
-
.sort((a, b) => a.label.localeCompare(b.label));
|
|
34
|
-
|
|
35
|
-
const handleOptionChange = async (
|
|
36
|
-
selectedProduct: WorkflowComboBoxOption,
|
|
37
|
-
) => {
|
|
38
|
-
if (await isEngineRunningNow()) {
|
|
39
|
-
const { workflowName } = selectedProduct.data;
|
|
40
|
-
router.push({
|
|
41
|
-
pathname: `${PATH_START_NEW_TASK}/${workflowName}`,
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<WfoButtonComboBox
|
|
48
|
-
buttonText={t('newTask')}
|
|
49
|
-
options={taskList}
|
|
50
|
-
onOptionChange={handleOptionChange}
|
|
51
|
-
isProcess={false}
|
|
52
|
-
/>
|
|
53
|
-
);
|
|
54
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './WfoStartTaskButtonComboBox';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from './subscriptionsListQuery';
|
|
2
|
-
export * from './productBlocksQuery';
|
|
3
|
-
export * from './productsQuery';
|
|
4
|
-
export * from './resourceTypesQuery';
|
|
5
|
-
export * from './subscriptionDetailQuery';
|
|
6
|
-
export * from './subscriptionsDropdownOptionsQuery';
|
|
7
|
-
export * from './processStepsQuery';
|
|
8
|
-
export * from './processListQuery';
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { parse } from 'graphql';
|
|
2
|
-
import { gql } from 'graphql-request';
|
|
3
|
-
|
|
4
|
-
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
5
|
-
|
|
6
|
-
import { GraphqlQueryVariables, Process, ProcessListResult } from '@/types';
|
|
7
|
-
|
|
8
|
-
export const GET_PROCESS_LIST_SUMMARY_GRAPHQL_QUERY = parse(gql`
|
|
9
|
-
query ProcessListSummary(
|
|
10
|
-
$first: Int!
|
|
11
|
-
$after: Int!
|
|
12
|
-
$sortBy: [GraphqlSort!]
|
|
13
|
-
$filterBy: [GraphqlFilter!]
|
|
14
|
-
$query: String
|
|
15
|
-
) {
|
|
16
|
-
processes(
|
|
17
|
-
first: $first
|
|
18
|
-
after: $after
|
|
19
|
-
sortBy: $sortBy
|
|
20
|
-
filterBy: $filterBy
|
|
21
|
-
query: $query
|
|
22
|
-
) {
|
|
23
|
-
page {
|
|
24
|
-
processId
|
|
25
|
-
workflowName
|
|
26
|
-
startedAt
|
|
27
|
-
}
|
|
28
|
-
pageInfo {
|
|
29
|
-
totalItems
|
|
30
|
-
startCursor
|
|
31
|
-
endCursor
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
`);
|
|
36
|
-
|
|
37
|
-
export const GET_PROCESS_LIST_GRAPHQL_QUERY = parse(gql`
|
|
38
|
-
query ProcessList(
|
|
39
|
-
$first: Int!
|
|
40
|
-
$after: Int!
|
|
41
|
-
$sortBy: [GraphqlSort!]
|
|
42
|
-
$filterBy: [GraphqlFilter!]
|
|
43
|
-
$query: String
|
|
44
|
-
) {
|
|
45
|
-
processes(
|
|
46
|
-
first: $first
|
|
47
|
-
after: $after
|
|
48
|
-
sortBy: $sortBy
|
|
49
|
-
filterBy: $filterBy
|
|
50
|
-
query: $query
|
|
51
|
-
) {
|
|
52
|
-
page {
|
|
53
|
-
workflowName
|
|
54
|
-
lastStep
|
|
55
|
-
lastStatus
|
|
56
|
-
workflowTarget
|
|
57
|
-
product {
|
|
58
|
-
name
|
|
59
|
-
tag
|
|
60
|
-
}
|
|
61
|
-
customer {
|
|
62
|
-
fullname
|
|
63
|
-
shortcode
|
|
64
|
-
}
|
|
65
|
-
createdBy
|
|
66
|
-
assignee
|
|
67
|
-
processId
|
|
68
|
-
startedAt
|
|
69
|
-
lastModifiedAt
|
|
70
|
-
isTask
|
|
71
|
-
subscriptions {
|
|
72
|
-
page {
|
|
73
|
-
subscriptionId
|
|
74
|
-
description
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
pageInfo {
|
|
79
|
-
hasNextPage
|
|
80
|
-
hasPreviousPage
|
|
81
|
-
startCursor
|
|
82
|
-
totalItems
|
|
83
|
-
endCursor
|
|
84
|
-
sortFields
|
|
85
|
-
filterFields
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
`);
|
|
90
|
-
|
|
91
|
-
export const getProcessListGraphQlQuery = (): TypedDocumentNode<
|
|
92
|
-
ProcessListResult,
|
|
93
|
-
GraphqlQueryVariables<Process>
|
|
94
|
-
> => GET_PROCESS_LIST_GRAPHQL_QUERY;
|
|
95
|
-
|
|
96
|
-
export const getProcessListSummaryGraphQlQuery = (): TypedDocumentNode<
|
|
97
|
-
ProcessListResult<
|
|
98
|
-
Pick<Process, 'processId' | 'workflowName' | 'startedAt'>
|
|
99
|
-
>,
|
|
100
|
-
GraphqlQueryVariables<Process>
|
|
101
|
-
> => GET_PROCESS_LIST_SUMMARY_GRAPHQL_QUERY;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { parse } from 'graphql';
|
|
2
|
-
import { gql } from 'graphql-request';
|
|
3
|
-
|
|
4
|
-
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
5
|
-
|
|
6
|
-
import { ProcessStepsResult } from '@/types';
|
|
7
|
-
|
|
8
|
-
export const GET_PROCESS_STEPS_GRAPHQL_QUERY: TypedDocumentNode<
|
|
9
|
-
ProcessStepsResult,
|
|
10
|
-
{ processName: string }
|
|
11
|
-
> = parse(gql`
|
|
12
|
-
query ProcessSteps($processName: String!) {
|
|
13
|
-
workflows(filterBy: { field: "name", value: $processName }) {
|
|
14
|
-
page {
|
|
15
|
-
steps {
|
|
16
|
-
name
|
|
17
|
-
assignee
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
`);
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { parse } from 'graphql';
|
|
2
|
-
import { gql } from 'graphql-request';
|
|
3
|
-
|
|
4
|
-
import type { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
5
|
-
|
|
6
|
-
import type { ProductBlockDefinition } from '@/types';
|
|
7
|
-
import { GraphqlQueryVariables, ProductBlockDefinitionsResult } from '@/types';
|
|
8
|
-
|
|
9
|
-
export const GET_PRODUCTS_BLOCKS_GRAPHQL_QUERY: TypedDocumentNode<
|
|
10
|
-
ProductBlockDefinitionsResult,
|
|
11
|
-
GraphqlQueryVariables<ProductBlockDefinition>
|
|
12
|
-
> = parse(gql`
|
|
13
|
-
query MetadataProductBlocks(
|
|
14
|
-
$first: Int!
|
|
15
|
-
$after: Int!
|
|
16
|
-
$sortBy: [GraphqlSort!]
|
|
17
|
-
$query: String
|
|
18
|
-
) {
|
|
19
|
-
productBlocks(
|
|
20
|
-
first: $first
|
|
21
|
-
after: $after
|
|
22
|
-
sortBy: $sortBy
|
|
23
|
-
query: $query
|
|
24
|
-
) {
|
|
25
|
-
page {
|
|
26
|
-
productBlockId
|
|
27
|
-
name
|
|
28
|
-
tag
|
|
29
|
-
description
|
|
30
|
-
status
|
|
31
|
-
createdAt
|
|
32
|
-
endDate
|
|
33
|
-
resourceTypes {
|
|
34
|
-
description
|
|
35
|
-
resourceType
|
|
36
|
-
resourceTypeId
|
|
37
|
-
}
|
|
38
|
-
dependsOn {
|
|
39
|
-
productBlockId
|
|
40
|
-
name
|
|
41
|
-
tag
|
|
42
|
-
description
|
|
43
|
-
status
|
|
44
|
-
createdAt
|
|
45
|
-
endDate
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
pageInfo {
|
|
49
|
-
endCursor
|
|
50
|
-
hasNextPage
|
|
51
|
-
hasPreviousPage
|
|
52
|
-
startCursor
|
|
53
|
-
totalItems
|
|
54
|
-
sortFields
|
|
55
|
-
filterFields
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
`);
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { parse } from 'graphql';
|
|
2
|
-
import { gql } from 'graphql-request';
|
|
3
|
-
|
|
4
|
-
import type { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
GraphqlQueryVariables,
|
|
8
|
-
ProductDefinition,
|
|
9
|
-
ProductDefinitionsResult,
|
|
10
|
-
SubscriptionsResult,
|
|
11
|
-
} from '../types';
|
|
12
|
-
|
|
13
|
-
export const GET_PRODUCTS_GRAPHQL_QUERY = parse(gql`
|
|
14
|
-
query MetadataProducts(
|
|
15
|
-
$first: Int!
|
|
16
|
-
$after: Int!
|
|
17
|
-
$sortBy: [GraphqlSort!]
|
|
18
|
-
$query: String
|
|
19
|
-
) {
|
|
20
|
-
products(first: $first, after: $after, sortBy: $sortBy, query: $query) {
|
|
21
|
-
page {
|
|
22
|
-
productId
|
|
23
|
-
name
|
|
24
|
-
description
|
|
25
|
-
tag
|
|
26
|
-
createdAt
|
|
27
|
-
productType
|
|
28
|
-
status
|
|
29
|
-
productBlocks {
|
|
30
|
-
name
|
|
31
|
-
}
|
|
32
|
-
fixedInputs {
|
|
33
|
-
name
|
|
34
|
-
value
|
|
35
|
-
}
|
|
36
|
-
endDate
|
|
37
|
-
}
|
|
38
|
-
pageInfo {
|
|
39
|
-
endCursor
|
|
40
|
-
hasNextPage
|
|
41
|
-
hasPreviousPage
|
|
42
|
-
startCursor
|
|
43
|
-
totalItems
|
|
44
|
-
sortFields
|
|
45
|
-
filterFields
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
`);
|
|
50
|
-
|
|
51
|
-
export const GET_PRODUCTS_SUMMARY_GRAPHQL_QUERY = parse(gql`
|
|
52
|
-
query MetadataProducts(
|
|
53
|
-
$first: Int!
|
|
54
|
-
$after: Int!
|
|
55
|
-
$sortBy: [GraphqlSort!]
|
|
56
|
-
) {
|
|
57
|
-
products(first: $first, after: $after, sortBy: $sortBy) {
|
|
58
|
-
page {
|
|
59
|
-
name
|
|
60
|
-
subscriptions {
|
|
61
|
-
pageInfo {
|
|
62
|
-
totalItems
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
pageInfo {
|
|
67
|
-
totalItems
|
|
68
|
-
startCursor
|
|
69
|
-
endCursor
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
`);
|
|
74
|
-
|
|
75
|
-
export const getProductsSummaryQuery = (): TypedDocumentNode<
|
|
76
|
-
ProductDefinitionsResult<
|
|
77
|
-
Pick<ProductDefinition, 'name'> & SubscriptionsResult<never>
|
|
78
|
-
>,
|
|
79
|
-
GraphqlQueryVariables<ProductDefinition>
|
|
80
|
-
> => GET_PRODUCTS_SUMMARY_GRAPHQL_QUERY;
|
|
81
|
-
|
|
82
|
-
export const getProductsQuery = (): TypedDocumentNode<
|
|
83
|
-
ProductDefinitionsResult,
|
|
84
|
-
GraphqlQueryVariables<ProductDefinition>
|
|
85
|
-
> => GET_PRODUCTS_GRAPHQL_QUERY;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { parse } from 'graphql';
|
|
2
|
-
import { gql } from 'graphql-request';
|
|
3
|
-
|
|
4
|
-
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
GraphqlFilter,
|
|
8
|
-
GraphqlQueryVariables,
|
|
9
|
-
RelatedSubscription,
|
|
10
|
-
RelatedSubscriptionsResult,
|
|
11
|
-
Subscription,
|
|
12
|
-
} from '../types';
|
|
13
|
-
|
|
14
|
-
export const GET_RELATED_SUBSCRIPTIONS_GRAPHQL_QUERY: TypedDocumentNode<
|
|
15
|
-
RelatedSubscriptionsResult,
|
|
16
|
-
GraphqlQueryVariables<RelatedSubscription> &
|
|
17
|
-
Pick<Subscription, 'subscriptionId'> & {
|
|
18
|
-
terminatedSubscriptionFilter?: GraphqlFilter<RelatedSubscription>;
|
|
19
|
-
}
|
|
20
|
-
> = parse(gql`
|
|
21
|
-
query RelatedSubscriptions(
|
|
22
|
-
$subscriptionId: String!
|
|
23
|
-
$first: Int!
|
|
24
|
-
$after: Int!
|
|
25
|
-
$sortBy: [GraphqlSort!]
|
|
26
|
-
$terminatedSubscriptionFilter: [GraphqlFilter!]
|
|
27
|
-
) {
|
|
28
|
-
subscriptions(
|
|
29
|
-
filterBy: { value: $subscriptionId, field: "subscriptionId" }
|
|
30
|
-
) {
|
|
31
|
-
page {
|
|
32
|
-
subscriptionId
|
|
33
|
-
inUseBySubscriptions(
|
|
34
|
-
first: $first
|
|
35
|
-
after: $after
|
|
36
|
-
sortBy: $sortBy
|
|
37
|
-
filterBy: $terminatedSubscriptionFilter
|
|
38
|
-
) {
|
|
39
|
-
page {
|
|
40
|
-
subscriptionId
|
|
41
|
-
customer {
|
|
42
|
-
fullname
|
|
43
|
-
}
|
|
44
|
-
description
|
|
45
|
-
insync
|
|
46
|
-
startDate
|
|
47
|
-
status
|
|
48
|
-
product {
|
|
49
|
-
tag
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
pageInfo {
|
|
53
|
-
endCursor
|
|
54
|
-
hasNextPage
|
|
55
|
-
hasPreviousPage
|
|
56
|
-
startCursor
|
|
57
|
-
totalItems
|
|
58
|
-
sortFields
|
|
59
|
-
filterFields
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
`);
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { parse } from 'graphql';
|
|
2
|
-
import { gql } from 'graphql-request';
|
|
3
|
-
|
|
4
|
-
import type { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
5
|
-
|
|
6
|
-
import type {
|
|
7
|
-
GraphqlQueryVariables,
|
|
8
|
-
ResourceTypeDefinition,
|
|
9
|
-
ResourceTypeDefinitionsResult,
|
|
10
|
-
} from '@/types';
|
|
11
|
-
|
|
12
|
-
export const GET_RESOURCE_TYPES_GRAPHQL_QUERY: TypedDocumentNode<
|
|
13
|
-
ResourceTypeDefinitionsResult,
|
|
14
|
-
GraphqlQueryVariables<ResourceTypeDefinition>
|
|
15
|
-
> = parse(gql`
|
|
16
|
-
query MetadataResourceTypes(
|
|
17
|
-
$first: Int!
|
|
18
|
-
$after: Int!
|
|
19
|
-
$sortBy: [GraphqlSort!]
|
|
20
|
-
$query: String
|
|
21
|
-
) {
|
|
22
|
-
resourceTypes(
|
|
23
|
-
first: $first
|
|
24
|
-
after: $after
|
|
25
|
-
sortBy: $sortBy
|
|
26
|
-
query: $query
|
|
27
|
-
) {
|
|
28
|
-
page {
|
|
29
|
-
resourceTypeId
|
|
30
|
-
resourceType
|
|
31
|
-
description
|
|
32
|
-
productBlocks {
|
|
33
|
-
description
|
|
34
|
-
name
|
|
35
|
-
productBlockId
|
|
36
|
-
status
|
|
37
|
-
createdAt
|
|
38
|
-
endDate
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
pageInfo {
|
|
42
|
-
endCursor
|
|
43
|
-
hasNextPage
|
|
44
|
-
hasPreviousPage
|
|
45
|
-
startCursor
|
|
46
|
-
totalItems
|
|
47
|
-
sortFields
|
|
48
|
-
filterFields
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
`);
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { parse } from 'graphql';
|
|
2
|
-
import { gql } from 'graphql-request';
|
|
3
|
-
|
|
4
|
-
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
GraphqlQueryVariables,
|
|
8
|
-
SubscriptionDropdownOption,
|
|
9
|
-
SubscriptionDropdownOptionsResult,
|
|
10
|
-
} from '../types';
|
|
11
|
-
|
|
12
|
-
// Avoiding pagination by passing a large number to first. TODO: Fix this better
|
|
13
|
-
export const GET_SUBSCRIPTION_DROPDOWN_OPTIONS_GRAPHQL_QUERY = parse(gql`
|
|
14
|
-
query SubscriptionDropdownOptions($filterBy: [GraphqlFilter!]) {
|
|
15
|
-
subscriptions(filterBy: $filterBy, first: 1000000, after: 0) {
|
|
16
|
-
page {
|
|
17
|
-
description
|
|
18
|
-
subscriptionId
|
|
19
|
-
product {
|
|
20
|
-
tag
|
|
21
|
-
productId
|
|
22
|
-
}
|
|
23
|
-
customer {
|
|
24
|
-
fullname
|
|
25
|
-
customerId
|
|
26
|
-
}
|
|
27
|
-
productBlockInstances {
|
|
28
|
-
id
|
|
29
|
-
ownerSubscriptionId
|
|
30
|
-
parent
|
|
31
|
-
productBlockInstanceValues
|
|
32
|
-
subscriptionInstanceId
|
|
33
|
-
inUseByRelations
|
|
34
|
-
}
|
|
35
|
-
fixedInputs
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
`);
|
|
40
|
-
|
|
41
|
-
export function getSubscriptionDropdownOptionsGraphQlQuery<
|
|
42
|
-
QueryVariablesType = SubscriptionDropdownOption,
|
|
43
|
-
>(): TypedDocumentNode<
|
|
44
|
-
SubscriptionDropdownOptionsResult,
|
|
45
|
-
GraphqlQueryVariables<QueryVariablesType>
|
|
46
|
-
> {
|
|
47
|
-
return GET_SUBSCRIPTION_DROPDOWN_OPTIONS_GRAPHQL_QUERY;
|
|
48
|
-
}
|