@devtron-labs/devtron-fe-common-lib 0.0.37 → 0.0.38
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/dist/Common/AppStatus/AppStatus.d.ts +3 -0
- package/dist/Common/AppStatus/constants.d.ts +51 -0
- package/dist/Common/AppStatus/index.d.ts +1 -0
- package/dist/Common/AppStatus/types.d.ts +12 -0
- package/dist/Common/AppStatus/utils.d.ts +1 -0
- package/dist/Common/Helper.d.ts +1 -0
- package/dist/Common/index.d.ts +1 -0
- package/dist/index.js +106 -1
- package/package.json +1 -1
- package/src/Common/AppStatus/AppStatus.tsx +64 -0
- package/src/Common/AppStatus/constants.ts +53 -0
- package/src/Common/AppStatus/index.ts +1 -0
- package/src/Common/AppStatus/types.ts +12 -0
- package/src/Common/AppStatus/utils.ts +14 -0
- package/src/Common/Helper.tsx +8 -0
- package/src/Common/index.ts +1 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export declare const StatusConstants: {
|
|
2
|
+
NOT_DEPLOYED: {
|
|
3
|
+
noSpaceLower: string;
|
|
4
|
+
normalCase: string;
|
|
5
|
+
lowerCase: string;
|
|
6
|
+
};
|
|
7
|
+
APP_STATUS: {
|
|
8
|
+
noSpaceLower: string;
|
|
9
|
+
normalText: string;
|
|
10
|
+
};
|
|
11
|
+
PROJECT: {
|
|
12
|
+
pluralLower: string;
|
|
13
|
+
lowerCase: string;
|
|
14
|
+
};
|
|
15
|
+
CLUSTER: {
|
|
16
|
+
pluralLower: string;
|
|
17
|
+
lowerCase: string;
|
|
18
|
+
};
|
|
19
|
+
NAMESPACE: {
|
|
20
|
+
pluralLower: string;
|
|
21
|
+
lowerCase: string;
|
|
22
|
+
};
|
|
23
|
+
ENVIRONMENT: {
|
|
24
|
+
pluralLower: string;
|
|
25
|
+
lowerCase: string;
|
|
26
|
+
};
|
|
27
|
+
NOT_AVILABLE: {
|
|
28
|
+
normalCase: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export declare enum TIMELINE_STATUS {
|
|
32
|
+
DEPLOYMENT_INITIATED = "DEPLOYMENT_INITIATED",
|
|
33
|
+
GIT_COMMIT = "GIT_COMMIT",
|
|
34
|
+
GIT_COMMIT_FAILED = "GIT_COMMIT_FAILED",
|
|
35
|
+
KUBECTL_APPLY = "KUBECTL_APPLY",
|
|
36
|
+
KUBECTL_APPLY_STARTED = "KUBECTL_APPLY_STARTED",
|
|
37
|
+
KUBECTL_APPLY_SYNCED = "KUBECTL_APPLY_SYNCED",
|
|
38
|
+
HEALTHY = "HEALTHY",
|
|
39
|
+
APP_HEALTH = "APP_HEALTH",
|
|
40
|
+
DEPLOYMENT_FAILED = "FAILED",
|
|
41
|
+
FETCH_TIMED_OUT = "TIMED_OUT",
|
|
42
|
+
UNABLE_TO_FETCH_STATUS = "UNABLE_TO_FETCH_STATUS",
|
|
43
|
+
DEGRADED = "DEGRADED",
|
|
44
|
+
DEPLOYMENT_SUPERSEDED = "DEPLOYMENT_SUPERSEDED",
|
|
45
|
+
ABORTED = "ABORTED",
|
|
46
|
+
INPROGRESS = "INPROGRESS",
|
|
47
|
+
HELM_PACKAGE_GENERATED = "HELM_PACKAGE_GENERATED",
|
|
48
|
+
HELM_MANIFEST_PUSHED_TO_HELM_REPO = "HELM_MANIFEST_PUSHED_TO_HELM_REPO",
|
|
49
|
+
HELM_MANIFEST_PUSHED_TO_HELM_REPO_FAILED = "HELM_MANIFEST_PUSHED_TO_HELM_REPO_FAILED"
|
|
50
|
+
}
|
|
51
|
+
export declare const YET_TO_RUN = "Yet to run";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as AppStatus } from './AppStatus';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface AppStatusType {
|
|
2
|
+
appStatus: string;
|
|
3
|
+
isDeploymentStatus?: boolean;
|
|
4
|
+
isJobView?: boolean;
|
|
5
|
+
isVirtualEnv?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Hide the status message if true and show status message in tooltip
|
|
8
|
+
*
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
|
+
hideStatusMessage?: boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const triggerStatus: (triggerDetailStatus: string) => string;
|
package/dist/Common/Helper.d.ts
CHANGED
|
@@ -51,4 +51,5 @@ export declare const closeOnEscKeyPressed: (e: any, actionClose: () => void) =>
|
|
|
51
51
|
*/
|
|
52
52
|
export declare function copyToClipboard(str: any, callback?: typeof noop): void;
|
|
53
53
|
export declare function useAsync<T>(func: (...rest: any[]) => Promise<T>, dependencyArray?: any[], shouldRun?: boolean, options?: AsyncOptions): [boolean, T, any | null, () => void, React.Dispatch<any>, any[]];
|
|
54
|
+
export declare const processDeployedTime: (lastDeployed: any, isArgoInstalled: any) => string;
|
|
54
55
|
export {};
|
package/dist/Common/index.d.ts
CHANGED
|
@@ -39,3 +39,4 @@ export { default as DebouncedSearch } from './DebouncedSearch/DebouncedSearch';
|
|
|
39
39
|
export { default as Grid } from './Grid/Grid';
|
|
40
40
|
export { default as ClipboardButton } from './ClipboardButton/ClipboardButton';
|
|
41
41
|
export * from './Hooks';
|
|
42
|
+
export { AppStatus } from './AppStatus';
|
package/dist/index.js
CHANGED
|
@@ -10220,7 +10220,15 @@ function useAsync(func, dependencyArray, shouldRun, options) {
|
|
|
10220
10220
|
}
|
|
10221
10221
|
};
|
|
10222
10222
|
return [state.loading, state.result, state.error, reload, setResult, state.dependencies];
|
|
10223
|
-
}
|
|
10223
|
+
}
|
|
10224
|
+
var processDeployedTime = function (lastDeployed, isArgoInstalled) {
|
|
10225
|
+
if (lastDeployed) {
|
|
10226
|
+
return handleUTCTime(lastDeployed, true);
|
|
10227
|
+
}
|
|
10228
|
+
else {
|
|
10229
|
+
return isArgoInstalled ? '' : 'Not deployed';
|
|
10230
|
+
}
|
|
10231
|
+
};
|
|
10224
10232
|
|
|
10225
10233
|
function Progressing(_a) {
|
|
10226
10234
|
var pageLoader = _a.pageLoader, size = _a.size, theme = _a.theme, styles = _a.styles, fillColor = _a.fillColor;
|
|
@@ -23608,6 +23616,102 @@ var useSuperAdmin = function () {
|
|
|
23608
23616
|
return { isSuperAdmin: isSuperAdmin };
|
|
23609
23617
|
};
|
|
23610
23618
|
|
|
23619
|
+
var StatusConstants = {
|
|
23620
|
+
NOT_DEPLOYED: {
|
|
23621
|
+
noSpaceLower: 'notdeployed',
|
|
23622
|
+
normalCase: 'Not deployed',
|
|
23623
|
+
lowerCase: 'not-deployed',
|
|
23624
|
+
},
|
|
23625
|
+
APP_STATUS: {
|
|
23626
|
+
noSpaceLower: 'appStatus',
|
|
23627
|
+
normalText: 'App status',
|
|
23628
|
+
},
|
|
23629
|
+
PROJECT: {
|
|
23630
|
+
pluralLower: 'projects',
|
|
23631
|
+
lowerCase: 'project',
|
|
23632
|
+
},
|
|
23633
|
+
CLUSTER: {
|
|
23634
|
+
pluralLower: 'clusters',
|
|
23635
|
+
lowerCase: 'cluster',
|
|
23636
|
+
},
|
|
23637
|
+
NAMESPACE: {
|
|
23638
|
+
pluralLower: 'namespaces',
|
|
23639
|
+
lowerCase: 'namespace',
|
|
23640
|
+
},
|
|
23641
|
+
ENVIRONMENT: {
|
|
23642
|
+
pluralLower: 'environments',
|
|
23643
|
+
lowerCase: 'environment',
|
|
23644
|
+
},
|
|
23645
|
+
NOT_AVILABLE: {
|
|
23646
|
+
normalCase: 'Not available',
|
|
23647
|
+
},
|
|
23648
|
+
};
|
|
23649
|
+
var TIMELINE_STATUS;
|
|
23650
|
+
(function (TIMELINE_STATUS) {
|
|
23651
|
+
TIMELINE_STATUS["DEPLOYMENT_INITIATED"] = "DEPLOYMENT_INITIATED";
|
|
23652
|
+
TIMELINE_STATUS["GIT_COMMIT"] = "GIT_COMMIT";
|
|
23653
|
+
TIMELINE_STATUS["GIT_COMMIT_FAILED"] = "GIT_COMMIT_FAILED";
|
|
23654
|
+
TIMELINE_STATUS["KUBECTL_APPLY"] = "KUBECTL_APPLY";
|
|
23655
|
+
TIMELINE_STATUS["KUBECTL_APPLY_STARTED"] = "KUBECTL_APPLY_STARTED";
|
|
23656
|
+
TIMELINE_STATUS["KUBECTL_APPLY_SYNCED"] = "KUBECTL_APPLY_SYNCED";
|
|
23657
|
+
TIMELINE_STATUS["HEALTHY"] = "HEALTHY";
|
|
23658
|
+
TIMELINE_STATUS["APP_HEALTH"] = "APP_HEALTH";
|
|
23659
|
+
TIMELINE_STATUS["DEPLOYMENT_FAILED"] = "FAILED";
|
|
23660
|
+
TIMELINE_STATUS["FETCH_TIMED_OUT"] = "TIMED_OUT";
|
|
23661
|
+
TIMELINE_STATUS["UNABLE_TO_FETCH_STATUS"] = "UNABLE_TO_FETCH_STATUS";
|
|
23662
|
+
TIMELINE_STATUS["DEGRADED"] = "DEGRADED";
|
|
23663
|
+
TIMELINE_STATUS["DEPLOYMENT_SUPERSEDED"] = "DEPLOYMENT_SUPERSEDED";
|
|
23664
|
+
TIMELINE_STATUS["ABORTED"] = "ABORTED";
|
|
23665
|
+
TIMELINE_STATUS["INPROGRESS"] = "INPROGRESS";
|
|
23666
|
+
TIMELINE_STATUS["HELM_PACKAGE_GENERATED"] = "HELM_PACKAGE_GENERATED";
|
|
23667
|
+
TIMELINE_STATUS["HELM_MANIFEST_PUSHED_TO_HELM_REPO"] = "HELM_MANIFEST_PUSHED_TO_HELM_REPO";
|
|
23668
|
+
TIMELINE_STATUS["HELM_MANIFEST_PUSHED_TO_HELM_REPO_FAILED"] = "HELM_MANIFEST_PUSHED_TO_HELM_REPO_FAILED";
|
|
23669
|
+
})(TIMELINE_STATUS || (TIMELINE_STATUS = {}));
|
|
23670
|
+
var YET_TO_RUN = 'Yet to run';
|
|
23671
|
+
|
|
23672
|
+
var triggerStatus = function (triggerDetailStatus) {
|
|
23673
|
+
var triggerStatus = triggerDetailStatus === null || triggerDetailStatus === void 0 ? void 0 : triggerDetailStatus.toUpperCase();
|
|
23674
|
+
if (triggerStatus === TIMELINE_STATUS.ABORTED || triggerStatus === TIMELINE_STATUS.DEGRADED) {
|
|
23675
|
+
return 'Failed';
|
|
23676
|
+
}
|
|
23677
|
+
else if (triggerStatus === TIMELINE_STATUS.HEALTHY) {
|
|
23678
|
+
return 'Succeeded';
|
|
23679
|
+
}
|
|
23680
|
+
else if (triggerStatus === TIMELINE_STATUS.INPROGRESS) {
|
|
23681
|
+
return 'Inprogress';
|
|
23682
|
+
}
|
|
23683
|
+
else {
|
|
23684
|
+
return triggerDetailStatus;
|
|
23685
|
+
}
|
|
23686
|
+
};
|
|
23687
|
+
|
|
23688
|
+
function AppStatus(_a) {
|
|
23689
|
+
var appStatus = _a.appStatus, _b = _a.isDeploymentStatus, isDeploymentStatus = _b === void 0 ? false : _b, _c = _a.isJobView, isJobView = _c === void 0 ? false : _c, isVirtualEnv = _a.isVirtualEnv, _d = _a.hideStatusMessage, hideStatusMessage = _d === void 0 ? false : _d;
|
|
23690
|
+
var status = appStatus;
|
|
23691
|
+
if (isDeploymentStatus) {
|
|
23692
|
+
status = triggerStatus(appStatus);
|
|
23693
|
+
}
|
|
23694
|
+
var appStatusLowerCase = status === null || status === void 0 ? void 0 : status.toLowerCase();
|
|
23695
|
+
var isNotDeployed = appStatusLowerCase === StatusConstants.NOT_DEPLOYED.noSpaceLower;
|
|
23696
|
+
var iconClass = isNotDeployed ? StatusConstants.NOT_DEPLOYED.lowerCase : appStatusLowerCase;
|
|
23697
|
+
var statusMessage = status || (isVirtualEnv ? StatusConstants.NOT_AVILABLE.normalCase : '-');
|
|
23698
|
+
var notDeployed = isJobView ? YET_TO_RUN : StatusConstants.NOT_DEPLOYED.normalCase;
|
|
23699
|
+
var textContent = isNotDeployed ? notDeployed : statusMessage;
|
|
23700
|
+
var renderIcon = function () {
|
|
23701
|
+
if (iconClass) {
|
|
23702
|
+
return jsxRuntime.jsx("span", { className: "dc__app-summary__icon icon-dim-16 ".concat(iconClass, " ").concat(iconClass, "--node") });
|
|
23703
|
+
}
|
|
23704
|
+
else if (isVirtualEnv) {
|
|
23705
|
+
return (jsxRuntime.jsx("span", { className: "dc__app-summary__icon icon-dim-16 ".concat(StatusConstants.NOT_DEPLOYED.lowerCase, " ").concat(StatusConstants.NOT_DEPLOYED.lowerCase, "--node") }));
|
|
23706
|
+
}
|
|
23707
|
+
else {
|
|
23708
|
+
return (jsxRuntime.jsx(Tippy, __assign({ className: "default-tt w-200", arrow: false, placement: "top", content: "To fetch app status for GitOps based deployments open the app detail page" }, { children: jsxRuntime.jsx(SvgIcInfoOutlined, { className: "icon-dim-16 fcn-6" }) })));
|
|
23709
|
+
}
|
|
23710
|
+
};
|
|
23711
|
+
return hideStatusMessage ? (iconClass || isVirtualEnv ? (jsxRuntime.jsx(Tippy, __assign({ className: "default-tt", arrow: false, placement: "top", content: textContent }, { children: jsxRuntime.jsx("div", __assign({ className: "flex" }, { children: renderIcon() })) }))) : (renderIcon())) : (jsxRuntime.jsxs("div", __assign({ className: "flex left" }, { children: [jsxRuntime.jsx("div", __assign({ className: "flex mr-6" }, { children: renderIcon() })), jsxRuntime.jsx("p", __assign({ "data-testid": "".concat(status, "-app-status"), className: "dc__truncate-text dc__first-letter-capitalize cn-6 m-0" }, { children: textContent }))] })));
|
|
23712
|
+
}
|
|
23713
|
+
|
|
23714
|
+
exports.AppStatus = AppStatus;
|
|
23611
23715
|
exports.BreadCrumb = BreadCrumb;
|
|
23612
23716
|
exports.BreadcrumbStore = Store;
|
|
23613
23717
|
exports.BuildStageVariable = BuildStageVariable;
|
|
@@ -23697,6 +23801,7 @@ exports.multiSelectStyles = multiSelectStyles;
|
|
|
23697
23801
|
exports.noop = noop$1;
|
|
23698
23802
|
exports.not = not;
|
|
23699
23803
|
exports.post = post;
|
|
23804
|
+
exports.processDeployedTime = processDeployedTime;
|
|
23700
23805
|
exports.put = put;
|
|
23701
23806
|
exports.setImageTags = setImageTags;
|
|
23702
23807
|
exports.showError = showError;
|
package/package.json
CHANGED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import Tippy from '@tippyjs/react'
|
|
2
|
+
import { ReactComponent as InfoIcon } from '../../Assets/Icon/ic-info-outlined.svg'
|
|
3
|
+
import { StatusConstants, YET_TO_RUN } from './constants'
|
|
4
|
+
import { AppStatusType } from './types'
|
|
5
|
+
import { triggerStatus } from './utils'
|
|
6
|
+
|
|
7
|
+
export default function AppStatus({
|
|
8
|
+
appStatus,
|
|
9
|
+
isDeploymentStatus = false,
|
|
10
|
+
isJobView = false,
|
|
11
|
+
isVirtualEnv,
|
|
12
|
+
hideStatusMessage = false,
|
|
13
|
+
}: AppStatusType) {
|
|
14
|
+
let status = appStatus
|
|
15
|
+
if (isDeploymentStatus) {
|
|
16
|
+
status = triggerStatus(appStatus)
|
|
17
|
+
}
|
|
18
|
+
const appStatusLowerCase = status?.toLowerCase()
|
|
19
|
+
const isNotDeployed = appStatusLowerCase === StatusConstants.NOT_DEPLOYED.noSpaceLower
|
|
20
|
+
const iconClass = isNotDeployed ? StatusConstants.NOT_DEPLOYED.lowerCase : appStatusLowerCase
|
|
21
|
+
const statusMessage = status || (isVirtualEnv ? StatusConstants.NOT_AVILABLE.normalCase : '-')
|
|
22
|
+
const notDeployed = isJobView ? YET_TO_RUN : StatusConstants.NOT_DEPLOYED.normalCase
|
|
23
|
+
const textContent = isNotDeployed ? notDeployed : statusMessage
|
|
24
|
+
|
|
25
|
+
const renderIcon = () => {
|
|
26
|
+
if (iconClass) {
|
|
27
|
+
return <span className={`dc__app-summary__icon icon-dim-16 ${iconClass} ${iconClass}--node`} />
|
|
28
|
+
} else if (isVirtualEnv) {
|
|
29
|
+
return (
|
|
30
|
+
<span
|
|
31
|
+
className={`dc__app-summary__icon icon-dim-16 ${StatusConstants.NOT_DEPLOYED.lowerCase} ${StatusConstants.NOT_DEPLOYED.lowerCase}--node`}
|
|
32
|
+
/>
|
|
33
|
+
)
|
|
34
|
+
} else {
|
|
35
|
+
return (
|
|
36
|
+
<Tippy
|
|
37
|
+
className="default-tt w-200"
|
|
38
|
+
arrow={false}
|
|
39
|
+
placement="top"
|
|
40
|
+
content="To fetch app status for GitOps based deployments open the app detail page"
|
|
41
|
+
>
|
|
42
|
+
<InfoIcon className="icon-dim-16 fcn-6" />
|
|
43
|
+
</Tippy>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return hideStatusMessage ? (
|
|
49
|
+
iconClass || isVirtualEnv ? (
|
|
50
|
+
<Tippy className="default-tt" arrow={false} placement="top" content={textContent}>
|
|
51
|
+
<div className="flex">{renderIcon()}</div>
|
|
52
|
+
</Tippy>
|
|
53
|
+
) : (
|
|
54
|
+
renderIcon()
|
|
55
|
+
)
|
|
56
|
+
) : (
|
|
57
|
+
<div className="flex left">
|
|
58
|
+
<div className="flex mr-6">{renderIcon()}</div>
|
|
59
|
+
<p data-testid={`${status}-app-status`} className="dc__truncate-text dc__first-letter-capitalize cn-6 m-0">
|
|
60
|
+
{textContent}
|
|
61
|
+
</p>
|
|
62
|
+
</div>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export const StatusConstants = {
|
|
2
|
+
NOT_DEPLOYED: {
|
|
3
|
+
noSpaceLower: 'notdeployed',
|
|
4
|
+
normalCase: 'Not deployed',
|
|
5
|
+
lowerCase: 'not-deployed',
|
|
6
|
+
},
|
|
7
|
+
APP_STATUS: {
|
|
8
|
+
noSpaceLower: 'appStatus',
|
|
9
|
+
normalText: 'App status',
|
|
10
|
+
},
|
|
11
|
+
PROJECT: {
|
|
12
|
+
pluralLower: 'projects',
|
|
13
|
+
lowerCase: 'project',
|
|
14
|
+
},
|
|
15
|
+
CLUSTER: {
|
|
16
|
+
pluralLower: 'clusters',
|
|
17
|
+
lowerCase: 'cluster',
|
|
18
|
+
},
|
|
19
|
+
NAMESPACE: {
|
|
20
|
+
pluralLower: 'namespaces',
|
|
21
|
+
lowerCase: 'namespace',
|
|
22
|
+
},
|
|
23
|
+
ENVIRONMENT: {
|
|
24
|
+
pluralLower: 'environments',
|
|
25
|
+
lowerCase: 'environment',
|
|
26
|
+
},
|
|
27
|
+
NOT_AVILABLE: {
|
|
28
|
+
normalCase: 'Not available',
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export enum TIMELINE_STATUS {
|
|
33
|
+
DEPLOYMENT_INITIATED = 'DEPLOYMENT_INITIATED',
|
|
34
|
+
GIT_COMMIT = 'GIT_COMMIT',
|
|
35
|
+
GIT_COMMIT_FAILED = 'GIT_COMMIT_FAILED',
|
|
36
|
+
KUBECTL_APPLY = 'KUBECTL_APPLY',
|
|
37
|
+
KUBECTL_APPLY_STARTED = 'KUBECTL_APPLY_STARTED',
|
|
38
|
+
KUBECTL_APPLY_SYNCED = 'KUBECTL_APPLY_SYNCED',
|
|
39
|
+
HEALTHY = 'HEALTHY',
|
|
40
|
+
APP_HEALTH = 'APP_HEALTH',
|
|
41
|
+
DEPLOYMENT_FAILED = 'FAILED',
|
|
42
|
+
FETCH_TIMED_OUT = 'TIMED_OUT',
|
|
43
|
+
UNABLE_TO_FETCH_STATUS = 'UNABLE_TO_FETCH_STATUS',
|
|
44
|
+
DEGRADED = 'DEGRADED',
|
|
45
|
+
DEPLOYMENT_SUPERSEDED = 'DEPLOYMENT_SUPERSEDED',
|
|
46
|
+
ABORTED = 'ABORTED',
|
|
47
|
+
INPROGRESS = 'INPROGRESS',
|
|
48
|
+
HELM_PACKAGE_GENERATED = 'HELM_PACKAGE_GENERATED',
|
|
49
|
+
HELM_MANIFEST_PUSHED_TO_HELM_REPO = 'HELM_MANIFEST_PUSHED_TO_HELM_REPO',
|
|
50
|
+
HELM_MANIFEST_PUSHED_TO_HELM_REPO_FAILED = 'HELM_MANIFEST_PUSHED_TO_HELM_REPO_FAILED',
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const YET_TO_RUN = 'Yet to run'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as AppStatus } from './AppStatus'
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface AppStatusType {
|
|
2
|
+
appStatus: string
|
|
3
|
+
isDeploymentStatus?: boolean
|
|
4
|
+
isJobView?: boolean
|
|
5
|
+
isVirtualEnv?: boolean
|
|
6
|
+
/**
|
|
7
|
+
* Hide the status message if true and show status message in tooltip
|
|
8
|
+
*
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
|
+
hideStatusMessage?: boolean
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TIMELINE_STATUS } from './constants'
|
|
2
|
+
|
|
3
|
+
export const triggerStatus = (triggerDetailStatus: string): string => {
|
|
4
|
+
let triggerStatus = triggerDetailStatus?.toUpperCase()
|
|
5
|
+
if (triggerStatus === TIMELINE_STATUS.ABORTED || triggerStatus === TIMELINE_STATUS.DEGRADED) {
|
|
6
|
+
return 'Failed'
|
|
7
|
+
} else if (triggerStatus === TIMELINE_STATUS.HEALTHY) {
|
|
8
|
+
return 'Succeeded'
|
|
9
|
+
} else if (triggerStatus === TIMELINE_STATUS.INPROGRESS) {
|
|
10
|
+
return 'Inprogress'
|
|
11
|
+
} else {
|
|
12
|
+
return triggerDetailStatus
|
|
13
|
+
}
|
|
14
|
+
}
|
package/src/Common/Helper.tsx
CHANGED
|
@@ -487,3 +487,11 @@ export function useAsync<T>(
|
|
|
487
487
|
|
|
488
488
|
return [state.loading, state.result, state.error, reload, setResult, state.dependencies]
|
|
489
489
|
}
|
|
490
|
+
|
|
491
|
+
export const processDeployedTime = (lastDeployed, isArgoInstalled) => {
|
|
492
|
+
if (lastDeployed) {
|
|
493
|
+
return handleUTCTime(lastDeployed, true)
|
|
494
|
+
} else {
|
|
495
|
+
return isArgoInstalled ? '' : 'Not deployed'
|
|
496
|
+
}
|
|
497
|
+
}
|
package/src/Common/index.ts
CHANGED
|
@@ -39,3 +39,4 @@ export { default as DebouncedSearch } from './DebouncedSearch/DebouncedSearch'
|
|
|
39
39
|
export { default as Grid } from './Grid/Grid'
|
|
40
40
|
export { default as ClipboardButton } from './ClipboardButton/ClipboardButton'
|
|
41
41
|
export * from './Hooks'
|
|
42
|
+
export { AppStatus } from './AppStatus'
|