Skip to content

Commit

Permalink
Lint Term.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jglass-st committed Dec 19, 2024
1 parent a1fa264 commit 09fc8fb
Showing 1 changed file with 12 additions and 21 deletions.
33 changes: 12 additions & 21 deletions resources/js/components/Concept/mixins/Term.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,26 @@ import termApi from '../../../api/TermService';
export default {
data() {
return {
terms: this.termProps.map(
(term, index) => {
term.index = index;
if('undefined' === typeof term.inEdit){
term.inEdit = false;
}
return term;
},
),
terms: this.termProps.map((term, index) => {
term.index = index;
if ('undefined' === typeof term.inEdit) {
term.inEdit = false;
}
return term;
}),
termSearch: [],
allTermsSearch: false,
};
},
computed: {
alternateTerms() {
return this.terms
.filter((term) => !term.preferred)
.sort();
return this.terms.filter((term) => !term.preferred).sort();
},
preferredTerm() {
return this.terms.find((term) => term.preferred);
},
hasEmptyTerm() {
return !!(
this.terms.length &&
!this.terms[
this.terms.length - 1
].text
);
return !!(this.terms.length && !this.terms[this.terms.length - 1].text);
},
},
methods: {
Expand All @@ -54,7 +45,7 @@ export default {
},
async saveTerm(term, termIndex) {
const finalize = (term, termIndex) => {
if(term.inEdit) {
if (term.inEdit) {
this.cancelInlineEdit(term, termIndex);
}

Expand Down Expand Up @@ -136,7 +127,7 @@ export default {
});
},
enableInlineEdit(term, termIndex) {
if(!this.isVocabularyEditor){
if (!this.isVocabularyEditor) {
return;
}

Expand All @@ -146,6 +137,6 @@ export default {
cancelInlineEdit(term, termIndex) {
term.inEdit = false;
this.$set(this.terms, termIndex, term);
}
},
},
};

0 comments on commit 09fc8fb

Please sign in to comment.