public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Aaron Lauterer <a.lauterer@proxmox.com>
To: Dominik Csapak <d.csapak@proxmox.com>,
	Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH v2 manager 2/2] ui: ceph status: add tooltip with details to warnings
Date: Wed, 8 Mar 2023 13:03:03 +0100	[thread overview]
Message-ID: <c271299b-a0ec-5da5-ad79-6a91916948f3@proxmox.com> (raw)
In-Reply-To: <68c45f86-51f1-5656-b5d5-3f7b7d82b74c@proxmox.com>



On 3/8/23 10:27, Dominik Csapak wrote:
> nice, works really good now with the different interactions
> (button/container/changing store/etc)
> 
> some comments inline (mostly minor stuff though)
> 
> On 3/3/23 16:59, Aaron Lauterer wrote:
[...]
>> diff --git a/www/manager6/ceph/Status.js b/www/manager6/ceph/Status.js
>> index b223ab35..9de89df5 100644
>> --- a/www/manager6/ceph/Status.js
>> +++ b/www/manager6/ceph/Status.js
>> @@ -76,6 +76,66 @@ Ext.define('PVE.node.CephStatus', {
>>               trackRemoved: false,
>>               data: [],
>>               },
>> +            generateTooltipText: (text) => {
>> +            text = text?.trimStart();
> 
> above you indicate that text might be undefined (with the 'text?.'),
> but below you don't to any checks again
> 
> iff text can really be undefined, i'd do
> text = text?.trimStart() ?? '';
> 
> otherwise just drop the '?'


hmm yeah, AFAICT there are already checks in place before we even call 
generateTooltipText -> dropping the '?'

> 
>> +            if (text.length > 500) {
>> +                text = `${text.substring(0, 500)}…`;
>> +            }
>> +            return text.replaceAll('\n', '<br>');
>> +            },
>> +            updateTooltip: (view, isLeave) => {
>> +            if (!view.tooltip) {
> 
> i was rather confused at first what 'view' actually is, but
> i found out it's the table view of the grid
> 
> couldn't you use always the grid ('this') instead ?
> or is there some instance where 'this' isn't the grid?
> 
> i think that would make the code a bit more readable, since
> you don't have to pass the view around

as discussed off-list: arrow functions do not set 'this' in the same context -> 
switch to regular 'updateTooltip: function(..) {' instead of arrow functions and 
in other places too.
> 

[...]




      reply	other threads:[~2023-03-08 12:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-03 15:59 [pve-devel] [PATCH v2 manager 0/2] ui: ceph: improve discoverability of warning details Aaron Lauterer
2023-03-03 15:59 ` [pve-devel] [PATCH v2 manager 1/2] ui: ceph: make the warning detail button stand out more Aaron Lauterer
2023-03-03 15:59 ` [pve-devel] [PATCH v2 manager 2/2] ui: ceph status: add tooltip with details to warnings Aaron Lauterer
2023-03-08  9:27   ` Dominik Csapak
2023-03-08 12:03     ` Aaron Lauterer [this message]

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=c271299b-a0ec-5da5-ad79-6a91916948f3@proxmox.com \
    --to=a.lauterer@proxmox.com \
    --cc=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