diff --git a/contentcuration/contentcuration/frontend/channelEdit/components/ResourcePanel.vue b/contentcuration/contentcuration/frontend/channelEdit/components/ResourcePanel.vue index e651764293..0c505ddbfa 100644 --- a/contentcuration/contentcuration/frontend/channelEdit/components/ResourcePanel.vue +++ b/contentcuration/contentcuration/frontend/channelEdit/components/ResourcePanel.vue @@ -310,7 +310,11 @@ inline /> - + diff --git a/contentcuration/contentcuration/frontend/channelEdit/components/edit/DetailsTabView.vue b/contentcuration/contentcuration/frontend/channelEdit/components/edit/DetailsTabView.vue index e319fc452a..3c899602a7 100644 --- a/contentcuration/contentcuration/frontend/channelEdit/components/edit/DetailsTabView.vue +++ b/contentcuration/contentcuration/frontend/channelEdit/components/edit/DetailsTabView.vue @@ -554,12 +554,7 @@ return this.firstNode.original_channel_name; }, requiresAccessibility() { - return ( - this.oneSelected && - this.nodes.every( - node => node.kind !== ContentKindsNames.AUDIO && node.kind !== ContentKindsNames.TOPIC - ) - ); + return this.oneSelected && this.nodes.every(node => node.kind !== ContentKindsNames.TOPIC); }, audioAccessibility() { return this.oneSelected && this.firstNode.kind === 'audio'; diff --git a/contentcuration/contentcuration/frontend/channelEdit/components/edit/__tests__/accessibilityOptions.spec.js b/contentcuration/contentcuration/frontend/channelEdit/components/edit/__tests__/accessibilityOptions.spec.js index 050f389c6a..9bc5d81c04 100644 --- a/contentcuration/contentcuration/frontend/channelEdit/components/edit/__tests__/accessibilityOptions.spec.js +++ b/contentcuration/contentcuration/frontend/channelEdit/components/edit/__tests__/accessibilityOptions.spec.js @@ -73,6 +73,17 @@ describe('AccessibilityOptions', () => { expect(wrapper.find('[data-test="checkbox-audioDescription"]').exists()).toBe(false); }); + it('should display the correct list of accessibility options if resource is an audio', () => { + const wrapper = mount(AccessibilityOptions, { + propsData: { + kind: 'audio', + }, + }); + + expect(wrapper.find('[data-test="checkbox-captionsSubtitles"]').exists()).toBe(true); + expect(wrapper.find('[data-test="tooltip-captionsSubtitles"]').exists()).toBe(false); + }); + it('should render appropriate tooltips along with the checkbox', () => { const wrapper = mount(AccessibilityOptions, { propsData: { diff --git a/contentcuration/contentcuration/frontend/shared/constants.js b/contentcuration/contentcuration/frontend/shared/constants.js index 21a14afc08..005be9a69c 100644 --- a/contentcuration/contentcuration/frontend/shared/constants.js +++ b/contentcuration/contentcuration/frontend/shared/constants.js @@ -199,11 +199,11 @@ export const ContentModalities = { }; export const AccessibilityCategoriesMap = { - // Note: audio is not included, as it is rendered in the UI differently. document: ['ALT_TEXT', 'HIGH_CONTRAST', 'TAGGED_PDF'], video: ['CAPTIONS_SUBTITLES', 'AUDIO_DESCRIPTION', 'SIGN_LANGUAGE'], exercise: ['ALT_TEXT'], html5: ['ALT_TEXT', 'HIGH_CONTRAST'], + audio: ['CAPTIONS_SUBTITLES'], }; export const CompletionDropdownMap = { diff --git a/contentcuration/contentcuration/management/commands/set_orm_based_has_captions.py b/contentcuration/contentcuration/management/commands/set_orm_based_has_captions.py index 29769e4389..38865f6b89 100644 --- a/contentcuration/contentcuration/management/commands/set_orm_based_has_captions.py +++ b/contentcuration/contentcuration/management/commands/set_orm_based_has_captions.py @@ -22,13 +22,13 @@ class Command(BaseCommand): def handle(self, *args, **options): start = time.time() - logging.info("Setting 'has captions' for video kinds") + logging.info("Setting 'has captions' for audio kinds") has_captions_subquery = Exists(File.objects.filter(contentnode=OuterRef("id"), language=OuterRef("language"), preset_id=format_presets.VIDEO_SUBTITLE)) - # Only try to update video nodes which have not had any accessibility labels set on them + # Only try to update audio nodes which have not had any accessibility labels set on them # this will allow this management command to be rerun and resume from where it left off # and also prevent stomping previous edits to the accessibility_labels field. - updateable_nodes = ContentNode.objects.filter(has_captions_subquery, kind=content_kinds.VIDEO, accessibility_labels__isnull=True) + updateable_nodes = ContentNode.objects.filter(has_captions_subquery, kind=content_kinds.AUDIO, accessibility_labels__isnull=True) updateable_node_slice = updateable_nodes.values_list("id", flat=True)[0:CHUNKSIZE]