@orchestrator-ui/orchestrator-ui-components 0.2.7 → 0.3.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 +10 -9
- package/.turbo/turbo-lint.log +2 -5
- package/.turbo/turbo-test.log +15 -10
- package/CHANGELOG.md +17 -0
- package/dist/index.d.ts +1464 -337
- package/dist/index.js +37266 -8348
- package/package.json +38 -31
- package/src/api/axios.ts +2 -8
- package/src/api/index.ts +59 -4
- package/src/components/WfoBadges/WfoBadge/WfoBadge.tsx +4 -1
- package/src/components/WfoBadges/index.ts +1 -0
- package/src/components/WfoDiff/WfoDiff.tsx +119 -0
- package/src/components/WfoDiff/index.ts +1 -0
- package/src/components/WfoDiff/unidiff.d.ts +1 -0
- package/src/components/WfoError/WfoError.stories.tsx +26 -0
- package/src/components/WfoError/WfoError.tsx +19 -0
- package/src/components/WfoError/index.ts +1 -0
- package/src/components/WfoFilterTabs/WfoFilterTabs.tsx +4 -2
- package/src/components/WfoForms/AutoFieldLoader.tsx +5 -1
- package/src/components/WfoForms/CreateForm.tsx +1 -0
- package/src/components/WfoForms/UserInputForm.tsx +88 -45
- package/src/components/WfoForms/UserInputFormWizard.tsx +11 -4
- package/src/components/WfoForms/formFields/AcceptField.tsx +8 -5
- package/src/components/WfoForms/formFields/BoolField.tsx +1 -1
- package/src/components/WfoForms/formFields/ImsNodeIdField.tsx +2 -2
- package/src/components/WfoForms/formFields/ImsPortIdField.tsx +238 -0
- package/src/components/WfoForms/formFields/ImsPortIdFieldStyling.ts +17 -0
- package/src/components/WfoForms/formFields/ListAddField.tsx +1 -1
- package/src/components/WfoForms/formFields/ListDelField.tsx +1 -1
- package/src/components/WfoForms/formFields/OptGroupField.tsx +1 -1
- package/src/components/WfoForms/formFields/SplitPrefix.tsx +2 -1
- package/src/components/WfoForms/formFields/SubscriptionField.tsx +10 -4
- package/src/components/WfoForms/formFields/SummaryField.tsx +103 -0
- package/src/components/WfoForms/formFields/SummaryFieldStyling.ts +46 -0
- package/src/components/WfoForms/formFields/VlanField.tsx +10 -10
- package/src/components/WfoForms/formFields/index.ts +2 -0
- package/src/components/WfoForms/formFields/surf/types.ts +26 -0
- package/src/components/WfoForms/formFields/utils.spec.ts +89 -9
- package/src/components/WfoJsonCodeBlock/index.ts +1 -0
- package/src/components/WfoKeyValueTable/WfoValueCell.tsx +2 -2
- package/src/components/WfoOptionalLink/WfoOptionalLink.tsx +20 -0
- package/src/components/WfoOptionalLink/index.ts +1 -0
- package/src/components/WfoPageTemplate/WfoBreadcrumbs/WfoBreadcrumbs.tsx +5 -2
- package/src/components/WfoPageTemplate/WfoPageHeader/WfoAppLogo.tsx +28 -0
- package/src/components/WfoPageTemplate/WfoPageHeader/WfoPageHeader.tsx +23 -19
- package/src/components/WfoPageTemplate/WfoPageHeader/styles.ts +29 -0
- package/src/components/WfoPageTemplate/WfoPageHeader/utils/toHexColorWithOpacity.spec.ts +12 -0
- package/src/components/WfoPageTemplate/WfoPageHeader/utils/toHexColorWithOpacity.ts +5 -0
- package/src/components/WfoPageTemplate/WfoSidebar/WfoSidebar.tsx +14 -14
- package/src/components/WfoPageTemplate/WfoSidebar/WfoStartCreateWorkflowButtonComboBox.tsx +15 -12
- package/src/components/WfoPageTemplate/paths.ts +3 -2
- package/src/components/{WfoProcessesList/WfoProcessList.tsx → WfoProcessList/WfoProcessesList.tsx} +46 -38
- package/src/components/WfoProcessList/index.ts +1 -0
- package/src/components/{WfoProcessesList → WfoProcessList}/processListObjectMappers.ts +5 -3
- package/src/components/WfoSearchBar/WfoSearchField.tsx +27 -37
- package/src/components/{WfoSettingsPage → WfoSettings}/WfoEngineStatusButton.tsx +7 -4
- package/src/components/{WfoSettingsPage → WfoSettings}/WfoFlushSettings.tsx +29 -18
- package/src/components/WfoSettings/WfoModifySettings.tsx +38 -0
- package/src/components/WfoSettings/WfoSettings.tsx +40 -0
- package/src/components/{WfoSettingsPage → WfoSettings}/WfoStatus.tsx +21 -14
- package/src/components/WfoSettingsModal/WfoSubmitModal.tsx +61 -0
- package/src/components/WfoSettingsModal/index.tsx +1 -0
- package/src/components/WfoStartTaskButtonComboBox/WfoStartTaskButtonComboBox.tsx +14 -11
- package/src/components/WfoSubscription/WfoProcessesTimeline.tsx +11 -18
- package/src/components/WfoSubscription/WfoRelatedSubscriptions.tsx +4 -1
- package/src/components/WfoSubscription/WfoSubscription.tsx +38 -66
- package/src/components/WfoSubscription/WfoSubscriptionActions.tsx +41 -33
- package/src/components/WfoSubscription/WfoSubscriptionDetailTree.tsx +34 -28
- package/src/components/WfoSubscription/WfoSubscriptionProductBlock.tsx +96 -91
- package/src/components/WfoSubscription/WfoTargetTypeIcon.tsx +26 -0
- package/src/components/WfoSubscription/subscriptionDetailTabs.tsx +29 -0
- package/src/components/WfoSubscription/utils/utils.spec.ts +24 -0
- package/src/components/WfoSubscription/utils/utils.ts +21 -5
- package/src/components/WfoSubscriptionsList/WfoSubscriptionsList.tsx +42 -48
- package/src/components/WfoSubscriptionsList/index.ts +1 -1
- package/src/components/WfoSubscriptionsList/{mapGrapghQlSubscriptionsResultToSubscriptionListItems.ts → mapGraphQlSubscriptionsResultToSubscriptionListItems.ts} +8 -1
- package/src/components/WfoSubscriptionsList/subscriptionListTabs.ts +8 -30
- package/src/components/WfoSummary/WfoSummaryCardHeader/WfoSummaryCardHeader.tsx +55 -0
- package/src/components/WfoSummary/WfoSummaryCardHeader/index.ts +1 -0
- package/src/components/WfoSummary/WfoSummaryCardHeader/styles.ts +26 -0
- package/src/components/WfoSummary/WfoSummaryCardList/WfoSummaryCardList.tsx +86 -0
- package/src/components/WfoSummary/WfoSummaryCardList/WfoSummaryCardListItem.tsx +59 -0
- package/src/components/WfoSummary/WfoSummaryCardList/index.ts +2 -0
- package/src/components/WfoSummary/WfoSummaryCardList/styles.ts +52 -0
- package/src/components/WfoSummary/WfoSummaryCards.tsx +111 -0
- package/src/components/WfoSummary/getNumberOfColumns.ts +14 -0
- package/src/components/WfoSummary/index.ts +4 -0
- package/src/components/WfoSummary/styles.ts +13 -0
- package/src/components/WfoTable/WfoBasicTable/WfoBasicTable.tsx +18 -16
- package/src/components/WfoTable/WfoBasicTable/WfoTableHeaderCell.tsx +2 -2
- package/src/components/WfoTable/WfoBasicTable/index.ts +1 -0
- package/src/components/WfoTable/WfoBasicTable/styles.ts +28 -2
- package/src/components/WfoTable/WfoFirstPartUUID/WfoFirstPartUUID.tsx +12 -3
- package/src/components/WfoTable/WfoFirstPartUUID/styles.ts +12 -0
- package/src/components/WfoTable/WfoTableWithFilter/WfoTableWithFilter.tsx +32 -23
- package/src/components/WfoTable/WfoTableWithFilter/updateQueryString.spec.ts +95 -0
- package/src/components/WfoTable/WfoTableWithFilter/updateQueryString.ts +60 -0
- package/src/components/WfoTable/index.ts +2 -0
- package/src/components/WfoTable/utils/columns.ts +21 -15
- package/src/components/WfoTable/utils/constants.ts +4 -2
- package/src/components/WfoTable/utils/mapSortableAndFilterableValuesToTableColumnConfig.ts +5 -3
- package/src/components/WfoTable/utils/tableUtils.ts +3 -3
- package/src/components/WfoTextAnchor/WfoTextAnchor.stories.tsx +18 -0
- package/src/components/WfoTextAnchor/WfoTextAnchor.tsx +22 -0
- package/src/components/WfoTextAnchor/index.ts +1 -0
- package/src/components/WfoTextAnchor/styles.ts +17 -0
- package/src/components/WfoTimeline/styles.ts +10 -4
- package/src/components/WfoTree/WfoTreeNode.tsx +1 -4
- package/src/components/WfoWorkflowSteps/WfoStep/WfoStep.tsx +42 -26
- package/src/components/WfoWorkflowSteps/WfoStep/WfoStepForm.tsx +48 -0
- package/src/components/WfoWorkflowSteps/WfoStepList/WfoStepList.tsx +10 -10
- package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoStepListHeader.tsx +22 -23
- package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoWorkflowStepList.tsx +97 -17
- package/src/components/WfoWorkflowSteps/index.ts +1 -0
- package/src/components/WfoWorkflowSteps/stepListUtils.ts +1 -28
- package/src/components/confirmationDialog/WfoConfirmationDialog.tsx +3 -3
- package/src/components/index.ts +9 -2
- package/src/contexts/ApiClientContext.tsx +5 -1
- package/src/contexts/ConfirmationDialogProvider.tsx +2 -2
- package/src/contexts/OrchestratorConfigContext.tsx +0 -3
- package/src/contexts/ToastContext.tsx +1 -1
- package/src/contexts/TreeContext.tsx +6 -1
- package/src/graphqlQueries/customersQuery.ts +2 -1
- package/src/graphqlQueries/index.ts +1 -0
- package/src/graphqlQueries/processDetailQuery.ts +8 -0
- package/src/graphqlQueries/processListQuery.ts +48 -7
- package/src/graphqlQueries/processStepsQuery.ts +22 -0
- package/src/graphqlQueries/productBlocksQuery.ts +11 -5
- package/src/graphqlQueries/productsQuery.ts +42 -7
- package/src/graphqlQueries/relatedSubscriptionsQuery.ts +2 -2
- package/src/graphqlQueries/resourceTypesQuery.ts +10 -4
- package/src/graphqlQueries/subscriptionDetailQuery.ts +5 -1
- package/src/graphqlQueries/subscriptionsDropdownOptionsQuery.ts +2 -1
- package/src/graphqlQueries/subscriptionsListQuery.ts +46 -7
- package/src/graphqlQueries/workflows/workflowsQuery.ts +10 -4
- package/src/graphqlQueries/workflows/workflowsQueryForDropdownList.ts +3 -6
- package/src/hooks/DataFetchHooks.ts +20 -61
- package/src/hooks/index.ts +3 -0
- package/src/hooks/surf/useGetSubscriptionDropdownOptions.ts +1 -0
- package/src/hooks/surf/useIsTaggedPort.ts +1 -2
- package/src/hooks/useCheckEngineStatus.ts +30 -0
- package/src/hooks/useDataDisplayParams.ts +3 -3
- package/src/hooks/useEngineStatusQuery.ts +9 -7
- package/src/hooks/useMutateProcess.ts +96 -0
- package/src/hooks/useOrchestratorConfig.ts +0 -3
- package/src/hooks/useQueryWithGraphql.ts +25 -13
- package/src/hooks/useSessionWithToken.ts +3 -5
- package/src/hooks/useSubscriptionActions.ts +8 -2
- package/src/icons/WfoBell.tsx +34 -0
- package/src/icons/WfoContactEnvelopeFill.tsx +29 -0
- package/src/icons/WfoPencil.tsx +21 -0
- package/src/icons/WfoSideMenu.stories.tsx +13 -0
- package/src/icons/WfoSideMenu.tsx +39 -0
- package/src/icons/WfoStatistic.tsx +3 -3
- package/src/icons/WfoViewList.tsx +24 -0
- package/src/icons/index.ts +6 -0
- package/src/messages/{en-US.json → en-GB.json} +117 -39
- package/src/messages/getTranslationMessages.spec.ts +25 -40
- package/src/messages/index.ts +1 -1
- package/src/messages/nl-NL.json +126 -49
- package/src/messages/useGetTranslationMessages.ts +51 -0
- package/src/pages/index.ts +2 -1
- package/src/pages/metadata/WfoProductBlocksPage.tsx +17 -19
- package/src/pages/metadata/WfoProductsPage.tsx +30 -34
- package/src/pages/metadata/WfoResourceTypesPage.tsx +16 -18
- package/src/pages/metadata/WfoWorkflowsPage.tsx +18 -19
- package/src/pages/processes/WfoProcessDetail.tsx +101 -80
- package/src/pages/processes/WfoProcessDetailPage.tsx +35 -17
- package/src/pages/processes/WfoStartProcessPage.tsx +251 -0
- package/src/pages/processes/index.ts +1 -3
- package/src/pages/settings/WfoSettingsPage.tsx +30 -0
- package/src/pages/settings/index.ts +1 -0
- package/src/pages/startPage/WfoStartPage.tsx +239 -0
- package/src/pages/startPage/index.ts +1 -0
- package/src/pages/subscriptions/WfoSubscriptionsListPage.tsx +22 -26
- package/src/pages/tasks/WfoTasksListPage.tsx +169 -0
- package/src/pages/tasks/getTasksListTabTypeFromString.ts +19 -0
- package/src/pages/tasks/index.ts +3 -1
- package/src/pages/tasks/tabConfig.ts +51 -0
- package/src/pages/{processes/WfoProcessListPage.tsx → workflows/WfoWorkflowsListPage.tsx} +30 -32
- package/src/pages/workflows/getWorkflowsListTabTypeFromString.ts +19 -0
- package/src/pages/workflows/index.ts +1 -0
- package/src/pages/{processes → workflows}/tabConfig.ts +9 -9
- package/src/theme/defaultOrchestratorTheme.ts +8 -0
- package/src/types/types.ts +38 -53
- package/src/utils/date.ts +39 -0
- package/src/utils/getDefaultTableConfig.ts +19 -9
- package/tsconfig.json +4 -4
- package/src/components/WfoSettingsPage/WfoModifySettings.tsx +0 -33
- package/src/components/WfoSettingsPage/WfoSettings.tsx +0 -40
- package/src/components/WfoStartPage/WfoFrequentlyUsed.stories.tsx +0 -16
- package/src/components/WfoStartPage/WfoFrequentlyUsed.tsx +0 -21
- package/src/components/WfoStartPage/WfoListItemStartPage.stories.tsx +0 -40
- package/src/components/WfoStartPage/WfoListItemStartPage.tsx +0 -95
- package/src/components/WfoStartPage/WfoListStartPage.stories.tsx +0 -98
- package/src/components/WfoStartPage/WfoListStartPage.tsx +0 -45
- package/src/components/WfoStartPage/WfoMultiListSection.stories.tsx +0 -90
- package/src/components/WfoStartPage/WfoMultiListSection.tsx +0 -25
- package/src/components/WfoStartPage/WfoNewProcessPanel.stories.tsx +0 -13
- package/src/components/WfoStartPage/WfoNewProcessPanel.tsx +0 -45
- package/src/components/WfoStartPage/WfoStatCards.stories.tsx +0 -13
- package/src/components/WfoStartPage/WfoStatCards.tsx +0 -75
- package/src/components/WfoStartPage/index.ts +0 -6
- package/src/hooks/ProcessesHooks/useDeleteProcess.ts +0 -37
- package/src/messages/getTranslationMessages.ts +0 -26
- package/src/pages/processes/getProcessListTabTypeFromString.ts +0 -19
- package/src/pages/tasks/WfoTaskListPage.tsx +0 -120
- package/src/pages/workflow/WfoStartWorkflowPage.tsx +0 -177
- package/src/pages/workflow/index.ts +0 -1
- /package/src/components/{WfoSettingsPage → WfoSettings}/index.ts +0 -0
|
@@ -12,6 +12,7 @@ export type TreeContextType = {
|
|
|
12
12
|
expandAll: () => void;
|
|
13
13
|
collapseAll: () => void;
|
|
14
14
|
resetSelection: () => void;
|
|
15
|
+
selectAll: () => void;
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
export const TreeContext = React.createContext<TreeContextType | null>(null);
|
|
@@ -22,7 +23,7 @@ export type TreeProviderProps = {
|
|
|
22
23
|
|
|
23
24
|
export const TreeProvider: React.FC<TreeProviderProps> = ({ children }) => {
|
|
24
25
|
const [depths, setDepths] = React.useState<number[]>([]);
|
|
25
|
-
const [selectedIds, setSelectedIds] = React.useState<number[]>([]);
|
|
26
|
+
const [selectedIds, setSelectedIds] = React.useState<number[]>([0]);
|
|
26
27
|
const [expandedIds, setExpandedIds] = React.useState<number[]>([0]);
|
|
27
28
|
|
|
28
29
|
const toggleSelectedId = (id: number) => {
|
|
@@ -38,6 +39,9 @@ export const TreeProvider: React.FC<TreeProviderProps> = ({ children }) => {
|
|
|
38
39
|
);
|
|
39
40
|
}
|
|
40
41
|
};
|
|
42
|
+
const selectAll = () => {
|
|
43
|
+
setSelectedIds(Array.from(Array(depths.length).keys()));
|
|
44
|
+
};
|
|
41
45
|
|
|
42
46
|
const toggleExpandedId = (id: number) => {
|
|
43
47
|
if (expandedIds.includes(id)) {
|
|
@@ -106,6 +110,7 @@ export const TreeProvider: React.FC<TreeProviderProps> = ({ children }) => {
|
|
|
106
110
|
expandAll,
|
|
107
111
|
collapseAll,
|
|
108
112
|
resetSelection,
|
|
113
|
+
selectAll,
|
|
109
114
|
}}
|
|
110
115
|
>
|
|
111
116
|
{children}
|
|
@@ -5,10 +5,11 @@ import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
|
5
5
|
|
|
6
6
|
import { CustomersResult } from '../types';
|
|
7
7
|
|
|
8
|
+
// Avoiding pagination by passing a large number to first. TODO: Fix this better
|
|
8
9
|
export const GET_CUSTOMER_GRAPHQL_QUERY: TypedDocumentNode<CustomersResult> =
|
|
9
10
|
parse(gql`
|
|
10
11
|
query Customers {
|
|
11
|
-
customers {
|
|
12
|
+
customers(first: 1000000, after: 0) {
|
|
12
13
|
page {
|
|
13
14
|
fullname
|
|
14
15
|
identifier
|
|
@@ -3,23 +3,22 @@ import { gql } from 'graphql-request';
|
|
|
3
3
|
|
|
4
4
|
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
5
5
|
|
|
6
|
-
import { GraphqlQueryVariables, Process,
|
|
6
|
+
import { GraphqlQueryVariables, Process, ProcessListResult } from '@/types';
|
|
7
7
|
|
|
8
|
-
export const GET_PROCESS_LIST_GRAPHQL_QUERY
|
|
9
|
-
ProcessesResult,
|
|
10
|
-
GraphqlQueryVariables<Process>
|
|
11
|
-
> = parse(gql`
|
|
8
|
+
export const GET_PROCESS_LIST_GRAPHQL_QUERY = parse(gql`
|
|
12
9
|
query ProcessList(
|
|
13
|
-
$first:
|
|
14
|
-
$after:
|
|
10
|
+
$first: Int!
|
|
11
|
+
$after: Int!
|
|
15
12
|
$sortBy: [GraphqlSort!]
|
|
16
13
|
$filterBy: [GraphqlFilter!]
|
|
14
|
+
$query: String
|
|
17
15
|
) {
|
|
18
16
|
processes(
|
|
19
17
|
first: $first
|
|
20
18
|
after: $after
|
|
21
19
|
sortBy: $sortBy
|
|
22
20
|
filterBy: $filterBy
|
|
21
|
+
query: $query
|
|
23
22
|
) {
|
|
24
23
|
page {
|
|
25
24
|
workflowName
|
|
@@ -39,6 +38,7 @@ export const GET_PROCESS_LIST_GRAPHQL_QUERY: TypedDocumentNode<
|
|
|
39
38
|
processId
|
|
40
39
|
startedAt
|
|
41
40
|
lastModifiedAt
|
|
41
|
+
isTask
|
|
42
42
|
subscriptions {
|
|
43
43
|
page {
|
|
44
44
|
subscriptionId
|
|
@@ -58,3 +58,44 @@ export const GET_PROCESS_LIST_GRAPHQL_QUERY: TypedDocumentNode<
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
`);
|
|
61
|
+
|
|
62
|
+
export const GET_PROCESS_LIST_SUMMARY_GRAPHQL_QUERY = parse(gql`
|
|
63
|
+
query ProcessListSummary(
|
|
64
|
+
$first: Int!
|
|
65
|
+
$after: Int!
|
|
66
|
+
$sortBy: [GraphqlSort!]
|
|
67
|
+
$filterBy: [GraphqlFilter!]
|
|
68
|
+
$query: String
|
|
69
|
+
) {
|
|
70
|
+
processes(
|
|
71
|
+
first: $first
|
|
72
|
+
after: $after
|
|
73
|
+
sortBy: $sortBy
|
|
74
|
+
filterBy: $filterBy
|
|
75
|
+
query: $query
|
|
76
|
+
) {
|
|
77
|
+
page {
|
|
78
|
+
processId
|
|
79
|
+
workflowName
|
|
80
|
+
startedAt
|
|
81
|
+
}
|
|
82
|
+
pageInfo {
|
|
83
|
+
totalItems
|
|
84
|
+
startCursor
|
|
85
|
+
endCursor
|
|
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;
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
`);
|
|
@@ -3,19 +3,25 @@ import { gql } from 'graphql-request';
|
|
|
3
3
|
|
|
4
4
|
import type { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
5
5
|
|
|
6
|
-
import type { ProductBlockDefinition } from '
|
|
7
|
-
import { GraphqlQueryVariables, ProductBlockDefinitionsResult } from '
|
|
6
|
+
import type { ProductBlockDefinition } from '@/types';
|
|
7
|
+
import { GraphqlQueryVariables, ProductBlockDefinitionsResult } from '@/types';
|
|
8
8
|
|
|
9
9
|
export const GET_PRODUCTS_BLOCKS_GRAPHQL_QUERY: TypedDocumentNode<
|
|
10
10
|
ProductBlockDefinitionsResult,
|
|
11
11
|
GraphqlQueryVariables<ProductBlockDefinition>
|
|
12
12
|
> = parse(gql`
|
|
13
13
|
query MetadataProductBlocks(
|
|
14
|
-
$first:
|
|
15
|
-
$after:
|
|
14
|
+
$first: Int!
|
|
15
|
+
$after: Int!
|
|
16
16
|
$sortBy: [GraphqlSort!]
|
|
17
|
+
$query: String
|
|
17
18
|
) {
|
|
18
|
-
productBlocks(
|
|
19
|
+
productBlocks(
|
|
20
|
+
first: $first
|
|
21
|
+
after: $after
|
|
22
|
+
sortBy: $sortBy
|
|
23
|
+
query: $query
|
|
24
|
+
) {
|
|
19
25
|
page {
|
|
20
26
|
productBlockId
|
|
21
27
|
name
|
|
@@ -7,18 +7,17 @@ import {
|
|
|
7
7
|
GraphqlQueryVariables,
|
|
8
8
|
ProductDefinition,
|
|
9
9
|
ProductDefinitionsResult,
|
|
10
|
+
SubscriptionsResult,
|
|
10
11
|
} from '../types';
|
|
11
12
|
|
|
12
|
-
export const GET_PRODUCTS_GRAPHQL_QUERY
|
|
13
|
-
ProductDefinitionsResult,
|
|
14
|
-
GraphqlQueryVariables<ProductDefinition>
|
|
15
|
-
> = parse(gql`
|
|
13
|
+
export const GET_PRODUCTS_GRAPHQL_QUERY = parse(gql`
|
|
16
14
|
query MetadataProducts(
|
|
17
|
-
$first:
|
|
18
|
-
$after:
|
|
15
|
+
$first: Int!
|
|
16
|
+
$after: Int!
|
|
19
17
|
$sortBy: [GraphqlSort!]
|
|
18
|
+
$query: String
|
|
20
19
|
) {
|
|
21
|
-
products(first: $first, after: $after, sortBy: $sortBy) {
|
|
20
|
+
products(first: $first, after: $after, sortBy: $sortBy, query: $query) {
|
|
22
21
|
page {
|
|
23
22
|
productId
|
|
24
23
|
name
|
|
@@ -48,3 +47,39 @@ export const GET_PRODUCTS_GRAPHQL_QUERY: TypedDocumentNode<
|
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
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;
|
|
@@ -20,8 +20,8 @@ export const GET_RELATED_SUBSCRIPTIONS_GRAPHQL_QUERY: TypedDocumentNode<
|
|
|
20
20
|
> = parse(gql`
|
|
21
21
|
query RelatedSubscriptions(
|
|
22
22
|
$subscriptionId: String!
|
|
23
|
-
$first:
|
|
24
|
-
$after:
|
|
23
|
+
$first: Int!
|
|
24
|
+
$after: Int!
|
|
25
25
|
$sortBy: [GraphqlSort!]
|
|
26
26
|
$terminatedSubscriptionFilter: [GraphqlFilter!]
|
|
27
27
|
) {
|
|
@@ -7,18 +7,24 @@ import type {
|
|
|
7
7
|
GraphqlQueryVariables,
|
|
8
8
|
ResourceTypeDefinition,
|
|
9
9
|
ResourceTypeDefinitionsResult,
|
|
10
|
-
} from '
|
|
10
|
+
} from '@/types';
|
|
11
11
|
|
|
12
12
|
export const GET_RESOURCE_TYPES_GRAPHQL_QUERY: TypedDocumentNode<
|
|
13
13
|
ResourceTypeDefinitionsResult,
|
|
14
14
|
GraphqlQueryVariables<ResourceTypeDefinition>
|
|
15
15
|
> = parse(gql`
|
|
16
16
|
query MetadataResourceTypes(
|
|
17
|
-
$first:
|
|
18
|
-
$after:
|
|
17
|
+
$first: Int!
|
|
18
|
+
$after: Int!
|
|
19
19
|
$sortBy: [GraphqlSort!]
|
|
20
|
+
$query: String
|
|
20
21
|
) {
|
|
21
|
-
resourceTypes(
|
|
22
|
+
resourceTypes(
|
|
23
|
+
first: $first
|
|
24
|
+
after: $after
|
|
25
|
+
sortBy: $sortBy
|
|
26
|
+
query: $query
|
|
27
|
+
) {
|
|
22
28
|
page {
|
|
23
29
|
resourceTypeId
|
|
24
30
|
resourceType
|
|
@@ -46,7 +46,10 @@ export const GET_SUBSCRIPTION_DETAIL_GRAPHQL_QUERY: TypedDocumentNode<
|
|
|
46
46
|
subscriptionInstanceId
|
|
47
47
|
inUseByRelations
|
|
48
48
|
}
|
|
49
|
-
processes(
|
|
49
|
+
processes(
|
|
50
|
+
sortBy: { field: "startedAt", order: ASC }
|
|
51
|
+
filterBy: { field: "isTask", value: "false" }
|
|
52
|
+
) {
|
|
50
53
|
page {
|
|
51
54
|
processId
|
|
52
55
|
lastStatus
|
|
@@ -54,6 +57,7 @@ export const GET_SUBSCRIPTION_DETAIL_GRAPHQL_QUERY: TypedDocumentNode<
|
|
|
54
57
|
createdBy
|
|
55
58
|
workflowTarget
|
|
56
59
|
workflowName
|
|
60
|
+
isTask
|
|
57
61
|
}
|
|
58
62
|
}
|
|
59
63
|
}
|
|
@@ -9,9 +9,10 @@ import {
|
|
|
9
9
|
SubscriptionDropdownOptionsResult,
|
|
10
10
|
} from '../types';
|
|
11
11
|
|
|
12
|
+
// Avoiding pagination by passing a large number to first. TODO: Fix this better
|
|
12
13
|
export const GET_SUBSCRIPTION_DROPDOWN_OPTIONS_GRAPHQL_QUERY = parse(gql`
|
|
13
14
|
query SubscriptionDropdownOptions($filterBy: [GraphqlFilter!]) {
|
|
14
|
-
subscriptions(filterBy: $filterBy) {
|
|
15
|
+
subscriptions(filterBy: $filterBy, first: 1000000, after: 0) {
|
|
15
16
|
page {
|
|
16
17
|
description
|
|
17
18
|
subscriptionId
|
|
@@ -7,20 +7,22 @@ import {
|
|
|
7
7
|
GraphqlQueryVariables,
|
|
8
8
|
Subscription,
|
|
9
9
|
SubscriptionsResult,
|
|
10
|
-
} from '
|
|
10
|
+
} from '@/types';
|
|
11
11
|
|
|
12
12
|
export const GET_SUBSCRIPTIONS_LIST_GRAPHQL_QUERY = parse(gql`
|
|
13
13
|
query SubscriptionsList(
|
|
14
|
-
$first:
|
|
15
|
-
$after:
|
|
14
|
+
$first: Int!
|
|
15
|
+
$after: Int!
|
|
16
16
|
$sortBy: [GraphqlSort!]
|
|
17
17
|
$filterBy: [GraphqlFilter!]
|
|
18
|
+
$query: String
|
|
18
19
|
) {
|
|
19
20
|
subscriptions(
|
|
20
21
|
first: $first
|
|
21
22
|
after: $after
|
|
22
23
|
sortBy: $sortBy
|
|
23
24
|
filterBy: $filterBy
|
|
25
|
+
query: $query
|
|
24
26
|
) {
|
|
25
27
|
page {
|
|
26
28
|
note
|
|
@@ -35,6 +37,10 @@ export const GET_SUBSCRIPTIONS_LIST_GRAPHQL_QUERY = parse(gql`
|
|
|
35
37
|
tag
|
|
36
38
|
productType
|
|
37
39
|
}
|
|
40
|
+
customer {
|
|
41
|
+
fullname
|
|
42
|
+
shortcode
|
|
43
|
+
}
|
|
38
44
|
}
|
|
39
45
|
pageInfo {
|
|
40
46
|
totalItems
|
|
@@ -49,11 +55,44 @@ export const GET_SUBSCRIPTIONS_LIST_GRAPHQL_QUERY = parse(gql`
|
|
|
49
55
|
}
|
|
50
56
|
`);
|
|
51
57
|
|
|
52
|
-
export
|
|
58
|
+
export const GET_SUBSCRIPTIONS_LIST_SUMMARY_GRAPHQL_QUERY = parse(gql`
|
|
59
|
+
query SubscriptionsList(
|
|
60
|
+
$first: Int!
|
|
61
|
+
$after: Int!
|
|
62
|
+
$sortBy: [GraphqlSort!]
|
|
63
|
+
$filterBy: [GraphqlFilter!]
|
|
64
|
+
$query: String
|
|
65
|
+
) {
|
|
66
|
+
subscriptions(
|
|
67
|
+
first: $first
|
|
68
|
+
after: $after
|
|
69
|
+
sortBy: $sortBy
|
|
70
|
+
filterBy: $filterBy
|
|
71
|
+
query: $query
|
|
72
|
+
) {
|
|
73
|
+
page {
|
|
74
|
+
description
|
|
75
|
+
subscriptionId
|
|
76
|
+
}
|
|
77
|
+
pageInfo {
|
|
78
|
+
totalItems
|
|
79
|
+
startCursor
|
|
80
|
+
endCursor
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
`);
|
|
85
|
+
|
|
86
|
+
export const getSubscriptionsListGraphQlQuery = <
|
|
53
87
|
QueryVariablesType = Subscription,
|
|
54
88
|
>(): TypedDocumentNode<
|
|
55
89
|
SubscriptionsResult,
|
|
56
90
|
GraphqlQueryVariables<QueryVariablesType>
|
|
57
|
-
>
|
|
58
|
-
|
|
59
|
-
|
|
91
|
+
> => GET_SUBSCRIPTIONS_LIST_GRAPHQL_QUERY;
|
|
92
|
+
|
|
93
|
+
export const getSubscriptionsListSummaryGraphQlQuery = <
|
|
94
|
+
QueryVariablesType = Subscription,
|
|
95
|
+
>(): TypedDocumentNode<
|
|
96
|
+
SubscriptionsResult<Pick<Subscription, 'subscriptionId' | 'description'>>,
|
|
97
|
+
GraphqlQueryVariables<QueryVariablesType>
|
|
98
|
+
> => GET_SUBSCRIPTIONS_LIST_SUMMARY_GRAPHQL_QUERY;
|
|
@@ -7,18 +7,24 @@ import {
|
|
|
7
7
|
GraphqlQueryVariables,
|
|
8
8
|
WorkflowDefinition,
|
|
9
9
|
WorkflowDefinitionsResult,
|
|
10
|
-
} from '
|
|
10
|
+
} from '@/types';
|
|
11
11
|
|
|
12
12
|
export const GET_WORKFLOWS_GRAPHQL_QUERY: TypedDocumentNode<
|
|
13
13
|
WorkflowDefinitionsResult,
|
|
14
14
|
GraphqlQueryVariables<WorkflowDefinition>
|
|
15
15
|
> = parse(gql`
|
|
16
16
|
query MetadataWorkflows(
|
|
17
|
-
$first:
|
|
18
|
-
$after:
|
|
17
|
+
$first: Int!
|
|
18
|
+
$after: Int!
|
|
19
19
|
$sortBy: [GraphqlSort!]
|
|
20
|
+
$query: String
|
|
20
21
|
) {
|
|
21
|
-
workflows(
|
|
22
|
+
workflows(
|
|
23
|
+
first: $first
|
|
24
|
+
after: $after
|
|
25
|
+
sortBy: $sortBy
|
|
26
|
+
query: $query
|
|
27
|
+
) {
|
|
22
28
|
page {
|
|
23
29
|
name
|
|
24
30
|
description
|
|
@@ -9,16 +9,13 @@ import {
|
|
|
9
9
|
WorkflowDefinitionsResult,
|
|
10
10
|
} from '../../types';
|
|
11
11
|
|
|
12
|
+
// Avoiding pagination by passing a large number to first. TODO: Fix this better
|
|
12
13
|
export const GET_WORKFLOWS_FOR_DROPDOWN_LIST_GRAPHQL_QUERY: TypedDocumentNode<
|
|
13
14
|
WorkflowDefinitionsResult<WorkflowDefinition>,
|
|
14
15
|
GraphqlQueryVariables<WorkflowDefinition>
|
|
15
16
|
> = parse(gql`
|
|
16
|
-
query StartWorkflows(
|
|
17
|
-
|
|
18
|
-
$after: IntType!
|
|
19
|
-
$filterBy: [GraphqlFilter!]
|
|
20
|
-
) {
|
|
21
|
-
workflows(first: $first, after: $after, filterBy: $filterBy) {
|
|
17
|
+
query StartWorkflows($filterBy: [GraphqlFilter!]) {
|
|
18
|
+
workflows(first: 1000000, after: 0, filterBy: $filterBy) {
|
|
22
19
|
page {
|
|
23
20
|
name
|
|
24
21
|
description
|
|
@@ -1,70 +1,21 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
2
|
import { useQuery } from 'react-query';
|
|
3
3
|
|
|
4
|
-
import { OrchestratorConfigContext } from '
|
|
5
|
-
import { GraphqlFilter,
|
|
4
|
+
import { OrchestratorConfigContext } from '@/contexts';
|
|
5
|
+
import { GraphqlFilter, ProcessDetailResultRaw } from '@/types';
|
|
6
|
+
|
|
6
7
|
import { useQueryWithFetch } from './useQueryWithFetch';
|
|
8
|
+
import { useSessionWithToken } from './useSessionWithToken';
|
|
7
9
|
|
|
8
10
|
export type CacheNames = { [key: string]: string };
|
|
9
11
|
|
|
10
|
-
export const useFavouriteSubscriptions = () => {
|
|
11
|
-
const { orchestratorApiBaseUrl } = useContext(OrchestratorConfigContext);
|
|
12
|
-
const url = `${orchestratorApiBaseUrl}/subscriptions/?range=10%2C15`;
|
|
13
|
-
const initialData: ItemsList = {
|
|
14
|
-
buttonName: 'Show all favourites',
|
|
15
|
-
items: [],
|
|
16
|
-
title: 'Favourite Subscriptions',
|
|
17
|
-
type: 'subscription',
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const { data, isLoading } = useQueryWithFetch<
|
|
21
|
-
ProcessFromRestApi[],
|
|
22
|
-
Record<string, never>
|
|
23
|
-
>(url, {}, 'favouriteSubscriptions');
|
|
24
|
-
return isLoading ? initialData : { ...initialData, items: data || [] };
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const useProcessesAttention = () => {
|
|
28
|
-
const { orchestratorApiBaseUrl } = useContext(OrchestratorConfigContext);
|
|
29
|
-
const url = `${orchestratorApiBaseUrl}/processes/?range=100%2C105`;
|
|
30
|
-
const initialData: ItemsList = {
|
|
31
|
-
type: 'process',
|
|
32
|
-
title: 'Processes that need attention',
|
|
33
|
-
items: [],
|
|
34
|
-
buttonName: 'Show all active processes',
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const { data, isLoading } = useQueryWithFetch<
|
|
38
|
-
ProcessFromRestApi[],
|
|
39
|
-
Record<string, never>
|
|
40
|
-
>(url, {}, 'processesAttention');
|
|
41
|
-
return isLoading ? initialData : { ...initialData, items: data || [] };
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const useRecentProcesses = () => {
|
|
45
|
-
const { orchestratorApiBaseUrl } = useContext(OrchestratorConfigContext);
|
|
46
|
-
const url = `${orchestratorApiBaseUrl}/processes/?range=106%2C111`;
|
|
47
|
-
const initialData: ItemsList = {
|
|
48
|
-
type: 'process',
|
|
49
|
-
title: 'Recently completed processes',
|
|
50
|
-
items: [],
|
|
51
|
-
buttonName: 'Show all completed processes',
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const { data, isLoading } = useQueryWithFetch<
|
|
55
|
-
ProcessFromRestApi[],
|
|
56
|
-
Record<string, never>
|
|
57
|
-
>(url, {}, 'recentProcesses');
|
|
58
|
-
return isLoading ? initialData : { ...initialData, items: data || [] };
|
|
59
|
-
};
|
|
60
|
-
|
|
61
12
|
export const useRawProcessDetails = (processId: string) => {
|
|
62
13
|
const { orchestratorApiBaseUrl } = useContext(OrchestratorConfigContext);
|
|
63
14
|
const url = `${orchestratorApiBaseUrl}/processes/${processId}`;
|
|
64
|
-
return useQueryWithFetch<
|
|
15
|
+
return useQueryWithFetch<ProcessDetailResultRaw, Record<string, never>>(
|
|
65
16
|
url,
|
|
66
17
|
{},
|
|
67
|
-
|
|
18
|
+
`RawProcessDetails-${processId}`,
|
|
68
19
|
);
|
|
69
20
|
};
|
|
70
21
|
|
|
@@ -74,7 +25,7 @@ export const useCacheNames = () => {
|
|
|
74
25
|
return useQueryWithFetch<CacheNames, Record<string, never>>(
|
|
75
26
|
url,
|
|
76
27
|
{},
|
|
77
|
-
'
|
|
28
|
+
'cacheNames',
|
|
78
29
|
);
|
|
79
30
|
};
|
|
80
31
|
|
|
@@ -82,23 +33,31 @@ const filterDataByCriteria = <Type>(
|
|
|
82
33
|
data: Type[],
|
|
83
34
|
filterCriteria: GraphqlFilter<Type>[],
|
|
84
35
|
): Type[] => {
|
|
85
|
-
return data.filter((
|
|
36
|
+
return data.filter((dataItem) => {
|
|
86
37
|
return filterCriteria.some((filter) => {
|
|
87
|
-
|
|
38
|
+
const dataValue = dataItem[filter.field] as unknown as string;
|
|
39
|
+
const filterValue = filter.value;
|
|
40
|
+
return dataValue === filterValue;
|
|
88
41
|
});
|
|
89
42
|
});
|
|
90
43
|
};
|
|
91
44
|
|
|
92
45
|
export const useFilterQueryWithRest = <Type>(
|
|
93
|
-
|
|
46
|
+
url: string,
|
|
94
47
|
queryKey: string[],
|
|
95
48
|
filters?: GraphqlFilter<Type>[],
|
|
96
49
|
refetchInterval?: number,
|
|
97
50
|
) => {
|
|
98
|
-
const {
|
|
51
|
+
const { session } = useSessionWithToken();
|
|
99
52
|
|
|
100
53
|
const fetchFromApi = async () => {
|
|
101
|
-
const response = await fetch(
|
|
54
|
+
const response = await fetch(url, {
|
|
55
|
+
headers: {
|
|
56
|
+
Authorization: session?.accessToken
|
|
57
|
+
? `Bearer ${session.accessToken}`
|
|
58
|
+
: '',
|
|
59
|
+
},
|
|
60
|
+
});
|
|
102
61
|
const data = await response.json();
|
|
103
62
|
return filters ? filterDataByCriteria(data, filters) : data;
|
|
104
63
|
};
|
package/src/hooks/index.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
export * from './useCheckEngineStatus';
|
|
1
2
|
export * from './useQueryWithGraphql';
|
|
2
3
|
export * from './useEngineStatusQuery';
|
|
4
|
+
export * from './useMutateProcess';
|
|
3
5
|
export * from './useOrchestratorConfig';
|
|
4
6
|
export * from './useOrchestratorTheme';
|
|
5
7
|
export * from './useProcessStatusCountsQuery';
|
|
@@ -10,3 +12,4 @@ export * from './useToastMessage';
|
|
|
10
12
|
export * from './useStoredTableConfig';
|
|
11
13
|
export * from './useWithOrchestratorTheme';
|
|
12
14
|
export * from './useSessionWithToken';
|
|
15
|
+
export * from './useQueryWithFetch';
|
|
@@ -10,8 +10,7 @@ export const useIsTaggedPort = (subscriptionId: string): [boolean, boolean] => {
|
|
|
10
10
|
GET_SUBSCRIPTION_DETAIL_GRAPHQL_QUERY,
|
|
11
11
|
{ subscriptionId },
|
|
12
12
|
`subscription-${subscriptionId}`,
|
|
13
|
-
|
|
14
|
-
!!subscriptionId,
|
|
13
|
+
{ enabled: !!subscriptionId },
|
|
15
14
|
);
|
|
16
15
|
const subscriptionDetail = data?.subscriptions.page[0];
|
|
17
16
|
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useTranslations } from 'next-intl';
|
|
2
|
+
|
|
3
|
+
import { ToastTypes } from '@/contexts';
|
|
4
|
+
import { useEngineStatusQuery } from '@/hooks/useEngineStatusQuery';
|
|
5
|
+
import { useToastMessage } from '@/hooks/useToastMessage';
|
|
6
|
+
|
|
7
|
+
export const useCheckEngineStatus = () => {
|
|
8
|
+
const tErrors = useTranslations('errors');
|
|
9
|
+
const toastMessage = useToastMessage();
|
|
10
|
+
const { refetch } = useEngineStatusQuery();
|
|
11
|
+
|
|
12
|
+
const isEngineRunningNow = async () => {
|
|
13
|
+
const result = await refetch();
|
|
14
|
+
const isEngineRunning = result.data?.global_status === 'RUNNING';
|
|
15
|
+
|
|
16
|
+
if (!isEngineRunning) {
|
|
17
|
+
toastMessage.addToast(
|
|
18
|
+
ToastTypes.ERROR,
|
|
19
|
+
tErrors('notAllowedWhenEngineIsNotRunningMessage'),
|
|
20
|
+
tErrors('notAllowedWhenEngineIsNotRunningTitle'),
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return isEngineRunning;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
isEngineRunningNow,
|
|
29
|
+
};
|
|
30
|
+
};
|