web/admin: make user clickable for bound policies list
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
fe0d3a64c8
commit
b30ffd1318
|
@ -51,7 +51,7 @@ export class BoundPoliciesList extends Table<PolicyBinding> {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
getPolicyUserGroupRow(item: PolicyBinding): string {
|
getPolicyUserGroupRowLabel(item: PolicyBinding): string {
|
||||||
if (item.policy) {
|
if (item.policy) {
|
||||||
return t`Policy ${item.policyObj?.name}`;
|
return t`Policy ${item.policyObj?.name}`;
|
||||||
} else if (item.group) {
|
} else if (item.group) {
|
||||||
|
@ -63,9 +63,17 @@ export class BoundPoliciesList extends Table<PolicyBinding> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getPolicyUserGroupRow(item: PolicyBinding): TemplateResult {
|
||||||
|
const label = this.getPolicyUserGroupRowLabel(item);
|
||||||
|
if (item.user) {
|
||||||
|
return html` <a href=${t`#/identity/users/${item.user}`}> ${label} </a> `;
|
||||||
|
}
|
||||||
|
return html`${label}`;
|
||||||
|
}
|
||||||
|
|
||||||
getObjectEditButton(item: PolicyBinding): TemplateResult {
|
getObjectEditButton(item: PolicyBinding): TemplateResult {
|
||||||
if (item.policy) {
|
if (item.policy) {
|
||||||
return html` <ak-forms-modal>
|
return html`<ak-forms-modal>
|
||||||
<span slot="submit"> ${t`Update`} </span>
|
<span slot="submit"> ${t`Update`} </span>
|
||||||
<span slot="header"> ${t`Update ${item.policyObj?.name}`} </span>
|
<span slot="header"> ${t`Update ${item.policyObj?.name}`} </span>
|
||||||
<ak-proxy-form
|
<ak-proxy-form
|
||||||
|
@ -105,7 +113,7 @@ export class BoundPoliciesList extends Table<PolicyBinding> {
|
||||||
.metadata=${(item: PolicyBinding) => {
|
.metadata=${(item: PolicyBinding) => {
|
||||||
return [
|
return [
|
||||||
{ key: t`Order`, value: item.order.toString() },
|
{ key: t`Order`, value: item.order.toString() },
|
||||||
{ key: t`Policy / User / Group`, value: this.getPolicyUserGroupRow(item) },
|
{ key: t`Policy / User / Group`, value: this.getPolicyUserGroupRowLabel(item) },
|
||||||
];
|
];
|
||||||
}}
|
}}
|
||||||
.usedBy=${(item: PolicyBinding) => {
|
.usedBy=${(item: PolicyBinding) => {
|
||||||
|
|
Reference in a new issue