From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 452E71FF0E4 for ; Tue, 14 Jul 2026 10:52:00 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 51D72213A2; Tue, 14 Jul 2026 10:51:59 +0200 (CEST) Message-ID: <3b44232a-6d0b-4bf4-b8c7-7940c59c803c@proxmox.com> Date: Tue, 14 Jul 2026 10:51:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH manager v2 06/12] ui: ha: node affinity: move node priority selector into separate component To: Daniel Kral , pve-devel@lists.proxmox.com References: <20260602100226.180071-1-d.kral@proxmox.com> <20260602100226.180071-7-d.kral@proxmox.com> Content-Language: en-US From: David Riley In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1784019069056 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.216 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: E52SPAJSJETB26WR755SEE2RANYEFYPG X-Message-ID-Hash: E52SPAJSJETB26WR755SEE2RANYEFYPG X-MailFrom: d.riley@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: comment inline On 7/14/26 9:56 AM, Daniel Kral wrote: > [ snip ] > >>> + >>> + getErrors: function (value) { >>> + let me = this; >>> + >>> + if (!me.isDisabled() && me.allowBlank === false && me.getValue().length === 0) { >>> + me.addBodyCls(['x-form-trigger-wrap-default', 'x-form-trigger-wrap-invalid']); >>> + return [gettext('No nodes selected')]; >> Not sure if this returned text is visible in the UI. I played around with it and the grid turned >> red if no node is selected, but due to the fact that the "Add" button is disabled anyways this >> message will never appear, but it does not hurt either. >> > Yeah, this was also taken from the VMSelector component... The nodes > field is required here and probably will always be for the node priority > selector. > >>> + } >>> + >>> + me.removeBodyCls(['x-form-trigger-wrap-default', 'x-form-trigger-wrap-invalid']); >>> + >>> + return []; >>> + }, >> >> Not sure if I like this approach. I tried to look for better solutions but it seems like >> there is no extjs native way to handle this. >> > What approach are you referring to exactly? I meant the way getErrors adds side effects by adding/removing CSS classes to highlight the error in the grid [0]. However, as you mentioned, this seems to be an established way of handling it here, since it's already done this way in the VMSelector component [1]. [0] https://docs.sencha.com/ext/7.0.0/api/Ext.form.CheckboxGroup.html#method-getErrors [1] https://git.proxmox.com/?p=pve-manager.git;a=blob;f=www/manager6/form/VMSelector.js;h=a9e90b04e43b560c7c4ef8c9735f52b1035348dd;hb=b0b650c16c520eaaf62db54810dcf8d66bc4249f#l197 > >>> + >>> + initComponent: function () { >>> + let me = this; >>> + >>> + me.callParent(); >>> + me.initField(); >>> + }, >>> +}); > [ snip ] >