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
6e4f6d2c
Commit
6e4f6d2c
authored
8 years ago
by
Tom Robinson
Browse files
Options
Downloads
Patches
Plain Diff
Reset dashboard state when loading a dashboard
parent
e153be9e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/metabase/dashboard/components/Dashboard.jsx
+2
-0
2 additions, 0 deletions
frontend/src/metabase/dashboard/components/Dashboard.jsx
frontend/src/metabase/dashboard/dashboard.js
+7
-1
7 additions, 1 deletion
frontend/src/metabase/dashboard/dashboard.js
with
9 additions
and
1 deletion
frontend/src/metabase/dashboard/components/Dashboard.jsx
+
2
−
0
View file @
6e4f6d2c
...
...
@@ -99,6 +99,8 @@ export default class Dashboard extends Component {
}
async
loadDashboard
(
dashboardId
)
{
this
.
props
.
initialize
();
this
.
loadParams
();
const
{
addCardOnLoad
,
fetchDashboard
,
fetchCards
,
addCardToDashboard
,
onChangeLocation
,
location
}
=
this
.
props
;
...
...
This diff is collapsed.
Click to expand it.
frontend/src/metabase/dashboard/dashboard.js
+
7
−
1
View file @
6e4f6d2c
...
...
@@ -22,9 +22,10 @@ dashboard.define({
ordered_cards
:
arrayOf
(
dashcard
)
});
// action constants
export
const
INITIALIZE
=
"
metabase/dashboard/INITIALIZE
"
;
// action constants
export
const
SET_EDITING_DASHBOARD
=
"
metabase/dashboard/SET_EDITING_DASHBOARD
"
;
export
const
FETCH_CARDS
=
"
metabase/dashboard/FETCH_CARDS
"
;
...
...
@@ -74,6 +75,7 @@ const RevisionApi = new AngularResourceProxy("Revision", ["list", "revert"]);
// action creators
export
const
initialize
=
createAction
(
INITIALIZE
);
export
const
setEditingDashboard
=
createAction
(
SET_EDITING_DASHBOARD
);
export
const
markNewCardSeen
=
createAction
(
MARK_NEW_CARD_SEEN
);
...
...
@@ -356,10 +358,12 @@ export const removeParameter = createThunkAction(REMOVE_PARAMETER, (parameterId)
// reducers
const
dashboardId
=
handleActions
({
[
INITIALIZE
]:
{
next
:
(
state
)
=>
null
},
[
SET_DASHBOARD_ID
]:
{
next
:
(
state
,
{
payload
})
=>
payload
}
},
null
);
const
isEditing
=
handleActions
({
[
INITIALIZE
]:
{
next
:
(
state
)
=>
false
},
[
SET_EDITING_DASHBOARD
]:
{
next
:
(
state
,
{
payload
})
=>
payload
}
},
false
);
...
...
@@ -423,6 +427,8 @@ const revisions = handleActions({
},
{});
const
dashcardData
=
handleActions
({
// clear existing dashboard data when loading a dashboard
[
INITIALIZE
]:
{
next
:
(
state
)
=>
({})
},
[
FETCH_CARD_DATA
]:
{
next
:
(
state
,
{
payload
:
{
dashcard_id
,
card_id
,
result
}})
=>
i
.
assocIn
(
state
,
[
dashcard_id
,
card_id
],
result
)
},
...
...
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