Skip to content

Commit 50339ef

Browse files
committed
Requested changes
1 parent e2fe971 commit 50339ef

9 files changed

Lines changed: 26 additions & 54 deletions

File tree

contentcuration/contentcuration/frontend/channelEdit/components/ContentNodeOptions.vue

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
tabindex="0"
1717
@click="option.onClick($event)"
1818
@keydown.enter="option.onClick($event)"
19-
@keydown.tab="handleTab($event)"
19+
@keydown.tab="checkTabBoundaries($event)"
2020
>
2121
<VListTileTitle>
2222
{{ option.label }}
@@ -253,8 +253,7 @@
253253
firstOption.focus();
254254
}
255255
},
256-
handleTab($event) {
257-
$event.preventDefault();
256+
checkTabBoundaries($event) {
258257
const optionsList = this.$refs.optionsList;
259258
const options = optionsList.$el.querySelectorAll('a');
260259
const index = Array.from(options).indexOf($event.target);
@@ -263,11 +262,9 @@
263262
(index === options.length - 1 && !$event.shiftKey)
264263
) {
265264
// destroy component
265+
$event.preventDefault();
266266
this.$destroy();
267267
}
268-
const nextIndex = $event.shiftKey ? index - 1 : index + 1;
269-
const nextOption = options[nextIndex];
270-
nextOption && nextOption.focus();
271268
},
272269
newTopicNode() {
273270
this.trackAction('New topic');
@@ -315,13 +312,13 @@
315312
},
316313
quickEditModalFactory(modal) {
317314
return $event => {
315+
$event.preventDefault();
318316
this.openQuickEditModal({
319317
modal,
320318
nodeIds: [this.nodeId],
321319
});
322320
const trackActionLabel = modal.replace(/_/g, ' ').toLowerCase();
323321
this.trackAction(`Edit ${trackActionLabel}`);
324-
$event.preventDefault();
325322
};
326323
},
327324
removeNode: withChangeTracker(function(changeTracker) {

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

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
<p data-test="multiple-audience-message">
1616
{{ $tr('multipleAudience') }}
1717
</p>
18-
<hr
19-
:style="dividerStyle"
20-
>
18+
<Divider />
19+
2120
</template>
2221
<h4 class="modal-subheading">
2322
{{ $tr('visibleTo') }}
@@ -35,9 +34,8 @@
3534
:description="rol.description"
3635
/>
3736
</div>
38-
<hr
39-
:style="dividerStyle"
40-
>
37+
<Divider />
38+
4139
<KCheckbox
4240
:checked="forBeginners"
4341
data-test="for-beginners-checkbox"
@@ -84,13 +82,6 @@
8482
description: this.rolesDescription[role],
8583
}));
8684
},
87-
dividerStyle() {
88-
return {
89-
border: 0,
90-
borderBottom: `1px solid ${this.$themeTokens.fineLine}`,
91-
margin: '24px 0',
92-
};
93-
},
9485
rolesDescription() {
9586
return {
9687
[RolesNames.COACH]: this.$tr('visibleToCoaches'),

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

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
:label="$tr('updateDescendantsCheckbox')"
1919
@change="(value) => { updateDescendants = value }"
2020
/>
21-
<hr
22-
:style="dividerStyle"
23-
>
21+
<Divider />
2422
</template>
2523
<slot
2624
name="input"
@@ -97,13 +95,6 @@
9795
isTopicSelected() {
9896
return this.nodes.some(node => node.kind === ContentKindsNames.TOPIC);
9997
},
100-
dividerStyle() {
101-
return {
102-
border: 0,
103-
borderBottom: `1px solid ${this.$themeTokens.fineLine}`,
104-
margin: '1em 0',
105-
};
106-
},
10798
},
10899
watch: {
109100
selectedValues() {

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

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@
2929
:label="$tr('updateDescendantsCheckbox')"
3030
@change="(value) => { updateDescendants = value }"
3131
/>
32-
<hr
33-
:style="dividerStyle"
34-
>
32+
<Divider />
3533
</template>
3634
<div
3735
ref="languages"
@@ -96,13 +94,6 @@
9694
criteria.some(key => lang[key] && lang[key].toLowerCase().includes(searchQuery))
9795
);
9896
},
99-
dividerStyle() {
100-
return {
101-
border: 0,
102-
borderBottom: `1px solid ${this.$themeTokens.fineLine}`,
103-
margin: '1em 0',
104-
};
105-
},
10697
},
10798
created() {
10899
const languages = [...new Set(this.nodes.map(node => node.language))];
@@ -119,7 +110,7 @@
119110
);
120111
const selectedRadio = selectedInput && selectedInput.parentElement;
121112
if (selectedRadio && selectedRadio.scrollIntoView) {
122-
selectedRadio.scrollIntoView();
113+
selectedRadio.scrollIntoView({ behavior: 'instant' });
123114
}
124115
}
125116
},

