-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:quiltdata/quilt into bucket-admin…
…-link
- Loading branch information
Showing
12 changed files
with
166 additions
and
116 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 was deleted.
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
43 changes: 43 additions & 0 deletions
43
catalog/app/containers/Bucket/PackageDialog/MetaInputErrorHelper.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,43 @@ | ||
import * as React from 'react' | ||
import * as M from '@material-ui/core' | ||
import * as Lab from '@material-ui/lab' | ||
|
||
const useStyles = M.makeStyles((t) => ({ | ||
code: { | ||
backgroundColor: t.palette.error.light, | ||
border: `1px solid ${t.palette.error.dark}`, | ||
borderRadius: '2px', | ||
color: t.palette.error.contrastText, | ||
marginRight: '6px', | ||
padding: '1px 2px', | ||
}, | ||
})) | ||
|
||
function SingleError({ error }) { | ||
const classes = useStyles() | ||
|
||
return ( | ||
<Lab.Alert severity="error"> | ||
{error.dataPath && ( | ||
<> | ||
<code className={classes.code}>{error.dataPath}</code> | ||
</> | ||
)} | ||
{error.message} | ||
</Lab.Alert> | ||
) | ||
} | ||
|
||
export default function ErrorHelper({ className, error }) { | ||
if (!error) return null | ||
|
||
return ( | ||
<div className={className}> | ||
{Array.isArray(error) ? ( | ||
error.map((e) => <SingleError error={e} key={e.dataPath + e.message} />) | ||
) : ( | ||
<SingleError error={error} /> | ||
)} | ||
</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
Oops, something went wrong.