]> git.proxmox.com Git - proxmox-backup.git/commitdiff
ui: trim whitespaces when adding a subscription key
authorStefan Sterz <s.sterz@proxmox.com>
Fri, 1 Mar 2024 09:40:19 +0000 (10:40 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 1 Mar 2024 09:44:40 +0000 (10:44 +0100)
users that add the correct subscription key just get unnecessarily
confused with a "value does not match the regex pattern" error if
they accidentally have a stray whitespace at the end or beginning
otherwise.

Switch to using our `proxmoxtextfield` component that provides a
`trimValue` config option since widget-toolkit commit 5d7d30d ("text
field: add trimValue config") that was made just for this case.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
 [ TL: reference widget toolkit commit ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/Subscription.js

index 7f1de468c2faca7f437f3288e5f7526c818586ef..0780c4d411742bc1b3810d6f8f291dfbc5e5cd5e 100644 (file)
@@ -8,7 +8,8 @@ Ext.define('PBS.SubscriptionKeyEdit', {
     onlineHelp: 'get_help',
 
     items: {
-       xtype: 'textfield',
+       xtype: 'proxmoxtextfield',
+       trimValue: true,
        labelWidth: 120,
        name: 'key',
        value: '',