From 5a892e9c42ae2a6ffcb098c7073fb1bd498bb4dd Mon Sep 17 00:00:00 2001 From: Anton Kulyk <kuliks.anton@gmail.com> Date: Thu, 3 Jun 2021 19:40:46 +0300 Subject: [PATCH] Fix "Edit collection permissions" btn disappeared (#16339) --- .../collections/containers/CollectionContent.jsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontend/src/metabase/collections/containers/CollectionContent.jsx b/frontend/src/metabase/collections/containers/CollectionContent.jsx index 1c9abca5178..f39657a082f 100644 --- a/frontend/src/metabase/collections/containers/CollectionContent.jsx +++ b/frontend/src/metabase/collections/containers/CollectionContent.jsx @@ -3,10 +3,13 @@ import React, { useState, useCallback } from "react"; import { Box } from "grid-styled"; import _ from "underscore"; import { withRouter } from "react-router"; +import { connect } from "react-redux"; import Collection from "metabase/entities/collections"; import Search from "metabase/entities/search"; +import { getUserIsAdmin } from "metabase/selectors/user"; + import BulkActions from "metabase/collections/components/BulkActions"; import Header from "metabase/collections/components/Header"; import ItemList from "metabase/collections/components/ItemList"; @@ -34,6 +37,12 @@ const getModelsByFilter = filter => { const itemKeyFn = item => `${item.id}:${item.model}`; +function mapStateToProps(state) { + return { + isAdmin: getUserIsAdmin(state), + }; +} + function CollectionContent({ collection, collectionId, @@ -230,5 +239,6 @@ export default _.compose( id: (_, props) => props.collectionId, reload: true, }), + connect(mapStateToProps), withRouter, )(CollectionContent); -- GitLab