X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/f024fc6c50ad0473674ebb6e30ab227b98c5b661..bf5703f285ed90bb3334f531ce0a46e5e00d122f:/src/views-components/details-panel/collection-details.tsx?ds=inline

diff --git a/src/views-components/details-panel/collection-details.tsx b/src/views-components/details-panel/collection-details.tsx
index f2b599e7..4431465b 100644
--- a/src/views-components/details-panel/collection-details.tsx
+++ b/src/views-components/details-panel/collection-details.tsx
@@ -8,7 +8,7 @@ import { CollectionResource } from 'models/collection';
 import { DetailsData } from "./details-data";
 import { CollectionDetailsAttributes } from 'views/collection-panel/collection-panel';
 import { RootState } from 'store/store';
-import { filterResources, getResource } from 'store/resources/resources';
+import { filterResources, getResource, ResourcesState } from 'store/resources/resources';
 import { connect } from 'react-redux';
 import { Button, Grid, ListItem, StyleRulesCallback, Typography, withStyles, WithStyles } from '@material-ui/core';
 import { formatDate, formatFileSize } from 'common/formatters';
@@ -17,8 +17,14 @@ import { Dispatch } from 'redux';
 import { navigateTo } from 'store/navigation/navigation-action';
 import { openContextMenu, resourceUuidToContextMenuKind } from 'store/context-menu/context-menu-actions';
 import { openCollectionUpdateDialog } from 'store/collections/collection-update-actions';
+import { resourceIsFrozen } from 'common/frozen-resources';
 
-export type CssRules = 'versionBrowserHeader' | 'versionBrowserItem' | 'versionBrowserField' | 'editIcon';
+export type CssRules = 'versionBrowserHeader'
+    | 'versionBrowserItem'
+    | 'versionBrowserField'
+    | 'editButton'
+    | 'editIcon'
+    | 'tag';
 
 const styles: StyleRulesCallback<CssRules> = theme => ({
     versionBrowserHeader: {
@@ -35,6 +41,15 @@ const styles: StyleRulesCallback<CssRules> = theme => ({
         paddingRight: theme.spacing.unit/2,
         fontSize: '1.125rem',
     },
+    editButton: {
+        boxShadow: 'none',
+        padding: '2px 10px 2px 5px',
+        fontSize: '0.75rem'
+    },
+    tag: {
+        marginRight: theme.spacing.unit / 2,
+        marginBottom: theme.spacing.unit / 2
+    },
 });
 
 export class CollectionDetails extends DetailsData<CollectionResource> {
@@ -68,6 +83,7 @@ export class CollectionDetails extends DetailsData<CollectionResource> {
 }
 
 interface CollectionInfoDataProps {
+    resources: ResourcesState;
     currentCollection: CollectionResource | undefined;
 }
 
@@ -77,6 +93,7 @@ interface CollectionInfoDispatchProps {
 
 const ciMapStateToProps = (state: RootState): CollectionInfoDataProps => {
     return {
+        resources: state.resources,
         currentCollection: getResource<CollectionResource>(state.detailsPanel.resourceUuid)(state.resources),
     };
 };
@@ -96,13 +113,17 @@ type CollectionInfoProps = CollectionInfoDataProps & CollectionInfoDispatchProps
 
 const CollectionInfo = withStyles(styles)(
     connect(ciMapStateToProps, ciMapDispatchToProps)(
-        ({ currentCollection, editCollection, classes }: CollectionInfoProps) =>
+        ({ currentCollection, resources, editCollection, classes }: CollectionInfoProps) =>
             currentCollection !== undefined
                 ? <div>
-                    <Button data-cy='details-panel-edit-btn' onClick={() => editCollection(currentCollection)}>
+                    <Button
+                        disabled={resourceIsFrozen(currentCollection, resources)}
+                        className={classes.editButton} variant='contained'
+                        data-cy='details-panel-edit-btn' color='primary' size='small'
+                        onClick={() => editCollection(currentCollection)}>
                         <RenameIcon className={classes.editIcon} /> Edit
                     </Button>
-                    <CollectionDetailsAttributes twoCol={false} item={currentCollection} />
+                    <CollectionDetailsAttributes classes={classes} twoCol={false} item={currentCollection} />
                 </div>
                 : <div />
     )
