-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transcript Front End #11707
Draft
Isabella-Mitchell
wants to merge
36
commits into
latest
Choose a base branch
from
Transcript-front-end
base: latest
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Transcript Front End #11707
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
f187449
Transcript Front End: Initial commit
Isabella-Mitchell 2255797
Transcript - render on local article
Isabella-Mitchell 3929222
Fix errors
Isabella-Mitchell acdcbe6
Use display: block
Isabella-Mitchell df49ad1
Transcript-front-end: A11y updates
Isabella-Mitchell 9a11125
Merge branch 'latest' into Transcript-front-end
Isabella-Mitchell b4c3709
Merge branch 'latest' into Transcript-front-end
Isabella-Mitchell d68de51
Transcript front end: Adds SVG and makes disclaimer optional
Isabella-Mitchell af89963
Transcript front end: Updates stories
Isabella-Mitchell a1a75e1
Transcript front end: Fix unit tests
Isabella-Mitchell 328a686
Transcript-front-end: Replaces svg with css triangle
Isabella-Mitchell 0a7e90a
Transcript front end: tidy
Isabella-Mitchell 0244a53
Transcript front end: Adds initial readme
Isabella-Mitchell 5f0432a
Trancript-front-end: apply darkUi styles
Isabella-Mitchell 4d13863
Replace custom css arrow with SVG
Isabella-Mitchell 10d67a4
Merge branch 'latest' into Transcript-front-end
Isabella-Mitchell 96bf199
Typeify
Isabella-Mitchell 801f9d5
Update mediaLoader to render Transcript if provided
Isabella-Mitchell 7bd1587
Adds unit tests. Updates listItem rendering logic
Isabella-Mitchell 134586a
Add basic transcript tests
Isabella-Mitchell c9e8ef8
Refines listitem logic and styles
Isabella-Mitchell 317f3a8
Merge branch 'latest' into Transcript-front-end
Isabella-Mitchell ec0f986
Transcript-front-end: lint post merge
Isabella-Mitchell f0017a7
Transcript: Update bundle size
Isabella-Mitchell d493e12
Transcript-front-end: Moves margin
Isabella-Mitchell dfe8d46
Transcript-front-end: add article with transcript story
Isabella-Mitchell 0d0e6b2
Transcript-front-end: Try fix github alert
Isabella-Mitchell 4167937
Transcript-front-end: SVG align adjust. Tries move visually hidden text
Isabella-Mitchell b344efc
Transcript-front-end: attempt improve summary text swiping
Isabella-Mitchell 9ff1160
Update snapshot
Isabella-Mitchell d7b30bb
Transcript-front-end: Mock up Talkback bug fix - introduces bug to Vo…
Isabella-Mitchell 4568711
Transcrip-front-end: Reverts changes. Removes A11y comments
Isabella-Mitchell 157c817
Merge Latest
Isabella-Mitchell 3ac2fcb
WSTEAM1-Transcript: Updates button title and timestamp
Isabella-Mitchell 38c886a
WSTEAM1-Transcript: Updates tests and bundle size
Isabella-Mitchell 14439af
WSTEAM1-Transcript: Renders Transcript on .lite site
Isabella-Mitchell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/app/components/MediaLoader/utils/getTranscriptBlock.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { aresMediaBlockWithTranscript, aresMediaBlocks } from '../fixture'; | ||
import { MediaBlock } from '../types'; | ||
import getTranscriptBlock from './getTranscriptBlock'; | ||
import TranscriptBlock from '../../Transcript/fixture.json'; | ||
|
||
describe('getTranscriptBlock', () => { | ||
it('Should return a valid transcript block for an AresMedia block for an article page.', () => { | ||
const result = getTranscriptBlock( | ||
aresMediaBlockWithTranscript as MediaBlock[], | ||
); | ||
|
||
expect(result).toStrictEqual(TranscriptBlock); | ||
}); | ||
|
||
it('Should return null if no transcript block is present.', () => { | ||
const result = getTranscriptBlock(aresMediaBlocks as MediaBlock[]); | ||
|
||
expect(result).toStrictEqual(null); | ||
}); | ||
}); |
16 changes: 16 additions & 0 deletions
16
src/app/components/MediaLoader/utils/getTranscriptBlock.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import filterForBlockType from '#app/lib/utilities/blockHandlers'; | ||
import { MediaBlock } from '../types'; | ||
import { TranscriptBlock } from '../../Transcript/types'; | ||
|
||
export default function getTranscriptBlock( | ||
blocks: MediaBlock[], | ||
): TranscriptBlock | null { | ||
const transcriptBlock: TranscriptBlock = filterForBlockType( | ||
blocks, | ||
'transcript', | ||
); | ||
|
||
if (!transcriptBlock) return null; | ||
|
||
return transcriptBlock; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
## Description | ||
|
||
The `Transcript` component renders video transcripts. | ||
|
||
## Props | ||
|
||
| Name | type | Description | | ||
| --------------- | ------- | ----------------------------------------------------- | | ||
| transcript | object | contains transcript content | | ||
| title | string | title of video | | ||
| hideDisclaimer? | boolean | decides whether to show disclaimer (defaults to true) | | ||
|
||
## Example | ||
|
||
```tsx | ||
<Transcript transcript={transcriptBlock} title={mediaTitle} hideDisclaimer /> | ||
``` |
14 changes: 14 additions & 0 deletions
14
src/app/components/Transcript/TranscriptTimestamp/index.styles.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { css, Theme } from '@emotion/react'; | ||
|
||
const styles = { | ||
time: ({ mq }: Theme) => | ||
Isabella-Mitchell marked this conversation as resolved.
Show resolved
Hide resolved
|
||
css({ | ||
float: 'inline-start', | ||
Isabella-Mitchell marked this conversation as resolved.
Show resolved
Hide resolved
|
||
width: '100%', | ||
[mq.GROUP_1_MIN_WIDTH]: { | ||
width: 'auto', | ||
}, | ||
}), | ||
}; | ||
|
||
export default styles; |
10 changes: 10 additions & 0 deletions
10
src/app/components/Transcript/TranscriptTimestamp/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** @jsx jsx */ | ||
import { jsx } from '@emotion/react'; | ||
import styles from './index.styles'; | ||
|
||
// using span not time element to prevent text splitting bug on Talkback | ||
const TranscriptTimestamp = ({ timestamp }: { timestamp: string }) => { | ||
return <span css={styles.time}>{timestamp}</span>; | ||
}; | ||
|
||
export default TranscriptTimestamp; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To do: add tests & remove comment