Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CloWM UI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Monitor
Service Desk
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
Computational Metagenomics
CloWM
CloWM UI
Commits
657105ab
Verified
Commit
657105ab
authored
2 years ago
by
Daniel Göbel
Browse files
Options
Downloads
Patches
Plain Diff
Add delete modal to confirm deletion of permission
#13
parent
e01e2b22
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!13
Add modal to confirm deletion
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/Modals/PermissionModal.vue
+13
-2
13 additions, 2 deletions
src/components/Modals/PermissionModal.vue
with
13 additions
and
2 deletions
src/components/Modals/PermissionModal.vue
+
13
−
2
View file @
657105ab
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
onMounted
,
reactive
,
watch
,
ref
,
computed
}
from
"
vue
"
;
import
{
onMounted
,
reactive
,
watch
,
ref
,
computed
}
from
"
vue
"
;
import
BootstrapModal
from
"
@/components/Modals/BootstrapModal.vue
"
;
import
BootstrapModal
from
"
@/components/Modals/BootstrapModal.vue
"
;
import
DeleteModal
from
"
@/components/Modals/DeleteModal.vue
"
;
import
{
Modal
}
from
"
bootstrap
"
;
import
{
Modal
}
from
"
bootstrap
"
;
import
dayjs
from
"
dayjs
"
;
import
dayjs
from
"
dayjs
"
;
import
type
{
import
type
{
...
@@ -248,7 +249,7 @@ function formSubmit() {
...
@@ -248,7 +249,7 @@ function formSubmit() {
* @param bucketName Bucket to delete
* @param bucketName Bucket to delete
* @param uid ID of grantee of the permission
* @param uid ID of grantee of the permission
*/
*/
function
d
eletePermission
(
bucketName
:
string
,
uid
:
string
)
{
function
confirmedD
eletePermission
(
bucketName
:
string
,
uid
:
string
)
{
if
(
!
formState
.
loading
)
{
if
(
!
formState
.
loading
)
{
formState
.
loading
=
true
;
formState
.
loading
=
true
;
BucketPermissionsService
.
bucketPermissionsDeletePermissionForBucket
(
BucketPermissionsService
.
bucketPermissionsDeletePermissionForBucket
(
...
@@ -280,6 +281,15 @@ onMounted(() => {
...
@@ -280,6 +281,15 @@ onMounted(() => {
</
script
>
</
script
>
<
template
>
<
template
>
<DeleteModal
:modalID=
"'delete-permission-modal' + randomIDSuffix"
modal-label=
"some-label"
object-name-delete=
"permission"
:back-modal-id=
"modalID"
@
confirm-delete=
"
confirmedDeletePermission(permission.bucket_name, permission.uid)
"
/>
<div
class=
"toast-container position-fixed top-0 end-0 p-3"
>
<div
class=
"toast-container position-fixed top-0 end-0 p-3"
>
<div
<div
role=
"alert"
role=
"alert"
...
@@ -329,7 +339,8 @@ onMounted(() => {
...
@@ -329,7 +339,8 @@ onMounted(() => {
fill=
"currentColor"
fill=
"currentColor"
class=
"me-2"
class=
"me-2"
:class=
"
{ 'delete-icon': !formState.loading }"
:class=
"
{ 'delete-icon': !formState.loading }"
@click="deletePermission(permission.bucket_name, permission.uid)"
data-bs-toggle="modal"
:data-bs-target="'#delete-permission-modal' + randomIDSuffix"
/>
/>
<bootstrap-icon
<bootstrap-icon
v-if=
"formState.readonly && props.editable"
v-if=
"formState.readonly && props.editable"
...
...
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