@orchestrator-ui/orchestrator-ui-components 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/.turbo/turbo-build.log +4 -4
  2. package/.turbo/turbo-lint.log +1 -1
  3. package/.turbo/turbo-test.log +1 -1
  4. package/CHANGELOG.md +12 -0
  5. package/dist/index.d.ts +55 -32
  6. package/dist/index.js +397 -82
  7. package/package.json +1 -1
  8. package/src/components/WFOBadges/{WFOStatusBadge/WFOStatusBadge.stories.tsx → WFOSubscriptionStatusBadge/WFOSubscriptionStatusBadge.stories.tsx} +4 -4
  9. package/src/components/WFOBadges/{WFOStatusBadge/WFOStatusBadge.tsx → WFOSubscriptionStatusBadge/WFOSubscriptionStatusBadge.tsx} +5 -3
  10. package/src/components/WFOBadges/WFOSubscriptionStatusBadge/index.ts +1 -0
  11. package/src/components/WFOBadges/index.ts +1 -1
  12. package/src/components/{WFOBreadcrumbs → WFOPageTemplate/WFOBreadcrumbs}/WFOBreadcrumbs.tsx +1 -1
  13. package/src/components/WFOPageTemplate/WFOPageTemplate/WFOPageTemplate.tsx +2 -0
  14. package/src/components/WFOPageTemplate/WFOSidebar/WFOSidebar.tsx +14 -12
  15. package/src/components/WFOPageTemplate/index.ts +1 -0
  16. package/src/components/WFOPageTemplate/paths.ts +11 -0
  17. package/src/components/WFOSubscription/WFOSubscriptionBlock.tsx +3 -2
  18. package/src/components/WFOSubscriptionsList/WFOSubscriptionsList.tsx +199 -0
  19. package/src/components/WFOSubscriptionsList/index.ts +4 -0
  20. package/src/components/WFOSubscriptionsList/mapGrapghQlSubscriptionsResultToSubscriptionListItems.ts +34 -0
  21. package/src/{pages/subscriptions → components/WFOSubscriptionsList}/types.ts +0 -2
  22. package/src/components/WFOTable/utils/constants.ts +2 -0
  23. package/src/components/index.ts +1 -1
  24. package/src/graphqlQueries/index.ts +2 -1
  25. package/src/graphqlQueries/processListQuery.ts +5 -8
  26. package/src/graphqlQueries/productsQuery.ts +3 -4
  27. package/src/graphqlQueries/subscriptionsListQuery.ts +55 -0
  28. package/src/graphqlQueries/workflowsQuery.ts +3 -4
  29. package/src/index.ts +1 -0
  30. package/src/messages/en-US.json +4 -3
  31. package/src/messages/nl-NL.json +4 -3
  32. package/src/pages/metadata/WFOProductBlocksPage.tsx +4 -2
  33. package/src/pages/metadata/WFOProductsPage.tsx +4 -2
  34. package/src/pages/processes/WFOProcessListPage.tsx +22 -13
  35. package/src/pages/processes/tableConfig.ts +3 -3
  36. package/src/pages/subscriptions/WFOSubscriptionsListPage.tsx +85 -0
  37. package/src/pages/subscriptions/index.ts +1 -2
  38. package/src/types/index.ts +2 -0
  39. package/src/types/subscription.ts +21 -0
  40. package/src/{types.ts → types/types.ts} +14 -17
  41. package/src/components/WFOBadges/WFOStatusBadge/index.ts +0 -1
  42. /package/src/components/{WFOBreadcrumbs → WFOPageTemplate/WFOBreadcrumbs}/index.ts +0 -0
  43. /package/src/{pages/subscriptions → components/WFOSubscriptionsList}/subscriptionListTabs.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orchestrator-ui/orchestrator-ui-components",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -1,9 +1,9 @@
1
1
  import type { Meta } from '@storybook/react';
2
- import { WFOStatusBadge } from './WFOStatusBadge';
2
+ import { WFOSubscriptionStatusBadge } from './WFOSubscriptionStatusBadge';
3
3
 
