Skip to content

Commit

Permalink
display the username of the last validator
Browse files Browse the repository at this point in the history
  • Loading branch information
khansadaoudi committed Nov 29, 2024
1 parent 7380af5 commit 1e0188a
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/components/sentence/SentenceCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
{{ reactiveSentencesObj[openTabUser].state.metaJson[meta] }}
</q-item>
</q-list>
<div v-if="lastValidator" class="row">
<div class="text-overline">Last validator: {{ lastValidator }}</div>
</div>
<div class="row">
<div class="text-overline">Tags:</div>
<div v-for="tag in userTags">
Expand Down Expand Up @@ -307,6 +310,9 @@ export default defineComponent({
}
return this.orderConlls(filteredConlls);
},
lastValidator() {
return this.reactiveSentencesObj[this.openTabUser].state.metaJson['validated_by']
}
},
created() {
for (const [userId, conll] of Object.entries(this.sentence.conlls)) {
Expand Down Expand Up @@ -380,30 +386,31 @@ export default defineComponent({
this.sentenceBus.emit('action:saved', {
userId: this.openTabUser,
});
const newConll = response.data.new_conll;
this.removePendingModification(`${this.sentence.sent_id}_${this.openTabUser}`);
this.reloadCommits += 1;
if (this.sentenceData.conlls[changedConllUser]) {
// the user already had a tree
this.hasPendingChanges[changedConllUser] = false;
this.sentenceData.conlls[changedConllUser] = exportedConll;
this.reactiveSentencesObj[changedConllUser].fromSentenceConll(exportedConll);
this.sentenceData.conlls[changedConllUser] = newConll;
this.reactiveSentencesObj[changedConllUser].fromSentenceConll(newConll);
} else {
// user still don't have a tree for this sentence, creating it.
this.sentenceData.conlls[changedConllUser] = exportedConll;
this.sentenceData.conlls[changedConllUser] = newConll;
this.reactiveSentencesObj[changedConllUser] = new ReactiveSentence();
}
if (this.openTabUser !== changedConllUser) {
this.reactiveSentencesObj[this.openTabUser].fromSentenceConll(this.sentenceData.conlls[this.openTabUser]);
this.sentenceText = this.reactiveSentencesObj[this.openTabUser].state.metaJson.text as string;
this.openTabUser = changedConllUser;
this.exportedConll = exportedConll;
this.exportedConll = newConll;
}
if (this.sentenceData.sent_id !== sentenceConllToJson(exportedConll).metaJson.sent_id ) {
if (this.sentenceData.sent_id !== sentenceConllToJson(newConll).metaJson.sent_id ) {
this.reloadTrees = true;
}
notifyMessage({ position: 'top', message: 'Saved on the server', icon: 'save' });
this.validateUdTree(exportedConll);
this.validateUdTree(newConll);
}
})
.catch((error) => {
Expand Down

0 comments on commit 1e0188a

Please sign in to comment.