1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import React from "react";
6 import { Dialog, DialogTitle, DialogContent, DialogActions, Button, Typography, Grid } from "@mui/material";
7 import { WithDialogProps } from "store/dialog/with-dialog";
8 import { withDialog } from 'store/dialog/with-dialog';
9 import { REPOSITORY_ATTRIBUTES_DIALOG } from "store/repositories/repositories-actions";
10 import { CustomStyleRulesCallback } from 'common/custom-theme';
11 import { WithStyles } from '@mui/styles';
12 import withStyles from '@mui/styles/withStyles';
13 import { ArvadosTheme } from 'common/custom-theme';
14 import { compose } from "redux";
15 import { RepositoryResource } from "models/repositories";
17 type CssRules = 'rightContainer' | 'leftContainer' | 'spacing';
19 const styles: CustomStyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
22 paddingRight: theme.spacing(2),
23 color: theme.palette.grey["500"]
27 paddingLeft: theme.spacing(2)
30 paddingTop: theme.spacing(2)
34 interface RepositoryAttributesDataProps {
35 repositoryData: RepositoryResource;
38 type RepositoryAttributesProps = RepositoryAttributesDataProps & WithStyles<CssRules>;
40 export const RepositoryAttributesDialog = compose(
41 withDialog(REPOSITORY_ATTRIBUTES_DIALOG),
43 (props: WithDialogProps<RepositoryAttributesProps> & RepositoryAttributesProps) =>
44 <Dialog open={props.open}
45 onClose={props.closeDialog}
48 <DialogTitle>Attributes</DialogTitle>
50 <Typography variant='body1' className={props.classes.spacing}>
51 {props.data.repositoryData && attributes(props.data.repositoryData, props.classes)}
58 onClick={props.closeDialog}>
65 const attributes = (repositoryData: RepositoryResource, classes: any) => {
66 const { uuid, ownerUuid, createdAt, modifiedAt, modifiedByUserUuid, name } = repositoryData;
69 <Grid container direction="row">
70 <Grid item xs={5} className={classes.rightContainer}>
71 <Grid item>Name</Grid>
72 <Grid item>Owner uuid</Grid>
73 <Grid item>Created at</Grid>
74 <Grid item>Modified at</Grid>
75 <Grid item>Modified by user uuid</Grid>
76 <Grid item>uuid</Grid>
78 <Grid item xs={7} className={classes.leftContainer}>
79 <Grid item>{name}</Grid>
80 <Grid item>{ownerUuid}</Grid>
81 <Grid item>{createdAt}</Grid>
82 <Grid item>{modifiedAt}</Grid>
83 <Grid item>{modifiedByUserUuid}</Grid>
84 <Grid item>{uuid}</Grid>