-
Notifications
You must be signed in to change notification settings - Fork 2
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
Work out audio upload issues #364
Conversation
- fix broken upload button - provide visual feedback on upload status, failure
✅ Deploy Preview for dailp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Roadmap of changes
<div | ||
<form |
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.
I'm not sure this change was actually needed
<label htmlFor="file-upload" style={{ display: "inline-block" }}> | ||
<div style={{ display: "inline-block" }}> | ||
<IconTextButton | ||
icon={<MdUploadFile />} | ||
// @ts-ignore -- I couldn't find a way to fix how this is typed | ||
// this is part of React's ugly insides | ||
as="label" | ||
htmlFor="file-upload" | ||
className={ | ||
currentTab === "upload" ? subtleButtonActive : subtleButton | ||
} | ||
> | ||
Upload audio | ||
</IconTextButton> | ||
</label> | ||
</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.
There was some bad interaction happening between the button and label elements here. This seems to have resolved the issue, kept the tab order correct, and kept cursor changes correct as well.
<div | ||
style={{ | ||
position: "absolute", | ||
top: 0, | ||
left: 0, | ||
bottom: 0, | ||
right: 0, | ||
background: "rgba(255,255,255,0.65)", | ||
color: "black", | ||
padding: 40, | ||
backdropFilter: "blur(2px)", | ||
border: `4px solid ${border}`, | ||
}} | ||
> |
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 should live in a ...styles.tsx
file
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.
Please make this change
website/src/components/wordpress.tsx
Outdated
const wordEmbedStyle = /\[(\w*):([0-9]*)-?([0-9]*)?:?(audio)?(join)?(#)?(\w*)?\]/ // [DocName:Start(-OptionalEnd):?(audio?)(join?)#?OptionalChapterSlug?] | ||
const wordEmbedStyle = | ||
/\[(\w*):([0-9]*)-?([0-9]*)?:?(audio)?(join)?(#)?(\w*)?\]/ // [DocName:Start(-OptionalEnd):?(audio?)(join?)#?OptionalChapterSlug?] |
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.
@GracefulLemming we may be in a formatting battle - my dev-check
changed this, but the last edit was you and the commit message was prettier
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.
try merging main in– running prettier -w src
and prettier -w --config package.json src
yields two different outputs. All of our checks use the one with --config
specified so thats likely what I ran
dailp-encoding/terraform/user-roles.nix Line 26 in 863bf0d
Ah... fixing this in a new branch now |
|
||
async function uploadAudioAndReset(data: Blob) { | ||
const success = await uploadAudio(data) | ||
if (success) { |
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.
Should we notify the user if this fails, or at least log an error in the console?
<div | ||
style={{ | ||
position: "absolute", | ||
top: 0, | ||
left: 0, | ||
bottom: 0, | ||
right: 0, | ||
background: "rgba(255,255,255,0.65)", | ||
color: "black", | ||
padding: 40, | ||
backdropFilter: "blur(2px)", | ||
border: `4px solid ${border}`, | ||
}} | ||
> |
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.
Please make this change
@@ -323,5 +418,5 @@ async function uploadContributorAudioToS3(user: CognitoUser, data: Blob) { | |||
}) | |||
) | |||
|
|||
return { resourceUrl: `https://d1q0qkah8ttfau.cloudfront.net/${key}` } | |||
return { resourceUrl: `https://${process.env["CF_URL"]}/${key}` } |
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.
Does the cloudflare url have https://
at the front or no? I found some code from @GracefulLemming from four months ago where we started prepending https://
in a backend process. I'm struggling to find where this secret is managed.
TODO
NotAuthorizedException: Token is not from a supported provider of this identity pool.
contributors.tsx
needs to be broken up