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
4ef7c10e
Commit
4ef7c10e
authored
6 years ago
by
Tom Robinson
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup collection action modals. Resolves #9409
parent
a7c44355
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/metabase/components/CollectionLanding.jsx
+10
-10
10 additions, 10 deletions
frontend/src/metabase/components/CollectionLanding.jsx
frontend/src/metabase/containers/CollectionMoveModal.jsx
+4
-13
4 additions, 13 deletions
frontend/src/metabase/containers/CollectionMoveModal.jsx
with
14 additions
and
23 deletions
frontend/src/metabase/components/CollectionLanding.jsx
+
10
−
10
View file @
4ef7c10e
...
...
@@ -153,7 +153,7 @@ class DefaultLanding extends React.Component {
await
Promise
.
all
(
this
.
state
.
selectedItems
.
map
(
item
=>
item
.
setCollection
(
collection
)),
);
this
.
setState
({
selectedItems
:
null
,
selectedAction
:
null
}
);
this
.
handleCloseModal
(
);
}
finally
{
this
.
handleBulkActionSuccess
();
}
...
...
@@ -166,6 +166,10 @@ class DefaultLanding extends React.Component {
this
.
props
.
onSelectNone
();
};
handleCloseModal
=
()
=>
{
this
.
setState
({
selectedItems
:
null
,
selectedAction
:
null
});
};
render
()
{
const
{
ancestors
,
...
...
@@ -499,14 +503,12 @@ class DefaultLanding extends React.Component {
</
Box
>
{
!
_
.
isEmpty
(
selectedItems
)
&&
selectedAction
==
"
copy
"
&&
(
<
Modal
>
<
Modal
onClose
=
{
this
.
handleCloseModal
}
>
<
CollectionCopyEntityModal
entityObject
=
{
selectedItems
[
0
]
}
onClose
=
{
()
=>
this
.
setState
({
selectedItems
:
null
,
selectedAction
:
null
})
}
onClose
=
{
this
.
handleCloseModal
}
onSaved
=
{
newEntityObject
=>
{
this
.
setState
({
selectedItems
:
null
,
selectedAction
:
null
}
);
this
.
handleCloseModal
(
);
this
.
handleBulkActionSuccess
();
}
}
/>
...
...
@@ -514,16 +516,14 @@ class DefaultLanding extends React.Component {
)
}
{
!
_
.
isEmpty
(
selectedItems
)
&&
selectedAction
==
"
move
"
&&
(
<
Modal
>
<
Modal
onClose
=
{
this
.
handleCloseModal
}
>
<
CollectionMoveModal
title
=
{
selectedItems
.
length
>
1
?
t
`Move
${
selectedItems
.
length
}
items?`
:
t
`Move "
${
selectedItems
[
0
].
getName
()}
"?`
}
onClose
=
{
()
=>
this
.
setState
({
selectedItems
:
null
,
selectedAction
:
null
})
}
onClose
=
{
this
.
handleCloseModal
}
onMove
=
{
this
.
handleBulkMove
}
/>
</
Modal
>
...
...
This diff is collapsed.
Click to expand it.
frontend/src/metabase/containers/CollectionMoveModal.jsx
+
4
−
13
View file @
4ef7c10e
...
...
@@ -3,10 +3,9 @@ import PropTypes from "prop-types";
import
{
t
}
from
"
c-3po
"
;
import
{
Flex
,
Box
}
from
"
grid-styled
"
;
import
Subhead
from
"
metabase/components/Subhead
"
;
import
{
Flex
}
from
"
grid-styled
"
;
import
Button
from
"
metabase/components/Button
"
;
import
Icon
from
"
metabase/components/
Icon
"
;
import
ModalContent
from
"
metabase/components/
ModalContent
"
;
import
CollectionPicker
from
"
metabase/containers/CollectionPicker
"
;
...
...
@@ -41,15 +40,7 @@ class CollectionMoveModal extends React.Component {
const
{
selectedCollectionId
}
=
this
.
state
;
return
(
<
Box
p
=
{
3
}
>
<
Flex
align
=
"center"
mb
=
{
2
}
>
<
Subhead
>
{
this
.
props
.
title
}
</
Subhead
>
<
Icon
name
=
"close"
className
=
"ml-auto"
onClick
=
{
()
=>
this
.
props
.
onClose
()
}
/>
</
Flex
>
<
ModalContent
title
=
{
this
.
props
.
title
}
onClose
=
{
this
.
props
.
onClose
}
>
<
CollectionPicker
value
=
{
selectedCollectionId
}
onChange
=
{
selectedCollectionId
=>
...
...
@@ -78,7 +69,7 @@ class CollectionMoveModal extends React.Component {
{
t
`Move`
}
</
Button
>
</
Flex
>
</
Box
>
</
ModalContent
>
);
}
}
...
...
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