From 945144734cbab6caf728071bb3a2f91432a38381 Mon Sep 17 00:00:00 2001 From: Mo Bitar Date: Fri, 25 Sep 2020 10:56:50 -0500 Subject: [PATCH] fix: extension hiding + deprecation notice --- app/assets/javascripts/directives/views/actionsMenu.ts | 7 ++++--- app/assets/templates/directives/actions-menu.pug | 6 ++++-- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/directives/views/actionsMenu.ts b/app/assets/javascripts/directives/views/actionsMenu.ts index d98a6c0493e..4d7c8d28e5e 100644 --- a/app/assets/javascripts/directives/views/actionsMenu.ts +++ b/app/assets/javascripts/directives/views/actionsMenu.ts @@ -97,6 +97,7 @@ class ActionsMenuCtrl extends PureViewCtrl<{}, ActionsMenuState> implements Acti loading: state?.loading ?? false, error: state?.error ?? false, hidden: state?.hidden ?? false, + deprecation: extension.deprecation!, actions: extension.actionsWithContextForItem(this.item).map(action => { if (action.id === selectedActionId) { return { @@ -114,7 +115,7 @@ class ActionsMenuCtrl extends PureViewCtrl<{}, ActionsMenuState> implements Acti async loadExtensions() { await Promise.all(this.state.extensions.map(async (extension: SNActionsExtension) => { - await this.setLoadingExtension(extension.uuid, true); + this.setLoadingExtension(extension.uuid, true); const updatedExtension = await this.application.actionsManager!.loadExtensionInContextOfItem( extension, this.item @@ -122,9 +123,9 @@ class ActionsMenuCtrl extends PureViewCtrl<{}, ActionsMenuState> implements Acti if (updatedExtension) { await this.updateExtension(updatedExtension!); } else { - await this.setErrorExtension(extension.uuid, true); + this.setErrorExtension(extension.uuid, true); } - await this.setLoadingExtension(extension.uuid, false); + this.setLoadingExtension(extension.uuid, false); })); } diff --git a/app/assets/templates/directives/actions-menu.pug b/app/assets/templates/directives/actions-menu.pug index 99a50788d57..2931a2bacef 100644 --- a/app/assets/templates/directives/actions-menu.pug +++ b/app/assets/templates/directives/actions-menu.pug @@ -13,13 +13,15 @@ ) .sk-menu-panel-column .sk-menu-panel-header-title {{extension.name}} - div(ng-if='extension.visible') … + div(ng-if='extension.hidden') … + .sk-menu-panel-header-subtitle(ng-if='extension.deprecation && !extension.hidden') + | {{extension.deprecation}} div(ng-if='extension.loading') .sk-spinner.small.loading menu-row( action='self.executeAction(action, extension.uuid)', label='action.label', - ng-if='!extension.visible && !extension.loading && !extension.error', + ng-if='!extension.hidden && !extension.loading && !extension.error', ng-repeat='action in extension.actions track by $index', disabled='action.running' spinner-class="action.running ? 'info' : null", diff --git a/package-lock.json b/package-lock.json index b781a4d14cf..321f819aca1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10956,8 +10956,8 @@ "from": "github:standardnotes/sncrypto#8794c88daa967eaae493cd5fdec7506d52b257ad" }, "snjs": { - "version": "github:standardnotes/snjs#30520edbd80564d584c4b00a09b552d89d1c9e26", - "from": "github:standardnotes/snjs#30520edbd80564d584c4b00a09b552d89d1c9e26" + "version": "github:standardnotes/snjs#303e9609efb9ad83bf07160c2aae6404533efeb7", + "from": "github:standardnotes/snjs#303e9609efb9ad83bf07160c2aae6404533efeb7" }, "sockjs": { "version": "0.3.20", diff --git a/package.json b/package.json index 9929dc93a38..edd12d8c12d 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,6 @@ }, "dependencies": { "sncrypto": "github:standardnotes/sncrypto#8794c88daa967eaae493cd5fdec7506d52b257ad", - "snjs": "github:standardnotes/snjs#30520edbd80564d584c4b00a09b552d89d1c9e26" + "snjs": "github:standardnotes/snjs#303e9609efb9ad83bf07160c2aae6404533efeb7" } }