public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH v2 proxmox-widget-toolkit/proxmox-backup 0/2] ui: slightly improve removable datastore dialog
@ 2024-11-26 16:20 Fiona Ebner
  2024-11-26 16:20 ` [pbs-devel] [PATCH v2 widget-toolkit] form: display-edit: support emptyText Fiona Ebner
  2024-11-26 16:20 ` [pbs-devel] [PATCH v2 proxmox-backup 2/2] ui: datastore edit: fix emptytext for path field Fiona Ebner
  0 siblings, 2 replies; 4+ messages in thread
From: Fiona Ebner @ 2024-11-26 16:20 UTC (permalink / raw)
  To: pbs-devel

Changes in v2:
* avoid tracking emptyText state twice

proxmox-widget-toolkit:

Fiona Ebner (1):
  form: display-edit: support emptyText

 src/form/DisplayEdit.js | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

proxmox-backup:

Fiona Ebner (1):
  ui: datastore edit: fix emptytext for path field

 www/window/DataStoreEdit.js | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.39.5



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pbs-devel] [PATCH v2 widget-toolkit] form: display-edit: support emptyText
  2024-11-26 16:20 [pbs-devel] [PATCH v2 proxmox-widget-toolkit/proxmox-backup 0/2] ui: slightly improve removable datastore dialog Fiona Ebner
@ 2024-11-26 16:20 ` Fiona Ebner
  2024-11-26 16:25   ` Fiona Ebner
  2024-11-26 16:20 ` [pbs-devel] [PATCH v2 proxmox-backup 2/2] ui: datastore edit: fix emptytext for path field Fiona Ebner
  1 sibling, 1 reply; 4+ messages in thread
From: Fiona Ebner @ 2024-11-26 16:20 UTC (permalink / raw)
  To: pbs-devel

To access the edit field, its xtype is now tracked.

First user is intended to be the path field for datastores where the
emptyText should dynamically be for a relative or absolute path.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---

Changes in v2:
* avoid tracking emptyText state twice, pass directly to edit field.

 src/form/DisplayEdit.js | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/form/DisplayEdit.js b/src/form/DisplayEdit.js
index fe1b83b..01d6a05 100644
--- a/src/form/DisplayEdit.js
+++ b/src/form/DisplayEdit.js
@@ -12,6 +12,9 @@ Ext.define('Proxmox.form.field.DisplayEdit', {
 
     displayType: 'displayfield',
 
+    // internal only, use editConfig to set the xtype
+    _editType: 'textfield',
+
     editConfig: {},
     editable: false,
     setEditable: function(editable) {
@@ -41,6 +44,15 @@ Ext.define('Proxmox.form.field.DisplayEdit', {
 	vm.get('value');
     },
 
+    setEmptyText: function(emptyText) {
+	let me = this;
+	me.down(me._editType).setEmptyText(emptyText);
+    },
+    getEmptyText: function() {
+	let me = this;
+	return me.down(me._editType).getEmptyText();
+    },
+
     layout: 'fit',
     defaults: {
 	hideLabel: true,
@@ -64,6 +76,8 @@ Ext.define('Proxmox.form.field.DisplayEdit', {
 	});
 	Ext.applyIf(editConfig, displayConfig);
 
+	me.__editType = editConfig.xtype;
+
 	if (me.initialConfig && me.initialConfig.displayConfig) {
 	    Ext.applyIf(displayConfig, me.initialConfig.displayConfig);
 	    delete displayConfig.displayConfig;
-- 
2.39.5



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pbs-devel] [PATCH v2 proxmox-backup 2/2] ui: datastore edit: fix emptytext for path field
  2024-11-26 16:20 [pbs-devel] [PATCH v2 proxmox-widget-toolkit/proxmox-backup 0/2] ui: slightly improve removable datastore dialog Fiona Ebner
  2024-11-26 16:20 ` [pbs-devel] [PATCH v2 widget-toolkit] form: display-edit: support emptyText Fiona Ebner
