Remove cc_in_rce_video_tray flag

Closes MAT-137
flag=none

Test Plan:
- Navigate to the site admin account on your
  local Canvas and verify the flag is gone
- Navigate to an RCE and upload a video
- Click the video and then click "Video Options"
- Verify you can upload closed captions from the
  tray that opens

Change-Id: I4457585873a341d1b3944729a2407f9340a18328
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/280803
Reviewed-by: Jacob DeWar <jacob.dewar@instructure.com>
QA-Review: Jacob DeWar <jacob.dewar@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
This commit is contained in:
Weston Dransfield 2021-12-09 15:27:31 -07:00
parent 067253d999
commit f4c0c8f4d0
7 changed files with 19 additions and 58 deletions

View File

@ -265,7 +265,7 @@ class ApplicationController < ActionController::Base
# put feature checks on Account.site_admin and @domain_root_account that we're loading for every page in here
# so altogether we can get them faster the vast majority of the time
JS_ENV_SITE_ADMIN_FEATURES = %i[
cc_in_rce_video_tray featured_help_links rce_buttons_and_icons important_dates feature_flag_filters k5_parent_support
featured_help_links rce_buttons_and_icons important_dates feature_flag_filters k5_parent_support
conferencing_in_planner remember_settings_tab word_count_in_speed_grader observer_picker lti_platform_storage
scale_equation_images new_equation_editor
].freeze

View File

@ -1,8 +1,3 @@
cc_in_rce_video_tray:
state: hidden
display_name: RCE Edit Closed Captions
description: Edit closed captions/subtitles to videos from the video options tray in the RCE
applies_to: SiteAdmin
scale_equation_images:
state: hidden
display_name: 'Math: Scale equation images'

View File

@ -61,12 +61,6 @@ beforeAll(() => {
const vid = elem.parentElement.getAttribute('id')
return mockVideoPlayers.find(vp => vp.id === vid)
})
window.ENV = {
FEATURES: {
cc_in_rce_video_tray: true
}
}
})
afterAll(() => {

View File

@ -27,12 +27,6 @@ describe('RCE "Videos" Plugin > VideoOptionsTray', () => {
let tray
beforeEach(() => {
window.ENV = {
FEATURES: {
cc_in_rce_video_tray: true
}
}
props = {
onRequestClose: jest.fn(),
onSave: jest.fn(),
@ -159,12 +153,6 @@ describe('RCE "Videos" Plugin > VideoOptionsTray', () => {
tray.setTitleText('hello')
expect(tray.$titleTextField).toBe(document.activeElement)
})
it('is not displayed when feature flag is false', () => {
window.ENV.FEATURES.cc_in_rce_video_tray = false
renderComponent()
expect(tray.$closedCaptionPanel).toBeNull()
})
})
describe('"Done" button', () => {

View File

@ -129,8 +129,7 @@ export default function VideoOptionsTray(props) {
const saveDisabled =
displayAs === 'embed' &&
(titleText === '' || (videoSize === CUSTOM && !dimensionsState.isValid))
// yes I know ENV shouldn't be used in the sub-package, but it's temporary
const cc_in_rce_video_tray = !!ENV?.FEATURES?.cc_in_rce_video_tray
return (
<StoreProvider {...trayProps}>
{contentProps => (
@ -146,7 +145,7 @@ export default function VideoOptionsTray(props) {
shouldCloseOnDocumentClick
shouldContainFocus
shouldReturnFocus
size={cc_in_rce_video_tray ? 'regular' : undefined}
size="regular"
>
<Flex direction="column" height={getTrayHeight()}>
<Flex.Item as="header" padding="medium">
@ -220,22 +219,20 @@ export default function VideoOptionsTray(props) {
</View>
)}
</Flex.Item>
{cc_in_rce_video_tray && (
<Flex.Item padding="small">
<FormFieldGroup description={formatMessage('Closed Captions/Subtitles')}>
<ClosedCaptionPanel
subtitles={subtitles.map(st => ({
locale: st.locale,
file: {name: st.language || st.locale} // this is an artifact of ClosedCaptionCreatorRow's inards
}))}
uploadMediaTranslations={Bridge.uploadMediaTranslations}
languages={Bridge.languages}
updateSubtitles={handleUpdateSubtitles}
liveRegion={getLiveRegion}
/>
</FormFieldGroup>
</Flex.Item>
)}
<Flex.Item padding="small">
<FormFieldGroup description={formatMessage('Closed Captions/Subtitles')}>
<ClosedCaptionPanel
subtitles={subtitles.map(st => ({
locale: st.locale,
file: {name: st.language || st.locale} // this is an artifact of ClosedCaptionCreatorRow's inards
}))}
uploadMediaTranslations={Bridge.uploadMediaTranslations}
languages={Bridge.languages}
updateSubtitles={handleUpdateSubtitles}
liveRegion={getLiveRegion}
/>
</FormFieldGroup>
</Flex.Item>
</Flex>
</Flex.Item>
<Flex.Item

View File

@ -94,12 +94,7 @@ export function updateMediaObject({media_object_id, title, subtitles}) {
throw e
})
if (ENV.FEATURES.cc_in_rce_video_tray) {
const ccupdate = state.source.updateClosedCaptions(state, {media_object_id, subtitles})
return Promise.all([moupdate, ccupdate])
} else {
return moupdate
}
const ccupdate = state.source.updateClosedCaptions(state, {media_object_id, subtitles})
return Promise.all([moupdate, ccupdate])
}
}

View File

@ -43,14 +43,6 @@ function getInitialState() {
}
}
beforeEach(() => {
global.ENV = {
FEATURES: {
cc_in_rce_video_tray: true
}
}
})
describe('Media actions', () => {
afterEach(() => {
sinon.restore()