Skip to content

Commit

Permalink
fix minor problems of validation
Browse files Browse the repository at this point in the history
  • Loading branch information
khansadaoudi committed Sep 20, 2024
1 parent 15892fa commit db576cc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
21 changes: 12 additions & 9 deletions src/components/sentence/SentenceCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ export default defineComponent({
computed: {
...mapWritableState(useProjectStore, ['diffMode', 'diffUserId', 'name']),
...mapWritableState(useGithubStore, ['reloadCommits']),
...mapState(useTreesStore, ['reloadValidation']),
...mapState(useProjectStore, ['isValidator', 'blindAnnotationMode', 'shownMeta', 'languageDetected']),
...mapState(useUserStore, ['username']),
...mapState(useTagsStore, ['defaultTags']),
Expand Down Expand Up @@ -320,16 +321,18 @@ export default defineComponent({
watch: {
'udValidation': {
handler: function (newVal) {
for (const user of Object.keys(this.sentence.conlls)) {
if(newVal[user]) {
this.udValidationMsg[user] = newVal[user].message;
this.udValidationStatut[user] = 'negative'
}
else {
this.udValidationMsg[user] = '';
this.udValidationStatut[user] = 'positive';
if (this.reloadValidation) {
for (const user of Object.keys(this.sentence.conlls)) {
if(newVal[user]) {
this.udValidationMsg[user] = newVal[user].message;
this.udValidationStatut[user] = 'negative'
}
else {
this.udValidationMsg[user] = '';
this.udValidationStatut[user] = 'positive';
}
}
}
}
},
deep: true,
},
Expand Down
4 changes: 3 additions & 1 deletion src/pages/Sample.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default defineComponent({
'sortedSentIds'
]),
...mapState(useProjectStore, ['name']),
...mapWritableState(useTreesStore, ['reloadTrees']),
...mapWritableState(useTreesStore, ['reloadTrees', 'reloadValidation']),
sampleName() {
return this.$route.params.samplename as string;
}
Expand All @@ -117,6 +117,7 @@ export default defineComponent({
this.emptyPendingModification();
this.getTrees();
this.calculateHeight();
this.reloadValidation = false;
},
beforeUnmount() {
window.removeEventListener('resize', this.calculateHeight);
Expand Down Expand Up @@ -162,6 +163,7 @@ export default defineComponent({
this.udValidationPassed[sentId][userId] = userTreeValidation;
}
}
this.reloadValidation = true;
})
.catch((error) => {
notifyError({ error: error });
Expand Down
1 change: 1 addition & 0 deletions src/pinia/modules/trees/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const useTreesStore = defineStore('trees', {
featuresSetForNotDiffs: [] as string[],
selectedTags: [] as string[],
reloadTrees: false as boolean,
reloadValidation: false as boolean,
pendingModifications: new Map(),
};
},
Expand Down

0 comments on commit db576cc

Please sign in to comment.