projects
/
arvados-workbench2.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
15736: Don't allow user to delete local/federation sessions
[arvados-workbench2.git]
/
src
/
views
/
site-manager-panel
/
site-manager-panel-root.tsx
diff --git
a/src/views/site-manager-panel/site-manager-panel-root.tsx
b/src/views/site-manager-panel/site-manager-panel-root.tsx
index f402211121450d7e59a484514beaffe0fbfb6a74..223e373c58187e34bd3b3f5ea8dfce7ae1c9ec88 100644
(file)
--- a/
src/views/site-manager-panel/site-manager-panel-root.tsx
+++ b/
src/views/site-manager-panel/site-manager-panel-root.tsx
@@
-8,6
+8,7
@@
import {
CardContent,
CircularProgress,
Grid,
CardContent,
CircularProgress,
Grid,
+ IconButton,
StyleRulesCallback,
Table,
TableBody,
StyleRulesCallback,
Table,
TableBody,
@@
-28,6
+29,7
@@
import { addSession } from "~/store/auth/auth-action-session";
import { SITE_MANAGER_REMOTE_HOST_VALIDATION } from "~/validators/validators";
import { Config } from '~/common/config';
import { ResourceCluster } from '~/views-components/data-explorer/renderers';
import { SITE_MANAGER_REMOTE_HOST_VALIDATION } from "~/validators/validators";
import { Config } from '~/common/config';
import { ResourceCluster } from '~/views-components/data-explorer/renderers';
+import { TrashIcon } from "~/components/icon/icon";
type CssRules = 'root' | 'link' | 'buttonContainer' | 'table' | 'tableRow' |
'remoteSiteInfo' | 'buttonAdd' | 'buttonLoggedIn' | 'buttonLoggedOut' |
type CssRules = 'root' | 'link' | 'buttonContainer' | 'table' | 'tableRow' |
'remoteSiteInfo' | 'buttonAdd' | 'buttonLoggedIn' | 'buttonLoggedOut' |
@@
-86,11
+88,13
@@
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
export interface SiteManagerPanelRootActionProps {
toggleSession: (session: Session) => void;
export interface SiteManagerPanelRootActionProps {
toggleSession: (session: Session) => void;
+ removeSession: (session: Session) => void;
}
export interface SiteManagerPanelRootDataProps {
sessions: Session[];
remoteHostsConfig: { [key: string]: Config };
}
export interface SiteManagerPanelRootDataProps {
sessions: Session[];
remoteHostsConfig: { [key: string]: Config };
+ localClusterConfig: Config;
}
type SiteManagerPanelRootProps = SiteManagerPanelRootDataProps & SiteManagerPanelRootActionProps & WithStyles<CssRules> & InjectedFormProps;
}
type SiteManagerPanelRootProps = SiteManagerPanelRootDataProps & SiteManagerPanelRootActionProps & WithStyles<CssRules> & InjectedFormProps;
@@
-117,7
+121,7
@@
export const SiteManagerPanelRoot = compose(
}
}),
withStyles(styles))
}
}),
withStyles(styles))
- (({ classes, sessions, handleSubmit, toggleSession, remoteHostsConfig }: SiteManagerPanelRootProps) =>
+ (({ classes, sessions, handleSubmit, toggleSession, remo
veSession, localClusterConfig, remo
teHostsConfig }: SiteManagerPanelRootProps) =>
<Card className={classes.root}>
<CardContent>
<Grid container direction="row">
<Card className={classes.root}>
<CardContent>
<Grid container direction="row">
@@
-136,6
+140,7
@@
export const SiteManagerPanelRoot = compose(
<TableCell>Email</TableCell>
<TableCell>UUID</TableCell>
<TableCell>Status</TableCell>
<TableCell>Email</TableCell>
<TableCell>UUID</TableCell>
<TableCell>Status</TableCell>
+ <TableCell>Actions</TableCell>
</TableRow>
</TableHead>
<TableBody>
</TableRow>
</TableHead>
<TableBody>
@@
-156,6
+161,13
@@
export const SiteManagerPanelRoot = compose(
{validating ? "Validating" : (session.loggedIn ? "Logged in" : "Logged out")}
</Button>
</TableCell>
{validating ? "Validating" : (session.loggedIn ? "Logged in" : "Logged out")}
</Button>
</TableCell>
+ <TableCell>
+ {session.clusterId !== localClusterConfig.uuidPrefix &&
+ !localClusterConfig.clusterConfig.RemoteClusters[session.clusterId] &&
+ <IconButton onClick={() => removeSession(session)}>
+ <TrashIcon />
+ </IconButton>}
+ </TableCell>
</TableRow>;
})}
</TableBody>
</TableRow>;
})}
</TableBody>