Skip to content

Commit

Permalink
fix the problem of undefined annotationFeatures
Browse files Browse the repository at this point in the history
  • Loading branch information
khansadaoudi committed Oct 21, 2024
1 parent fc2bf7c commit ba3f3e1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 20 deletions.
6 changes: 2 additions & 4 deletions src/components/sentence/RelationDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,10 @@ export default defineComponent({
return newDeprel;
},
},
created() {
this.deprels = this.annotationFeatures.DEPREL;
this.splitRegex = new RegExp(`[${this.deprels.map(({ join }) => join).join('')}]`, 'g');
},
mounted() {
this.sentenceBus.on('open:relationDialog', ({ dep, gov, userId }) => {
this.deprels = this.annotationFeatures.DEPREL;
this.splitRegex = new RegExp(`[${this.deprels.map(({ join }) => join).join('')}]`, 'g');
this.dep = dep;
this.gov = gov;
this.userId = userId;
Expand Down
6 changes: 3 additions & 3 deletions src/components/sentence/SentenceCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@
</div>
<template>
<RelationDialog :sentence-bus="sentenceBus" />
<UposDialog :sentence-bus="sentenceBus" />
<XposDialog :sentence-bus="sentenceBus" />
<UposDialog :sentence-bus="sentenceBus" :upos-options="annotationFeatures.UPOS"/>
<XposDialog :sentence-bus="sentenceBus" :xpos-options="annotationFeatures.XPOS" />
<FeaturesDialog
:sentence-bus="sentenceBus"
:reactive-sentences-obj="(reactiveSentencesObj as reactive_sentences_obj_t)"
Expand Down Expand Up @@ -267,7 +267,7 @@ export default defineComponent({
...mapWritableState(useGithubStore, ['reloadCommits']),
...mapWritableState(useTreesStore, ['reloadTrees']),
...mapState(useTreesStore, ['reloadValidation']),
...mapState(useProjectStore, ['isValidator', 'blindAnnotationMode', 'shownMeta', 'languageDetected']),
...mapState(useProjectStore, ['isValidator', 'blindAnnotationMode', 'shownMeta', 'languageDetected', 'annotationFeatures']),
...mapState(useUserStore, ['username']),
...mapState(useTagsStore, ['defaultTags']),
lastModifiedTime() {
Expand Down
12 changes: 6 additions & 6 deletions src/components/sentence/UposDialog.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<template>
<PosDialog :sentence-bus="sentenceBus" :title="'UPOS'" :pos-options="annotationFeatures.UPOS" :event-name="'open:uposDialog'" />
<PosDialog :sentence-bus="sentenceBus" :title="'UPOS'" :pos-options="uposOptions" :event-name="'open:uposDialog'" />
</template>

<script lang="ts">
import { mapState } from 'pinia';
import { useProjectStore } from 'src/pinia/modules/project';
import { sentence_bus_t } from 'src/types/main_types';
import { PropType, defineComponent } from 'vue';
Expand All @@ -20,9 +18,11 @@ export default defineComponent({
type: Object as PropType<sentence_bus_t>,
required: true,
},
uposOptions: {
type: Object as PropType<string[]>,
required: true,
},
},
computed: {
...mapState(useProjectStore, ['annotationFeatures']),
},
});
</script>
13 changes: 6 additions & 7 deletions src/components/sentence/XposDialog.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<template>
<PosDialog :sentence-bus="sentenceBus" :title="'XPOS'" :pos-options="annotationFeatures.XPOS" :event-name="'open:xposDialog'" />
<PosDialog :sentence-bus="sentenceBus" :title="'XPOS'" :pos-options="xposOptions" :event-name="'open:xposDialog'" />
</template>

<script lang="ts">
import { mapState } from 'pinia';
import { useProjectStore } from 'src/pinia/modules/project';
import { sentence_bus_t } from 'src/types/main_types';
import { PropType, defineComponent } from 'vue';
Expand All @@ -20,10 +18,11 @@ export default defineComponent({
type: Object as PropType<sentence_bus_t>,
required: true,
},
},
computed: {
...mapState(useProjectStore, ['annotationFeatures']),
xposOptions: {
type: Object as PropType<string[]>,
required: true,
}
},
});
</script>
<style></style>

0 comments on commit ba3f3e1

Please sign in to comment.