From a6e83a8e7ba34c1a2b2540d5790d0d273364380e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Kuty=C5=82a?= Date: Wed, 17 Aug 2022 09:06:15 +0200 Subject: [PATCH] 18692: Fixed collection beeing editable within the details panel MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła --- .../details-panel/collection-details.tsx | 8 ++++++-- .../details-panel/details-panel.tsx | 9 +++++++++ .../details-panel/project-details.tsx | 14 ++++++++++++-- src/views/collection-panel/collection-panel.tsx | 6 ++++++ 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/views-components/details-panel/collection-details.tsx b/src/views-components/details-panel/collection-details.tsx index 5edfbc37e1..4431465b87 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,6 +17,7 @@ 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' @@ -82,6 +83,7 @@ export class CollectionDetails extends DetailsData { } interface CollectionInfoDataProps { + resources: ResourcesState; currentCollection: CollectionResource | undefined; } @@ -91,6 +93,7 @@ interface CollectionInfoDispatchProps { const ciMapStateToProps = (state: RootState): CollectionInfoDataProps => { return { + resources: state.resources, currentCollection: getResource(state.detailsPanel.resourceUuid)(state.resources), }; }; @@ -110,10 +113,11 @@ type CollectionInfoProps = CollectionInfoDataProps & CollectionInfoDispatchProps const CollectionInfo = withStyles(styles)( connect(ciMapStateToProps, ciMapDispatchToProps)( - ({ currentCollection, editCollection, classes }: CollectionInfoProps) => + ({ currentCollection, resources, editCollection, classes }: CollectionInfoProps) => currentCollection !== undefined ?