@orchestrator-ui/orchestrator-ui-components 1.14.0 → 1.14.2
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 +9 -9
- package/CHANGELOG.md +13 -0
- package/dist/index.d.ts +186 -51
- package/dist/index.js +2232 -1952
- package/package.json +1 -1
- package/src/components/WfoSubscription/WfoInUseByRelations.tsx +92 -0
- package/src/components/WfoSubscription/WfoSubscriptionProductBlock/WfoSubscriptionProductBlock.tsx +10 -9
- package/src/components/WfoSubscription/styles.ts +9 -0
- package/src/components/WfoSummary/WfoActiveWorkflowsSummaryCard.tsx +39 -0
- package/src/components/WfoSummary/WfoFailedTasksSummaryCard.tsx +33 -0
- package/src/components/WfoSummary/WfoLatestActiveSubscriptionsSummaryCard.tsx +39 -0
- package/src/components/WfoSummary/WfoLatestOutOfSyncSubscriptionSummaryCard.tsx +44 -0
- package/src/components/WfoSummary/WfoMyWorkflowsSummaryCard.tsx +48 -0
- package/src/components/WfoSummary/WfoProductsSummaryCard.tsx +55 -0
- package/src/components/WfoSummary/WfoSummaryCard.tsx +82 -0
- package/src/components/WfoSummary/WfoSummaryCards.tsx +5 -93
- package/src/components/WfoSummary/index.ts +8 -0
- package/src/components/WfoWorkflowSteps/WfoStepStatusIcon/WfoStepStatusIcon.tsx +1 -1
- package/src/components/index.ts +1 -1
- package/src/icons/WfoBoltFill.tsx +36 -0
- package/src/icons/WfoBoltSlashFill.tsx +36 -0
- package/src/icons/index.ts +2 -0
- package/src/pages/index.ts +1 -0
- package/src/pages/processes/WfoProcessDetail.tsx +1 -0
- package/src/pages/startPage/WfoStartPage.tsx +22 -188
- package/src/pages/startPage/index.ts +1 -0
- package/src/rtk/endpoints/index.ts +4 -2
- package/src/rtk/endpoints/subscriptionInUseByRelationsList.ts +67 -0
- package/src/rtk/slices/orchestratorComponentOverride.ts +5 -7
- package/src/types/types.ts +11 -0
package/package.json
CHANGED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { useTranslations } from 'next-intl';
|
|
4
|
+
import Link from 'next/link';
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
WfoError,
|
|
8
|
+
WfoFirstPartUUID,
|
|
9
|
+
WfoKeyValueTable,
|
|
10
|
+
WfoLoading,
|
|
11
|
+
} from '@/components';
|
|
12
|
+
import type { WfoKeyValueTableDataType } from '@/components';
|
|
13
|
+
import { PATH_SUBSCRIPTIONS } from '@/components';
|
|
14
|
+
import { useWithOrchestratorTheme } from '@/hooks';
|
|
15
|
+
import { useGetInUseByRelationDetailsQuery } from '@/rtk';
|
|
16
|
+
import { InUseByRelation, InUseByRelationDetail } from '@/types';
|
|
17
|
+
|
|
18
|
+
import { getStyles } from './styles';
|
|
19
|
+
|
|
20
|
+
interface WfoInUseByRelationsProps {
|
|
21
|
+
inUseByRelations: InUseByRelation[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const WfoInUseByRelations = ({
|
|
25
|
+
inUseByRelations,
|
|
26
|
+
}: WfoInUseByRelationsProps) => {
|
|
27
|
+
const t = useTranslations('subscriptions.detail');
|
|
28
|
+
const { inUseByRelationDetailsStyle } = useWithOrchestratorTheme(getStyles);
|
|
29
|
+
const subscriptionIds = inUseByRelations
|
|
30
|
+
.map((relation) => relation.subscription_id)
|
|
31
|
+
.join('|');
|
|
32
|
+
const { data, isLoading, isError } = useGetInUseByRelationDetailsQuery({
|
|
33
|
+
subscriptionIds,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
if (isError) {
|
|
37
|
+
return <WfoError />;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (isLoading) {
|
|
41
|
+
return <WfoLoading />;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const getKeyValues = (
|
|
45
|
+
inUseByRelationDetails: InUseByRelationDetail,
|
|
46
|
+
): WfoKeyValueTableDataType[] => {
|
|
47
|
+
return [
|
|
48
|
+
{
|
|
49
|
+
key: t('subscriptionId'),
|
|
50
|
+
value: (
|
|
51
|
+
<WfoFirstPartUUID
|
|
52
|
+
UUID={inUseByRelationDetails.subscriptionId}
|
|
53
|
+
/>
|
|
54
|
+
),
|
|
55
|
+
textToCopy: inUseByRelationDetails.subscriptionId,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
key: t('description'),
|
|
59
|
+
value: (
|
|
60
|
+
<Link
|
|
61
|
+
href={`/${PATH_SUBSCRIPTIONS}/${inUseByRelationDetails.subscriptionId}`}
|
|
62
|
+
>
|
|
63
|
+
{inUseByRelationDetails.description}
|
|
64
|
+
</Link>
|
|
65
|
+
),
|
|
66
|
+
textToCopy: inUseByRelationDetails.description,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
key: t('productName'),
|
|
70
|
+
value: inUseByRelationDetails.product.name,
|
|
71
|
+
textToCopy: inUseByRelationDetails.product.name,
|
|
72
|
+
},
|
|
73
|
+
];
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<>
|
|
78
|
+
{data?.inUseByRelationDetails.map((relation, index) => {
|
|
79
|
+
const keyValues = getKeyValues(relation);
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<div css={inUseByRelationDetailsStyle} key={index}>
|
|
83
|
+
<WfoKeyValueTable
|
|
84
|
+
keyValues={keyValues}
|
|
85
|
+
showCopyToClipboardIcon={true}
|
|
86
|
+
/>
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
})}
|
|
90
|
+
</>
|
|
91
|
+
);
|
|
92
|
+
};
|
package/src/components/WfoSubscription/WfoSubscriptionProductBlock/WfoSubscriptionProductBlock.tsx
CHANGED
|
@@ -14,14 +14,11 @@ import {
|
|
|
14
14
|
EuiText,
|
|
15
15
|
} from '@elastic/eui';
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
PATH_SUBSCRIPTIONS,
|
|
19
|
-
WfoJsonCodeBlock,
|
|
20
|
-
WfoProductBlockKeyValueRow,
|
|
21
|
-
} from '@/components';
|
|
17
|
+
import { PATH_SUBSCRIPTIONS, WfoProductBlockKeyValueRow } from '@/components';
|
|
22
18
|
import { useOrchestratorTheme, useWithOrchestratorTheme } from '@/hooks';
|
|
23
19
|
import { FieldValue, InUseByRelation } from '@/types';
|
|
24
20
|
|
|
21
|
+
import { WfoInUseByRelations } from '../WfoInUseByRelations';
|
|
25
22
|
import {
|
|
26
23
|
getFieldFromProductBlockInstanceValues,
|
|
27
24
|
getProductBlockTitle,
|
|
@@ -143,10 +140,14 @@ export const WfoSubscriptionProductBlock = ({
|
|
|
143
140
|
<b>{t('inUseByRelations')}</b>
|
|
144
141
|
</td>
|
|
145
142
|
<td css={rightColumnStyle}>
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
143
|
+
{(inUseByRelations.length === 0 &&
|
|
144
|
+
'None') || (
|
|
145
|
+
<WfoInUseByRelations
|
|
146
|
+
inUseByRelations={
|
|
147
|
+
inUseByRelations
|
|
148
|
+
}
|
|
149
|
+
/>
|
|
150
|
+
)}
|
|
150
151
|
</td>
|
|
151
152
|
</tr>
|
|
152
153
|
</>
|
|
@@ -43,6 +43,14 @@ export const getStyles = (theme: EuiThemeComputed) => {
|
|
|
43
43
|
border: 0,
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
+
const inUseByRelationDetailsStyle = css({
|
|
47
|
+
borderColor: theme.colors.lightShade,
|
|
48
|
+
borderStyle: 'solid',
|
|
49
|
+
borderWidth: 'thin',
|
|
50
|
+
marginBottom: theme.base / 4,
|
|
51
|
+
borderRadius: theme.border.radius.medium,
|
|
52
|
+
});
|
|
53
|
+
|
|
46
54
|
return {
|
|
47
55
|
contentCellStyle,
|
|
48
56
|
headerCellStyle,
|
|
@@ -52,5 +60,6 @@ export const getStyles = (theme: EuiThemeComputed) => {
|
|
|
52
60
|
emptyCellStyle,
|
|
53
61
|
lastContentCellStyle,
|
|
54
62
|
lastHeaderCellStyle,
|
|
63
|
+
inUseByRelationDetailsStyle,
|
|
55
64
|
};
|
|
56
65
|
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { useTranslations } from 'next-intl';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
PATH_WORKFLOWS,
|
|
7
|
+
SummaryCardStatus,
|
|
8
|
+
WfoSummaryCard,
|
|
9
|
+
} from '@/components';
|
|
10
|
+
import { mapProcessSummaryToSummaryCardListItem } from '@/pages/startPage/mappers';
|
|
11
|
+
import { activeWorkflowsListSummaryQueryVariables } from '@/pages/startPage/queryVariables';
|
|
12
|
+
import { useGetProcessListSummaryQuery } from '@/rtk';
|
|
13
|
+
import { optionalArrayMapper } from '@/utils';
|
|
14
|
+
|
|
15
|
+
export const WfoActiveWorkflowsSummaryCard = () => {
|
|
16
|
+
const t = useTranslations('startPage.activeWorkflows');
|
|
17
|
+
|
|
18
|
+
const {
|
|
19
|
+
data: activeWorkflowsSummaryResponse,
|
|
20
|
+
isFetching: activeWorkflowsSummaryIsFetching,
|
|
21
|
+
} = useGetProcessListSummaryQuery(activeWorkflowsListSummaryQueryVariables);
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<WfoSummaryCard
|
|
25
|
+
headerTitle={t('headerTitle')}
|
|
26
|
+
headerValue={
|
|
27
|
+
activeWorkflowsSummaryResponse?.pageInfo.totalItems ?? 0
|
|
28
|
+
}
|
|
29
|
+
headerStatus={SummaryCardStatus.Success}
|
|
30
|
+
listTitle={t('listTitle')}
|
|
31
|
+
listItems={optionalArrayMapper(
|
|
32
|
+
activeWorkflowsSummaryResponse?.processes,
|
|
33
|
+
mapProcessSummaryToSummaryCardListItem,
|
|
34
|
+
)}
|
|
35
|
+
button={{ name: t('buttonText'), url: PATH_WORKFLOWS }}
|
|
36
|
+
isLoading={activeWorkflowsSummaryIsFetching}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { useTranslations } from 'next-intl';
|
|
4
|
+
|
|
5
|
+
import { PATH_TASKS, SummaryCardStatus, WfoSummaryCard } from '@/components';
|
|
6
|
+
import { mapProcessSummaryToSummaryCardListItem } from '@/pages/startPage/mappers';
|
|
7
|
+
import { taskListSummaryQueryVariables } from '@/pages/startPage/queryVariables';
|
|
8
|
+
import { useGetProcessListSummaryQuery } from '@/rtk';
|
|
9
|
+
import { optionalArrayMapper } from '@/utils';
|
|
10
|
+
|
|
11
|
+
export const WfoFailedTasksSummaryCard = () => {
|
|
12
|
+
const t = useTranslations('startPage.failedTasks');
|
|
13
|
+
|
|
14
|
+
const {
|
|
15
|
+
data: failedTasksSummaryResponse,
|
|
16
|
+
isFetching: failedTasksSummaryIsFetching,
|
|
17
|
+
} = useGetProcessListSummaryQuery(taskListSummaryQueryVariables);
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<WfoSummaryCard
|
|
21
|
+
headerTitle={t('headerTitle')}
|
|
22
|
+
headerValue={failedTasksSummaryResponse?.pageInfo.totalItems ?? 0}
|
|
23
|
+
headerStatus={SummaryCardStatus.Error}
|
|
24
|
+
listTitle={t('listTitle')}
|
|
25
|
+
listItems={optionalArrayMapper(
|
|
26
|
+
failedTasksSummaryResponse?.processes,
|
|
27
|
+
mapProcessSummaryToSummaryCardListItem,
|
|
28
|
+
)}
|
|
29
|
+
button={{ name: t('buttonText'), url: PATH_TASKS }}
|
|
30
|
+
isLoading={failedTasksSummaryIsFetching}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { useTranslations } from 'next-intl';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
PATH_SUBSCRIPTIONS,
|
|
7
|
+
SummaryCardStatus,
|
|
8
|
+
WfoSummaryCard,
|
|
9
|
+
} from '@/components';
|
|
10
|
+
import { mapSubscriptionSummaryToSummaryCardListItem } from '@/pages/startPage/mappers';
|
|
11
|
+
import { subscriptionsListSummaryQueryVariables } from '@/pages/startPage/queryVariables';
|
|
12
|
+
import { useGetSubscriptionSummaryListQuery } from '@/rtk';
|
|
13
|
+
import { optionalArrayMapper } from '@/utils';
|
|
14
|
+
|
|
15
|
+
export const WfoLatestActiveSubscriptionsSummaryCard = () => {
|
|
16
|
+
const t = useTranslations('startPage.activeSubscriptions');
|
|
17
|
+
|
|
18
|
+
const {
|
|
19
|
+
data: subscriptionsSummaryResult,
|
|
20
|
+
isLoading: subscriptionsSummaryIsFetching,
|
|
21
|
+
} = useGetSubscriptionSummaryListQuery(
|
|
22
|
+
subscriptionsListSummaryQueryVariables,
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<WfoSummaryCard
|
|
27
|
+
headerTitle={t('headerTitle')}
|
|
28
|
+
headerValue={subscriptionsSummaryResult?.pageInfo.totalItems ?? 0}
|
|
29
|
+
headerStatus={SummaryCardStatus.Neutral}
|
|
30
|
+
listTitle={t('listTitle')}
|
|
31
|
+
listItems={optionalArrayMapper(
|
|
32
|
+
subscriptionsSummaryResult?.subscriptions,
|
|
33
|
+
mapSubscriptionSummaryToSummaryCardListItem,
|
|
34
|
+
)}
|
|
35
|
+
button={{ name: t('buttonText'), url: PATH_SUBSCRIPTIONS }}
|
|
36
|
+
isLoading={subscriptionsSummaryIsFetching}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { useTranslations } from 'next-intl';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
PATH_SUBSCRIPTIONS,
|
|
7
|
+
SummaryCardStatus,
|
|
8
|
+
WfoSummaryCard,
|
|
9
|
+
} from '@/components';
|
|
10
|
+
import { mapSubscriptionSummaryToSummaryCardListItem } from '@/pages/startPage/mappers';
|
|
11
|
+
import { outOfSyncSubscriptionsListSummaryQueryVariables } from '@/pages/startPage/queryVariables';
|
|
12
|
+
import { useGetSubscriptionSummaryListQuery } from '@/rtk';
|
|
13
|
+
import { optionalArrayMapper } from '@/utils';
|
|
14
|
+
|
|
15
|
+
export const WfoLatestOutOfSyncSubscriptionSummaryCard = () => {
|
|
16
|
+
const t = useTranslations('startPage.outOfSyncSubscriptions');
|
|
17
|
+
|
|
18
|
+
const {
|
|
19
|
+
data: outOfSyncSubscriptionsSummaryResult,
|
|
20
|
+
isLoading: outOfSyncsubscriptionsSummaryIsFetching,
|
|
21
|
+
} = useGetSubscriptionSummaryListQuery(
|
|
22
|
+
outOfSyncSubscriptionsListSummaryQueryVariables,
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<WfoSummaryCard
|
|
27
|
+
headerTitle={t('headerTitle')}
|
|
28
|
+
headerValue={
|
|
29
|
+
outOfSyncSubscriptionsSummaryResult?.pageInfo.totalItems ?? 0
|
|
30
|
+
}
|
|
31
|
+
headerStatus={SummaryCardStatus.Error}
|
|
32
|
+
listTitle={t('listTitle')}
|
|
33
|
+
listItems={optionalArrayMapper(
|
|
34
|
+
outOfSyncSubscriptionsSummaryResult?.subscriptions,
|
|
35
|
+
mapSubscriptionSummaryToSummaryCardListItem,
|
|
36
|
+
)}
|
|
37
|
+
button={{
|
|
38
|
+
name: t('buttonText'),
|
|
39
|
+
url: `${PATH_SUBSCRIPTIONS}?activeTab=ALL&sortBy=field-startDate_order-ASC&queryString=status%3A%28provisioning%7Cactive%29+insync%3Afalse`,
|
|
40
|
+
}}
|
|
41
|
+
isLoading={outOfSyncsubscriptionsSummaryIsFetching}
|
|
42
|
+
/>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
import { useTranslations } from 'next-intl';
|
|
4
|
+
|
|
5
|
+
import { PATH_WORKFLOWS } from '@/components';
|
|
6
|
+
import {
|
|
7
|
+
SummaryCardStatus,
|
|
8
|
+
WfoSummaryCard,
|
|
9
|
+
} from '@/components/WfoSummary/WfoSummaryCard';
|
|
10
|
+
import { mapProcessSummaryToSummaryCardListItem } from '@/pages/startPage/mappers';
|
|
11
|
+
import { getMyWorkflowListSummaryQueryVariables } from '@/pages/startPage/queryVariables';
|
|
12
|
+
import { useGetProcessListSummaryQuery } from '@/rtk';
|
|
13
|
+
import { optionalArrayMapper } from '@/utils';
|
|
14
|
+
|
|
15
|
+
export type WfoMyWorkflowsSummaryCardProps = {
|
|
16
|
+
username: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const WfoMyWorkflowsSummaryCard: FC<WfoMyWorkflowsSummaryCardProps> = ({
|
|
20
|
+
username,
|
|
21
|
+
}) => {
|
|
22
|
+
const t = useTranslations('startPage.myWorkflows');
|
|
23
|
+
|
|
24
|
+
const {
|
|
25
|
+
data: myWorkflowsSummaryResponse,
|
|
26
|
+
isFetching: myWorkflowsSummaryIsFetching,
|
|
27
|
+
} = useGetProcessListSummaryQuery(
|
|
28
|
+
getMyWorkflowListSummaryQueryVariables(username),
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<WfoSummaryCard
|
|
33
|
+
headerTitle={t('headerTitle')}
|
|
34
|
+
headerValue={myWorkflowsSummaryResponse?.pageInfo.totalItems ?? 0}
|
|
35
|
+
headerStatus={SummaryCardStatus.Success}
|
|
36
|
+
listTitle={t('listTitle')}
|
|
37
|
+
listItems={optionalArrayMapper(
|
|
38
|
+
myWorkflowsSummaryResponse?.processes,
|
|
39
|
+
mapProcessSummaryToSummaryCardListItem,
|
|
40
|
+
)}
|
|
41
|
+
button={{
|
|
42
|
+
name: t('buttonText'),
|
|
43
|
+
url: `${PATH_WORKFLOWS}?activeTab=COMPLETED&sortBy=field-lastModifiedAt_order-DESC&queryString=createdBy%3A${username}`,
|
|
44
|
+
}}
|
|
45
|
+
isLoading={myWorkflowsSummaryIsFetching}
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { useTranslations } from 'next-intl';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
SummaryCardListItem,
|
|
7
|
+
SummaryCardStatus,
|
|
8
|
+
WfoSummaryCard,
|
|
9
|
+
} from '@/components';
|
|
10
|
+
import { productsSummaryQueryVariables } from '@/pages/startPage/queryVariables';
|
|
11
|
+
import { useGetProductsSummaryQuery } from '@/rtk';
|
|
12
|
+
|
|
13
|
+
export const WfoProductsSummaryCard = () => {
|
|
14
|
+
const t = useTranslations('startPage.products');
|
|
15
|
+
|
|
16
|
+
const {
|
|
17
|
+
data: productsSummaryResult,
|
|
18
|
+
isLoading: productsSummaryIsFetching,
|
|
19
|
+
} = useGetProductsSummaryQuery(productsSummaryQueryVariables);
|
|
20
|
+
|
|
21
|
+
const listItems: SummaryCardListItem[] =
|
|
22
|
+
[...(productsSummaryResult?.products ?? [])]
|
|
23
|
+
.sort(
|
|
24
|
+
(left, right) =>
|
|
25
|
+
(right.subscriptions.pageInfo.totalItems ?? 0) -
|
|
26
|
+
(left.subscriptions.pageInfo.totalItems ?? 0),
|
|
27
|
+
)
|
|
28
|
+
.map((product) => ({
|
|
29
|
+
title: '',
|
|
30
|
+
value: (
|
|
31
|
+
<div
|
|
32
|
+
css={{
|
|
33
|
+
display: 'flex',
|
|
34
|
+
justifyContent: 'space-between',
|
|
35
|
+
}}
|
|
36
|
+
>
|
|
37
|
+
<div>{product.name}</div>
|
|
38
|
+
<div>
|
|
39
|
+
{product.subscriptions.pageInfo.totalItems || 0}
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
),
|
|
43
|
+
})) ?? [];
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<WfoSummaryCard
|
|
47
|
+
headerTitle={t('headerTitle')}
|
|
48
|
+
headerValue={productsSummaryResult?.pageInfo.totalItems ?? 0}
|
|
49
|
+
headerStatus={SummaryCardStatus.Neutral}
|
|
50
|
+
listTitle={t('listTitle')}
|
|
51
|
+
listItems={listItems}
|
|
52
|
+
isLoading={productsSummaryIsFetching}
|
|
53
|
+
/>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
import { EuiFlexItem, EuiSpacer } from '@elastic/eui';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
SummaryCardButtonConfig,
|
|
7
|
+
SummaryCardListItem,
|
|
8
|
+
WfoSummaryCardHeader,
|
|
9
|
+
WfoSummaryCardHeaderProps,
|
|
10
|
+
WfoSummaryCardList,
|
|
11
|
+
} from '@/components';
|
|
12
|
+
import { getWfoSummaryCardsStyles } from '@/components/WfoSummary/styles';
|
|
13
|
+
import { useOrchestratorTheme } from '@/hooks';
|
|
14
|
+
|
|
15
|
+
export enum SummaryCardStatus {
|
|
16
|
+
Success = 'Success',
|
|
17
|
+
Error = 'Error',
|
|
18
|
+
Neutral = 'Neutral',
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type WfoSummaryCardProps = {
|
|
22
|
+
headerTitle: string;
|
|
23
|
+
headerValue: string | number;
|
|
24
|
+
headerStatus: SummaryCardStatus;
|
|
25
|
+
listTitle: string;
|
|
26
|
+
listItems: SummaryCardListItem[];
|
|
27
|
+
button?: SummaryCardButtonConfig;
|
|
28
|
+
isLoading?: boolean;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const WfoSummaryCard: FC<WfoSummaryCardProps> = ({
|
|
32
|
+
button,
|
|
33
|
+
isLoading,
|
|
34
|
+
headerStatus,
|
|
35
|
+
headerValue,
|
|
36
|
+
headerTitle,
|
|
37
|
+
listTitle,
|
|
38
|
+
listItems,
|
|
39
|
+
}) => {
|
|
40
|
+
const { theme } = useOrchestratorTheme();
|
|
41
|
+
const { cardContainerStyle } = getWfoSummaryCardsStyles(theme);
|
|
42
|
+
|
|
43
|
+
const getIconTypeAndColorForHeaderStatus = (
|
|
44
|
+
status: SummaryCardStatus,
|
|
45
|
+
): Pick<WfoSummaryCardHeaderProps, 'iconType' | 'iconColor'> => {
|
|
46
|
+
switch (status) {
|
|
47
|
+
case SummaryCardStatus.Success:
|
|
48
|
+
return {
|
|
49
|
+
iconType: 'checkInCircleFilled',
|
|
50
|
+
iconColor: theme.colors.success,
|
|
51
|
+
};
|
|
52
|
+
case SummaryCardStatus.Error:
|
|
53
|
+
return {
|
|
54
|
+
iconType: 'error',
|
|
55
|
+
iconColor: theme.colors.danger,
|
|
56
|
+
};
|
|
57
|
+
case SummaryCardStatus.Neutral:
|
|
58
|
+
default:
|
|
59
|
+
return {
|
|
60
|
+
iconType: 'kubernetesPod',
|
|
61
|
+
iconColor: theme.colors.primary,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<EuiFlexItem css={cardContainerStyle}>
|
|
68
|
+
<WfoSummaryCardHeader
|
|
69
|
+
text={headerTitle}
|
|
70
|
+
value={headerValue}
|
|
71
|
+
{...getIconTypeAndColorForHeaderStatus(headerStatus)}
|
|
72
|
+
/>
|
|
73
|
+
<EuiSpacer size="m" />
|
|
74
|
+
<WfoSummaryCardList
|
|
75
|
+
title={listTitle}
|
|
76
|
+
items={listItems}
|
|
77
|
+
button={button}
|
|
78
|
+
isLoading={isLoading}
|
|
79
|
+
/>
|
|
80
|
+
</EuiFlexItem>
|
|
81
|
+
);
|
|
82
|
+
};
|
|
@@ -1,111 +1,23 @@
|
|
|
1
|
-
import React, { FC } from 'react';
|
|
1
|
+
import React, { FC, ReactElement } from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
EuiFlexGrid,
|
|
5
|
-
EuiFlexItem,
|
|
6
|
-
EuiSpacer,
|
|
7
|
-
useCurrentEuiBreakpoint,
|
|
8
|
-
} from '@elastic/eui';
|
|
3
|
+
import { EuiFlexGrid, useCurrentEuiBreakpoint } from '@elastic/eui';
|
|
9
4
|
|
|
10
|
-
import {
|
|
11
|
-
SummaryCardListItem,
|
|
12
|
-
WfoSummaryCardHeader,
|
|
13
|
-
WfoSummaryCardHeaderProps,
|
|
14
|
-
} from '@/components/WfoSummary/';
|
|
15
|
-
import { getWfoSummaryCardsStyles } from '@/components/WfoSummary/styles';
|
|
16
|
-
import { useOrchestratorTheme } from '@/hooks';
|
|
17
|
-
|
|
18
|
-
import {
|
|
19
|
-
SummaryCardButtonConfig,
|
|
20
|
-
WfoSummaryCardList,
|
|
21
|
-
} from './WfoSummaryCardList/WfoSummaryCardList';
|
|
22
5
|
import { getNumberOfColumns } from './getNumberOfColumns';
|
|
23
6
|
|
|
24
|
-
export enum SummaryCardStatus {
|
|
25
|
-
Success = 'Success',
|
|
26
|
-
Error = 'Error',
|
|
27
|
-
Neutral = 'Neutral',
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export type SummaryCard = {
|
|
31
|
-
headerTitle: string;
|
|
32
|
-
headerValue: string | number;
|
|
33
|
-
headerStatus: SummaryCardStatus;
|
|
34
|
-
listTitle: string;
|
|
35
|
-
listItems: SummaryCardListItem[];
|
|
36
|
-
button?: SummaryCardButtonConfig;
|
|
37
|
-
isLoading?: boolean;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
7
|
export type WfoSummaryCardsProps = {
|
|
41
|
-
|
|
8
|
+
children: ReactElement[];
|
|
42
9
|
};
|
|
43
10
|
|
|
44
|
-
export const WfoSummaryCards: FC<WfoSummaryCardsProps> = ({
|
|
45
|
-
const { theme } = useOrchestratorTheme();
|
|
46
|
-
const { cardContainerStyle } = getWfoSummaryCardsStyles(theme);
|
|
11
|
+
export const WfoSummaryCards: FC<WfoSummaryCardsProps> = ({ children }) => {
|
|
47
12
|
const currentBreakpoint = useCurrentEuiBreakpoint();
|
|
48
13
|
|
|
49
|
-
const getIconTypeAndColorForHeaderStatus = (
|
|
50
|
-
status: SummaryCardStatus,
|
|
51
|
-
): Pick<WfoSummaryCardHeaderProps, 'iconType' | 'iconColor'> => {
|
|
52
|
-
switch (status) {
|
|
53
|
-
case SummaryCardStatus.Success:
|
|
54
|
-
return {
|
|
55
|
-
iconType: 'checkInCircleFilled',
|
|
56
|
-
iconColor: theme.colors.success,
|
|
57
|
-
};
|
|
58
|
-
case SummaryCardStatus.Error:
|
|
59
|
-
return {
|
|
60
|
-
iconType: 'error',
|
|
61
|
-
iconColor: theme.colors.danger,
|
|
62
|
-
};
|
|
63
|
-
case SummaryCardStatus.Neutral:
|
|
64
|
-
default:
|
|
65
|
-
return {
|
|
66
|
-
iconType: 'kubernetesPod',
|
|
67
|
-
iconColor: theme.colors.primary,
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
|
|
72
14
|
return (
|
|
73
15
|
<EuiFlexGrid
|
|
74
16
|
responsive={false}
|
|
75
17
|
columns={getNumberOfColumns(currentBreakpoint)}
|
|
76
18
|
gutterSize="xl"
|
|
77
19
|
>
|
|
78
|
-
{
|
|
79
|
-
(
|
|
80
|
-
{
|
|
81
|
-
headerTitle,
|
|
82
|
-
headerValue,
|
|
83
|
-
headerStatus,
|
|
84
|
-
listTitle,
|
|
85
|
-
listItems,
|
|
86
|
-
button,
|
|
87
|
-
isLoading,
|
|
88
|
-
},
|
|
89
|
-
index,
|
|
90
|
-
) => (
|
|
91
|
-
<EuiFlexItem key={index} css={cardContainerStyle}>
|
|
92
|
-
<WfoSummaryCardHeader
|
|
93
|
-
text={headerTitle}
|
|
94
|
-
value={headerValue}
|
|
95
|
-
{...getIconTypeAndColorForHeaderStatus(
|
|
96
|
-
headerStatus,
|
|
97
|
-
)}
|
|
98
|
-
/>
|
|
99
|
-
<EuiSpacer size="m" />
|
|
100
|
-
<WfoSummaryCardList
|
|
101
|
-
title={listTitle}
|
|
102
|
-
items={listItems}
|
|
103
|
-
button={button}
|
|
104
|
-
isLoading={isLoading}
|
|
105
|
-
/>
|
|
106
|
-
</EuiFlexItem>
|
|
107
|
-
),
|
|
108
|
-
)}
|
|
20
|
+
{children}
|
|
109
21
|
</EuiFlexGrid>
|
|
110
22
|
);
|
|
111
23
|
};
|
|
@@ -2,3 +2,11 @@ export * from './getNumberOfColumns';
|
|
|
2
2
|
export * from './WfoSummaryCardHeader';
|
|
3
3
|
export * from './WfoSummaryCardList';
|
|
4
4
|
export * from './WfoSummaryCards';
|
|
5
|
+
export * from './WfoSummaryCard';
|
|
6
|
+
|
|
7
|
+
export * from './WfoActiveWorkflowsSummaryCard';
|
|
8
|
+
export * from './WfoFailedTasksSummaryCard';
|
|
9
|
+
export * from './WfoLatestActiveSubscriptionsSummaryCard';
|
|
10
|
+
export * from './WfoLatestOutOfSyncSubscriptionSummaryCard';
|
|
11
|
+
export * from './WfoMyWorkflowsSummaryCard';
|
|
12
|
+
export * from './WfoProductsSummaryCard';
|
package/src/components/index.ts
CHANGED
|
@@ -6,7 +6,6 @@ export * from './WfoKeyValueTable';
|
|
|
6
6
|
export * from './WfoPageTemplate';
|
|
7
7
|
export * from './WfoSearchBar';
|
|
8
8
|
export * from './WfoSettingsModal';
|
|
9
|
-
export * from '../pages/settings/WfoSettingsPage';
|
|
10
9
|
export * from './WfoSubscription';
|
|
11
10
|
export * from './WfoTable';
|
|
12
11
|
export * from './WfoTimeline';
|
|
@@ -28,3 +27,4 @@ export * from './WfoWorkflowSteps';
|
|
|
28
27
|
export * from './WfoNoResults';
|
|
29
28
|
export * from './WfoStartButton';
|
|
30
29
|
export * from './WfoSubscriptionsList';
|
|
30
|
+
export * from './WfoSummary';
|