hide subtitle download button for files not saved
we are hiding the download button for subtitles that haven't been saved yet. When we add an edit mode, the download button can be shown there. Test Plan: - in A2 as a student start a media submission - add a subtitle file with language selection to your media - see that the download button does not show closes COMMS-2410 flag=assignments_2 Change-Id: I6b489a6296bf7472e62e2699aff647bf95b8ea3e Reviewed-on: https://gerrit.instructure.com/208825 Reviewed-by: Steven Burnett <sburnett@instructure.com> QA-Review: Steven Burnett <sburnett@instructure.com> Tested-by: Jenkins Product-Review: Ben Nelson <bnelson@instructure.com>
This commit is contained in:
parent
d1667aa3a8
commit
ae013df523
|
@ -36,9 +36,11 @@ export default function ClosedCaptionRow({closedCaption, trashButtonOnClick}) {
|
|||
<Text>{closedCaption.file.name}</Text>
|
||||
</Flex.Item>
|
||||
<Flex.Item textAlign="end" shrink grow>
|
||||
<Button variant="icon" icon={IconDownloadLine}>
|
||||
<ScreenReaderContent>Download {closedCaption.file.name}</ScreenReaderContent>
|
||||
</Button>
|
||||
{!closedCaption.isNew && (
|
||||
<Button variant="icon" icon={IconDownloadLine}>
|
||||
<ScreenReaderContent>Download {closedCaption.file.name}</ScreenReaderContent>
|
||||
</Button>
|
||||
)}
|
||||
<Button variant="icon" icon={IconTrashLine} onClick={onRowDelete}>
|
||||
<ScreenReaderContent>Delete {closedCaption.file.name}</ScreenReaderContent>
|
||||
</Button>
|
||||
|
|
|
@ -29,7 +29,8 @@ function makeProps() {
|
|||
},
|
||||
file: {
|
||||
name: 'bestfileever.webvtt'
|
||||
}
|
||||
},
|
||||
isNew: true
|
||||
},
|
||||
trashButtonOnClick: () => {}
|
||||
}
|
||||
|
@ -40,7 +41,6 @@ describe('ClosedCaptionRow', () => {
|
|||
const {getByText} = render(<ClosedCaptionRow {...makeProps()} />)
|
||||
expect(getByText('english')).toBeInTheDocument()
|
||||
expect(getByText('bestfileever.webvtt')).toBeInTheDocument()
|
||||
expect(getByText('Download bestfileever.webvtt')).toBeInTheDocument()
|
||||
expect(getByText('Delete bestfileever.webvtt')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
|
|
|
@ -55,7 +55,12 @@ export default class ClosedCaptionPanel extends Component {
|
|||
e.persist()
|
||||
this.setState(prevState => {
|
||||
const subtitles = prevState.subtitles.concat([
|
||||
{id: shortId(), language: prevState.newSelectedLanguage, file: e.target.files[0]}
|
||||
{
|
||||
id: shortId(),
|
||||
language: prevState.newSelectedLanguage,
|
||||
file: e.target.files[0],
|
||||
isNew: true
|
||||
}
|
||||
])
|
||||
this.props.updateSubtitles(subtitles)
|
||||
return {
|
||||
|
@ -74,7 +79,7 @@ export default class ClosedCaptionPanel extends Component {
|
|||
if (this.state.newSelectedFile) {
|
||||
this.setState(prevState => {
|
||||
const subtitles = prevState.subtitles.concat([
|
||||
{id: shortId(), language: option, file: prevState.newSelectedFile}
|
||||
{id: shortId(), language: option, file: prevState.newSelectedFile, isNew: true}
|
||||
])
|
||||
this.props.updateSubtitles(subtitles)
|
||||
return {
|
||||
|
|
Loading…
Reference in New Issue