X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/352e8d13baae99e7f4e9f1b88253d6988541fecb..f1158a80eae96784f909ad496487f5604fe95329:/src/views-components/data-explorer/renderers.tsx diff --git a/src/views-components/data-explorer/renderers.tsx b/src/views-components/data-explorer/renderers.tsx index 51b7dcc8..245a6597 100644 --- a/src/views-components/data-explorer/renderers.tsx +++ b/src/views-components/data-explorer/renderers.tsx @@ -3,10 +3,19 @@ // SPDX-License-Identifier: AGPL-3.0 import React from 'react'; -import { Grid, Typography, withStyles, Tooltip, IconButton, Checkbox } from '@material-ui/core'; +import { + Grid, + Typography, + withStyles, + Tooltip, + IconButton, + Checkbox, + Chip +} from '@material-ui/core'; import { FavoriteStar, PublicFavoriteStar } from '../favorite-star/favorite-star'; import { Resource, ResourceKind, TrashableResource } from 'models/resource'; import { + LockIcon, ProjectIcon, FilterGroupIcon, CollectionIcon, @@ -50,6 +59,8 @@ import { PermissionLevel } from 'models/permission'; import { openPermissionEditContextMenu } from 'store/context-menu/context-menu-actions'; import { getUserUuid } from 'common/getuser'; import { VirtualMachinesResource } from 'models/virtual-machines'; +import { CopyToClipboardSnackbar } from 'components/copy-to-clipboard-snackbar/copy-to-clipboard-snackbar'; +import { ProjectResource } from 'models/project'; const renderName = (dispatch: Dispatch, item: GroupContentsResource) => { @@ -70,11 +81,32 @@ const renderName = (dispatch: Dispatch, item: GroupContentsResource) => { + { + item.kind === ResourceKind.PROJECT && + } ; }; +const FrozenProject = (props: {item: ProjectResource}) => { + const [fullUsername, setFullusername] = React.useState(null); + const getFullName = React.useCallback(() => { + if (props.item.frozenByUuid) { + setFullusername(); + } + }, [props.item, setFullusername]) + + if (props.item.frozenByUuid) { + + return Project was frozen by {fullUsername}}> + + ; + } else { + return null; + } +} + export const ResourceName = connect( (state: RootState, props: { uuid: string }) => { const resource = getResource(props.uuid)(state.resources); @@ -192,15 +224,15 @@ export const UserResourceFullName = connect( return {item: resource || { uuid: '', firstName: '', lastName: '' }, link: props.link}; })((props: {item: {uuid: string, firstName: string, lastName: string}, link?: boolean} & DispatchProp) => renderFullName(props.dispatch, props.item, props.link)); - const renderUuid = (item: { uuid: string }) => - {item.uuid}; + + {item.uuid} + + ; -export const ResourceUuid = connect( - (state: RootState, props: { uuid: string }) => { - const resource = getResource(props.uuid)(state.resources); - return resource || { uuid: '' }; - })(renderUuid); +export const ResourceUuid = connect((state: RootState, props: { uuid: string }) => ( + getResource(props.uuid)(state.resources) || { uuid: '' } + ))(renderUuid); const renderEmail = (item: { email: string }) => {item.email}; @@ -219,16 +251,16 @@ enum UserAccountStatus { } const renderAccountStatus = (props: {status: UserAccountStatus}) => - + {(() => { switch(props.status) { case UserAccountStatus.ACTIVE: - return ; + return ; case UserAccountStatus.SETUP: - return ; + return ; case UserAccountStatus.INACTIVE: - return ; + return ; default: return <>; } @@ -725,7 +757,7 @@ export const ResourceOwnerWithName = export const UserNameFromID = compose(userFromID)( - (props: { uuid: string, userFullname: string, dispatch: Dispatch }) => { + (props: { uuid: string, displayAsText?: string, userFullname: string, dispatch: Dispatch }) => { const { uuid, userFullname, dispatch } = props; if (userFullname === '') { @@ -824,14 +856,21 @@ export const ProcessStatus = compose( return { process: getProcess(props.uuid)(state.resources) }; }), withStyles({}, { withTheme: true })) - ((props: { process?: Process, theme: ArvadosTheme }) => { - const status = props.process ? getProcessStatus(props.process) : "-"; - return - {status} - ; - }); + ((props: { process?: Process, theme: ArvadosTheme }) => + props.process + ? + : - + ); export const ProcessStartDate = connect( (state: RootState, props: { uuid: string }) => {