public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: Thomas Lamprecht <t.lamprecht@proxmox.com>,
	Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup 5/7] ui: Dashboard/TaskSummary: refactor types and title
Date: Tue, 6 Oct 2020 08:56:53 +0200	[thread overview]
Message-ID: <a4915ee9-d367-8a11-0fde-2285e4c1edc2@proxmox.com> (raw)
In-Reply-To: <f6dbdc81-e717-19c0-647b-c37fcdd7ba54@proxmox.com>

On 10/5/20 4:52 PM, Thomas Lamprecht wrote:
> On 05.10.20 15:43, Dominik Csapak wrote:
>> by moving the definition into the controller and dynamically use them
>> in the updateTasks function
>>
>> we will reuse/extend this later
>>
>> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
>> ---
>>   www/dashboard/TaskSummary.js | 31 +++++++++++++++++++++----------
>>   1 file changed, 21 insertions(+), 10 deletions(-)
>>
>> diff --git a/www/dashboard/TaskSummary.js b/www/dashboard/TaskSummary.js
>> index 0cf049cd..efbd011d 100644
>> --- a/www/dashboard/TaskSummary.js
>> +++ b/www/dashboard/TaskSummary.js
>> @@ -7,6 +7,20 @@ Ext.define('PBS.TaskSummary', {
>>       controller: {
>>   	xclass: 'Ext.app.ViewController',
>>   
>> +	types: [
>> +	    "backup",
>> +	    "prune",
>> +	    "garbage_collection",
>> +	    "sync",
>> +	],
>> +
>> +	titles: {
>> +	    "backup": gettext('Backups'),
>> +	    "prune": gettext('Prunes'),
>> +	    "garbage_collection": gettext('Garbage collections'),
>> +	    "sync": gettext('Syncs'),
>> +	},
>> +
>>   	render_icon: function(state, count) {
>>   	    let cls = 'question';
>>   	    let color = 'faded';
>> @@ -42,16 +56,13 @@ Ext.define('PBS.TaskSummary', {
>>   
>>       updateTasks: function(data) {
>>   	let me = this;
>> -	data.backup.type = gettext('Backups');
>> -	data.prune.type = gettext('Prunes');
>> -	data.garbage_collection.type = gettext('Garbage collections');
>> -	data.sync.type = gettext('Syncs');
>> -	me.lookup('grid').getStore().setData([
>> -	    data.backup,
>> -	    data.prune,
>> -	    data.garbage_collection,
>> -	    data.sync,
>> -	]);
>> +	let controller = me.getController();
>> +	let data = [];
> 
> This introduces an linter error:
> 
>> [./dashboard/TaskSummary.js]:
>> ERR : line 60 col 6: null - Parsing error: Identifier 'data' has already been declared
> 
> You're overwriting the function parameter "data" scope here.
> 
>> +	controller.types.forEach((type) => {
>> +	    source[type].type = controller.titles[type];
> 
> "source" is not declared anywhere?

ah yes, this went wrong when i separated the patches

the function signature should be:

updateTasks: function(source) {

(after patch 7/7 it's ok again)

i'll send a v2 later

> 
>> +	    data.push(source[type]);
>> +	});
>> +	me.lookup('grid').getStore().setData(data);
>>       },
>>   
>>       layout: 'fit',
>>
> 





  reply	other threads:[~2020-10-06  6:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-05 13:43 [pbs-devel] [PATCH proxmox-backup 1/7] api2/types: add TaskStateType struct Dominik Csapak
2020-10-05 13:43 ` [pbs-devel] [PATCH proxmox-backup 2/7] api2/status: add type- and statusfilter to tasks api call Dominik Csapak
2020-10-05 13:43 ` [pbs-devel] [PATCH proxmox-backup 3/7] ui: implment task history limit and make it configurable Dominik Csapak
2020-10-05 14:44   ` Thomas Lamprecht
2020-10-05 13:43 ` [pbs-devel] [PATCH proxmox-backup 4/7] ui: refactor render_icon code Dominik Csapak
2020-10-05 14:52   ` [pbs-devel] applied: " Thomas Lamprecht
2020-10-05 13:43 ` [pbs-devel] [PATCH proxmox-backup 5/7] ui: Dashboard/TaskSummary: refactor types and title Dominik Csapak
2020-10-05 14:52   ` Thomas Lamprecht
2020-10-06  6:56     ` Dominik Csapak [this message]
2020-10-05 13:43 ` [pbs-devel] [PATCH proxmox-backup 6/7] ui: Dashboard/TaskSummary: add Verifies to the Summary Dominik Csapak
2020-10-05 13:43 ` [pbs-devel] [PATCH proxmox-backup 7/7] ui: Dashboard/TaskSummary: show task overlay when clicking on a count Dominik Csapak

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=a4915ee9-d367-8a11-0fde-2285e4c1edc2@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    --cc=t.lamprecht@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