mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-06 03:26:51 +03:00
feat: add optional minified check displaying
This commit is contained in:
@@ -1,10 +1,20 @@
|
||||
import { IDiagnosticsChecksStoreItem, store } from '../../../store';
|
||||
|
||||
export function updateDiagnosticsCheck(check: IDiagnosticsChecksStoreItem) {
|
||||
export function updateDiagnosticsCheck(
|
||||
check: IDiagnosticsChecksStoreItem,
|
||||
minified?: boolean,
|
||||
) {
|
||||
const diagnosticsChecks = store.get().diagnosticsChecks;
|
||||
const other = diagnosticsChecks.filter((item) => item.code !== check.code);
|
||||
|
||||
const smallCheck: IDiagnosticsChecksStoreItem = {
|
||||
...check,
|
||||
items: check.items.filter((item) => item.state !== 'success'),
|
||||
};
|
||||
|
||||
const targetCheck = minified ? smallCheck : check;
|
||||
|
||||
store.set({
|
||||
diagnosticsChecks: [...other, check],
|
||||
diagnosticsChecks: [...other, targetCheck],
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2610,11 +2610,16 @@ function renderCheckSection(props) {
|
||||
}
|
||||
|
||||
// src/podkop/tabs/diagnostic/updateDiagnosticsCheck.ts
|
||||
function updateDiagnosticsCheck(check) {
|
||||
function updateDiagnosticsCheck(check, minified) {
|
||||
const diagnosticsChecks = store.get().diagnosticsChecks;
|
||||
const other = diagnosticsChecks.filter((item) => item.code !== check.code);
|
||||
const smallCheck = {
|
||||
...check,
|
||||
items: check.items.filter((item) => item.state !== "success")
|
||||
};
|
||||
const targetCheck = minified ? smallCheck : check;
|
||||
store.set({
|
||||
diagnosticsChecks: [...other, check]
|
||||
diagnosticsChecks: [...other, targetCheck]
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user