web/elements: Fix display in deleteform when object has no name

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-04-06 17:27:53 +02:00
parent a13d89fcde
commit fb409a73a1
4 changed files with 23 additions and 15 deletions

View File

@ -49,6 +49,12 @@ export class DeleteForm extends ModalButton {
}
renderModalInner(): TemplateResult {
let objName = this.obj?.name;
if (objName) {
objName = ` "${objName}"`;
} else {
objName = "";
}
return html`<section class="pf-c-page__main-section pf-m-light">
<div class="pf-c-content">
<h1 class="pf-c-title pf-m-2xl">
@ -59,7 +65,7 @@ export class DeleteForm extends ModalButton {
<section class="pf-c-page__main-section pf-m-light">
<form class="pf-c-form pf-m-horizontal">
<p>
${t`Are you sure you want to delete ${this.objectLabel} "${this.obj?.name}"?`}
${t`Are you sure you want to delete ${this.objectLabel} ${objName} ?`}
</p>
</form>
</section>