Merge pull request #873 from LaurenceJJones/fix-default-image-delete
fix: hide delete overlay for default app images
This commit is contained in:
commit
2a6f9fbc7c
|
|
@ -431,6 +431,7 @@ func (a *ApplicationAPI) RemoveApplicationImage(ctx *gin.Context) {
|
||||||
|
|
||||||
func withResolvedImage(app *model.Application) *model.Application {
|
func withResolvedImage(app *model.Application) *model.Application {
|
||||||
if app.Image == "" {
|
if app.Image == "" {
|
||||||
|
// This must stay in sync with the isDefaultImage check in ui/src/application/Applications.tsx.
|
||||||
app.Image = "static/defaultapp.png"
|
app.Image = "static/defaultapp.png"
|
||||||
} else {
|
} else {
|
||||||
app.Image = "image/" + app.Image
|
app.Image = "image/" + app.Image
|
||||||
|
|
|
||||||
|
|
@ -197,12 +197,16 @@ const Row = ({
|
||||||
fEdit,
|
fEdit,
|
||||||
}: IRowProps) => {
|
}: IRowProps) => {
|
||||||
const {classes} = useStyles();
|
const {classes} = useStyles();
|
||||||
|
const isDefaultImage = image === 'static/defaultapp.png';
|
||||||
return (
|
return (
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell padding="normal">
|
<TableCell padding="normal">
|
||||||
<div style={{display: 'flex'}}>
|
<div style={{display: 'flex'}}>
|
||||||
<Tooltip title="Delete image" placement="top" arrow>
|
<Tooltip title="Delete image" placement="top" arrow>
|
||||||
<ButtonBase className={classes.imageContainer} onClick={fDeleteImage}>
|
<ButtonBase
|
||||||
|
className={classes.imageContainer}
|
||||||
|
onClick={fDeleteImage}
|
||||||
|
disabled={isDefaultImage}>
|
||||||
<img
|
<img
|
||||||
src={config.get('url') + image}
|
src={config.get('url') + image}
|
||||||
alt="app logo"
|
alt="app logo"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue