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
d83a3bf1
Commit
d83a3bf1
authored
6 years ago
by
Tom Robinson
Browse files
Options
Downloads
Patches
Plain Diff
Auto Dashboard: disable save button after saving
parent
cbbf6874
No related branches found
Branches containing commit
No related tags found
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
+13
-4
13 additions, 4 deletions
...c/metabase/dashboard/containers/AutomaticDashboardApp.jsx
with
13 additions
and
4 deletions
frontend/src/metabase/dashboard/containers/AutomaticDashboardApp.jsx
+
13
−
4
View file @
d83a3bf1
...
...
@@ -42,6 +42,10 @@ const mapStateToProps = (state, props) => ({
@
connect
(
mapStateToProps
,
{
addUndo
,
createUndo
})
@
DashboardData
class
AutomaticDashboardApp
extends
React
.
Component
{
state
=
{
savedDashboardId
:
null
,
};
componentDidUpdate
(
prevProps
)
{
// scroll to the top when the pathname changes
if
(
prevProps
.
location
.
pathname
!==
this
.
props
.
location
.
pathname
)
{
...
...
@@ -67,6 +71,7 @@ class AutomaticDashboardApp extends React.Component {
action
:
null
,
}),
);
this
.
setState
({
savedDashboardId
:
newDashboard
.
id
});
};
render
()
{
...
...
@@ -78,6 +83,7 @@ class AutomaticDashboardApp extends React.Component {
location
,
isAdmin
,
}
=
this
.
props
;
const
{
savedDashboardId
}
=
this
.
state
;
// pull out "more" related items for displaying as a button at the bottom of the dashboard
const
more
=
dashboard
&&
dashboard
.
related
&&
dashboard
.
related
[
"
more
"
];
const
related
=
dashboard
&&
_
.
omit
(
dashboard
.
related
,
"
more
"
);
...
...
@@ -97,15 +103,18 @@ class AutomaticDashboardApp extends React.Component {
<
TransientFilters
filters
=
{
dashboard
.
transient_filters
}
/>
)
}
</
div
>
{
isAdmin
&&
(
{
savedDashboardId
!=
null
?
(
<
Button
className
=
"ml-auto"
disabled
>
{
t
`Saved`
}
</
Button
>
)
:
isAdmin
?
(
<
ActionButton
className
=
"ml-auto Button--success"
className
=
"ml-auto"
success
borderless
actionFn
=
{
this
.
save
}
>
Save this
{
t
`
Save this
`
}
</
ActionButton
>
)
}
)
:
null
}
</
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