From 3d4eaf33d8768b588b8caf8d3102a4696ac3d336 Mon Sep 17 00:00:00 2001 From: Fitz Elliott Date: Mon, 30 Dec 2024 18:52:52 -0500 Subject: [PATCH] better save disable checking * Responding to code review, improve disableSaveButton check * Responding to code review, {{#if}} around the entire FileManager --- .../configured-addon-edit/component.ts | 2 +- .../configured-addon-edit/template.hbs | 58 +++++++++---------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/lib/osf-components/addon/components/addons-service/configured-addon-edit/component.ts b/lib/osf-components/addon/components/addons-service/configured-addon-edit/component.ts index 29b7e08f52..c91c6cb731 100644 --- a/lib/osf-components/addon/components/addons-service/configured-addon-edit/component.ts +++ b/lib/osf-components/addon/components/addons-service/configured-addon-edit/component.ts @@ -33,7 +33,7 @@ export default class ConfiguredAddonEdit extends Component { } get disableSave() { - return this.hasRootFolder && (!this.selectedFolder || this.invalidDisplayName || this.args.onSave.isRunning); + return this.invalidDisplayName || this.args.onSave.isRunning || (this.hasRootFolder && !this.selectedFolder); } get onSaveArgs() { diff --git a/lib/osf-components/addon/components/addons-service/configured-addon-edit/template.hbs b/lib/osf-components/addon/components/addons-service/configured-addon-edit/template.hbs index 75f159ac44..15313e433a 100644 --- a/lib/osf-components/addon/components/addons-service/configured-addon-edit/template.hbs +++ b/lib/osf-components/addon/components/addons-service/configured-addon-edit/template.hbs @@ -21,14 +21,14 @@ {{/if}} - - {{#if this.hasRootFolder }} + {{#if this.hasRootFolder }} +
- -
-
+
+ {{/if}} +
+ + +