Skip to content

Commit 91b5dbe

Browse files
committed
add bulkEditor tab option
1 parent 3a4cf8c commit 91b5dbe

File tree

1 file changed

+39
-20
lines changed

1 file changed

+39
-20
lines changed

packages/platform-ui/src/components/Edit/CourseEditor.vue

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,42 @@
88
<router-link to="/q">Quilts</router-link> /
99
<router-link :to="`/q/${courseConfig ? courseConfig.name : course}`">{{ courseConfig?.name }}</router-link>
1010
</h1>
11-
<v-btn color="success" @click="toggleComponent">Content Editing / Component Registration</v-btn>
12-
<div v-if="editingMode">
13-
<v-select
14-
v-model="selectedShape"
15-
label="What kind of content are you adding?"
16-
:items="registeredDataShapes.map((shape) => shape.name)"
17-
/>
18-
19-
<data-input-form
20-
v-if="!loading && selectedShape !== '' && courseConfig && dataShape"
21-
:data-shape="dataShape"
22-
:course-cfg="courseConfig"
23-
/>
24-
</div>
25-
<component-registration v-else :course="course" />
11+
12+
<v-tabs v-model="currentTab" bg-color="primary" grow>
13+
<v-tab value="single">Single Card Input</v-tab>
14+
<v-tab value="bulk">Bulk Import</v-tab>
15+
<v-tab value="registration">Component Registration</v-tab>
16+
</v-tabs>
17+
18+
<v-window v-model="currentTab">
19+
<v-window-item value="single">
20+
<v-container fluid>
21+
<v-select
22+
v-model="selectedShape"
23+
label="What kind of content are you adding?"
24+
:items="registeredDataShapes.map((shape) => shape.name)"
25+
class="mt-4"
26+
/>
27+
<data-input-form
28+
v-if="selectedShape !== '' && courseConfig && dataShape"
29+
:data-shape="dataShape"
30+
:course-cfg="courseConfig"
31+
/>
32+
</v-container>
33+
</v-window-item>
34+
35+
<v-window-item value="bulk">
36+
<v-container fluid>
37+
<bulk-import-view v-if="courseConfig" :course-cfg="courseConfig" class="mt-4" />
38+
</v-container>
39+
</v-window-item>
40+
41+
<v-window-item value="registration">
42+
<v-container fluid>
43+
<component-registration :course="course" class="mt-4" />
44+
</v-container>
45+
</v-window-item>
46+
</v-window>
2647
</div>
2748
</div>
2849
</template>
@@ -34,6 +55,7 @@ import { allCourses } from '@vue-skuilder/courses';
3455
import { BlanksCard, BlanksCardDataShapes } from '@vue-skuilder/courses';
3556
import { CourseConfig, NameSpacer, DataShape } from '@vue-skuilder/common';
3657
import DataInputForm from './ViewableDataInputForm/DataInputForm.vue';
58+
import BulkImportView from './BulkImportView.vue'; // Added import
3759
import { getDataLayer } from '@vue-skuilder/db';
3860
import { useDataInputFormStore } from '@/stores/useDataInputFormStore';
3961
@@ -43,6 +65,7 @@ export default defineComponent({
4365
components: {
4466
DataInputForm,
4567
ComponentRegistration,
68+
BulkImportView,
4669
},
4770
4871
props: {
@@ -60,7 +83,7 @@ export default defineComponent({
6083
courseConfig: null as CourseConfig | null,
6184
dataShape: BlanksCardDataShapes[0] as DataShape,
6285
loading: true,
63-
editingMode: true,
86+
currentTab: 'single',
6487
dataInputFormStore: useDataInputFormStore(),
6588
};
6689
},
@@ -118,10 +141,6 @@ export default defineComponent({
118141
return shape.name === shapeName;
119142
})!;
120143
},
121-
122-
toggleComponent() {
123-
this.editingMode = !this.editingMode;
124-
},
125144
},
126145
});
127146
</script>

0 commit comments

Comments
 (0)