@@ -36,12 +35,12 @@
-
+
{{else}}
{{this.title}}
diff --git a/packages/frontend/app/components/school-vocabulary-manager.js b/packages/frontend/app/components/school-vocabulary-manager.js
index 9dd818eaa3..d32da930f0 100644
--- a/packages/frontend/app/components/school-vocabulary-manager.js
+++ b/packages/frontend/app/components/school-vocabulary-manager.js
@@ -15,8 +15,7 @@ export default class SchoolVocabularyManagerComponent extends Component {
@NotBlank()
@Length(1, 200)
@Custom('validateTitleCallback', 'validateTitleMessageCallback')
- title;
- @tracked isActive = false;
+ titleValue;
@tracked newTerm;
@cached
@@ -42,19 +41,17 @@ export default class SchoolVocabularyManagerComponent extends Component {
);
}
- @action
- load() {
- this.title = this.args.vocabulary.title;
- this.isActive = this.args.vocabulary.active;
+ get title() {
+ return this.titleValue || this.args.vocabulary.title;
}
changeTitle = dropTask(async () => {
- this.addErrorDisplayFor('title');
+ this.addErrorDisplayFor('titleValue');
const isValid = await this.isValid();
if (!isValid) {
return false;
}
- this.removeErrorDisplayFor('title');
+ this.removeErrorDisplayFor('titleValue');
this.args.vocabulary.title = this.title;
await this.args.vocabulary.save();
});
@@ -62,7 +59,7 @@ export default class SchoolVocabularyManagerComponent extends Component {
@action
revertTitleChanges() {
this.removeErrorDisplayFor('title');
- this.title = this.args.vocabulary.title;
+ this.titleValue = this.args.vocabulary.title;
}
@action
@@ -82,7 +79,7 @@ export default class SchoolVocabularyManagerComponent extends Component {
return vocab !== this.args.vocabulary;
});
const siblingTitles = mapBy(siblings, 'title');
- return !siblingTitles.includes(this.title);
+ return !siblingTitles.includes(this.titleValue);
}
validateTitleMessageCallback() {
diff --git a/packages/frontend/app/components/school-vocabulary-term-manager.hbs b/packages/frontend/app/components/school-vocabulary-term-manager.hbs
index 6a63ad87fa..f7ca68830e 100644
--- a/packages/frontend/app/components/school-vocabulary-term-manager.hbs
+++ b/packages/frontend/app/components/school-vocabulary-term-manager.hbs
@@ -2,8 +2,6 @@
{{#if this.isLoading}}
@@ -62,14 +60,14 @@
type="text"
value={{this.title}}
disabled={{isSaving}}
- {{on "input" (pick "target.value" (set this.title))}}
- {{on "keyup" (fn this.addErrorDisplayFor "title")}}
+ {{on "input" (pick "target.value" (set this.titleValue))}}
+ {{on "keyup" (fn this.addErrorDisplayFor "titleValue")}}
>
{{else}}
{{this.title}}
{{/if}}
-
+
{{#if (and @canDelete (not this.children.length) (not @term.hasAssociations))}}
{{#if @canUpdate}}
@@ -111,7 +109,7 @@