@devtron-labs/devtron-fe-common-lib 4.0.6-pre-0 → 4.0.7-beta-1
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/index.js +49 -38
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -412,7 +412,11 @@ var du = ({ startNode: e }) => e.type === cr.WEBHOOK ? Gn.WEBHOOK : e.type === c
|
|
|
412
412
|
}
|
|
413
413
|
}, gd = (e) => {
|
|
414
414
|
let t = e ? structuredClone(e) : {};
|
|
415
|
-
|
|
415
|
+
if (window._env_.TRIGGER_API_TIMEOUT) {
|
|
416
|
+
let e = Number(window._env_.TRIGGER_API_TIMEOUT);
|
|
417
|
+
!Number.isNaN(e) && e > 0 && (t.timeout = e);
|
|
418
|
+
}
|
|
419
|
+
return t;
|
|
416
420
|
}, _d = (e) => e.deployed && e.latest, vd = async ({ file: e, appId: t, envId: n, allowedExtensions: r, maxUploadSize: i, abortControllerRef: a }) => {
|
|
417
421
|
let o = new FormData();
|
|
418
422
|
o.append("file", e[0]);
|
|
@@ -3398,7 +3402,7 @@ var du = ({ startNode: e }) => e.type === cr.WEBHOOK ? Gn.WEBHOOK : e.type === c
|
|
|
3398
3402
|
}, Vm = (e, t) => {
|
|
3399
3403
|
e && localStorage.setItem(e, t);
|
|
3400
3404
|
}, Hm = (e) => !e || !Object.keys(e).length ? !1 : Object.keys(e).some((t) => ai(e[t]) ? !1 : Array.isArray(e[t]) || typeof e[t] == "string" ? e[t].length > 0 : !0), { PAGE_SIZE: Um, PAGE_NUMBER: Wm, SEARCH_KEY: Gm, SORT_BY: Km, SORT_ORDER: qm } = zm, Jm = ({ initialSortKey: e, parseSearchParams: t, localStorageKey: n, redirectionMethod: r = "replace", defaultPageSize: i = 20 } = {}) => {
|
|
3401
|
-
let a = Ul(), o = Wl(), s = q(!1), c = (() => {
|
|
3405
|
+
let a = Ul(), o = Wl(), s = q(!1), c = q(null), l = (() => {
|
|
3402
3406
|
let e = new URLSearchParams(a.search);
|
|
3403
3407
|
if (!s.current && n) if (a.search) Vm(n, JSON.stringify(t(e)));
|
|
3404
3408
|
else {
|
|
@@ -3406,64 +3410,71 @@ var du = ({ startNode: e }) => e.type === cr.WEBHOOK ? Gn.WEBHOOK : e.type === c
|
|
|
3406
3410
|
let e = localStorage.getItem(n);
|
|
3407
3411
|
if (e) try {
|
|
3408
3412
|
let t = Se("", JSON.parse(e)), n = new URLSearchParams(t.split("?")[1] ?? "");
|
|
3409
|
-
return
|
|
3413
|
+
return c.current = n.toString(), n;
|
|
3410
3414
|
} catch {
|
|
3411
3415
|
localStorage.removeItem(n);
|
|
3412
3416
|
}
|
|
3413
3417
|
}
|
|
3414
3418
|
return e;
|
|
3415
|
-
})()
|
|
3416
|
-
|
|
3419
|
+
})();
|
|
3420
|
+
G(() => {
|
|
3421
|
+
if (c.current !== null) {
|
|
3422
|
+
let e = c.current;
|
|
3423
|
+
c.current = null, o({ search: e }, { replace: !0 });
|
|
3424
|
+
}
|
|
3425
|
+
}, []);
|
|
3426
|
+
let u = (e) => t ? t(e) : {}, { pageSize: d, pageNumber: f, searchKey: p, sortBy: m, sortOrder: h, parsedParams: g } = K(() => {
|
|
3427
|
+
let t = l.get(Um), n = l.get(Wm), r = l.get(Gm), a = l.get(qm), o = l.get(Km) || e || "", s = Object.values(Wt).includes(a) ? a : Wt.ASC, c = u(l);
|
|
3417
3428
|
return {
|
|
3418
3429
|
pageSize: Number(t) || i,
|
|
3419
3430
|
pageNumber: Number(n) || 1,
|
|
3420
3431
|
searchKey: r || "",
|
|
3421
3432
|
sortBy: o,
|
|
3422
3433
|
sortOrder: o ? s : "",
|
|
3423
|
-
parsedParams:
|
|
3434
|
+
parsedParams: c
|
|
3424
3435
|
};
|
|
3425
|
-
}, [
|
|
3436
|
+
}, [l]), _ = d * (f - 1), v = (e, t) => {
|
|
3426
3437
|
o({ search: e }, { replace: (t.redirectionMethod ?? r) === "replace" });
|
|
3427
|
-
},
|
|
3428
|
-
|
|
3429
|
-
},
|
|
3430
|
-
if (
|
|
3431
|
-
|
|
3438
|
+
}, y = (e, t, n = {}) => {
|
|
3439
|
+
l.set(e, String(t)), v(l.toString(), n);
|
|
3440
|
+
}, b = (e = {}) => {
|
|
3441
|
+
if (f !== 1) {
|
|
3442
|
+
y(Wm, 1, e);
|
|
3432
3443
|
return;
|
|
3433
3444
|
}
|
|
3434
|
-
|
|
3435
|
-
}, b = (e) => {
|
|
3436
|
-
v(Wm, e);
|
|
3445
|
+
v(l.toString(), e);
|
|
3437
3446
|
}, x = (e) => {
|
|
3438
|
-
|
|
3447
|
+
y(Wm, e);
|
|
3439
3448
|
}, S = (e) => {
|
|
3440
|
-
|
|
3449
|
+
y(Um, e), b();
|
|
3441
3450
|
}, C = (e) => {
|
|
3451
|
+
y(Gm, e), b();
|
|
3452
|
+
}, w = (e) => {
|
|
3442
3453
|
let t;
|
|
3443
|
-
t = e ===
|
|
3444
|
-
},
|
|
3445
|
-
|
|
3446
|
-
},
|
|
3454
|
+
t = e === m && h === Wt.ASC ? Wt.DESC : Wt.ASC, y(Km, e), y(qm, t), b();
|
|
3455
|
+
}, T = () => {
|
|
3456
|
+
v("", {}), n && localStorage.removeItem(n);
|
|
3457
|
+
}, E = (e, t = {}) => {
|
|
3447
3458
|
Object.keys(e).forEach((t) => {
|
|
3448
|
-
ri.includes(e[t]) ?
|
|
3449
|
-
|
|
3450
|
-
})) :
|
|
3451
|
-
}), Vm(n, JSON.stringify(l
|
|
3459
|
+
ri.includes(e[t]) ? l.delete(t) : Array.isArray(e[t]) ? (l.delete(t), e[t].forEach((e) => {
|
|
3460
|
+
l.append(t, e);
|
|
3461
|
+
})) : l.set(t, e[t]);
|
|
3462
|
+
}), Vm(n, JSON.stringify(u(l))), b(t);
|
|
3452
3463
|
};
|
|
3453
3464
|
return {
|
|
3454
|
-
pageSize:
|
|
3455
|
-
changePage:
|
|
3456
|
-
changePageSize:
|
|
3457
|
-
searchKey:
|
|
3458
|
-
handleSearch:
|
|
3459
|
-
offset:
|
|
3460
|
-
sortBy:
|
|
3461
|
-
sortOrder:
|
|
3462
|
-
handleSorting:
|
|
3463
|
-
clearFilters:
|
|
3464
|
-
...
|
|
3465
|
-
updateSearchParams:
|
|
3466
|
-
areFiltersApplied: !!
|
|
3465
|
+
pageSize: d,
|
|
3466
|
+
changePage: x,
|
|
3467
|
+
changePageSize: S,
|
|
3468
|
+
searchKey: p,
|
|
3469
|
+
handleSearch: C,
|
|
3470
|
+
offset: _,
|
|
3471
|
+
sortBy: m,
|
|
3472
|
+
sortOrder: h,
|
|
3473
|
+
handleSorting: w,
|
|
3474
|
+
clearFilters: T,
|
|
3475
|
+
...g,
|
|
3476
|
+
updateSearchParams: E,
|
|
3477
|
+
areFiltersApplied: !!p || Hm(g)
|
|
3467
3478
|
};
|
|
3468
3479
|
}, Ym, Xm = () => ({
|
|
3469
3480
|
width: window.innerWidth,
|