Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
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
SFB 1288 - INF
nopaque
Commits
c589fd1f
Commit
c589fd1f
authored
2 years ago
by
Patrick Jentsch
Browse files
Options
Downloads
Patches
Plain Diff
Remove unused function in utils
parent
21819bfd
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
app/static/js/Utils.js
+0
-56
0 additions, 56 deletions
app/static/js/Utils.js
with
0 additions
and
56 deletions
app/static/js/Utils.js
+
0
−
56
View file @
c589fd1f
...
@@ -69,62 +69,6 @@ class Utils {
...
@@ -69,62 +69,6 @@ class Utils {
return
Utils
.
mergeObjectsDeep
(
mergedObject
,
...
objects
.
slice
(
2
));
return
Utils
.
mergeObjectsDeep
(
mergedObject
,
...
objects
.
slice
(
2
));
}
}
static
deleteCorpusFileRequest
(
userId
,
corpusId
,
corpusFileId
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
corpusFile
;
try
{
corpusFile
=
app
.
data
.
users
[
userId
].
corpora
[
corpusId
].
files
[
corpusFileId
];
}
catch
(
error
)
{
corpusFile
=
{};
}
let
modalElement
=
Utils
.
HTMLToElement
(
`
<div class="modal">
<div class="modal-content">
<h4>Confirm Corpus File deletion</h4>
<p>Do you really want to delete the Corpus File <b>
${
corpusFile
?.
title
}
</b>? All files will be permanently deleted!</p>
</div>
<div class="modal-footer">
<a class="action-button btn modal-close waves-effect waves-light" data-action="cancel">Cancel</a>
<a class="action-button btn modal-close red waves-effect waves-light" data-action="confirm">Delete</a>
</div>
</div>
`
);
document
.
querySelector
(
'
#modals
'
).
appendChild
(
modalElement
);
let
modal
=
M
.
Modal
.
init
(
modalElement
,
{
dismissible
:
false
,
onCloseEnd
:
()
=>
{
modal
.
destroy
();
modalElement
.
remove
();
}
}
);
let
confirmElement
=
modalElement
.
querySelector
(
'
.action-button[data-action="confirm"]
'
);
confirmElement
.
addEventListener
(
'
click
'
,
(
event
)
=>
{
let
corpusFileTitle
=
corpusFile
?.
title
;
fetch
(
`/corpora/
${
corpusId
}
/files/
${
corpusFileId
}
`
,
{
method
:
'
DELETE
'
,
headers
:
{
Accept
:
'
application/json
'
}})
.
then
(
(
response
)
=>
{
if
(
response
.
status
===
403
)
{
app
.
flash
(
'
Forbidden
'
,
'
error
'
);
reject
(
response
);}
if
(
response
.
status
===
404
)
{
app
.
flash
(
'
Not Found
'
,
'
error
'
);
reject
(
response
);}
app
.
flash
(
`Corpus File "
${
corpusFileTitle
}
" deleted`
,
'
corpus
'
);
resolve
(
response
);
},
(
response
)
=>
{
app
.
flash
(
'
Something went wrong
'
,
'
error
'
);
reject
(
response
);
}
);
});
modal
.
open
();
});
}
static
deleteProfileAvatarRequest
(
userId
)
{
static
deleteProfileAvatarRequest
(
userId
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
modalElement
=
Utils
.
HTMLToElement
(
let
modalElement
=
Utils
.
HTMLToElement
(
...
...
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