Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Frontend
Commits
b093d3d3
Commit
b093d3d3
authored
2 years ago
by
ml bonhomme
Committed by
Erwan Rouchet
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Delete all uploaded files
parent
b035a574
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1338
Delete all uploaded files
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/Imports/Files/Selector.vue
+23
-18
23 additions, 18 deletions
src/components/Imports/Files/Selector.vue
with
23 additions
and
18 deletions
src/components/Imports/Files/Selector.vue
+
23
−
18
View file @
b093d3d3
...
...
@@ -2,13 +2,21 @@
<div
v-if=
"files"
>
<Uploader
:corpus-id=
"corpusId"
v-if=
"isVerified && canWrite(corpus)"
/>
<br
/>
<div
class=
"
control
is-pulled-right"
>
<div
class=
"
buttons
is-pulled-right"
>
<button
v-if=
"filesSelected"
class=
"button"
v-on:click=
"setAllSelected(false)"
>
Unselect all
</button>
<button
v-else
class=
"button"
v-on:click=
"setAllSelected(true)"
>
Select all
</button>
<button
class=
"button is-danger is-outlined"
:class=
"
{ 'is-loading': removing }"
:disabled="removing || null"
v-on:click="removeAll"
>
Delete all
</button>
</div>
<h2
class=
"subtitle is-marginless"
>
Available files to import
</h2>
<
br
/
>
<div
class=
"columns is-multiline is-vcentered"
>
<
div
class=
"is-clearfix"
></div
>
<div
class=
"columns is-multiline is-vcentered
is-marginless
"
>
<div
class=
"column is-one-quarter-fullhd is-one-third-widescreen is-half-tablet"
v-for=
"file in files"
:key=
"file.id"
>
<File
:file=
"file"
/>
</div>
...
...
@@ -48,6 +56,9 @@ export default {
immediate
:
true
}
},
data
:
()
=>
({
removing
:
false
}),
computed
:
{
...
mapGetters
(
'
auth
'
,
[
'
isVerified
'
]),
...
mapState
(
'
files
'
,
[
'
files
'
,
'
loaded
'
]),
...
...
@@ -61,21 +72,15 @@ export default {
list
()
{
this
.
$store
.
dispatch
(
'
files/list
'
,
{
corpus
:
this
.
corpusId
})
},
isSelected
(
file
)
{
return
this
.
selectedfiles
.
indexOf
(
file
)
>=
0
},
updateValue
(
f
)
{
const
fileIndex
=
this
.
selectedfiles
.
indexOf
(
f
)
if
(
fileIndex
>=
0
)
this
.
selectedfiles
.
splice
(
fileIndex
,
1
)
else
this
.
selectedfiles
.
push
(
f
)
this
.
$emit
(
'
change
'
,
this
.
selectedfiles
)
},
async
remove
(
f
)
{
await
this
.
$store
.
dispatch
(
'
files/delete
'
,
{
id
:
f
.
id
})
this
.
list
()
const
fileIndex
=
this
.
selectedfiles
.
indexOf
(
f
)
if
(
fileIndex
>=
0
)
this
.
selectedfiles
.
splice
(
fileIndex
,
1
)
this
.
$emit
(
'
change
'
,
this
.
selectedfiles
)
async
removeAll
()
{
this
.
removing
=
true
try
{
for
(
const
id
in
this
.
files
)
{
await
this
.
$store
.
dispatch
(
'
files/delete
'
,
{
id
})
}
}
finally
{
this
.
removing
=
false
}
}
}
}
...
...
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