Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DBRepo
Manage
Activity
Members
Labels
Plan
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FAIR Data Austria DB Repository
DBRepo
Commits
0140f511
Unverified
Commit
0140f511
authored
Mar 30, 2023
by
Martin Weise
Browse files
Options
Downloads
Patches
Plain Diff
Fixed some more buttons
parent
3823790f
No related branches found
No related tags found
2 merge requests
!163
Relase 1.3.0
,
!155
Added readme to authentication service and added eureka service
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
fda-ui/components/TableToolbar.vue
+41
-27
41 additions, 27 deletions
fda-ui/components/TableToolbar.vue
with
41 additions
and
27 deletions
fda-ui/components/TableToolbar.vue
+
41
−
27
View file @
0140f511
...
...
@@ -11,22 +11,22 @@
</v-toolbar-title>
<v-spacer
/>
<v-toolbar-title>
<v-btn
v-if=
"
!loading && canAdd && !editTupleDialog
"
class=
"mr-2 mb-1"
@
click=
"addTuple"
>
<v-btn
v-if=
"
canAddTuple
"
class=
"mr-2 mb-1"
@
click=
"addTuple"
>
<v-icon
left
>
mdi-plus
</v-icon>
Add
</v-btn>
<v-btn
v-if=
"
!loading && canEdit && !editTupleDialog
"
color=
"warning"
class=
"mr-2 mb-1 black--text"
@
click=
"editTuple"
>
<v-btn
v-if=
"
canEditTuple
"
color=
"warning"
class=
"mr-2 mb-1 black--text"
@
click=
"editTuple"
>
<v-icon
left
>
mdi-pencil
</v-icon>
Edit
</v-btn>
<v-btn
v-if=
"
!loading && canDelete && !editTupleDialog
"
color=
"error"
class=
"mr-2 mb-1"
@
click=
"deleteItems"
>
<v-btn
v-if=
"
canDeleteTuple
"
color=
"error"
class=
"mr-2 mb-1"
:loading=
"loadingDelete"
@
click=
"deleteItems"
>
<v-icon
left
>
mdi-delete
</v-icon>
Delete
<span
v-if=
"selection.length > 1"
>
{{
selection
.
length
}}
</span>
</v-btn>
<v-btn
v-if=
"
!loading && canRead
"
class=
"mb-1"
:to=
"`/container/$
{$route.params.container_id}/database/${$route.params.database_id}/query/create?tid=${$route.params.table_id}`" color="secondary">
<v-btn
v-if=
"
canExecuteQuery
"
class=
"mb-1"
:to=
"`/container/$
{$route.params.container_id}/database/${$route.params.database_id}/query/create?tid=${$route.params.table_id}`" color="secondary">
<v-icon
left
>
mdi-wrench
</v-icon>
Create Subset
</v-btn>
<v-btn
v-if=
"
!loading && canModify
"
class=
"ml-2 mb-1"
:to=
"`/container/$
{$route.params.container_id}/database/${$route.params.database_id}/view/create?tid=${$route.params.table_id}`" color="secondary">
<v-btn
v-if=
"
canCreateView
"
class=
"ml-2 mb-1"
:to=
"`/container/$
{$route.params.container_id}/database/${$route.params.database_id}/view/create?tid=${$route.params.table_id}`" color="secondary">
<v-icon
left
>
mdi-view-carousel
</v-icon>
Create View
</v-btn>
<v-btn
v-if=
"
!loading && canModify
"
class=
"ml-2 mb-1"
:to=
"`/container/$
{$route.params.container_id}/database/${$route.params.database_id}/table/${$route.params.table_id}/import`">
<v-btn
v-if=
"
canImportCsv
"
class=
"ml-2 mb-1"
:to=
"`/container/$
{$route.params.container_id}/database/${$route.params.database_id}/table/${$route.params.table_id}/import`">
<v-icon
left
>
mdi-cloud-upload
</v-icon>
Import csv
</v-btn>
</v-toolbar-title>
...
...
@@ -35,7 +35,7 @@
<v-tab
:to=
"`/container/$
{$route.params.container_id}/database/${$route.params.database_id}/table/${$route.params.table_id}/info`">
Info
</v-tab>
<v-tab
v-if=
"canRead"
:to=
"`/container/$
{$route.params.container_id}/database/${$route.params.database_id}/table/${$route.params.table_id}/data`">
<v-tab
v-if=
"canRead
Data
"
:to=
"`/container/$
{$route.params.container_id}/database/${$route.params.database_id}/table/${$route.params.table_id}/data`">
Data
</v-tab>
<v-tab
:to=
"`/container/$
{$route.params.container_id}/database/${$route.params.database_id}/table/${$route.params.table_id}/schema`">
...
...
@@ -71,6 +71,7 @@ export default {
return
{
tab
:
null
,
loading
:
false
,
loadingDelete
:
false
,
error
:
false
,
edit
:
false
,
editTupleDialog
:
false
...
...
@@ -95,36 +96,47 @@ export default {
token
()
{
return
this
.
$store
.
state
.
token
},
can
Modify
()
{
if
(
!
this
.
user
||
!
this
.
access
||
!
this
.
database
||
!
this
.
database
.
creator
)
{
can
AddTuple
()
{
if
(
!
this
.
user
)
{
return
false
}
if
(
this
.
database
.
creator
.
username
===
this
.
user
.
username
)
{
return
true
return
this
.
user
.
roles
.
includes
(
'
insert-table-data
'
)
},
canEditTuple
()
{
if
(
!
this
.
user
)
{
return
false
}
return
this
.
access
.
type
===
'
write_own
'
||
this
.
access
.
type
===
'
write_all
'
return
this
.
user
.
roles
.
includes
(
'
insert-table-data
'
)
},
can
Read
()
{
if
(
this
.
database
?.
is_public
)
{
return
tru
e
can
DeleteTuple
()
{
if
(
!
this
.
user
)
{
return
fals
e
}
if
(
!
this
.
access
)
{
return
this
.
user
.
roles
.
includes
(
'
delete-table-data
'
)
},
canExecuteQuery
()
{
if
(
!
this
.
user
)
{
return
false
}
return
this
.
access
.
type
===
'
read
'
||
this
.
access
.
type
===
'
write_own
'
||
this
.
access
.
type
===
'
write_all
'
return
this
.
user
.
roles
.
includes
(
'
execute-query
'
)
},
canDelete
()
{
return
this
.
selection
.
length
!==
0
&&
this
.
canModify
canCreateView
()
{
if
(
!
this
.
user
)
{
return
false
}
return
this
.
user
.
roles
.
includes
(
'
create-database-view
'
)
},
canEdit
()
{
if
(
this
.
selection
.
length
!==
1
)
{
return
false
}
return
this
.
canModify
canReadData
()
{
if
(
!
this
.
user
)
{
return
false
}
return
this
.
user
.
roles
.
includes
(
'
view-table-data
'
)
},
can
Add
()
{
if
(
this
.
canEdit
)
{
can
ImportCsv
()
{
if
(
!
this
.
user
)
{
return
false
}
return
this
.
canModify
return
this
.
user
.
roles
.
includes
(
'
insert-table-data
'
)
},
tuple
()
{
return
this
.
edit
?
this
.
selection
[
0
]
:
{}
...
...
@@ -187,6 +199,7 @@ export default {
return
}
try
{
this
.
loadingDelete
=
true
for
(
const
select
of
this
.
selection
)
{
/* remove in container */
const
constraints
=
{}
...
...
@@ -195,12 +208,12 @@ export default {
.
forEach
((
c
)
=>
{
constraints
[
c
.
internal_name
]
=
select
[
c
.
internal_name
]
})
const
res
=
await
this
.
$axios
.
delete
(
`/api/container/
${
this
.
$route
.
params
.
container_id
}
/database/
${
this
.
$route
.
params
.
database_id
}
/table/
${
this
.
$route
.
params
.
table_id
}
/data`
,
{
await
this
.
$axios
.
delete
(
`/api/container/
${
this
.
$route
.
params
.
container_id
}
/database/
${
this
.
$route
.
params
.
database_id
}
/table/
${
this
.
$route
.
params
.
table_id
}
/data`
,
{
headers
:
{
Authorization
:
`Bearer
${
this
.
token
}
`
},
data
:
{
keys
:
constraints
}
})
console
.
debug
(
'
tuple delete result
'
,
res
)
}
console
.
info
(
`Deleted
${
this
.
selection
.
length
}
rows(s)`
)
this
.
$toast
.
success
(
`Deleted
${
this
.
selection
.
length
}
rows(s)`
)
this
.
$emit
(
'
modified
'
,
{
success
:
true
,
action
:
'
delete
'
})
}
catch
(
error
)
{
...
...
@@ -209,6 +222,7 @@ export default {
const
{
message
}
=
data
this
.
$toast
.
error
(
`Failed to delete rows:
${
message
}
`
)
}
this
.
loadingDelete
=
false
},
close
(
event
)
{
console
.
debug
(
'
closed edit/create tuple dialog
'
,
event
)
...
...
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