@ 2024-11-26 16:20 ` Fiona Ebner
  1 sibling, 0 replies; 4+ messages in thread
From: Fiona Ebner @ 2024-11-26 16:20 UTC (permalink / raw)
  To: pbs-devel

It is a relative path for removable datastores.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---

No changes in v2.

 www/window/DataStoreEdit.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/www/window/DataStoreEdit.js b/www/window/DataStoreEdit.js
index 40ccd20a..4a0b8d81 100644
--- a/www/window/DataStoreEdit.js
+++ b/www/window/DataStoreEdit.js
@@ -114,8 +114,10 @@ Ext.define('PBS.DataStoreEdit', {
 				uuidEditField.setValue('');
 				if (isRemovable) {
 				    pathField.setFieldLabel(gettext('Path on Device'));
+				    pathField.setEmptyText(gettext('A relative path'));
 				} else {
 				    pathField.setFieldLabel(gettext('Backing Path'));
+				    pathField.setEmptyText(gettext('An absolute path'));
 				}
 			    },
 			},
-- 
2.39.5



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [pbs-devel] [PATCH v2 widget-toolkit] form: display-edit: support emptyText
  2024-11-26 16:20 ` [pbs-devel] [PATCH v2 widget-toolkit] form: display-edit: support emptyText Fiona Ebner
@ 2024-11-26 16:25   ` Fiona Ebner
  0 siblings, 0 replies; 4+ messages in thread
From: Fiona Ebner @ 2024-11-26 16:25 UTC (permalink / raw)
  To: pbs-devel



Am 26.11.24 um 17:20 schrieb Fiona Ebner:
> To access the edit field, its xtype is now tracked.
> 
> First user is intended to be the path field for datastores where the
> emptyText should dynamically be for a relative or absolute path.
> 
> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
> ---
> 
> Changes in v2:
> * avoid tracking emptyText state twice, pass directly to edit field.
> 
>  src/form/DisplayEdit.js | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/src/form/DisplayEdit.js b/src/form/DisplayEdit.js
> index fe1b83b..01d6a05 100644
> --- a/src/form/DisplayEdit.js
> +++ b/src/form/DisplayEdit.js
> @@ -12,6 +12,9 @@ Ext.define('Proxmox.form.field.DisplayEdit', {
>  
>      displayType: 'displayfield',
>  
> +    // internal only, use editConfig to set the xtype
> +    _editType: 'textfield',
> +
>      editConfig: {},
>      editable: false,
>      setEditable: function(editable) {
> @@ -41,6 +44,15 @@ Ext.define('Proxmox.form.field.DisplayEdit', {
>  	vm.get('value');
>      },
>  
> +    setEmptyText: function(emptyText) {
> +	let me = this;
> +	me.down(me._editType).setEmptyText(emptyText);
> +    },
> +    getEmptyText: function() {
> +	let me = this;
> +	return me.down(me._editType).getEmptyText();
> +    },
> +
>      layout: 'fit',
>      defaults: {
>  	hideLabel: true,
> @@ -64,6 +76,8 @@ Ext.define('Proxmox.form.field.DisplayEdit', {
>  	});
>  	Ext.applyIf(editConfig, displayConfig);
>  
> +	me.__editType = editConfig.xtype;

Sorry, there is a typo here, __editType instead of _editType

> +
>  	if (me.initialConfig && me.initialConfig.displayConfig) {
>  	    Ext.applyIf(displayConfig, me.initialConfig.displayConfig);
>  	    delete displayConfig.displayConfig;



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-11-26 16:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-26 16:20 [pbs-devel] [PATCH v2 proxmox-widget-toolkit/proxmox-backup 0/2] ui: slightly improve removable datastore dialog Fiona Ebner
2024-11-26 16:20 ` [pbs-devel] [PATCH v2 widget-toolkit] form: display-edit: support emptyText Fiona Ebner
2024-11-26 16:25   ` Fiona Ebner
2024-11-26 16:20 ` [pbs-devel] [PATCH v2 proxmox-backup 2/2] ui: datastore edit: fix emptytext for path field Fiona Ebner

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