From 59349344b9448efdd3eeb91e901b1d43d00b1b04 Mon Sep 17 00:00:00 2001 From: Andriy Sheredko Date: Sat, 28 Dec 2024 19:20:04 +0200 Subject: [PATCH 1/3] - ENG-6633 fixed display name on page load error --- .../addons-service/configured-addon-edit/component.ts | 5 +++++ .../addons-service/configured-addon-edit/template.hbs | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) 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 b1255dcaa5..013dd96c3a 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 @@ -42,4 +42,9 @@ export default class ConfiguredAddonEdit extends Component { selectFolder(folder: Item) { this.selectedFolder = folder.itemId; } + + @action + setDidAttemptSave() { + this.didAttemptSave = true; + } } 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 d04bbd2e15..117e8de3a2 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 @@ -12,7 +12,7 @@ @maxlength={{256}} /> - {{#if this.invalidDisplayName}} + {{#if (and this.didAttemptSave this.invalidDisplayName)}} {{t 'general.save'}} From 26963c7a948c1555132fb7ecd50a911cb055420b Mon Sep 17 00:00:00 2001 From: Andriy Sheredko Date: Mon, 30 Dec 2024 15:32:10 +0200 Subject: [PATCH 2/3] - ENG-6633 fixed display name on page load error --- .../addons-service/configured-addon-edit/component.ts | 7 +------ .../addons-service/configured-addon-edit/template.hbs | 3 +-- 2 files changed, 2 insertions(+), 8 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 013dd96c3a..d4f6260298 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 @@ -15,7 +15,7 @@ interface Args { } export default class ConfiguredAddonEdit extends Component { - @tracked displayName = this.args.configuredAddon?.displayName; + @tracked displayName = this.args.configuredAddon?.displayName || 'Default Account Name'; @tracked selectedFolder = this.args.configuredAddon?.rootFolder; @tracked currentItems: Item[] = []; @@ -42,9 +42,4 @@ export default class ConfiguredAddonEdit extends Component { selectFolder(folder: Item) { this.selectedFolder = folder.itemId; } - - @action - setDidAttemptSave() { - this.didAttemptSave = true; - } } 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 117e8de3a2..d04bbd2e15 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 @@ -12,7 +12,7 @@ @maxlength={{256}} /> - {{#if (and this.didAttemptSave this.invalidDisplayName)}} + {{#if this.invalidDisplayName}} {{t 'general.save'}} From 9c6ac00c118b4c309e7c34c7c9ba41f088fdc370 Mon Sep 17 00:00:00 2001 From: Andriy Sheredko Date: Mon, 30 Dec 2024 17:47:18 +0200 Subject: [PATCH 3/3] - ENG-6633 fixed display name on page load error --- .../addons-service/configured-addon-edit/component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 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 d4f6260298..ebf9a7a0f6 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 @@ -10,12 +10,12 @@ import ConfiguredAddonModel from 'ember-osf-web/models/configured-addon'; interface Args { configuredAddon?: ConfiguredAddonModel; - selectedAccount?: AuthorizedAccountModel; + authorizedAccount?: AuthorizedAccountModel; onSave: TaskInstance; } export default class ConfiguredAddonEdit extends Component { - @tracked displayName = this.args.configuredAddon?.displayName || 'Default Account Name'; + @tracked displayName = this.args.configuredAddon?.displayName || this.args.authorizedAccount?.displayName; @tracked selectedFolder = this.args.configuredAddon?.rootFolder; @tracked currentItems: Item[] = [];