contentcuration/contentcuration/frontend/channelEdit/views/CurrentTopicView.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@
911911
importFromChannels: 'Import from channels',
912912
addButton: 'Add',
913913
editButton: 'Edit',
914-
editSourceButton: 'Edit source',
914+
editSourceButton: 'Edit Source',
915915
editLevelsButton: 'Edit Levels',
916916
editLanguageButton: 'Edit Language',
917917
editAudienceButton: 'Edit Audience',

contentcuration/contentcuration/frontend/shared/utils/helpers.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -528,18 +528,16 @@ export function getSortedCategories() {
528528
return categoriesSorted;
529529
}
530530

531-
export function isAllowedFileType(file) {
531+
export function isAudioVideoFile(file) {
532532
if (!file || !file.file_format) {
533533
return false;
534534
}
535535

536-
let allowedFileTypes = [];
537-
// add the relevant format presets for audio and video
538-
// high res and low res are currently the same, so only one is included
539-
allowedFileTypes.push(FormatPresetsMap.get(FormatPresetsNames.HIGH_RES_VIDEO).allowed_formats);
540-
allowedFileTypes.push(FormatPresetsMap.get(FormatPresetsNames.AUDIO).allowed_formats);
541-
allowedFileTypes = allowedFileTypes.flat();
542-
return allowedFileTypes.includes(file.file_format);
536+
const videoAllowedFormats = FormatPresetsMap.get(FormatPresetsNames.VIDEO).allowed_formats;
537+
const audioAllowedFormats = FormatPresetsMap.get(FormatPresetsNames.AUDIO).allowed_formats;
538+
return (
539+
videoAllowedFormats.includes(file.file_format) || audioAllowedFormats.includes(file.file_format)
540+
);
543541
}
544542

545543
export function getFileDuration(nodeFiles, kind) {
@@ -553,7 +551,7 @@ export function getFileDuration(nodeFiles, kind) {
553551

554552
// filter for the correct file types,
555553
// to exclude files such as subtitle or cc
556-
const audioVideoFiles = nodeFiles.filter(file => isAllowedFileType(file));
554+
const audioVideoFiles = nodeFiles.filter(file => isAudioVideoFile(file));
557555
// return the last item in the array
558556
const file = audioVideoFiles[audioVideoFiles.length - 1];
559557
if (!file || !file.duration) {

contentcuration/contentcuration/frontend/shared/views/Divider.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
props: {
1414
margin: {
1515
type: String,
16-
default: '1em 0',
16+
default: '16px 0',
1717
},
1818
},
1919
computed: {

contentcuration/contentcuration/frontend/shared/views/LicenseDropdown.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@
132132
},
133133
description: {
134134
get() {
135+
if (this.isMixedDescription) {
136+
return this.$tr('mixed');
137+
}
135138
return this.value && this.value.license_description;
136139
},
137140
set(value) {
@@ -144,6 +147,9 @@
144147
isMixedLicense() {
145148
return this.value && this.value.license === nonUniqueValue;
146149
},
150+
isMixedDescription() {
151+
return this.value && this.value.license_description === nonUniqueValue;
152+
},
147153
selectedLicense() {
148154
if (this.isMixedLicense) {
149155
return null;

contentcuration/contentcuration/frontend/shared/views/contentNodeFields/CompletionOptions/index.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@
107107
import ActivityDuration from './ActivityDuration';
108108
import MasteryCriteriaGoal from './MasteryCriteriaGoal';
109109
import MasteryCriteriaMofNFields from './MasteryCriteriaMofNFields';
110-
import Divider from 'shared/views/Divider';
111110
import {
112111
nonUniqueValue,
113112
ContentModalities,
@@ -136,7 +135,6 @@
136135
export default {
137136
name: 'CompletionOptions',
138137
components: {
139-
Divider,
140138
ActivityDuration,
141139
ExpandableSelect,
142140
MasteryCriteriaMofNFields,

0 commit comments

Comments
 (0)