Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
cbbf6874
Commit
cbbf6874
authored
7 years ago
by
Tom Robinson
Browse files
Options
Downloads
Patches
Plain Diff
Auto Dashboard: only show save button to admins
parent
8f511237
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/src/metabase/dashboard/containers/AutomaticDashboardApp.jsx
+14
-8
14 additions, 8 deletions
...c/metabase/dashboard/containers/AutomaticDashboardApp.jsx
with
14 additions
and
8 deletions
frontend/src/metabase/dashboard/containers/AutomaticDashboardApp.jsx
+
14
−
8
View file @
cbbf6874
...
...
@@ -18,9 +18,11 @@ import { Dashboard } from "metabase/dashboard/containers/Dashboard";
import
DashboardData
from
"
metabase/dashboard/hoc/DashboardData
"
;
import
Parameters
from
"
metabase/parameters/components/Parameters
"
;
import
{
getMetadata
}
from
"
metabase/selectors/metadata
"
;
import
{
addUndo
,
createUndo
}
from
"
metabase/redux/undo
"
;
import
{
getMetadata
}
from
"
metabase/selectors/metadata
"
;
import
{
getUserIsAdmin
}
from
"
metabase/selectors/user
"
;
import
{
DashboardApi
}
from
"
metabase/services
"
;
import
*
as
Urls
from
"
metabase/lib/urls
"
;
...
...
@@ -32,6 +34,7 @@ const getDashboardId = (state, { params: { splat }, location: { hash } }) =>
`/auto/dashboard/
${
splat
}${
hash
.
replace
(
/^#
?
/
,
"
?
"
)}
`
;
const
mapStateToProps
=
(
state
,
props
)
=>
({
isAdmin
:
getUserIsAdmin
(
state
),
metadata
:
getMetadata
(
state
),
dashboardId
:
getDashboardId
(
state
,
props
),
});
...
...
@@ -73,6 +76,7 @@ class AutomaticDashboardApp extends React.Component {
parameterValues
,
setParameterValue
,
location
,
isAdmin
,
}
=
this
.
props
;
// pull out "more" related items for displaying as a button at the bottom of the dashboard
const
more
=
dashboard
&&
dashboard
.
related
&&
dashboard
.
related
[
"
more
"
];
...
...
@@ -93,13 +97,15 @@ class AutomaticDashboardApp extends React.Component {
<
TransientFilters
filters
=
{
dashboard
.
transient_filters
}
/>
)
}
</
div
>
<
ActionButton
className
=
"ml-auto Button--success"
borderless
actionFn
=
{
this
.
save
}
>
Save this
</
ActionButton
>
{
isAdmin
&&
(
<
ActionButton
className
=
"ml-auto Button--success"
borderless
actionFn
=
{
this
.
save
}
>
Save this
</
ActionButton
>
)
}
</
div
>
</
div
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment