Skip to content

Commit 6d1577b

Browse files
committed
Removing options components as prop
1 parent 7943411 commit 6d1577b

9 files changed

Lines changed: 94 additions & 76 deletions

File tree

contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditBooleanMapModal.vue

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,31 @@
1111
<p data-test="resources-selected-message">
1212
{{ $tr('resourcesSelected', { count: nodeIds.length }) }}
1313
</p>
14+
<template v-if="isDescendantsUpdatable && isTopicSelected">
15+
<KCheckbox
16+
:checked="updateDescendants"
17+
data-test="update-descendants-checkbox"
18+
:label="$tr('updateDescendantsCheckbox')"
19+
@change="(value) => { updateDescendants = value }"
20+
/>
21+
<hr
22+
:style="dividerStyle"
23+
>
24+
</template>
25+
<slot
26+
name="input"
27+
:value="selectedValues"
28+
:inputHandler="(value) => { selectedValues = value }"
29+
></slot>
30+
1431
<component
1532
:is="inputComponent"
1633
v-model="selectedValues"
1734
expanded
1835
hideLabel
1936
:nodeIds="nodeIds"
20-
>
21-
<template v-if="isDescendantsUpdatable && isTopicSelected" #prependOptions>
22-
<KCheckbox
23-
:checked="updateDescendants"
24-
data-test="update-descendants-checkbox"
25-
:label="$tr('updateDescendantsCheckbox')"
26-
@change="(value) => { updateDescendants = value }"
27-
/>
28-
<hr
29-
:style="dividerStyle"
30-
>
31-
</template>
32-
</component>
37+
/>
38+
3339
<span v-if="error" class="red--text">
3440
{{ error }}
3541
</span>

contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditCategoriesModal.vue

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,18 @@
66
:title="$tr('editCategories')"
77
:nodeIds="nodeIds"
88
:confirmationMessage="$tr('editedCategories', { count: nodeIds.length })"
9-
:inputComponent="CategoryOptionsComponent"
109
@close="() => $emit('close')"
11-
/>
10+
>
11+
<template #input="{ value, inputHandler }">
12+
<CategoryOptions
13+
expanded
14+
hideLabel
15+
:value="value"
16+
:nodeIds="nodeIds"
17+
@input="inputHandler"
18+
/>
19+
</template>
20+
</EditBooleanMapModal>
1221

1322
</template>
1423

