From 1407a0a37c9c03528deebd392d0b24509a44b7f8 Mon Sep 17 00:00:00 2001 From: Matija Obreza Date: Mon, 22 Oct 2018 08:27:26 +0200 Subject: [PATCH] Fix: Permissions button in Dashboard not working --- src/datasets/ui/DashboardPage.tsx | 1 + src/descriptorlists/ui/DashboardPage.tsx | 2 ++ src/descriptors/ui/DashboardPage.tsx | 1 + src/ui/catalog/dashboard/MyDataPage.tsx | 4 +++- src/ui/catalog/dashboard/c/DashboardTableRow.tsx | 4 ++-- src/ui/catalog/dashboard/c/MyDataTable.tsx | 3 +++ 6 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/datasets/ui/DashboardPage.tsx b/src/datasets/ui/DashboardPage.tsx index 1067f10..33eab98 100644 --- a/src/datasets/ui/DashboardPage.tsx +++ b/src/datasets/ui/DashboardPage.tsx @@ -29,6 +29,7 @@ class DashboardPage extends BaseMyDataPage { const mapStateToProps = (state, ownProps) => ({ paged: state.datasets.dashboard.paged, tab: 'datasets', + dataClassName: Dataset.clazz, }); const mapDispatchToProps = (dispatch) => bindActionCreators({ diff --git a/src/descriptorlists/ui/DashboardPage.tsx b/src/descriptorlists/ui/DashboardPage.tsx index 7cba81b..94dd09c 100644 --- a/src/descriptorlists/ui/DashboardPage.tsx +++ b/src/descriptorlists/ui/DashboardPage.tsx @@ -7,6 +7,7 @@ import BaseMyDataPage from 'ui/catalog/dashboard/MyDataPage'; import {listMyDescriptorLists, approveDescriptorList, deleteDescriptorList, unpublishDescriptorList, publishDescriptorList} from 'descriptorlists/actions/dashboard'; import {DescriptorListLink} from 'ui/catalog/Links'; import {PublishState} from 'model/common.model'; +import DescriptorList from 'model/catalog/DescriptorList'; const renderDataLink = ({row, children}) => ({ children }); @@ -27,6 +28,7 @@ class DashboardPage extends BaseMyDataPage { const mapStateToProps = (state, ownProps) => ({ paged: state.descriptorList.dashboard.paged, tab: 'descriptorlists', + dataClassName: DescriptorList.clazz, }); const mapDispatchToProps = (dispatch) => bindActionCreators({ diff --git a/src/descriptors/ui/DashboardPage.tsx b/src/descriptors/ui/DashboardPage.tsx index f2d8efe..e5b58af 100644 --- a/src/descriptors/ui/DashboardPage.tsx +++ b/src/descriptors/ui/DashboardPage.tsx @@ -30,6 +30,7 @@ class DashboardPage extends BaseMyDataPage { const mapStateToProps = (state, ownProps) => ({ paged: state.descriptors.dashboard.paged, tab: 'descriptors', + dataClassName: Descriptor.clazz, filterComponent: DashboardDescriptorFilters, }); diff --git a/src/ui/catalog/dashboard/MyDataPage.tsx b/src/ui/catalog/dashboard/MyDataPage.tsx index 3d4249d..3861dfe 100644 --- a/src/ui/catalog/dashboard/MyDataPage.tsx +++ b/src/ui/catalog/dashboard/MyDataPage.tsx @@ -28,6 +28,7 @@ interface IDataPublishedContainerProps extends React.ClassAttributes { basePath: string; filterCodeToUrl: any; listData: any; + dataClassName: string; renderDataLink: any; setPageTitle: (title: string) => void; addToEditList: (item: any) => void; @@ -138,7 +139,7 @@ class BaseMyDataPage extends React.Component extends React.Component { } public render() { - const {row, tab, index, isEditMode, DataLink} = this.props; + const { row, tab, index, isEditMode, DataLink, dataClassName } = this.props; const { inEditList } = this.state; return ( @@ -78,7 +78,7 @@ export class DashboardTableRow extends React.Component { { row._permissions.manage && - + } diff --git a/src/ui/catalog/dashboard/c/MyDataTable.tsx b/src/ui/catalog/dashboard/c/MyDataTable.tsx index 628b8f6..2340a78 100644 --- a/src/ui/catalog/dashboard/c/MyDataTable.tsx +++ b/src/ui/catalog/dashboard/c/MyDataTable.tsx @@ -36,6 +36,7 @@ interface IMyDataTableProps extends React.Props { onPaginationChange: (page: number, results: number, sortBy: string, dir?: string) => void; pageSort?: string; onFilter: (filter) => void; + dataClassName: string; renderDataLink: any; pagination: any; promiseListData: any; @@ -67,6 +68,7 @@ function MyDataTable({ onPaginationChange, onFilter, pagination, + dataClassName, renderDataLink, promiseListData, deleteAllAction, @@ -99,6 +101,7 @@ function MyDataTable({ inEditList={ _.includes(editList, row.uuid) } addToEditAction={ addToEditList } removeFromEditAction={ removeFromEditList } + dataClassName={ dataClassName } DataLink={ renderDataLink } /> ); -- GitLab