Skip to content

Commit ef517f8

Browse files
authored
Merge pull request #1308 from microbiomedata/issue-1306-show-hide-column-section
Pass correct string to showColumnsBySectionTitle when showing single section
2 parents 5859d49 + 3247017 commit ef517f8

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

web/src/views/SubmissionPortal/HarmonizerView.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ export default defineComponent({
250250
return allTabsValid && isOwner();
251251
});
252252
253-
const fields = computed(() => flattenDeep(Object.entries(harmonizerApi.schemaSections.value)
253+
const fields = computed(() => flattenDeep(Object.entries(harmonizerApi.schemaSectionColumns.value)
254254
.map(([sectionName, children]) => Object.entries(children).map(([columnName, column]) => {
255255
const val = {
256256
text: columnName ? ` ${columnName}` : sectionName,
@@ -750,13 +750,13 @@ export default defineComponent({
750750
Show section
751751
</span>
752752
<v-radio
753-
v-for="(value, sectionName) in harmonizerApi.schemaSections.value"
753+
v-for="(sectionName, sectionTitle) in harmonizerApi.schemaSectionNames.value"
754754
:key="sectionName"
755755
:value="sectionName"
756756
>
757757
<template #label>
758758
<span>
759-
{{ sectionName }}
759+
{{ sectionTitle }}
760760
</span>
761761
</template>
762762
</v-radio>

web/src/views/SubmissionPortal/harmonizerApi.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ interface CellData {
181181
}
182182

183183
export class HarmonizerApi {
184-
schemaSections: Ref<Record<string, Record<string, number>>>;
184+
schemaSectionNames: Ref<Record<string, string>>;
185+
186+
schemaSectionColumns: Ref<Record<string, Record<string, number>>>;
185187

186188
ready: Ref<boolean>;
187189

@@ -196,7 +198,8 @@ export class HarmonizerApi {
196198
schema: any;
197199

198200
constructor() {
199-
this.schemaSections = ref({});
201+
this.schemaSectionNames = ref({});
202+
this.schemaSectionColumns = ref({});
200203
this.ready = ref(false);
201204
this.selectedColumn = ref('');
202205
}
@@ -327,7 +330,11 @@ export class HarmonizerApi {
327330
}
328331

329332
refreshState() {
330-
this.schemaSections.value = this._getColumnCoordinates();
333+
this.schemaSectionNames.value = this.dh.template.reduce((acc: any, section: any) => {
334+
acc[section.title] = section.name;
335+
return acc;
336+
}, {});
337+
this.schemaSectionColumns.value = this._getColumnCoordinates();
331338
}
332339

333340
async loadData(data: any[]) {

0 commit comments

Comments
 (0)