4
- const Story: Meta<typeof WFOStatusBadge> = {
5
- component: WFOStatusBadge,
6
- title: 'Badges/WFOStatusBadge',
4
+ const Story: Meta<typeof WFOSubscriptionStatusBadge> = {
5
+ component: WFOSubscriptionStatusBadge,
6
+ title: 'Badges/WFOSubscriptionStatusBadge',
7
7
  };
8
8
  export default Story;
9
9
 
@@ -2,11 +2,13 @@ import { WFOBadge } from '../WFOBadge';
2
2
  import React, { FC } from 'react';
3
3
  import { useOrchestratorTheme } from '../../../hooks';
4
4
 
5
- export type WFOStatusBadgeProps = {
5
+ export type WFOSubscriptionStatusBadgeProps = {
6
6
  status: string;
7
7
  };
8
8
 
9
- export const WFOStatusBadge: FC<WFOStatusBadgeProps> = ({ status }) => {
9
+ export const WFOSubscriptionStatusBadge: FC<
10
+ WFOSubscriptionStatusBadgeProps
11
+ > = ({ status }) => {
10
12
  const { theme, toSecondaryColor } = useOrchestratorTheme();
11
13
 
12
14
  const getBadgeColorFromStatus = (status: string) => {
@@ -19,7 +21,7 @@ export const WFOStatusBadge: FC<WFOStatusBadgeProps> = ({ status }) => {
19
21
  successText,
20
22
  } = theme.colors;
21
23
 
22
- switch (status) {
24
+ switch (status.toLowerCase()) {
23
25
  case 'active':
24
26
  return {
25
27
  badgeColor: toSecondaryColor(success),
@@ -0,0 +1 @@
1
+ export * from './WFOSubscriptionStatusBadge';
@@ -1,5 +1,5 @@
1
1
  export * from './WFOBadge';
2
- export * from './WFOStatusBadge';
2
+ export * from './WFOSubscriptionStatusBadge';
3
3
  export * from './WFOProductBlockBadge';
4
4
  export * from './WFOProcessStatusBadge';
5
5
  export * from './WFOFailedTasksBadge';
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { EuiBreadcrumb, EuiBreadcrumbs, EuiSpacer } from '@elastic/eui';
3
3
  import { useRouter } from 'next/router';
4
- import { isUuid4, removeSuffix, upperCaseFirstChar } from '../../utils';
4
+ import { isUuid4, removeSuffix, upperCaseFirstChar } from '../../../utils';
5
5
 
6
6
  export const WFOBreadcrumbs = () => {
7
7
  const router = useRouter();
@@ -3,6 +3,7 @@ import { EuiPageTemplate } from '@elastic/eui';
3
3
  import { WFOPageHeader } from '../WFOPageHeader';
4
4
  import { WFOSidebar } from '../WFOSidebar';
5
5
  import { useOrchestratorTheme } from '../../../hooks/useOrchestratorTheme';
6
+ import { WFOBreadcrumbs } from '../WFOBreadcrumbs';
6
7
 
7
8
  export interface WFOPageTemplateProps {
8
9
  getAppLogo: (navigationHeight: number) => ReactElement;
@@ -50,6 +51,7 @@ export const WFOPageTemplate: FC<WFOPageTemplateProps> = ({
50
51
  backgroundColor: theme.colors.emptyShade,
51
52
  }}
52
53
  >
54
+ <WFOBreadcrumbs />
53
55
  {children}
54
56
  </EuiPageTemplate.Section>
55
57
  </EuiPageTemplate>
@@ -1,17 +1,19 @@
1
1
  import React, { FC } from 'react';
2
2
  import { EuiButton, EuiSideNav, EuiSpacer } from '@elastic/eui';
3
3
  import { useRouter } from 'next/router';
4
-
5
- const PATH_START = '/';
6
- const PATH_NEW_PROCESS = '/new-process';
7
- const PATH_PROCESSES = '/processes';
8
- const PATH_SUBSCRIPTIONS = '/subscriptions';
9
- const PATH_METADATA_PRODUCTS = '/metadata/products';
10
- const PATH_METADATA_PRODUCT_BLOCKS = '/metadata/productblocks';
11
- const PATH_METADATA_RESOURCE_TYPES = '/metadata/resource-types';
12
- const PATH_METADATA_WORKFLOWS = '/metadata/workflows';
13
- const PATH_TASKS = '/tasks';
14
- const PATH_SETTINGS = '/settings';
4
+ import {
5
+ PATH_METADATA,
6
+ PATH_METADATA_PRODUCT_BLOCKS,
7
+ PATH_METADATA_PRODUCTS,
8
+ PATH_METADATA_RESOURCE_TYPES,
9
+ PATH_METADATA_WORKFLOWS,
10
+ PATH_NEW_PROCESS,
11
+ PATH_PROCESSES,
12
+ PATH_SETTINGS,
13
+ PATH_START,
14
+ PATH_SUBSCRIPTIONS,
15
+ PATH_TASKS,
16
+ } from '../paths';
15
17
 
16
18
  export const WFOSidebar: FC = () => {
17
19
  const router = useRouter();
@@ -78,7 +80,7 @@ export const WFOSidebar: FC = () => {
78
80
  name: 'Metadata',
79
81
  id: '5',
80
82
  onClick: () => {
81
- router.push(PATH_METADATA_PRODUCTS);
83
+ router.push(PATH_METADATA);
82
84
  },
83
85
  items: [
84
86
  {
@@ -1,3 +1,4 @@
1
1
  export * from './WFOPageHeader';
2
2
  export * from './WFOPageTemplate';
3
3
  export * from './WFOSidebar';
4
+ export * from './paths';
@@ -0,0 +1,11 @@
1
+ export const PATH_START = '/';
2
+ export const PATH_NEW_PROCESS = '/new-process';
3
+ export const PATH_PROCESSES = '/processes';
4
+ export const PATH_SUBSCRIPTIONS = '/subscriptions';
5
+ export const PATH_METADATA = '/metadata';
6
+ export const PATH_METADATA_PRODUCTS = '/metadata/products';
7
+ export const PATH_METADATA_PRODUCT_BLOCKS = '/metadata/productblocks';
8
+ export const PATH_METADATA_RESOURCE_TYPES = '/metadata/resource-types';
9
+ export const PATH_METADATA_WORKFLOWS = '/metadata/workflows';
10
+ export const PATH_TASKS = '/tasks';
11
+ export const PATH_SETTINGS = '/settings';
@@ -9,7 +9,7 @@ import {
9
9
  } from '@elastic/eui';
10
10
  import { useTranslations } from 'next-intl';
11
11
  import { WFOCheckmarkCircleFill, WFOMinusCircleOutline } from '../../icons';
12
- import { WFOStatusBadge } from '../WFOBadges';
12
+ import { WFOSubscriptionStatusBadge } from '../WFOBadges';
13
13
  import {
14
14
  subscriptionDefinitionCellStyle,
15
15
  subscriptionTableRowStyle,
@@ -18,7 +18,8 @@ import {
18
18
 
19
19
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
20
  export const RenderField = (field: string, data: any) => {
21
- if (field === 'status') return <WFOStatusBadge status={data[field]} />;
21
+ if (field === 'status')
22
+ return <WFOSubscriptionStatusBadge status={data[field]} />;
22
23
  else if (field === 'insync')
23
24
  return (
24
25
  <div style={{ position: 'relative', top: 5 }}>
@@ -0,0 +1,199 @@
1
+ import React from 'react';
2
+ import { FC } from 'react';
3
+ import { useRouter } from 'next/router';
4
+ import Link from 'next/link';
5
+ import { EuiFlexItem, Pagination } from '@elastic/eui';
6
+ import { useTranslations } from 'next-intl';
7
+ import {
8
+ DEFAULT_PAGE_SIZES,
9
+ getDataSortHandler,
10
+ getEsQueryStringHandler,
11
+ getPageChangeHandler,
12
+ SUBSCRIPTIONS_TABLE_LOCAL_STORAGE_KEY,
13
+ TableColumnKeys,
14
+ WFODataSorting,
15
+ WFOTableColumns,
16
+ WFOTableControlColumnConfig,
17
+ WFOTableWithFilter,
18
+ } from '../WFOTable';
19
+ import { SubscriptionListItem } from './types';
20
+ import { FilterQuery } from '../WFOFilterTabs';
21
+ import { DataDisplayParams } from '../../hooks/useDataDisplayParams';
22
+ import { useOrchestratorTheme } from '../../hooks/useOrchestratorTheme';
23
+ import { getFirstUuidPart } from '../../utils/uuid';
24
+ import { WFOSubscriptionStatusBadge } from '../WFOBadges/WFOSubscriptionStatusBadge';
25
+ import {
26
+ WFOCheckmarkCircleFill,
27
+ WFOMinusCircleOutline,
28
+ WFOPlusCircleFill,
29
+ } from '../../icons';
30
+ import { parseDateToLocaleString } from '../../utils/date';
31
+ import { useQueryWithGraphql } from '../../hooks/useQueryWithGraphql';
32
+ import { getSubscriptionsListGraphQlQuery } from '../../graphqlQueries/subscriptionsListQuery';
33
+ import { getTypedFieldFromObject } from '../../utils/getTypedFieldFromObject';
34
+ import { WFOLoading } from '../WFOLoading';
35
+ import { SortOrder } from '../../types';
36
+ import { mapGrapghQlSubscriptionsResultToSubscriptionListItems } from './mapGrapghQlSubscriptionsResultToSubscriptionListItems';
37
+
38
+ const FIELD_NAME_INLINE_SUBSCRIPTION_DETAILS = 'inlineSubscriptionDetails';
39
+
40
+ const defaultHiddenColumns: TableColumnKeys<SubscriptionListItem> = [
41
+ 'productName',
42
+ ];
43
+
44
+ export type WFOSubscriptionsListProps = {
45
+ alwaysOnFilters?: FilterQuery<SubscriptionListItem>[];
46
+ dataDisplayParams: DataDisplayParams<SubscriptionListItem>;
47
+ setDataDisplayParam: <
48
+ DisplayParamKey extends keyof DataDisplayParams<SubscriptionListItem>,
49
+ >(
50
+ prop: DisplayParamKey,
51
+ value: DataDisplayParams<SubscriptionListItem>[DisplayParamKey],
52
+ ) => void;
53
+ };
54
+
55
+ export const WFOSubscriptionsList: FC<WFOSubscriptionsListProps> = ({
56
+ alwaysOnFilters,
57
+ dataDisplayParams,
58
+ setDataDisplayParam,
59
+ }) => {
60
+ const router = useRouter();
61
+ const t = useTranslations('subscriptions.index');
62
+
63
+ const { theme } = useOrchestratorTheme();
64
+
65
+ const tableColumns: WFOTableColumns<SubscriptionListItem> = {
66
+ subscriptionId: {
67
+ field: 'subscriptionId',
68
+ name: t('id'),
69
+ width: '100',
70
+ render: (value) => getFirstUuidPart(value),
71
+ },
72
+ description: {
73
+ field: 'description',
74
+ name: t('description'),
75
+ width: '400',
76
+ render: (value, record) => (
77
+ <Link href={`/subscriptions/${record.subscriptionId}`}>
78
+ {value}
79
+ </Link>
80
+ ),
81
+ },
82
+ status: {
83
+ field: 'status',
84
+ name: t('status'),
85
+ width: '110',
86
+ render: (value) => (
87
+ <WFOSubscriptionStatusBadge status={value.toLowerCase()} />
88
+ ),
89
+ },
90
+ insync: {
91
+ field: 'insync',
92
+ name: t('insync'),
93
+ width: '110',
94
+ render: (value) =>
95
+ value ? (
96
+ <WFOCheckmarkCircleFill color={theme.colors.primary} />
97
+ ) : (
98
+ <WFOMinusCircleOutline color={theme.colors.mediumShade} />
99
+ ),
100
+ },
101
+ productName: {
102
+ field: 'productName',
103
+ name: t('product'),
104
+ },
105
+ tag: {
106
+ field: 'tag',
107
+ name: t('tag'),
108
+ width: '100',
109
+ },
110
+ startDate: {
111
+ field: 'startDate',
112
+ name: t('startDate'),
113
+ width: '150',
114
+ render: parseDateToLocaleString,
115
+ },
116
+ endDate: {
117
+ field: 'endDate',
118
+ name: t('endDate'),
119
+ width: '150',
120
+ render: parseDateToLocaleString,
121
+ },
122
+ note: {
123
+ field: 'note',
124
+ name: t('note'),
125
+ },
126
+ };
127
+
128
+ const leadingControlColumns: WFOTableControlColumnConfig<SubscriptionListItem> =
129
+ {
130
+ inlineSubscriptionDetails: {
131
+ field: FIELD_NAME_INLINE_SUBSCRIPTION_DETAILS,
132
+ width: '40',
133
+ render: () => (
134
+ <EuiFlexItem>
135
+ <WFOPlusCircleFill color={theme.colors.mediumShade} />
136
+ </EuiFlexItem>
137
+ ),
138
+ },
139
+ };
140
+
141
+ const { sortBy } = dataDisplayParams;
142
+ const { data, isFetching } = useQueryWithGraphql(
143
+ getSubscriptionsListGraphQlQuery<SubscriptionListItem>(),
144
+ {
145
+ first: dataDisplayParams.pageSize,
146
+ after: dataDisplayParams.pageIndex * dataDisplayParams.pageSize,
147
+ sortBy,
148
+ filterBy: alwaysOnFilters,
149
+ },
150
+ 'subscriptions',
151
+ true,
152
+ );
153
+
154
+ const sortedColumnId = getTypedFieldFromObject(sortBy?.field, tableColumns);
155
+ if (!sortedColumnId) {
156
+ router.replace('/subscriptions');
157
+ return null;
158
+ }
159
+
160
+ if (!data) {
161
+ return <WFOLoading />;
162
+ }
163
+
164
+ const dataSorting: WFODataSorting<SubscriptionListItem> = {
165
+ field: sortedColumnId,
166
+ sortOrder: dataDisplayParams.sortBy?.order ?? SortOrder.ASC,
167
+ };
168
+ const { totalItems } = data.subscriptions.pageInfo;
169
+ const pagination: Pagination = {
170
+ pageSize: dataDisplayParams.pageSize,
171
+ pageIndex: dataDisplayParams.pageIndex,
172
+ pageSizeOptions: DEFAULT_PAGE_SIZES,
173
+ totalItemCount: totalItems ?? 0,
174
+ };
175
+
176
+ return (
177
+ <WFOTableWithFilter<SubscriptionListItem>
178
+ esQueryString={dataDisplayParams.esQueryString}
179
+ onUpdateEsQueryString={getEsQueryStringHandler<SubscriptionListItem>(
180
+ setDataDisplayParam,
181
+ )}
182
+ data={mapGrapghQlSubscriptionsResultToSubscriptionListItems(data)}
183
+ tableColumns={tableColumns}
184
+ leadingControlColumns={leadingControlColumns}
185
+ defaultHiddenColumns={defaultHiddenColumns}
186
+ dataSorting={dataSorting}
187
+ pagination={pagination}
188
+ isLoading={isFetching}
189
+ localStorageKey={SUBSCRIPTIONS_TABLE_LOCAL_STORAGE_KEY}
190
+ onUpdatePage={getPageChangeHandler<SubscriptionListItem>(
191
+ setDataDisplayParam,
192
+ )}
193
+ onUpdateDataSort={getDataSortHandler<SubscriptionListItem>(
194
+ dataDisplayParams,
195
+ setDataDisplayParam,
196
+ )}
197
+ />
198
+ );
199
+ };
@@ -0,0 +1,4 @@
1
+ export * from './mapGrapghQlSubscriptionsResultToSubscriptionListItems';
2
+ export * from './subscriptionListTabs';
3
+ export * from './WFOSubscriptionsList';
4
+ export * from './types';
@@ -0,0 +1,34 @@
1
+ import { SubscriptionsResult } from '../../types';
2
+ import { SubscriptionListItem } from './types';
3
+ import { parseDate } from '../../utils';
4
+
5
+ export function mapGrapghQlSubscriptionsResultToSubscriptionListItems(
6
+ graphqlResponse: SubscriptionsResult,
7
+ ): SubscriptionListItem[] {
8
+ return graphqlResponse.subscriptions.page.map((subscription) => {
9
+ const {
10
+ description,
11
+ insync,
12
+ product,
13
+ startDate,
14
+ endDate,
15
+ status,
16
+ subscriptionId,
17
+ note,
18
+ } = subscription;
19
+
20
+ const { name: productName, tag } = product;
21
+
22
+ return {
23
+ description,
24
+ insync,
25
+ productName,
26
+ tag,
27
+ startDate: parseDate(startDate),
28
+ endDate: parseDate(endDate),
29
+ status,
30
+ subscriptionId,
31
+ note: note ?? null,
32
+ };
33
+ });
34
+ }
@@ -1,5 +1,3 @@
1
- // Todo: preparation for moving the Subscriptions component (table) to the lib
2
- // https://github.com/workfloworchestrator/orchestrator-ui/issues/149
3
1
  export type SubscriptionListItem = {
4
2
  subscriptionId: string;
5
3
  description: string;
@@ -13,3 +13,5 @@ export const METADATA_PRODUCTBLOCKS_TABLE_LOCAL_STORAGE_KEY =
13
13
  export const METADATA_PRODUCT_TABLE_LOCAL_STORAGE_KEY = 'metadataProductTable';
14
14
  export const METADATA_WORKFLOWS_TABLE_LOCAL_STORAGE_KEY =
15
15
  'metadataWorkflowsTable';
16
+
17
+ export const SUBSCRIPTIONS_TABLE_LOCAL_STORAGE_KEY = 'subscriptionsTable';
@@ -1,5 +1,5 @@
1
1
  export * from './WFOBadges';
2
- export * from './WFOBreadcrumbs';
2
+ export * from './WFOPageTemplate/WFOBreadcrumbs';
3
3
  export * from './WFOFilterTabs';
4
4
  export * from './WFOPageTemplate';
5
5
  export * from './WFOSearchBar';
@@ -1,3 +1,4 @@
1
+ export * from './subscriptionsListQuery';
1
2
  export * from './productBlocksQuery';
2
- export * from './resourceTypesQuery';
3
3
  export * from './productsQuery';
4
+ export * from './resourceTypesQuery';
@@ -1,14 +1,10 @@
1
1
  import { parse } from 'graphql';
2
2
  import { gql } from 'graphql-request';
3
3
  import { TypedDocumentNode } from '@graphql-typed-document-node/core';
4
- import {
5
- GraphqlQueryVariables,
6
- Process,
7
- ProcessesDefinitionsResult,
8
- } from '../types';
4
+ import { GraphqlQueryVariables, Process, ProcessesResult } from '../types';
9
5
 
10
6
  export const GET_PROCESS_LIST_GRAPHQL_QUERY: TypedDocumentNode<
11
- ProcessesDefinitionsResult,
7
+ ProcessesResult,
12
8
  GraphqlQueryVariables<Process>
13
9
  > = parse(gql`
14
10
  query ProcessList(
@@ -25,15 +21,16 @@ export const GET_PROCESS_LIST_GRAPHQL_QUERY: TypedDocumentNode<
25
21
  ) {
26
22
  page {
27
23
  workflowName
28
- lastStep
24
+ step
29
25
  status
30
26
  product
31
27
  customer
32
28
  createdBy
33
29
  assignee
34
- id
30
+ processId
35
31
  started
36
32
  lastModified
33
+ workflowTarget
37
34
  subscriptions {
38
35
  page {
39
36
  subscriptionId
@@ -1,12 +1,11 @@
1
1
  import { gql } from 'graphql-request';
2
2
  import { parse } from 'graphql';
3
3
  import type { TypedDocumentNode } from '@graphql-typed-document-node/core';
4
-
5
- import type {
6
- ProductDefinition,
4
+ import {
7
5
  GraphqlQueryVariables,
6
+ ProductDefinition,
8
7
  ProductDefinitionsResult,
9
- } from '@orchestrator-ui/orchestrator-ui-components';
8
+ } from '../types';
10
9
 
11
10
  export const GET_PRODUCTS_GRAPHQL_QUERY: TypedDocumentNode<
12
11
  ProductDefinitionsResult,
@@ -0,0 +1,55 @@
1
+ import { parse } from 'graphql';
2
+ import { gql } from 'graphql-request';
3
+ import { TypedDocumentNode } from '@graphql-typed-document-node/core';
4
+ import {
5
+ GraphqlQueryVariables,
6
+ Subscription,
7
+ SubscriptionsResult,
8
+ } from '../types';
9
+
10
+ export const GET_SUBSCRIPTIONS_LIST_GRAPHQL_QUERY = parse(gql`
11
+ query SubscriptionsList(
12
+ $first: IntType!
13
+ $after: IntType!
14
+ $sortBy: [GraphqlSort!]
15
+ $filterBy: [GraphqlFilter!]
16
+ ) {
17
+ subscriptions(
18
+ first: $first
19
+ after: $after
20
+ sortBy: $sortBy
21
+ filterBy: $filterBy
22
+ ) {
23
+ page {
24
+ note
25
+ startDate
26
+ endDate
27
+ description
28
+ insync
29
+ status
30
+ subscriptionId
31
+ product {
32
+ name
33
+ tag
34
+ productType
35
+ }
36
+ }
37
+ pageInfo {
38
+ totalItems
39
+ startCursor
40
+ hasPreviousPage
41
+ hasNextPage
42
+ endCursor
43
+ }
44
+ }
45
+ }
46
+ `);
47
+
48
+ export function getSubscriptionsListGraphQlQuery<
49
+ QueryVariablesType = Subscription,
50
+ >(): TypedDocumentNode<
51
+ SubscriptionsResult,
52
+ GraphqlQueryVariables<QueryVariablesType>
53
+ > {
54
+ return GET_SUBSCRIPTIONS_LIST_GRAPHQL_QUERY;
55
+ }
@@ -1,12 +1,11 @@
1
1
  import { gql } from 'graphql-request';
2
2
  import { parse } from 'graphql';
3
3
  import type { TypedDocumentNode } from '@graphql-typed-document-node/core';
4
-
5
- import type {
6
- WorkflowDefinition,
4
+ import {
7
5
  GraphqlQueryVariables,
6
+ WorkflowDefinition,
8
7
  WorkflowDefinitionsResult,
9
- } from '@orchestrator-ui/orchestrator-ui-components';
8
+ } from '../types';
10
9
 
11
10
  export const GET_WORKFLOWS_GRAPHQL_QUERY: TypedDocumentNode<
12
11
  WorkflowDefinitionsResult,
package/src/index.ts CHANGED
@@ -7,3 +7,4 @@ export * from './types';
7
7
  export * from './hooks';
8
8
  export * from './messages';
9
9
  export * from './pages';
10
+ export * from './graphqlQueries';
@@ -57,16 +57,17 @@
57
57
  },
58
58
  "index": {
59
59
  "workflowName": "Workflow",
60
- "lastStep": "Last step",
60
+ "step": "Last step",
61
61
  "status": "Status",
62
62
  "product": "Product",
63
63
  "customer": "Customer",
64
64
  "subscriptions": "Subscriptions",
65
65
  "createdBy": "Created By",
66
66
  "assignee": "Assignee",
67
- "id": "ID",
67
+ "processId": "ID",
68
68
  "started": "Started",
69
- "lastModified": "Last Modified"
69
+ "lastModified": "Last Modified",
70
+ "workflowTarget": "Target"
70
71
  }
71
72
  },
72
73
  "subscriptions": {
@@ -55,16 +55,17 @@
55
55
  },
56
56
  "index": {
57
57
  "workflowName": "Workflow naam",
58
- "lastStep": "Laatste stap",
58
+ "step": "Laatste stap",
59
59
  "status": "Status",
60
60
  "product": "Product",
61
61
  "customer": "Klant",
62
62
  "subscriptions": "Subscriptions",
63
63
  "createdBy": "Gecreëerd door",
64
64
  "assignee": "Assignee",
65
- "id": "ID",
65
+ "processId": "ID",
66
66
  "started": "Gestart",
67
- "lastModified": "Aangepast op"
67
+ "lastModified": "Aangepast op",
68
+ "workflowTarget": "Doel"
68
69
  }
69
70
  },
70
71
  "subscriptions": {
@@ -8,7 +8,7 @@ import {
8
8
  METADATA_PRODUCTBLOCKS_TABLE_LOCAL_STORAGE_KEY,
9
9
  } from '../../components';
10
10
  import {
11
- WFOStatusBadge,
11
+ WFOSubscriptionStatusBadge,
12
12
  WFOProductBlockBadge,
13
13
  WFOTableWithFilter,
14
14
  } from '../../components';
@@ -85,7 +85,9 @@ export const WFOProductBlocksPage = () => {
85
85
  name: t('status'),
86
86
  width: '90',
87
87
  render: (value) => (
88
- <WFOStatusBadge status={value.toLocaleLowerCase()} />
88
+ <WFOSubscriptionStatusBadge
89
+ status={value.toLocaleLowerCase()}
90
+ />
89
91
  ),
90
92
  },
91
93
  resourceTypes: {
@@ -8,7 +8,7 @@ import {
8
8
  METADATA_PRODUCT_TABLE_LOCAL_STORAGE_KEY,
9
9
  } from '../../components';
10
10
  import {
11
- WFOStatusBadge,
11
+ WFOSubscriptionStatusBadge,
12
12
  WFOProductBlockBadge,
13
13
  WFOTableWithFilter,
14
14
  } from '../../components';
@@ -84,7 +84,9 @@ export const WFOProductsPage = () => {
84
84
  name: t('status'),
85
85
  width: '90',
86
86
  render: (value) => (
87
- <WFOStatusBadge status={value.toLocaleLowerCase()} />
87
+ <WFOSubscriptionStatusBadge
88
+ status={value.toLocaleLowerCase()}
89
+ />
88
90
  ),
89
91
  },
90
92
  productBlocks: {