Skip to content

Commit

Permalink
fix: extension hiding + deprecation notice
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed Sep 25, 2020
1 parent b124ac4 commit 9451447
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
7 changes: 4 additions & 3 deletions app/assets/javascripts/directives/views/actionsMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -114,17 +115,17 @@ 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
);
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);
}));
}

Expand Down
6 changes: 4 additions & 2 deletions app/assets/templates/directives/actions-menu.pug
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@
},
"dependencies": {
"sncrypto": "github:standardnotes/sncrypto#8794c88daa967eaae493cd5fdec7506d52b257ad",
"snjs": "github:standardnotes/snjs#30520edbd80564d584c4b00a09b552d89d1c9e26"
"snjs": "github:standardnotes/snjs#303e9609efb9ad83bf07160c2aae6404533efeb7"
}
}

0 comments on commit 9451447

Please sign in to comment.