public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: Re: [pve-devel] [PATCH manager 4/7] ui: qemu/HardwareView: eslint: enforce "no-shadow" rule
Date: Tue, 2 Feb 2021 14:07:44 +0100	[thread overview]
Message-ID: <4f0cb5f8-b49d-8f68-c4e9-ccf5c1158299@proxmox.com> (raw)
In-Reply-To: <20210201142131.30024-5-a.lauterer@proxmox.com>

the global confid variable is only there
so we could reuse the name

so i'd prefer we remove that
and use 'let confid' in the relevant blocks
(with var this would have failed)

On 2/1/21 3:21 PM, Aaron Lauterer wrote:
> `confid` is overwritten in each step anyways, so it should be no
> problem to use it in the outer scope.
> 
> Let's play it safe for `sm` and rename it in the function.
> 
> Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
> ---
> 
> Not sure if my solutions are okay or if another approach is preferable.
> Didn't find any patches in the manager repo that deal with the
> `no-shadow` rule as a guide though.
> 
>   www/manager6/qemu/HardwareView.js | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/www/manager6/qemu/HardwareView.js b/www/manager6/qemu/HardwareView.js
> index cc707a2a..213a946f 100644
> --- a/www/manager6/qemu/HardwareView.js
> +++ b/www/manager6/qemu/HardwareView.js
> @@ -220,7 +220,7 @@ Ext.define('PVE.qemu.HardwareView', {
>   	};
>   
>   	PVE.Utils.forEachBus(undefined, function(type, id) {
> -	    var confid = type + id;
> +	    confid = type + id;
>   	    rows[confid] = {
>   		group: 10,
>   		iconCls: 'hdd-o',
> @@ -531,8 +531,8 @@ Ext.define('PVE.qemu.HardwareView', {
>   	let isAtLimit = (type) => counts[type] >= PVE.Utils.hardware_counts[type];
>   
>   	var set_button_status = function() {
> -	    var sm = me.getSelectionModel();
> -	    var rec = sm.getSelection()[0];
> +	    var selection_model = me.getSelectionModel();
> +	    var rec = selection_model.getSelection()[0];
>   
>   	    // en/disable hardwarebuttons
>   	    counts = {};
> 




  reply	other threads:[~2021-02-02 13:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01 14:21 [pve-devel] [PATCH manager 0/7] ui: qemu/HardwareView: fix GUI permission checks and make eslint happier Aaron Lauterer
2021-02-01 14:21 ` [pve-devel] [PATCH manager 1/7] ui: qemu/HardwareView: eslint: enforce "no-mixed-operators" rule Aaron Lauterer
2021-02-03  7:37   ` [pve-devel] applied: " Thomas Lamprecht
2021-02-01 14:21 ` [pve-devel] [PATCH manager 2/7] ui: qemu/HardwareView: eslint: enforce "max-len" rule Aaron Lauterer
2021-02-03  7:40   ` Thomas Lamprecht
2021-02-03  9:50     ` Aaron Lauterer
2021-02-03  9:54       ` Aaron Lauterer
2021-02-01 14:21 ` [pve-devel] [PATCH manager 3/7] ui: qemu/HardwareView: eslint: enforce "no-useless-concat" rule Aaron Lauterer
2021-02-02 13:06   ` Dominik Csapak
2021-02-03  5:11     ` Thomas Lamprecht
2021-02-01 14:21 ` [pve-devel] [PATCH manager 4/7] ui: qemu/HardwareView: eslint: enforce "no-shadow" rule Aaron Lauterer
2021-02-02 13:07   ` Dominik Csapak [this message]
2021-02-03  6:18     ` Thomas Lamprecht
2021-02-01 14:21 ` [pve-devel] [PATCH manager 5/7] ui: qemu/HardwareView: change heuristic perms to const Aaron Lauterer
2021-02-03  7:37   ` [pve-devel] applied: " Thomas Lamprecht
2021-02-01 14:21 ` [pve-devel] [PATCH manager 6/7] ui: qemu/HardwareView: check EFI Disk button permissions Aaron Lauterer
2021-02-03  7:37   ` [pve-devel] applied: " Thomas Lamprecht
2021-02-01 14:21 ` [pve-devel] [PATCH manager 7/7] ui: qemu/HardwareView: add CDROM permission check to edit button Aaron Lauterer
2021-02-02 13:13   ` Dominik Csapak
2021-02-02 13:41     ` Aaron Lauterer
2021-02-03  6:21       ` Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4f0cb5f8-b49d-8f68-c4e9-ccf5c1158299@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal