From c239a92be2e83b5b611e26cfaec4f94e68fb14e1 Mon Sep 17 00:00:00 2001 From: JesmoDev <26099018+JesmoDev@users.noreply.github.com> Date: Tue, 28 May 2024 13:29:54 +0200 Subject: [PATCH] use uui table and add localization --- .../modals/rollback/rollback-modal.element.ts | 104 +++++++++--------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/modals/rollback/rollback-modal.element.ts b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/modals/rollback/rollback-modal.element.ts index da544a975b..26a285945f 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/modals/rollback/rollback-modal.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/modals/rollback/rollback-modal.element.ts @@ -262,31 +262,38 @@ export class UmbRollbackModalElement extends UmbModalBaseElement - Alias - Value + + + + + + ${this.localize.term('general_alias')} + ${this.localize.term('general_value')} + ${repeat( diffs, (item) => item.alias, (item) => { const diff = diffs.find((x) => x?.alias === item.alias); return html` - ${item.alias} - - ${diff - ? diff.diff.map((part) => - part.added - ? html`${part.value}` - : part.removed - ? html`${part.value}` - : part.value, - ) - : nothing} - + + ${item.alias} + + ${diff + ? diff.diff.map((part) => + part.added + ? html`${part.value}` + : part.removed + ? html`${part.value}` + : part.value, + ) + : nothing} + + `; }, )} - + `; } @@ -337,50 +344,43 @@ export class UmbRollbackModalElement extends UmbModalBaseElement * { - border-right: 1px solid var(--uui-color-border); - border-bottom: 1px solid var(--uui-color-border); - } - - #diff-grid > *:nth-child(2) { - border-top-right-radius: var(--uui-border-radius); - } - - #diff-grid > *:nth-child(1) { + uui-table-head-cell:first-child { border-top-left-radius: var(--uui-border-radius); } - - /* Remove borders from last column */ - #diff-grid > *:nth-child(2n) { - border-right: none; + uui-table-head-cell:last-child { + border-top-right-radius: var(--uui-border-radius); + } + uui-table-head-cell { + background-color: var(--uui-color-surface-alt); + } + uui-table-head-cell:last-child, + uui-table-cell:last-child { + border-right: 1px solid var(--uui-color-border); + } + uui-table-head-cell, + uui-table-cell { + border-top: 1px solid var(--uui-color-border); + border-left: 1px solid var(--uui-color-border); + } + uui-table-row:last-child uui-table-cell { + border-bottom: 1px solid var(--uui-color-border); + } + uui-table-row:last-child uui-table-cell:last-child { + border-bottom-right-radius: var(--uui-border-radius); + } + uui-table-row:last-child uui-table-cell:first-child { + border-bottom-left-radius: var(--uui-border-radius); } - /* Remove borders from last row */ - #diff-grid > *:nth-child(2n + 1):nth-last-child(-n + 2), - #diff-grid > *:nth-child(2n + 1):nth-last-child(-n + 2) ~ * { - border-bottom: none; - } - #diff-grid > * { - padding: var(--uui-size-2) var(--uui-size-space-4); - } - #diff-grid .added, + .diff-added, ins { background-color: #00c43e63; } - #diff-grid .removed, + .diff-removed, del { background-color: #ff35356a; }