Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
71f2d4bb
Commit
71f2d4bb
authored
Jul 18, 2019
by
Nick Kipling
Committed by
Nathan Friend
Jul 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updating FE to use new bulk_destroy endpoint
parent
0426d15c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
13 deletions
+15
-13
app/assets/javascripts/registry/components/table_registry.vue
...assets/javascripts/registry/components/table_registry.vue
+14
-13
app/assets/javascripts/registry/stores/actions.js
app/assets/javascripts/registry/stores/actions.js
+1
-0
No files found.
app/assets/javascripts/registry/components/table_registry.vue
View file @
71f2d4bb
...
@@ -45,6 +45,9 @@ export default {
...
@@ -45,6 +45,9 @@ export default {
};
};
},
},
computed
:
{
computed
:
{
bulkDeletePath
()
{
return
this
.
repo
.
tagsPath
?
this
.
repo
.
tagsPath
.
replace
(
'
?format=json
'
,
'
/bulk_destroy
'
)
:
''
;
},
shouldRenderPagination
()
{
shouldRenderPagination
()
{
return
this
.
repo
.
pagination
.
total
>
this
.
repo
.
pagination
.
perPage
;
return
this
.
repo
.
pagination
.
total
>
this
.
repo
.
pagination
.
perPage
;
},
},
...
@@ -78,7 +81,7 @@ export default {
...
@@ -78,7 +81,7 @@ export default {
},
},
},
},
methods
:
{
methods
:
{
...
mapActions
([
'
fetchList
'
,
'
deleteItem
'
]),
...
mapActions
([
'
fetchList
'
,
'
deleteItem
s
'
]),
layers
(
item
)
{
layers
(
item
)
{
return
item
.
layers
?
n__
(
'
%d layer
'
,
'
%d layers
'
,
item
.
layers
)
:
''
;
return
item
.
layers
?
n__
(
'
%d layer
'
,
'
%d layers
'
,
item
.
layers
)
:
''
;
},
},
...
@@ -101,18 +104,16 @@ export default {
...
@@ -101,18 +104,16 @@ export default {
itemsToBeDeleted
=
[
singleItemToBeDeleted
];
itemsToBeDeleted
=
[
singleItemToBeDeleted
];
}
}
const
deleteActions
=
itemsToBeDeleted
.
map
(
if
(
this
.
bulkDeletePath
)
{
x
=>
this
.
deleteItems
({
new
Promise
((
resolve
,
reject
)
=>
{
path
:
this
.
bulkDeletePath
,
this
.
deleteItem
(
this
.
repo
.
list
[
x
])
items
:
itemsToBeDeleted
.
map
(
x
=>
this
.
repo
.
list
[
x
].
tag
),
.
then
(
resolve
)
})
.
catch
(
reject
);
.
then
(()
=>
this
.
fetchList
({
repo
:
this
.
repo
}))
}),
.
catch
(()
=>
this
.
showError
(
errorMessagesTypes
.
DELETE_REGISTRY
));
);
}
else
{
this
.
showError
(
errorMessagesTypes
.
DELETE_REGISTRY
);
Promise
.
all
(
deleteActions
)
}
.
then
(()
=>
this
.
fetchList
({
repo
:
this
.
repo
}))
.
catch
(()
=>
this
.
showError
(
errorMessagesTypes
.
DELETE_REGISTRY
));
},
},
onPageChange
(
pageNumber
)
{
onPageChange
(
pageNumber
)
{
this
.
fetchList
({
repo
:
this
.
repo
,
page
:
pageNumber
}).
catch
(()
=>
this
.
fetchList
({
repo
:
this
.
repo
,
page
:
pageNumber
}).
catch
(()
=>
...
...
app/assets/javascripts/registry/stores/actions.js
View file @
71f2d4bb
...
@@ -36,6 +36,7 @@ export const fetchList = ({ commit }, { repo, page }) => {
...
@@ -36,6 +36,7 @@ export const fetchList = ({ commit }, { repo, page }) => {
};
};
export
const
deleteItem
=
(
_
,
item
)
=>
axios
.
delete
(
item
.
destroyPath
);
export
const
deleteItem
=
(
_
,
item
)
=>
axios
.
delete
(
item
.
destroyPath
);
export
const
deleteItems
=
(
_
,
{
path
,
items
})
=>
axios
.
delete
(
path
,
{
params
:
{
ids
:
items
}
});
export
const
setMainEndpoint
=
({
commit
},
data
)
=>
commit
(
types
.
SET_MAIN_ENDPOINT
,
data
);
export
const
setMainEndpoint
=
({
commit
},
data
)
=>
commit
(
types
.
SET_MAIN_ENDPOINT
,
data
);
export
const
toggleLoading
=
({
commit
})
=>
commit
(
types
.
TOGGLE_MAIN_LOADING
);
export
const
toggleLoading
=
({
commit
})
=>
commit
(
types
.
TOGGLE_MAIN_LOADING
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment