Fix permissions buttons when resource name or handle were not defined

This commit is contained in:
Jože Fortun
2022-12-22 10:59:58 +01:00
parent a578a0c242
commit ef04afeeb6
17 changed files with 47 additions and 56 deletions
@@ -17,9 +17,9 @@
</b-button>
<c-permissions-button
v-if="workflowID && canGrant"
:title="workflow.handle"
:target="workflow.handle"
:resource="'corteza::automation:workflow/'+workflowID"
:title="workflow.meta.name || workflow.handle || workflowID"
:target="workflow.meta.name || workflow.handle || workflowID"
:resource="`corteza::automation:workflow/${workflowID}`"
button-variant="light"
class="ml-2"
>
@@ -12,9 +12,9 @@
</b-button>
<c-permissions-button
v-if="routeID && canGrant"
:title="route.endpoint"
:target="route.endpoint"
:resource="'corteza::system:apigw-route/'+routeID"
:title="route.endpoint || routeID"
:target="route.endpoint || routeID"
:resource="`corteza::system:apigw-route/${routeID}`"
button-variant="light"
class="ml-2"
>
@@ -19,9 +19,9 @@
</b-button>
<c-permissions-button
v-if="applicationID && canGrant"
:title="application.name"
:target="application.name"
:resource="'corteza::system:application/'+applicationID"
:title="application.name || applicationID"
:target="application.name || applicationID"
:resource="`corteza::system:application/${applicationID}`"
button-variant="light"
class="ml-2"
>
@@ -19,9 +19,9 @@
</b-button>
<c-permissions-button
v-if="authClientID && canGrant"
:title="rbacEditorTitle"
:target="rbacEditorTitle"
:resource="'corteza::system:auth-client/'+authClientID"
:title="authclient.meta.name || authclient.handle || authClientID"
:target="authclient.meta.name || authclient.handle || authClientID"
:resource="`corteza::system:auth-client/${authClientID}`"
button-variant="light"
>
<font-awesome-icon :icon="['fas', 'lock']" />
@@ -108,15 +108,6 @@ export default {
title () {
return this.authClientID ? this.$t('title.edit') : this.$t('title.create')
},
rbacEditorTitle () {
if (this.authclient) {
const { meta: { name } = {}, handle } = this.authclient || {}
return name || handle
}
return ''
},
},
watch: {
@@ -21,9 +21,9 @@
<c-permissions-button
v-if="roleID && canGrant"
:title="role.name"
:target="role.name"
:resource="'corteza::system:role/'+roleID"
:title="role.name || role.handle || role.roleID"
:target="role.name || role.handle || role.roleID"
:resource="`corteza::system:role/${roleID}`"
button-variant="light"
class="mr-2"
>
@@ -20,9 +20,9 @@
</b-button>
<c-permissions-button
v-if="templateID && canGrant"
:title="template.handle"
:target="template.handle"
:resource="'corteza::system:template/'+templateID"
:title="template.meta.short || template.handle || template.templateID"
:target="template.meta.short || template.handle || template.templateID"
:resource="`corteza::system:template/${templateID}`"
button-variant="light"
>
<font-awesome-icon :icon="['fas', 'lock']" />
@@ -21,9 +21,9 @@
</b-button>
<c-permissions-button
v-if="canGrant"
:title="user.name || user.handle || user.email"
:target="user.name || user.handle || user.email"
:resource="'corteza::system:user/'+userID"
:title="user.name || user.handle || user.email || userID"
:target="user.name || user.handle || user.email || userID"
:resource="`corteza::system:user/${userID}`"
button-variant="light"
>
<font-awesome-icon :icon="['fas', 'lock']" />