Am 31.03.25 um 15:31 schrieb Michael Köppl:
> Adds a formatted guest identifier (e.g. "VMID (VM name)") to the
> SafeDestroy window. The formatted identifier is only used if it is
> explicitly set by the caller. Otherwise, the VMID is used, avoiding
> changes in behavior for other components.
> 
> Signed-off-by: Michael Köppl <m.koe...@proxmox.com>
> ---
>  src/window/SafeDestroy.js | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

does not applies as is on my side here, might need a rebase or other
patches are missing?

> 
> diff --git a/src/window/SafeDestroy.js b/src/window/SafeDestroy.js
> index c058465..a19747d 100644
> --- a/src/window/SafeDestroy.js
> +++ b/src/window/SafeDestroy.js
> @@ -26,6 +26,7 @@ Ext.define('Proxmox.window.SafeDestroy', {
>      config: {
>       item: {
>           id: undefined,
> +         formattedIdentifier: undefined,
>       },
>       url: undefined,
>       note: undefined,
> @@ -187,9 +188,13 @@ Ext.define('Proxmox.window.SafeDestroy', {
>       }
>  
>       let taskName = me.getTaskName();
> +     let formattedIdentifier = me.getItem().formattedIdentifier;
>       if (Ext.isDefined(taskName)) {
>           me.lookupReference('messageCmp').setHtml(
> -             Proxmox.Utils.format_task_description(taskName, itemId),
> +             Proxmox.Utils.format_task_description(
> +                 taskName,
> +                 formattedIdentifier ? formattedIdentifier : itemId,

FWIW you could also use the nullish coalescing (??) operator instead
of a ternary and avoid the intermediate variable, e.g.:

    me.getItem().formattedIdentifier ?? itemId,


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to