Skip to content

Commit d214bac

Browse files
committed
add labels to application delete dialog box
Signed-off-by: Harshit Gupta <[email protected]>
1 parent a306b3f commit d214bac

File tree

1 file changed

+32
-9
lines changed
  • web/src/components/applications-page/application-list/delete-application-dialog

1 file changed

+32
-9
lines changed

web/src/components/applications-page/application-list/delete-application-dialog/index.tsx

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,39 @@
1+
import { Application, selectById } from "~/modules/applications";
12
import {
23
Button,
34
CircularProgress,
45
Dialog,
56
DialogActions,
67
DialogContent,
78
DialogTitle,
8-
makeStyles,
99
Typography,
10+
makeStyles,
1011
} from "@material-ui/core";
11-
import { red } from "@material-ui/core/colors";
12-
import { Skeleton } from "@material-ui/lab";
13-
import Alert from "@material-ui/lab/Alert";
14-
import { FC, memo, useCallback } from "react";
15-
import { shallowEqual } from "react-redux";
16-
import { DELETE_APPLICATION_SUCCESS } from "~/constants/toast-text";
12+
import { FC, Fragment, memo, useCallback } from "react";
1713
import { UI_TEXT_CANCEL, UI_TEXT_DELETE } from "~/constants/ui-text";
18-
import { useAppSelector, useAppDispatch } from "~/hooks/redux";
19-
import { Application, selectById } from "~/modules/applications";
2014
import {
2115
clearDeletingApp,
2216
deleteApplication,
2317
} from "~/modules/delete-application";
18+
import { useAppDispatch, useAppSelector } from "~/hooks/redux";
19+
20+
import Alert from "@material-ui/lab/Alert";
21+
import { DELETE_APPLICATION_SUCCESS } from "~/constants/toast-text";
22+
import { Skeleton } from "@material-ui/lab";
2423
import { addToast } from "~/modules/toasts";
24+
import { red } from "@material-ui/core/colors";
25+
import { shallowEqual } from "react-redux";
2526
import { useStyles as useButtonStyles } from "~/styles/button";
2627

2728
const useStyles = makeStyles((theme) => ({
2829
applicationName: {
2930
color: theme.palette.text.primary,
3031
fontWeight: theme.typography.fontWeightMedium,
3132
},
33+
applicationLabels: {
34+
color: theme.palette.text.primary,
35+
fontWeight: theme.typography.fontWeightMedium,
36+
},
3237
description: {
3338
marginBottom: theme.spacing(2),
3439
},
@@ -104,6 +109,24 @@ export const DeleteApplicationDialog: FC<DeleteApplicationDialogProps> = memo(
104109
<Skeleton height={24} width={200} />
105110
)}
106111
</Typography>
112+
<div style={{ height: 24 }} /> {/* Spacer */}
113+
<Typography variant="caption">Labels</Typography>
114+
<Typography variant="body1" className={classes.applicationLabels}>
115+
{application ? (
116+
application.labelsMap.length !== 0 ? (
117+
application.labelsMap.map(([key, value]) => (
118+
<Fragment key={key}>
119+
<span>{key + ": " + value}</span>
120+
<br />
121+
</Fragment>
122+
))
123+
) : (
124+
"-"
125+
)
126+
) : (
127+
<Skeleton height={24} width={200} />
128+
)}
129+
</Typography>
107130
</DialogContent>
108131
<DialogActions>
109132
<Button onClick={handleCancel} disabled={isDeleting}>

0 commit comments

Comments
 (0)