@orchestrator-ui/orchestrator-ui-components 0.10.0 → 0.11.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 +4 -4
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-test.log +11 -10
- package/CHANGELOG.md +12 -0
- package/dist/index.d.ts +49 -9
- package/dist/index.js +4397 -4140
- package/package.json +1 -1
- package/src/components/WfoBadges/WfoFailedTasksBadge/WfoFailedTasksBadge.tsx +1 -3
- package/src/components/WfoBadges/WfoHeaderBadge/WfoHeaderBadge.tsx +1 -1
- package/src/components/WfoBadges/WfoSubscriptionSyncStatusBadge/WfoSubscriptionSyncStatusBadge.stories.tsx +27 -0
- package/src/components/WfoBadges/WfoSubscriptionSyncStatusBadge/WfoSubscriptionSyncStatusBadge.tsx +45 -0
- package/src/components/WfoBadges/WfoSubscriptionSyncStatusBadge/index.ts +1 -0
- package/src/components/WfoBadges/WfoWebsocketStatusBadge/WfoWebsocketStatusBadge.stories.tsx +13 -0
- package/src/components/WfoBadges/WfoWebsocketStatusBadge/WfoWebsocketStatusBadge.tsx +41 -0
- package/src/components/WfoBadges/WfoWebsocketStatusBadge/index.ts +1 -0
- package/src/components/WfoForms/formFields/CustomerField.tsx +4 -1
- package/src/components/WfoPageTemplate/WfoPageHeader/WfoPageHeader.tsx +47 -2
- package/src/components/WfoPageTemplate/WfoPageTemplate/WfoPageTemplate.tsx +4 -1
- package/src/components/WfoSubscription/WfoSubscription.tsx +25 -2
- package/src/contexts/OrchestratorConfigContext.tsx +1 -0
- package/src/hooks/useOrchestratorTheme.ts +3 -1
- package/src/hooks/useShowToastMessage.ts +4 -26
- package/src/icons/WfoSideMenu.stories.tsx +1 -1
- package/src/messages/en-GB.json +8 -2
- package/src/messages/nl-NL.json +8 -2
- package/src/rtk/api.ts +7 -1
- package/src/rtk/endpoints/index.ts +1 -0
- package/src/rtk/endpoints/settings.ts +3 -3
- package/src/rtk/endpoints/streamMessages.ts +128 -0
- package/src/theme/defaultOrchestratorTheme.ts +28 -1
- package/src/types/types.ts +6 -0
- package/src/utils/getToastMessage.spec.ts +28 -0
- package/src/utils/getToastMessage.ts +35 -0
package/package.json
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import type { Meta } from '@storybook/react';
|
|
4
|
+
|
|
5
|
+
import { WfoSubscriptionSyncStatusBadge } from './WfoSubscriptionSyncStatusBadge';
|
|
6
|
+
|
|
7
|
+
const Story: Meta<typeof WfoSubscriptionSyncStatusBadge> = {
|
|
8
|
+
component: (args) => (
|
|
9
|
+
<div style={{ display: 'flex' }}>
|
|
10
|
+
<WfoSubscriptionSyncStatusBadge {...args} />
|
|
11
|
+
</div>
|
|
12
|
+
),
|
|
13
|
+
title: 'Badges/WfoSubscriptionSyncStatusBadge',
|
|
14
|
+
};
|
|
15
|
+
export default Story;
|
|
16
|
+
|
|
17
|
+
export const Primary = {
|
|
18
|
+
args: {
|
|
19
|
+
insync: true,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Secondary = {
|
|
24
|
+
args: {
|
|
25
|
+
insync: false,
|
|
26
|
+
},
|
|
27
|
+
};
|
package/src/components/WfoBadges/WfoSubscriptionSyncStatusBadge/WfoSubscriptionSyncStatusBadge.tsx
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
import { useTranslations } from 'next-intl';
|
|
4
|
+
|
|
5
|
+
import { useOrchestratorTheme } from '../../../hooks';
|
|
6
|
+
import { WfoBadge } from '../WfoBadge';
|
|
7
|
+
|
|
8
|
+
export type WfoSubscriptionSyncStatusBadgeProps = {
|
|
9
|
+
insync: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const WfoSubscriptionSyncStatusBadge: FC<
|
|
13
|
+
WfoSubscriptionSyncStatusBadgeProps
|
|
14
|
+
> = ({ insync }) => {
|
|
15
|
+
const { theme, toSecondaryColor } = useOrchestratorTheme();
|
|
16
|
+
|
|
17
|
+
const t = useTranslations('common');
|
|
18
|
+
|
|
19
|
+
const getBadgePropertiesFromStatus = (insync: boolean) => {
|
|
20
|
+
const { danger, dangerText, success, successText } = theme.colors;
|
|
21
|
+
|
|
22
|
+
if (insync) {
|
|
23
|
+
return {
|
|
24
|
+
badgeColor: toSecondaryColor(success),
|
|
25
|
+
textColor: successText,
|
|
26
|
+
insyncText: t('insyncTrue'),
|
|
27
|
+
};
|
|
28
|
+
} else {
|
|
29
|
+
return {
|
|
30
|
+
badgeColor: toSecondaryColor(danger),
|
|
31
|
+
textColor: dangerText,
|
|
32
|
+
insyncText: t('insyncFalse'),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const { badgeColor, textColor, insyncText } =
|
|
38
|
+
getBadgePropertiesFromStatus(insync);
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<WfoBadge textColor={textColor} color={badgeColor}>
|
|
42
|
+
{insyncText}
|
|
43
|
+
</WfoBadge>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WfoSubscriptionSyncStatusBadge';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Meta } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import { WfoWebsocketStatusBadge } from './WfoWebsocketStatusBadge';
|
|
4
|
+
|
|
5
|
+
const Story: Meta<typeof WfoWebsocketStatusBadge> = {
|
|
6
|
+
component: WfoWebsocketStatusBadge,
|
|
7
|
+
title: 'Badges/WfoWebsocketStatusBadge',
|
|
8
|
+
};
|
|
9
|
+
export default Story;
|
|
10
|
+
|
|
11
|
+
export const Primary = {
|
|
12
|
+
args: {},
|
|
13
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { useTranslations } from 'next-intl';
|
|
4
|
+
|
|
5
|
+
import { EuiToolTip } from '@elastic/eui';
|
|
6
|
+
|
|
7
|
+
import { useOrchestratorTheme } from '@/hooks/useOrchestratorTheme';
|
|
8
|
+
import { WfoStatusDotIcon, WfoXCircleFill } from '@/icons';
|
|
9
|
+
import { useStreamMessagesQuery } from '@/rtk/endpoints/streamMessages';
|
|
10
|
+
|
|
11
|
+
import { WfoHeaderBadge } from '../WfoHeaderBadge';
|
|
12
|
+
|
|
13
|
+
export const WfoWebsocketStatusBadge = () => {
|
|
14
|
+
const t = useTranslations('main');
|
|
15
|
+
const { theme } = useOrchestratorTheme();
|
|
16
|
+
const { data: websocketConnected = false } = useStreamMessagesQuery();
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<EuiToolTip
|
|
20
|
+
position="bottom"
|
|
21
|
+
content={
|
|
22
|
+
websocketConnected
|
|
23
|
+
? t('websocketConnected')
|
|
24
|
+
: t('websocketDisconnected')
|
|
25
|
+
}
|
|
26
|
+
>
|
|
27
|
+
<WfoHeaderBadge
|
|
28
|
+
color={theme.colors.emptyShade}
|
|
29
|
+
textColor={theme.colors.shadow}
|
|
30
|
+
iconType={() =>
|
|
31
|
+
websocketConnected ? (
|
|
32
|
+
<WfoStatusDotIcon color={theme.colors.success} />
|
|
33
|
+
) : (
|
|
34
|
+
<WfoXCircleFill color={theme.colors.danger} />
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
style={{ paddingLeft: '8px' }}
|
|
38
|
+
/>
|
|
39
|
+
</EuiToolTip>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WfoWebsocketStatusBadge';
|
|
@@ -35,7 +35,10 @@ function Customer({ ...props }: CustomerFieldProps) {
|
|
|
35
35
|
|
|
36
36
|
if (!isLoading && customers) {
|
|
37
37
|
customers?.map((customer) => {
|
|
38
|
-
uuidCustomerNameMap.set(
|
|
38
|
+
uuidCustomerNameMap.set(
|
|
39
|
+
customer.customerId,
|
|
40
|
+
`${customer.shortcode} - ${customer.fullname}`,
|
|
41
|
+
);
|
|
39
42
|
});
|
|
40
43
|
}
|
|
41
44
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React, { FC, ReactElement } from 'react';
|
|
2
2
|
|
|
3
|
+
import { useTranslations } from 'next-intl';
|
|
4
|
+
|
|
3
5
|
import {
|
|
4
6
|
EuiBadgeGroup,
|
|
5
7
|
EuiButtonIcon,
|
|
@@ -8,16 +10,19 @@ import {
|
|
|
8
10
|
EuiHeaderSection,
|
|
9
11
|
EuiHeaderSectionItem,
|
|
10
12
|
} from '@elastic/eui';
|
|
13
|
+
import type { EuiThemeColorMode } from '@elastic/eui';
|
|
11
14
|
|
|
12
15
|
import {
|
|
13
16
|
WfoEngineStatusBadge,
|
|
14
17
|
WfoEnvironmentBadge,
|
|
15
18
|
WfoFailedTasksBadge,
|
|
16
19
|
} from '@/components';
|
|
20
|
+
import { WfoWebsocketStatusBadge } from '@/components/WfoBadges/WfoWebsocketStatusBadge';
|
|
17
21
|
import { WfoAppLogo } from '@/components/WfoPageTemplate/WfoPageHeader/WfoAppLogo';
|
|
18
22
|
import { getWfoPageHeaderStyles } from '@/components/WfoPageTemplate/WfoPageHeader/styles';
|
|
19
23
|
import { useOrchestratorTheme, useWithOrchestratorTheme } from '@/hooks';
|
|
20
24
|
import { WfoLogoutIcon, WfoSideMenu } from '@/icons';
|
|
25
|
+
import { ColorModes } from '@/types';
|
|
21
26
|
|
|
22
27
|
export interface WfoPageHeaderProps {
|
|
23
28
|
// todo: should be part of theme!
|
|
@@ -25,15 +30,23 @@ export interface WfoPageHeaderProps {
|
|
|
25
30
|
getAppLogo: (navigationHeight: number) => ReactElement;
|
|
26
31
|
handleSideMenuClick: () => void;
|
|
27
32
|
handleLogoutClick: () => void;
|
|
33
|
+
onThemeSwitch: (theme: EuiThemeColorMode) => void;
|
|
28
34
|
}
|
|
29
35
|
|
|
36
|
+
const ENABLE_THEME_SWITCH =
|
|
37
|
+
process.env.NEXT_PUBLIC_USE_THEME_TOGGLE === 'true' || false;
|
|
38
|
+
const ENABLE_WEBSOCKET =
|
|
39
|
+
process.env.NEXT_PUBLIC_USE_WEBSOCKET === 'true' || false;
|
|
40
|
+
|
|
30
41
|
export const WfoPageHeader: FC<WfoPageHeaderProps> = ({
|
|
31
42
|
navigationHeight,
|
|
32
43
|
getAppLogo,
|
|
33
44
|
handleSideMenuClick,
|
|
34
45
|
handleLogoutClick,
|
|
46
|
+
onThemeSwitch,
|
|
35
47
|
}) => {
|
|
36
|
-
const
|
|
48
|
+
const t = useTranslations('main');
|
|
49
|
+
const { theme, multiplyByBaseUnit, colorMode } = useOrchestratorTheme();
|
|
37
50
|
const { getHeaderStyle, appNameStyle } = useWithOrchestratorTheme(
|
|
38
51
|
getWfoPageHeaderStyles,
|
|
39
52
|
);
|
|
@@ -63,11 +76,43 @@ export const WfoPageHeader: FC<WfoPageHeaderProps> = ({
|
|
|
63
76
|
|
|
64
77
|
<EuiHeaderSection>
|
|
65
78
|
<EuiHeaderSectionItem>
|
|
66
|
-
<EuiBadgeGroup css={{ marginRight: multiplyByBaseUnit(
|
|
79
|
+
<EuiBadgeGroup css={{ marginRight: multiplyByBaseUnit(1) }}>
|
|
67
80
|
<WfoEngineStatusBadge />
|
|
68
81
|
<WfoFailedTasksBadge />
|
|
82
|
+
{ENABLE_WEBSOCKET && <WfoWebsocketStatusBadge />}
|
|
69
83
|
</EuiBadgeGroup>
|
|
70
84
|
|
|
85
|
+
{ENABLE_THEME_SWITCH && (
|
|
86
|
+
<EuiButtonIcon
|
|
87
|
+
aria-label={t(
|
|
88
|
+
colorMode === ColorModes.LIGHT
|
|
89
|
+
? 'darkMode'
|
|
90
|
+
: 'lightMode',
|
|
91
|
+
)}
|
|
92
|
+
display="empty"
|
|
93
|
+
iconType={
|
|
94
|
+
colorMode === ColorModes.LIGHT ? 'moon' : 'sun'
|
|
95
|
+
}
|
|
96
|
+
css={{
|
|
97
|
+
width: '48px',
|
|
98
|
+
height: '48px',
|
|
99
|
+
color: 'white',
|
|
100
|
+
}}
|
|
101
|
+
title={t(
|
|
102
|
+
colorMode === ColorModes.LIGHT
|
|
103
|
+
? 'darkMode'
|
|
104
|
+
: 'lightMode',
|
|
105
|
+
)}
|
|
106
|
+
onClick={() =>
|
|
107
|
+
onThemeSwitch(
|
|
108
|
+
colorMode === ColorModes.LIGHT
|
|
109
|
+
? ColorModes.DARK
|
|
110
|
+
: ColorModes.LIGHT,
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
/>
|
|
114
|
+
)}
|
|
115
|
+
|
|
71
116
|
<EuiButtonIcon
|
|
72
117
|
aria-label="Logout"
|
|
73
118
|
display="empty"
|
|
@@ -3,6 +3,7 @@ import React, { FC, ReactElement, ReactNode, useState } from 'react';
|
|
|
3
3
|
import { signOut } from 'next-auth/react';
|
|
4
4
|
|
|
5
5
|
import { EuiPageTemplate } from '@elastic/eui';
|
|
6
|
+
import type { EuiThemeColorMode } from '@elastic/eui';
|
|
6
7
|
import { EuiSideNavItemType } from '@elastic/eui/src/components/side_nav/side_nav_types';
|
|
7
8
|
|
|
8
9
|
import { useOrchestratorTheme } from '../../../hooks/useOrchestratorTheme';
|
|
@@ -15,6 +16,7 @@ export interface WfoPageTemplateProps {
|
|
|
15
16
|
overrideMenuItems?: (
|
|
16
17
|
defaultMenuItems: EuiSideNavItemType<object>[],
|
|
17
18
|
) => EuiSideNavItemType<object>[];
|
|
19
|
+
onThemeSwitch: (theme: EuiThemeColorMode) => void;
|
|
18
20
|
children: ReactNode;
|
|
19
21
|
}
|
|
20
22
|
|
|
@@ -22,10 +24,10 @@ export const WfoPageTemplate: FC<WfoPageTemplateProps> = ({
|
|
|
22
24
|
children,
|
|
23
25
|
getAppLogo,
|
|
24
26
|
overrideMenuItems,
|
|
27
|
+
onThemeSwitch,
|
|
25
28
|
}) => {
|
|
26
29
|
const { theme, multiplyByBaseUnit } = useOrchestratorTheme();
|
|
27
30
|
const [isSideMenuVisible, setIsSideMenuVisible] = useState(true);
|
|
28
|
-
|
|
29
31
|
const navigationHeight = multiplyByBaseUnit(3);
|
|
30
32
|
|
|
31
33
|
return (
|
|
@@ -37,6 +39,7 @@ export const WfoPageTemplate: FC<WfoPageTemplateProps> = ({
|
|
|
37
39
|
setIsSideMenuVisible((prevState) => !prevState)
|
|
38
40
|
}
|
|
39
41
|
handleLogoutClick={signOut}
|
|
42
|
+
onThemeSwitch={onThemeSwitch}
|
|
40
43
|
/>
|
|
41
44
|
|
|
42
45
|
{/* Sidebar and content area */}
|
|
@@ -2,11 +2,18 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { StringParam, useQueryParam, withDefault } from 'use-query-params';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
EuiBadgeGroup,
|
|
7
|
+
EuiFlexGroup,
|
|
8
|
+
EuiFlexItem,
|
|
9
|
+
EuiText,
|
|
10
|
+
} from '@elastic/eui';
|
|
6
11
|
|
|
7
12
|
import { GET_SUBSCRIPTION_DETAIL_GRAPHQL_QUERY } from '@/graphqlQueries';
|
|
8
|
-
import { useQueryWithGraphql } from '@/hooks';
|
|
13
|
+
import { useOrchestratorTheme, useQueryWithGraphql } from '@/hooks';
|
|
9
14
|
|
|
15
|
+
import { WfoSubscriptionStatusBadge } from '../WfoBadges';
|
|
16
|
+
import { WfoSubscriptionSyncStatusBadge } from '../WfoBadges/WfoSubscriptionSyncStatusBadge';
|
|
10
17
|
import { WfoError } from '../WfoError';
|
|
11
18
|
import { WfoFilterTabs } from '../WfoFilterTabs';
|
|
12
19
|
import { WfoLoading } from '../WfoLoading';
|
|
@@ -31,6 +38,8 @@ export const WfoSubscription = ({ subscriptionId }: WfoSubscriptionProps) => {
|
|
|
31
38
|
),
|
|
32
39
|
);
|
|
33
40
|
|
|
41
|
+
const { multiplyByBaseUnit } = useOrchestratorTheme();
|
|
42
|
+
|
|
34
43
|
const selectedTab = ((): SubscriptionDetailTab => {
|
|
35
44
|
return (
|
|
36
45
|
subscriptionDetailTabs.find(({ id }) => id === activeTab)?.id ||
|
|
@@ -68,6 +77,20 @@ export const WfoSubscription = ({ subscriptionId }: WfoSubscriptionProps) => {
|
|
|
68
77
|
<EuiText>
|
|
69
78
|
<h2>{subscriptionDetail.description}</h2>
|
|
70
79
|
</EuiText>
|
|
80
|
+
<EuiBadgeGroup
|
|
81
|
+
css={{ marginRight: multiplyByBaseUnit(1) }}
|
|
82
|
+
>
|
|
83
|
+
<EuiFlexItem grow={false}>
|
|
84
|
+
<WfoSubscriptionStatusBadge
|
|
85
|
+
status={subscriptionDetail.status}
|
|
86
|
+
/>
|
|
87
|
+
</EuiFlexItem>
|
|
88
|
+
<EuiFlexItem grow={false}>
|
|
89
|
+
<WfoSubscriptionSyncStatusBadge
|
|
90
|
+
insync={subscriptionDetail.insync}
|
|
91
|
+
/>
|
|
92
|
+
</EuiFlexItem>
|
|
93
|
+
</EuiBadgeGroup>
|
|
71
94
|
</EuiFlexItem>
|
|
72
95
|
<EuiFlexItem grow={false}>
|
|
73
96
|
<WfoSubscriptionActions
|
|
@@ -9,6 +9,7 @@ export const OrchestratorConfigContext = createContext<OrchestratorConfig>({
|
|
|
9
9
|
engineStatusEndpoint: '',
|
|
10
10
|
graphqlEndpointCore: '',
|
|
11
11
|
orchestratorApiBaseUrl: '',
|
|
12
|
+
orchestratorWebsocketUrl: '',
|
|
12
13
|
processStatusCountsEndpoint: '',
|
|
13
14
|
processesEndpoint: '',
|
|
14
15
|
subscriptionActionsEndpoint: '',
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { tint, useEuiTheme } from '@elastic/eui';
|
|
2
2
|
|
|
3
3
|
export const useOrchestratorTheme = () => {
|
|
4
|
-
const { euiTheme } = useEuiTheme();
|
|
4
|
+
const { euiTheme, colorMode } = useEuiTheme();
|
|
5
|
+
|
|
5
6
|
const baseUnit = euiTheme.base;
|
|
6
7
|
|
|
7
8
|
const multiplyByBaseUnit = (multiplier: number) => baseUnit * multiplier;
|
|
@@ -12,5 +13,6 @@ export const useOrchestratorTheme = () => {
|
|
|
12
13
|
theme: euiTheme,
|
|
13
14
|
multiplyByBaseUnit,
|
|
14
15
|
toSecondaryColor,
|
|
16
|
+
colorMode,
|
|
15
17
|
};
|
|
16
18
|
};
|
|
@@ -1,40 +1,18 @@
|
|
|
1
1
|
import { useAppDispatch } from '@/rtk/hooks';
|
|
2
2
|
import { addToastMessage } from '@/rtk/slices/toastMessages';
|
|
3
|
-
import {
|
|
3
|
+
import { ToastTypes } from '@/types';
|
|
4
|
+
import { getToastMessage } from '@/utils/getToastMessage';
|
|
4
5
|
|
|
5
6
|
export const useShowToastMessage = () => {
|
|
6
7
|
const dispatch = useAppDispatch();
|
|
7
8
|
|
|
8
|
-
const getTypeProps = (type: ToastTypes): Partial<Toast> => {
|
|
9
|
-
switch (type) {
|
|
10
|
-
case ToastTypes.ERROR:
|
|
11
|
-
return {
|
|
12
|
-
color: 'danger',
|
|
13
|
-
iconType: 'warning',
|
|
14
|
-
};
|
|
15
|
-
case ToastTypes.SUCCESS:
|
|
16
|
-
return {
|
|
17
|
-
color: 'success',
|
|
18
|
-
iconType: 'check',
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
|
|
23
9
|
const showToastMessage = (
|
|
24
10
|
type: ToastTypes,
|
|
25
11
|
text: string, // We use string here instead of Toast['text'] because we want to prevent passing in react component because they trigger an "unsynchronizable values in payload detected" error',
|
|
26
12
|
title: string, // same as above for string instead of Toast['title'],
|
|
27
13
|
) => {
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const toast: Toast = {
|
|
32
|
-
id,
|
|
33
|
-
text,
|
|
34
|
-
title,
|
|
35
|
-
...typeProps,
|
|
36
|
-
};
|
|
37
|
-
dispatch(addToastMessage(toast));
|
|
14
|
+
const toastMessage = getToastMessage(type, text, title);
|
|
15
|
+
dispatch(addToastMessage(toastMessage));
|
|
38
16
|
};
|
|
39
17
|
|
|
40
18
|
return {
|
package/src/messages/en-GB.json
CHANGED
|
@@ -12,7 +12,11 @@
|
|
|
12
12
|
"tasks": "Tasks",
|
|
13
13
|
"title": "Workflow Orchestrator",
|
|
14
14
|
"welcome": "Welcome",
|
|
15
|
-
"workflows": "Workflows"
|
|
15
|
+
"workflows": "Workflows",
|
|
16
|
+
"darkMode": "Dark mode",
|
|
17
|
+
"lightMode": "Light mode",
|
|
18
|
+
"websocketConnected": "The websocket is connected",
|
|
19
|
+
"websocketDisconnected": "The websocket is disconnected, try refreshing the page"
|
|
16
20
|
},
|
|
17
21
|
"common": {
|
|
18
22
|
"product": "Product",
|
|
@@ -26,7 +30,9 @@
|
|
|
26
30
|
"noItemsFound": "No items found",
|
|
27
31
|
"search": "Search",
|
|
28
32
|
"errorMessage": "An error occurred",
|
|
29
|
-
"export": "Export"
|
|
33
|
+
"export": "Export",
|
|
34
|
+
"insyncTrue": "in-sync",
|
|
35
|
+
"insyncFalse": "out-of-sync"
|
|
30
36
|
},
|
|
31
37
|
"confirmationDialog": {
|
|
32
38
|
"title": "Please confirm",
|
package/src/messages/nl-NL.json
CHANGED
|
@@ -12,7 +12,11 @@
|
|
|
12
12
|
"tasks": "Taken",
|
|
13
13
|
"title": "Workflow Orchestrator",
|
|
14
14
|
"welcome": "Welkom",
|
|
15
|
-
"workflows": "Workflows"
|
|
15
|
+
"workflows": "Workflows",
|
|
16
|
+
"darkMode": "Dark mode",
|
|
17
|
+
"lightMode": "Light mode",
|
|
18
|
+
"websocketConnected": "De websocket is actief",
|
|
19
|
+
"websocketDisconnected": "De websocket verbinding is verbroken, probeer de pagina te verversen."
|
|
16
20
|
},
|
|
17
21
|
"common": {
|
|
18
22
|
"product": "Produkt",
|
|
@@ -26,7 +30,9 @@
|
|
|
26
30
|
"noItemsFound": "Geen items gevonden",
|
|
27
31
|
"search": "Zoeken",
|
|
28
32
|
"errorMessage": "Er is een fout opgetreden",
|
|
29
|
-
"export": "Exporteren"
|
|
33
|
+
"export": "Exporteren",
|
|
34
|
+
"insyncTrue": "in-sync",
|
|
35
|
+
"insyncFalse": "out-of-sync"
|
|
30
36
|
},
|
|
31
37
|
"confirmationDialog": {
|
|
32
38
|
"title": "Graag bevestigen",
|
package/src/rtk/api.ts
CHANGED
|
@@ -13,6 +13,12 @@ export enum BaseQueryTypes {
|
|
|
13
13
|
custom = 'custom',
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
export enum CacheTags {
|
|
17
|
+
engineStatus = 'engineStatus',
|
|
18
|
+
// This is a placeholder for now. Having only one messes up the type of the tag in the onCacheEntryAdded function.
|
|
19
|
+
testStatus = 'testStatus',
|
|
20
|
+
}
|
|
21
|
+
|
|
16
22
|
type ExtraOptions = {
|
|
17
23
|
baseQueryType?: BaseQueryTypes;
|
|
18
24
|
};
|
|
@@ -50,5 +56,5 @@ export const orchestratorApi = createApi({
|
|
|
50
56
|
}
|
|
51
57
|
},
|
|
52
58
|
endpoints: () => ({}),
|
|
53
|
-
tagTypes: [
|
|
59
|
+
tagTypes: [CacheTags.engineStatus, CacheTags.testStatus],
|
|
54
60
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EngineStatus } from '@/types';
|
|
2
2
|
|
|
3
|
-
import { BaseQueryTypes, orchestratorApi } from '../api';
|
|
3
|
+
import { BaseQueryTypes, CacheTags, orchestratorApi } from '../api';
|
|
4
4
|
|
|
5
5
|
interface EngineStatusReturnValue {
|
|
6
6
|
engineStatus: EngineStatus;
|
|
@@ -35,7 +35,7 @@ const statusApi = orchestratorApi.injectEndpoints({
|
|
|
35
35
|
runningProcesses: data?.running_processes || 0,
|
|
36
36
|
};
|
|
37
37
|
},
|
|
38
|
-
providesTags: [
|
|
38
|
+
providesTags: [CacheTags.engineStatus],
|
|
39
39
|
}),
|
|
40
40
|
clearCache: build.mutation<void, string>({
|
|
41
41
|
query: (settingName) => ({
|
|
@@ -60,7 +60,7 @@ const statusApi = orchestratorApi.injectEndpoints({
|
|
|
60
60
|
extraOptions: {
|
|
61
61
|
baseQueryType: BaseQueryTypes.fetch,
|
|
62
62
|
},
|
|
63
|
-
invalidatesTags: [
|
|
63
|
+
invalidatesTags: [CacheTags.engineStatus],
|
|
64
64
|
}),
|
|
65
65
|
}),
|
|
66
66
|
});
|