|
| 1 | +import { Application, selectById } from "~/modules/applications"; |
1 | 2 | import {
|
2 | 3 | Button,
|
3 | 4 | CircularProgress,
|
4 | 5 | Dialog,
|
5 | 6 | DialogActions,
|
6 | 7 | DialogContent,
|
7 | 8 | DialogTitle,
|
8 |
| - makeStyles, |
9 | 9 | Typography,
|
| 10 | + makeStyles, |
10 | 11 | } 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"; |
17 | 13 | 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"; |
20 | 14 | import {
|
21 | 15 | clearDeletingApp,
|
22 | 16 | deleteApplication,
|
23 | 17 | } 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"; |
24 | 23 | import { addToast } from "~/modules/toasts";
|
| 24 | +import { red } from "@material-ui/core/colors"; |
| 25 | +import { shallowEqual } from "react-redux"; |
25 | 26 | import { useStyles as useButtonStyles } from "~/styles/button";
|
26 | 27 |
|
27 | 28 | const useStyles = makeStyles((theme) => ({
|
28 | 29 | applicationName: {
|
29 | 30 | color: theme.palette.text.primary,
|
30 | 31 | fontWeight: theme.typography.fontWeightMedium,
|
31 | 32 | },
|
| 33 | + applicationLabels: { |
| 34 | + color: theme.palette.text.primary, |
| 35 | + fontWeight: theme.typography.fontWeightMedium, |
| 36 | + }, |
32 | 37 | description: {
|
33 | 38 | marginBottom: theme.spacing(2),
|
34 | 39 | },
|
@@ -104,6 +109,24 @@ export const DeleteApplicationDialog: FC<DeleteApplicationDialogProps> = memo(
|
104 | 109 | <Skeleton height={24} width={200} />
|
105 | 110 | )}
|
106 | 111 | </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> |
107 | 130 | </DialogContent>
|
108 | 131 | <DialogActions>
|
109 | 132 | <Button onClick={handleCancel} disabled={isDeleting}>
|
|
0 commit comments