Skip to content

Commit

Permalink
fix: #394
Browse files Browse the repository at this point in the history
  • Loading branch information
khansadaoudi committed Sep 20, 2024
1 parent 8814a22 commit 15892fa
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/components/lexicon/LexiconMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
:passed-lexicon-items="lexiconItemsModified"
:lexicon-loading="false"
:features="features"
:key="lexiconItemsModified.length + 1"
:lexicon-type="data.treeType"
:sample-ids="sampleNames"
></LexiconTableBase>
Expand Down
4 changes: 3 additions & 1 deletion src/components/lexicon/LexiconTableBase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ export default defineComponent({
...mapState(useLexiconStore, ['lexiconItems']),
...mapState(useProjectStore, ['name']),
...mapWritableState(useProjectStore, ['tab']),
...mapWritableState(useGrewSearchStore, ['reloadGrew']),
getLexiconData() {
this.lexiconData = [];
for (const lexiconItem of this.passedLexiconItems) {
Expand Down Expand Up @@ -223,14 +224,15 @@ export default defineComponent({
get() {
let grewRuleConcatenated = '';
let counter = 1;
for (const after of this.table.selected) {
const before = this.findOriginalLexiconItem(after);
const thisRule = this.grewRuleFromLexiconItemPair(before, after);
grewRuleConcatenated += `rule r${counter} {\n${thisRule}\n}\n`;
counter = counter + 1;
}
this.changeLastGrewQuery({ text: grewRuleConcatenated, type: 'REWRITE', userType: this.lexiconType });
this.reloadGrew += 1;
this.tab = 'grew';
},
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Project.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
></ProjectTable>
</q-tab-panel>
<q-tab-panel class="q-pa-none" name="grew">
<GrewSearch :search-scope="projectName" :samples="samples" @reload="loadProjectData" />
<GrewSearch :search-scope="projectName" :samples="samples" @reload="loadProjectData" :key="reloadGrew" />
</q-tab-panel>
<q-tab-panel class="q-pa-none" name="parser">
<ParsingPanel :samples="samples" :parentGetProjectSamples="getProjectSamples"></ParsingPanel>
Expand Down Expand Up @@ -207,7 +207,7 @@ export default defineComponent({
]),
...mapWritableState(useProjectStore, ['reloadSamples', 'tab']),
...mapState(useGithubStore, ['reloadCommits']),
...mapWritableState(useGrewSearchStore, ['grewDialog']),
...mapWritableState(useGrewSearchStore, ['reloadGrew']),
projectName(): string {
return this.$route.params.projectname as string;
},
Expand Down
2 changes: 1 addition & 1 deletion src/pinia/modules/grewSearch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useProjectStore } from '../project';
export const useGrewSearchStore = defineStore('grewSearch', {
state: () => {
return {
grewDialog: false,
reloadGrew: 0,
lastQuery: null as null | { text: string; type: 'REWRITE' | 'SEARCH'; userType: string },
treeTypes: ['user', 'user_recent', 'recent', 'validated', 'pending', 'base_tree', 'all', 'others'],
};
Expand Down

0 comments on commit 15892fa

Please sign in to comment.