[pve-devel] [PATCH proxmox-widget-toolkit 3/5] ui: added possibility to show a small note in SafeRemove dialog

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Aug 18 19:59:13 CEST 2020


general note, while I find tags in the comment subject nice, this doesn't really
adds value as everything in widget toolkit is "ui" :) We only use that in things
like pve-manager or proxmox-backup-server as there API, UI and possibly other stuff
are shared in the same repo. You could use:

"safe destroy: add possibility to show a small extra note"

On 18.08.20 10:40, Hannes Laimer wrote:
> Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
> ---
>  src/window/SafeRemove.js | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
> 
> diff --git a/src/window/SafeRemove.js b/src/window/SafeRemove.js
> index c541272..c3fc7dd 100644
> --- a/src/window/SafeRemove.js
> +++ b/src/window/SafeRemove.js
...
> @@ -173,6 +199,8 @@ Ext.define('Proxmox.window.SafeRemove', {
>              msg = Proxmox.Utils.format_task_description('cephdestroypool', item.id);
>          } else if (item.type === 'Image') {
>              msg = Proxmox.Utils.format_task_description('unknownimgdel', item.id);
> +        } else if (item.type === 'Dir') {
> +            msg = `${gettext('Directory')} ${item.id} - ${gettext('Remove')}`

few issues:
1. misses a semicolon - did you even built it once? I'd guess that eslint complains about
   it then.
2. has nothing to do with this patch, should be separate
3. why not a format task description? In combination with my comments on patch 1/5 that
   could be much nicer, avoiding this clunky if/else block completely.

>          } else {
>              throw "unknown item type specified";
>          }
> 





More information about the pve-devel mailing list