From 5f1ad3117c78fd7c5b9ae56016019dd332295503 Mon Sep 17 00:00:00 2001 From: Grzegorz Jaskowski Date: Fri, 15 Sep 2023 23:46:03 +0200 Subject: [PATCH 1/2] ACS-5686 add reselect to edit offline, shorten template --- .../toggle-edit-offline.component.ts | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/projects/aca-content/src/lib/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.ts b/projects/aca-content/src/lib/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.ts index a3a59af237..29b6061414 100644 --- a/projects/aca-content/src/lib/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.ts +++ b/projects/aca-content/src/lib/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.ts @@ -22,7 +22,14 @@ * from Hyland Software. If not, see . */ -import { AppStore, DownloadNodesAction, EditOfflineAction, SnackbarErrorAction, getAppSelection } from '@alfresco/aca-shared/store'; +import { + AppStore, + DownloadNodesAction, + EditOfflineAction, + SetSelectedNodesAction, + SnackbarErrorAction, + getAppSelection +} from '@alfresco/aca-shared/store'; import { NodeEntry, SharedLinkEntry, Node, NodesApi } from '@alfresco/js-api'; import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import { Store } from '@ngrx/store'; @@ -39,15 +46,9 @@ import { MatIconModule } from '@angular/material/icon'; selector: 'app-toggle-edit-offline', template: ` `, encapsulation: ViewEncapsulation.None, @@ -84,6 +85,7 @@ export class ToggleEditOfflineComponent implements OnInit { this.update(response?.entry); this.store.dispatch(new EditOfflineAction(this.selection)); + this.store.dispatch(new SetSelectedNodesAction([this.selection])); } catch { this.onUnlockError(); } @@ -94,6 +96,7 @@ export class ToggleEditOfflineComponent implements OnInit { this.update(response?.entry); this.store.dispatch(new DownloadNodesAction([this.selection])); this.store.dispatch(new EditOfflineAction(this.selection)); + this.store.dispatch(new SetSelectedNodesAction([this.selection])); } catch { this.onLockError(); } From 4472a67739de784a06f01355e4132e807b858919 Mon Sep 17 00:00:00 2001 From: Grzegorz Jaskowski Date: Mon, 18 Sep 2023 19:28:08 +0200 Subject: [PATCH 2/2] ACS-5686 merge icon condition, use optional chain expression --- .../toggle-edit-offline/toggle-edit-offline.component.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/projects/aca-content/src/lib/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.ts b/projects/aca-content/src/lib/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.ts index 29b6061414..2862777322 100644 --- a/projects/aca-content/src/lib/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.ts +++ b/projects/aca-content/src/lib/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.ts @@ -46,8 +46,7 @@ import { MatIconModule } from '@angular/material/icon'; selector: 'app-toggle-edit-offline', template: ` `, @@ -131,7 +130,7 @@ export class ToggleEditOfflineComponent implements OnInit { } private update(data: Node) { - if (data && data.properties) { + if (data?.properties) { const properties = this.selection.entry.properties || {}; properties['cm:lockLifetime'] = data.properties['cm:lockLifetime'];