Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UX iprovements on server audit dialog #11036

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions browser/css/jsdialogs.css
Original file line number Diff line number Diff line change
@@ -2250,6 +2250,42 @@ kbd,
height: 16px;
}

#ServerAuditDialog #ServerAuditDialog-mainbox label {
display: flex;
align-items: center;
gap: 4px;
color: #000;
border-radius: 30px;
width: fit-content;
height: 16px;
margin-top: 8px;
padding-right: 10px;
}

#ServerAuditDialog #ServerAuditDialog-mainbox label#auditsuccess {
background-color: #c4f7cc;
color: #1c4f26;
}

#ServerAuditDialog #ServerAuditDialog-mainbox label#auditerror {
background-color: #ffd6d9;
color: #d42314;
}

#ServerAuditDialog #ServerAuditDialog-mainbox label#auditsuccess::before {
background: url('images/circle-check.svg') no-repeat center/18px;
content: '';
width: 16px;
height: 16px;
}

#ServerAuditDialog #ServerAuditDialog-mainbox label#auditerror::before {
background: url('images/monochrome-x-cross.svg') no-repeat center;
content: '';
width: 16px;
height: 16px;
}

/* text-area overflow on function wizard window */

#FormulaDialog #ed_formula.ui-textarea {
4 changes: 4 additions & 0 deletions browser/images/circle-check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions browser/images/monochrome-x-cross.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 27 additions & 7 deletions browser/src/control/Control.ServerAuditDialog.ts
Original file line number Diff line number Diff line change
@@ -176,8 +176,18 @@ class ServerAuditDialog {
return hasErrors;
}

private countErrors(): number {
return (
(app.serverAudit?.filter((entry: AuditEntry) => entry.status !== 'ok')
.length ?? 0) +
(app.clientAudit?.filter((entry: AuditEntry) => entry.status !== 'ok')
.length ?? 0)
);
}

private getJSON(entries: Array<any>): JSDialogJSON {
const hasErrors = this.hasErrors();
const countErrors = this.countErrors();

return {
id: this.id,
@@ -198,13 +208,6 @@ class ServerAuditDialog {
type: 'container',
vertical: true,
children: [
!hasErrors
? {
id: 'auditsuccess',
type: 'fixedtext',
text: _('No issues found'),
}
: {},
{
id: 'auditlist',
type: 'treelistbox',
@@ -215,6 +218,23 @@ class ServerAuditDialog {
entries: entries,
enabled: entries.length > 0,
},
!hasErrors
? {
id: 'auditsuccess',
type: 'fixedtext',
text: _('No issues found'),
}
: {
id: 'auditerror',
type: 'fixedtext',
text:
countErrors === 1
? _('1 issue found')
: _('%COUNT% issues found').replaceAll(
'%COUNT%',
countErrors,
),
},
{
id: this.id + '-buttonbox',
type: 'buttonbox',