-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into status-error-state
* main: @uppy/aws-s3: use `Promise.allSettled` insead of custom utils (#3079) Convert sets to arrays prior to using spread operator to enable transpilation to ES5 (#3297) Add showRecordingLength to webcam types (#3303) Required meta fields UI (#3285) Update BACKLOG.md Release [email protected] @uppy/[email protected]
- Loading branch information
Showing
14 changed files
with
167 additions
and
58 deletions.
There are no files selected for viewing
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
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
35 changes: 35 additions & 0 deletions
35
packages/@uppy/dashboard/src/components/FileItem/MetaErrorMessage.js
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,35 @@ | ||
const { h } = require('preact') | ||
|
||
const metaFieldIdToName = (metaFieldId, metaFields) => { | ||
const field = metaFields.filter(f => f.id === metaFieldId) | ||
return field[0].name | ||
} | ||
|
||
module.exports = function renderMissingMetaFieldsError (props) { | ||
const { file, toggleFileCard, i18n, metaFields } = props | ||
const { missingRequiredMetaFields } = file | ||
if (!missingRequiredMetaFields?.length) { | ||
return null | ||
} | ||
|
||
const metaFieldsString = missingRequiredMetaFields.map(missingMetaField => ( | ||
metaFieldIdToName(missingMetaField, metaFields) | ||
)).join(', ') | ||
|
||
return ( | ||
<div className="uppy-Dashboard-Item-errorMessage"> | ||
{i18n('missingRequiredMetaFields', { | ||
smart_count: missingRequiredMetaFields.length, | ||
fields: metaFieldsString, | ||
})} | ||
{' '} | ||
<button | ||
type="button" | ||
class="uppy-u-reset uppy-Dashboard-Item-errorMessageBtn" | ||
onClick={() => toggleFileCard(true, file.id)} | ||
> | ||
{i18n('editFile')} | ||
</button> | ||
</div> | ||
) | ||
} |
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
Oops, something went wrong.