@devtron-labs/devtron-fe-common-lib 0.0.82-beta-3 → 0.0.82-beta-5
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ErrorPageType } from './Types';
|
|
2
2
|
|
|
3
|
-
declare const ErrorPage: ({ code, image, title, subTitle, imageType, heightToDeduct, reload }: ErrorPageType) => JSX.Element;
|
|
3
|
+
declare const ErrorPage: ({ code, image, title, subTitle, imageType, heightToDeduct, reload, redirectURL }: ErrorPageType) => JSX.Element;
|
|
4
4
|
export default ErrorPage;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ErrorScreenManagerProps } from './Types';
|
|
2
2
|
|
|
3
|
-
declare const ErrorScreenManager: ({ code, reload, subtitle, reloadClass, heightToDeduct }: ErrorScreenManagerProps) => JSX.Element;
|
|
3
|
+
declare const ErrorScreenManager: ({ code, reload, subtitle, reloadClass, heightToDeduct, redirectURL, }: ErrorScreenManagerProps) => JSX.Element;
|
|
4
4
|
export default ErrorScreenManager;
|
package/dist/Common/Types.d.ts
CHANGED
|
@@ -116,7 +116,7 @@ export interface GenericEmptyStateType {
|
|
|
116
116
|
layout?: 'row' | 'column';
|
|
117
117
|
contentClassName?: string;
|
|
118
118
|
}
|
|
119
|
-
export interface ErrorPageType extends Pick<GenericEmptyStateType, 'image' | 'title' | 'subTitle' | 'renderButton' | 'imageType'>, Pick<ErrorScreenManagerProps, 'reload'> {
|
|
119
|
+
export interface ErrorPageType extends Pick<GenericEmptyStateType, 'image' | 'title' | 'subTitle' | 'renderButton' | 'imageType'>, Pick<ErrorScreenManagerProps, 'reload' | 'redirectURL'> {
|
|
120
120
|
code: number;
|
|
121
121
|
heightToDeduct?: number;
|
|
122
122
|
}
|
|
@@ -126,6 +126,11 @@ export interface ErrorScreenManagerProps {
|
|
|
126
126
|
subtitle?: React.ReactChild;
|
|
127
127
|
reloadClass?: string;
|
|
128
128
|
heightToDeduct?: number;
|
|
129
|
+
/**
|
|
130
|
+
* Would be used to redirect URL in case of 404
|
|
131
|
+
* @default - APP_LIST
|
|
132
|
+
*/
|
|
133
|
+
redirectURL?: string;
|
|
129
134
|
}
|
|
130
135
|
export interface ErrorScreenNotAuthorizedProps {
|
|
131
136
|
subtitle?: React.ReactChild;
|
|
@@ -524,7 +529,7 @@ export interface CDMaterialsMetaInfo {
|
|
|
524
529
|
*/
|
|
525
530
|
requestedUserId: number;
|
|
526
531
|
/**
|
|
527
|
-
* Would currently only be received in case of release
|
|
532
|
+
* Would currently only be received in case of release
|
|
528
533
|
*/
|
|
529
534
|
appWorkflowId: number;
|
|
530
535
|
}
|
package/dist/index.js
CHANGED
|
@@ -515,7 +515,7 @@ function Ki(e, t, n, r, i) {
|
|
|
515
515
|
}
|
|
516
516
|
const fs = (e, t, n, r) => Ki(e, "POST", t, n, r), ap = (e, t, n) => Ki(e, "PUT", t, n), eL = (e, t, n) => Ki(e, "PATCH", t, n), Ln = (e, t) => Ki(e, "GET", null, t), tL = (e, t, n) => Ki(e, "DELETE", t, n), nL = (e, t) => (t.current.abort(), t.current = new AbortController(), e()), rL = (e) => (
|
|
517
517
|
// The 0 code is common for aborted and blocked requests
|
|
518
|
-
e && e.code === 0 && e.message === "The user aborted a request."
|
|
518
|
+
e && e.code === 0 && (e.message === "The user aborted a request." || e.message === "signal is aborted without reason")
|
|
519
519
|
);
|
|
520
520
|
var ga = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
521
521
|
function sp(e) {
|
|
@@ -15134,14 +15134,14 @@ const Ky = ({
|
|
|
15134
15134
|
]
|
|
15135
15135
|
}
|
|
15136
15136
|
);
|
|
15137
|
-
}, Ul = Ky, qy = ({ code: e, image: t, title: n, subTitle: r, imageType: i, heightToDeduct: a, reload: s }) => {
|
|
15138
|
-
const { push:
|
|
15139
|
-
o
|
|
15140
|
-
},
|
|
15141
|
-
switch (
|
|
15137
|
+
}, Ul = Ky, qy = ({ code: e, image: t, title: n, subTitle: r, imageType: i, heightToDeduct: a, reload: s, redirectURL: o }) => {
|
|
15138
|
+
const { push: l } = vI(), u = () => {
|
|
15139
|
+
l(o || `/${et.APP_LIST}`);
|
|
15140
|
+
}, d = (A) => {
|
|
15141
|
+
switch (A) {
|
|
15142
15142
|
case Je.NOT_FOUND:
|
|
15143
15143
|
return {
|
|
15144
|
-
onClick:
|
|
15144
|
+
onClick: u,
|
|
15145
15145
|
renderButtonText: He.TAKE_BACK_HOME,
|
|
15146
15146
|
isButtonAvailable: !0
|
|
15147
15147
|
};
|
|
@@ -15163,23 +15163,30 @@ const Ky = ({
|
|
|
15163
15163
|
return { onClick: On, renderButtonText: "", isButtonAvailable: !1 };
|
|
15164
15164
|
}
|
|
15165
15165
|
}, {
|
|
15166
|
-
onClick:
|
|
15167
|
-
renderButtonText:
|
|
15168
|
-
isButtonAvailable:
|
|
15169
|
-
} =
|
|
15166
|
+
onClick: g,
|
|
15167
|
+
renderButtonText: f,
|
|
15168
|
+
isButtonAvailable: I
|
|
15169
|
+
} = d(e), p = () => /* @__PURE__ */ c.jsx("button", { type: "button", className: "flex cta h-36", onClick: g, "data-testid": "empty-screen-take-me-home", children: f });
|
|
15170
15170
|
return /* @__PURE__ */ c.jsx(
|
|
15171
15171
|
Ul,
|
|
15172
15172
|
{
|
|
15173
15173
|
image: t,
|
|
15174
15174
|
title: n,
|
|
15175
15175
|
subTitle: r,
|
|
15176
|
-
isButtonAvailable:
|
|
15177
|
-
renderButton:
|
|
15176
|
+
isButtonAvailable: I,
|
|
15177
|
+
renderButton: p,
|
|
15178
15178
|
imageType: i,
|
|
15179
15179
|
heightToDeduct: a
|
|
15180
15180
|
}
|
|
15181
15181
|
);
|
|
15182
|
-
}, $n = qy, _y = ({
|
|
15182
|
+
}, $n = qy, _y = ({
|
|
15183
|
+
code: e,
|
|
15184
|
+
reload: t,
|
|
15185
|
+
subtitle: n,
|
|
15186
|
+
reloadClass: r,
|
|
15187
|
+
heightToDeduct: i,
|
|
15188
|
+
redirectURL: a = et.APP_LIST
|
|
15189
|
+
}) => (() => {
|
|
15183
15190
|
switch (e) {
|
|
15184
15191
|
case Je.BAD_REQUEST:
|
|
15185
15192
|
return /* @__PURE__ */ c.jsx(
|
|
@@ -15227,7 +15234,8 @@ const Ky = ({
|
|
|
15227
15234
|
subTitle: n || He.PAGE_NOT_EXIST,
|
|
15228
15235
|
image: Xy,
|
|
15229
15236
|
imageType: Cn.Large,
|
|
15230
|
-
heightToDeduct: i
|
|
15237
|
+
heightToDeduct: i,
|
|
15238
|
+
redirectURL: a
|
|
15231
15239
|
}
|
|
15232
15240
|
);
|
|
15233
15241
|
case Je.INTERNAL_SERVER_ERROR:
|
|
@@ -15239,7 +15247,8 @@ const Ky = ({
|
|
|
15239
15247
|
subTitle: n || He.INTERNAL_SERVER_ERROR_MESSAGE,
|
|
15240
15248
|
image: Ea,
|
|
15241
15249
|
imageType: Cn.Large,
|
|
15242
|
-
heightToDeduct: i
|
|
15250
|
+
heightToDeduct: i,
|
|
15251
|
+
reload: t
|
|
15243
15252
|
}
|
|
15244
15253
|
);
|
|
15245
15254
|
case Je.BAD_GATEWAY:
|