// Copyright (C) The Arvados Authors. All rights reserved. // // SPDX-License-Identifier: AGPL-3.0 import React from "react"; import { Dialog, DialogTitle, DialogContent, DialogActions, Button, Typography, Grid } from "@material-ui/core"; import { WithDialogProps } from "store/dialog/with-dialog"; import { withDialog } from 'store/dialog/with-dialog'; import { REPOSITORY_ATTRIBUTES_DIALOG } from "store/repositories/repositories-actions"; import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles'; import { ArvadosTheme } from 'common/custom-theme'; import { compose } from "redux"; import { RepositoryResource } from "models/repositories"; type CssRules = 'rightContainer' | 'leftContainer' | 'spacing'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ rightContainer: { textAlign: 'right', paddingRight: theme.spacing.unit * 2, color: theme.palette.grey["500"] }, leftContainer: { textAlign: 'left', paddingLeft: theme.spacing.unit * 2 }, spacing: { paddingTop: theme.spacing.unit * 2 }, }); interface RepositoryAttributesDataProps { repositoryData: RepositoryResource; } type RepositoryAttributesProps = RepositoryAttributesDataProps & WithStyles; export const RepositoryAttributesDialog = compose( withDialog(REPOSITORY_ATTRIBUTES_DIALOG), withStyles(styles))( (props: WithDialogProps & RepositoryAttributesProps) => Attributes {props.data.repositoryData && attributes(props.data.repositoryData, props.classes)} ); const attributes = (repositoryData: RepositoryResource, classes: any) => { const { uuid, ownerUuid, createdAt, modifiedAt, modifiedByUserUuid, name } = repositoryData; return ( Name Owner uuid Created at Modified at Modified by user uuid uuid {name} {ownerUuid} {createdAt} {modifiedAt} {modifiedByUserUuid} {uuid} ); };