@@ -21,6 +30,7 @@
2130
export default {
2231
name: 'EditCategoriesModal',
2332
components: {
33+
CategoryOptions,
2434
EditBooleanMapModal,
2535
},
2636
props: {
@@ -29,11 +39,6 @@
2939
required: true,
3040
},
3141
},
32-
computed: {
33-
CategoryOptionsComponent() {
34-
return CategoryOptions;
35-
},
36-
},
3742
$trs: {
3843
editCategories: 'Edit Categories',
3944
editedCategories:

contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditLearningActivitiesModal.vue

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,17 @@
99
:inputComponent="LearningActivityOptionsComponent"
1010
:confirmationMessage="$tr('editedLearningActivities', { count: nodeIds.length })"
1111
@close="() => $emit('close')"
12-
/>
12+
>
13+
<template #input="{ value, inputHandler }">
14+
<LearningActivityOptions
15+
expanded
16+
hideLabel
17+
:value="value"
18+
:nodeIds="nodeIds"
19+
@input="inputHandler"
20+
/>
21+
</template>
22+
</EditBooleanMapModal>
1323

1424
</template>
1525

@@ -24,6 +34,7 @@
2434
name: 'EditLearningActivitiesModal',
2535
components: {
2636
EditBooleanMapModal,
37+
LearningActivityOptions,
2738
},
2839
props: {
2940
nodeIds: {
@@ -35,9 +46,6 @@
3546
learningActivityValidators() {
3647
return getLearningActivityValidators();
3748
},
38-
LearningActivityOptionsComponent() {
39-
return LearningActivityOptions;
40-
},
4149
},
4250
$trs: {
4351
editLearningActivitiesTitle: 'Edit Learning Activities',

contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditLevelsModal.vue

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,19 @@
55
isDescendantsUpdatable
66
:title="$tr('editLevelsTitle')"
77
:nodeIds="nodeIds"
8-
:inputComponent="LevelsOptionsComponent"
98
:confirmationMessage="$tr('editedLevels', { count: nodeIds.length })"
109
@close="() => $emit('close')"
11-
/>
10+
>
11+
<template #input="{ value, inputHandler }">
12+
<LevelsOptions
13+
expanded
14+
hideLabel
15+
:value="value"
16+
:nodeIds="nodeIds"
17+
@input="inputHandler"
18+
/>
19+
</template>
20+
</EditBooleanMapModal>
1221

1322
</template>
1423

@@ -21,6 +30,7 @@
2130
export default {
2231
name: 'EditLevelsModal',
2332
components: {
33+
LevelsOptions,
2434
EditBooleanMapModal,
2535
},
2636
props: {
@@ -29,11 +39,6 @@
2939
required: true,
3040
},
3141
},
32-
computed: {
33-
LevelsOptionsComponent() {
34-
return LevelsOptions;
35-
},
36-
},
3742
$trs: {
3843
editLevelsTitle: 'What Levels',
3944
editedLevels:

contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditResourcesNeededModal.vue

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,18 @@
66
:title="$tr('editResourcesNeededTitle')"
77
:nodeIds="nodeIds"
88
:confirmationMessage="$tr('editedResourcesNeeded', { count: nodeIds.length })"
9-
:inputComponent="ResourcesNeededOptionsComponent"
109
@close="() => $emit('close')"
11-
/>
10+
>
11+
<template #input="{ value, inputHandler }">
12+
<ResourcesNeededOptions
13+
expanded
14+
hideLabel
15+
:value="value"
16+
:nodeIds="nodeIds"
17+
@input="inputHandler"
18+
/>
19+
</template>
20+
</EditBooleanMapModal>
1221

1322
</template>
1423

@@ -22,18 +31,14 @@
2231
name: 'EditResourcesNeededModal',
2332
components: {
2433
EditBooleanMapModal,
34+
ResourcesNeededOptions,
2535
},
2636
props: {
2737
nodeIds: {
2838
type: Array,
2939
required: true,
3040
},
3141
},
32-
computed: {
33-
ResourcesNeededOptionsComponent() {
34-
return ResourcesNeededOptions;
35-
},
36-
},
3742
$trs: {
3843
editResourcesNeededTitle: 'What will you need?',
3944
editedResourcesNeeded:

contentcuration/contentcuration/frontend/shared/views/contentNodeFields/CategoryOptions.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@
7373
</template>
7474
</DropdownWrapper>
7575

76-
<slot name="prependOptions"></slot>
77-
7876
<div v-if="expanded" class="checkbox-list-wrapper">
7977
<KCheckbox
8078
v-for="option in filteredCategories"

contentcuration/contentcuration/frontend/shared/views/contentNodeFields/LearningActivityOptions.vue

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
<template>
22

3-
<div>
4-
<slot name="prependOptions"></slot>
5-
<ExpandableSelect
6-
v-model="learningActivity"
7-
multiple
8-
:disabled="disabled"
9-
:expanded="expanded"
10-
:options="learningActivities"
11-
:hideLabel="hideLabel"
12-
:rules="learningActivityRules"
13-
:label="translateMetadataString('learningActivity')"
14-
/>
15-
</div>
3+
<ExpandableSelect
4+
v-model="learningActivity"
5+
multiple
6+
:disabled="disabled"
7+
:expanded="expanded"
8+
:options="learningActivities"
9+
:hideLabel="hideLabel"
10+
:rules="learningActivityRules"
11+
:label="translateMetadataString('learningActivity')"
12+
/>
1613

1714
</template>
1815

contentcuration/contentcuration/frontend/shared/views/contentNodeFields/LevelsOptions.vue

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
<template>
22

3-
<div>
4-
<slot name="prependOptions"></slot>
5-
<ExpandableSelect
6-
v-model="level"
7-
multiple
8-
:expanded="expanded"
9-
:options="levels"
10-
:hideLabel="hideLabel"
11-
:label="translateMetadataString('level')"
12-
/>
13-
</div>
3+
<ExpandableSelect
4+
v-model="level"
5+
multiple
6+
:expanded="expanded"
7+
:options="levels"
8+
:hideLabel="hideLabel"
9+
:label="translateMetadataString('level')"
10+
/>
1411

1512
</template>
1613

contentcuration/contentcuration/frontend/shared/views/contentNodeFields/ResourcesNeededOptions.vue

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
<template>
22

3-
<div>
4-
<slot name="prependOptions"></slot>
5-
<ExpandableSelect
6-
v-model="need"
7-
multiple
8-
:expanded="expanded"
9-
:options="resources"
10-
:hideLabel="hideLabel"
11-
:label="$tr('resourcesNeededLabel')"
12-
:hint="hint"
13-
/>
14-
</div>
3+
<ExpandableSelect
4+
v-model="need"
5+
multiple
6+
:expanded="expanded"
7+
:options="resources"
8+
:hideLabel="hideLabel"
9+
:label="$tr('resourcesNeededLabel')"
10+
:hint="hint"
11+
/>
1512

1613
</template>
1714

0 commit comments

Comments
 (0)