-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat: audio component can be passed transcript text and launch own popup #2460
Conversation
Visit the preview URL for this PR (updated for commit 4d0ff66): https://plh-teens-app1--pr2460-feat-audio-player-co-00nwwtq8.web.app (expires Thu, 24 Oct 2024 10:39:25 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: e4c0bab6b08dd290fbf002fd6e07987fa4b5fce1 |
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.
Really nice you were able to get this working so smoothly, I really like the implementation overall and think it should simplify things for authors nicely. See a few minor comments inline, but otherwise I'd say should be good to go
src/app/shared/components/template/components/audio/audio.component.html
Outdated
Show resolved
Hide resolved
src/app/shared/components/template/components/layout/popup/popup.component.html
Show resolved
Hide resolved
(emittedValue)="handleEmittedValue($event)" | ||
></plh-template-container> | ||
@if (props.textOnly) { | ||
<div class="large standard normal" [innerHTML]="props.text | markdown"></div> |
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.
large standard normal
- which is it??! 😅
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.
Yeh this is pretty gross... I was using the same pattern to apply those styles as is used by the text
component, but now I've updated it so that the pop-up component, when called to display text only, uses an instance of the text
component itself. See 50cc535
The text component styling could still do with some tidying up, but at least this means that it's still only in one place
src/app/shared/components/template/components/layout/popup/popup.component.ts
Outdated
Show resolved
Hide resolved
Thanks @chrismclarke, I've addressed your points. I think this should be good to go, pending any opinions you have on my changes to the |
I really like leveraging the existing text component to be able to inherit consistent styling, although would much prefer to isolate the text component from these changes. We've already had to update the common popup component to add support for direct text, I think it starts to feel a bit over-engineered to then also be changing the text component to handle case when being rendered directly within a popup. So I'd say better to just create an ad-hoc template row in the popup component so that the text can display in the usual way |
Possibly too many changes to easily merge as "suggested changes" but hopefully you get the idea at least. Let me know what you think (probably should have done as a PR targetting this branch instead) |
src/app/shared/components/template/components/layout/popup/popup.component.html
Outdated
Show resolved
Hide resolved
…d-hoc row values instead
Ah good idea. I'd forgotten how easy it is to pass in a value for |
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.
Looks good to me, thanks for making the updates. Oh yeah, nice idea to tidy up the text component, had thought the same while looking at it
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.
Functional test passed
PR Checklist
Description
Follow up to #2448.
Adds a parameter,
transcript_text
to the audio component. This parameter takes a string value, which should represent the text of the transcript for the associated audio file. If a value fortranscript_text
is provided, then the audio component will show the "info button" icon (i.e.show_info_button
is set to true), and clicking on this button will automatically launch a pop-up to display the text when the "info button" is clicked, without having to manually author an action, as was the case after #2448 (although custom action handling is still supported).Git Issues
Closes #
Screenshots/Videos
comp_audio