From 1ba3dc07afa268d22f4dc3f06cb36b40dc5647b1 Mon Sep 17 00:00:00 2001 From: Kevin Jump Date: Thu, 13 Feb 2025 11:59:38 +0000 Subject: [PATCH] update the layout of the dashboard ui. --- .../Services/uSyncManagementService.cs | 10 ++++++---- .../src/components/usync-action-box.ts | 1 - .../src/components/usync-progress-box.ts | 1 - .../workspace/views/default/default.element.ts | 18 +++++++++++++----- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/uSync.Backoffice.Management.Api/Services/uSyncManagementService.cs b/uSync.Backoffice.Management.Api/Services/uSyncManagementService.cs index 36dd7503..1316ed7b 100644 --- a/uSync.Backoffice.Management.Api/Services/uSyncManagementService.cs +++ b/uSync.Backoffice.Management.Api/Services/uSyncManagementService.cs @@ -217,11 +217,13 @@ public async Task PerformActionAsync(PerformActionRequest var results = await method(handlerOptions, callbacks); _syncManagementCache.CacheItems(requestId, results.Actions, false); + var allActions = _syncManagementCache.GetCachedActions(requestId); return new PerformActionResponse { RequestId = requestId.ToString(), - Actions = results.Actions.Select(x => x.ToActionView()), - Status = GetSummaries(action, handlers, actionRequest.StepNumber, results.Actions.ToList()), + Actions = allActions.Select(x => x.ToActionView()), + // results.Actions.Select(x => x.ToActionView()), + Status = GetSummaries(action, handlers, actionRequest.StepNumber, allActions), // results.Actions.ToList()), Complete = false }; } @@ -289,8 +291,8 @@ private IEnumerable GetSummaries(HandlerActions action, List Icon = handlers[n].Icon, Status = n < nextStep ? HandlerStatus.Complete : n == nextStep ? HandlerStatus.Processing : HandlerStatus.Pending, - Changes = handlerActions.Count(x => x.Change > Core.ChangeType.NoChange), - InError = handlerActions.Any(x => x.Change >= Core.ChangeType.Fail) + Changes = handlerActions.CountChanges(), + InError = handlerActions.ContainsErrors() }; } diff --git a/uSync.Backoffice.Management.Client/usync-assets/src/components/usync-action-box.ts b/uSync.Backoffice.Management.Client/usync-assets/src/components/usync-action-box.ts index 1cfcd484..fe729b1f 100644 --- a/uSync.Backoffice.Management.Client/usync-assets/src/components/usync-action-box.ts +++ b/uSync.Backoffice.Management.Client/usync-assets/src/components/usync-action-box.ts @@ -71,7 +71,6 @@ export class uSyncActionBox extends LitElement { static styles = css` :host { flex-grow: 1; - margin: var(--uui-size-space-2); } .action-box { diff --git a/uSync.Backoffice.Management.Client/usync-assets/src/components/usync-progress-box.ts b/uSync.Backoffice.Management.Client/usync-assets/src/components/usync-progress-box.ts index 81393994..1f9901f9 100644 --- a/uSync.Backoffice.Management.Client/usync-assets/src/components/usync-progress-box.ts +++ b/uSync.Backoffice.Management.Client/usync-assets/src/components/usync-progress-box.ts @@ -99,7 +99,6 @@ export class uSyncProcessBox extends UmbElementMixin(LitElement) { static styles = css` :host { display: block; - margin: var(--uui-size-space-4) 0; } h2 { diff --git a/uSync.Backoffice.Management.Client/usync-assets/src/workspace/views/default/default.element.ts b/uSync.Backoffice.Management.Client/usync-assets/src/workspace/views/default/default.element.ts index e7dec8f9..5984708f 100644 --- a/uSync.Backoffice.Management.Client/usync-assets/src/workspace/views/default/default.element.ts +++ b/uSync.Backoffice.Management.Client/usync-assets/src/workspace/views/default/default.element.ts @@ -127,8 +127,11 @@ export class uSyncDefaultViewElement extends UmbLitElement { } else { return html` - ${this.#renderLegacyBanner()} ${this.#renderActions()} ${this.#renderBanner()} - ${this.#renderProcessBox()} ${this.#renderReport()} + ${this.#renderLegacyBanner()} +
+ ${this.#renderActions()} ${this.#renderBanner()} ${this.#renderProcessBox()} + ${this.#renderReport()} +
`; } @@ -146,7 +149,7 @@ export class uSyncDefaultViewElement extends UmbLitElement { } #renderActions() { - if (!this._actions || !Array.isArray(this._actions)) return nothing; + if (!this._actions || !Array.isArray(this._actions)) return nothing; var actions = this._actions?.map((group) => { return html` @@ -203,6 +206,12 @@ export class uSyncDefaultViewElement extends UmbLitElement { margin-top: calc(var(--uui-size-space-4) * -1); } + .wrapper { + display: flex; + flex-direction: column; + gap: var(--uui-size-space-4); + } + .legacy-banner { display: flex; gap: var(--uui-size-space-2); @@ -216,16 +225,15 @@ export class uSyncDefaultViewElement extends UmbLitElement { position: relative; display: block; z-index: 1; - margin: var(--uui-size-space-4) 0; } .action-buttons-box { position: relative; display: flex; + gap: var(--uui-size-space-4); flex-wrap: wrap; align-content: stretch; z-index: 1; - margin: calc(var(--uui-size-space-2) * -1); } umb-empty-state {