-
Notifications
You must be signed in to change notification settings - Fork 63
Conversation
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.
Some comments on casts mostly, how we can avoid them and/or how to push them down so that we're casting smaller expressions.
Casts are really powerful but they are also a hammer! Usually we want to try to thread needles with types so that we're not "forcing" things together.
Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com>
Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com>
Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com>
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.
LGTM! 🎉 Great work 😁
test/tapes/response-239.json5
Outdated
@@ -0,0 +1,69 @@ | |||
{ |
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 like related image requests don't have custom tape names 😢
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.
This is actually a request for an image with an id that doesn't exist (foo
). Since the tape name are generated using a UUID regex, this is expected. We could edit the regex to be more broad so that this specific case is caught, too.
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.
Ahhhh, okay! Makes sense then 🙂
# Conflicts: # src/components/VAudioTrack/VPlayPause.vue # src/locales/po-files/openverse.pot # test/tapes/related_audio_2e38ac1e-830c-4e9c-b13d-2c9a1ad53f95_keep-alive.json5 # test/tapes/related_images_da5cb478-c093-4d62-b721-cda18797e3fb_keep-alive.json5 # test/tapes/response-239.json5 # tsconfig.json
const layoutComponent = computed(() => layoutMappings[props.layout]) | ||
|
||
/** | ||
* Sets default size if not provided. | ||
*/ | ||
const _size = computed(() => { | ||
if (isBoxed && !props.size) { | ||
return null | ||
return undefined |
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.
This value is used to set the inline style width in VBoxLayout
, and null is not valid there:
<div :style="{ width }">
# Conflicts: # src/components/VAudioTrack/layouts/VBoxLayout.vue # test/tapes/related_audio_2ecd5631-c48c-4a5f-89c4-83c44dbbd365_keep-alive.json5 # test/tapes/related_images_f9384235-b72e-4f1e-9b05-e1b116262a29_keep-alive.json5
* Stop playing audio when global player is closed * Revert change from flex to inline-flex
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.
Amazing work!
isPlaying(): boolean { | ||
return this.status === 'playing' | ||
}, | ||
setup(props, { emit }) { |
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.
Fully converted to use the setup
function, nice!
audio: { | ||
type: Object as PropType<AudioDetail>, | ||
required: true, | ||
}, |
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.
This typing syntax really helps to clean files ✨
Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com>
Fixes
This belongs to TS-ification milestone.
Description
This PR converts the Audio components to TypeScript. It also extracts some audio-related constants to
constants/audio
:layout
s,size
s andstatus
es. I'm not sure that is the best place for them.Testing Instructions
The CI should pass, and there should be no errors or warnings on the audio pages.
Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin