]> git.proxmox.com Git - pmg-gui.git/commitdiff
rename create to isCreate
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 14 Nov 2017 10:17:21 +0000 (11:17 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 14 Nov 2017 10:40:42 +0000 (11:40 +0100)
following the changes in the edit window, we have to use
isCreate instead of create, which gets rid of many jslint
type confusion errors

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
js/ActionList.js
js/LDAPConfig.js
js/MyNetworks.js
js/ObjectGroupList.js
js/RelayDomains.js
js/RuleConfiguration.js
js/Transport.js
js/UserBlackWhiteList.js
js/UserEdit.js

index f9c0dfa4e738121e91acaaba59b2e357ffd3d83e..213afb224b3bf76b9525402c9f99bf594f30093d 100644 (file)
@@ -82,10 +82,7 @@ Ext.define('PMG.ActionList', {
 
            var config = Ext.apply({ method: 'POST' }, editor);
 
-           /*jslint confusion: true*/
-           /*create is a boolean below and a function above*/
-           config.create = true;
-           /*jslint confusion: false*/
+           config.isCreate = true;
            menu_items.push({
                text: config.subject,
                handler: function() {
index 6bea55d2ac9e8c786e3406276f278e7db3dcd7f0..71760df4e6b2c166ef721b1d0dce586a096e65b2 100644 (file)
@@ -1,7 +1,6 @@
 /*global Proxmox*/
 /*jslint confusion: true*/
-/*create is function and bool,
- * reload is function and string,
+/* reload is function and string,
  * height is number and string,
  * hidden is bool and string,
  * bind is function and object,
@@ -73,7 +72,7 @@ Ext.define('PMG.LDAPInputPanel', {
                xtype: 'proxmoxtextfield',
                fieldLabel: gettext('Server'),
                allowBlank: true,
-               deleteEmpty: me.create ? false : true,
+               deleteEmpty: me.isCreate ? false : true,
                vtype: 'IP64Address',
                name: 'server2'
            },
@@ -81,7 +80,7 @@ Ext.define('PMG.LDAPInputPanel', {
                xtype: 'proxmoxintegerfield',
                name: 'port',
                emptyText: gettext('Default'),
-               deleteEmpty: me.create ? false : true,
+               deleteEmpty: me.isCreate ? false : true,
                minValue: 1,
                maxValue: 65535,
                fieldLabel: gettext('Port')
@@ -112,42 +111,42 @@ Ext.define('PMG.LDAPInputPanel', {
            {
                xtype: 'proxmoxtextfield',
                allowBlank: true,
-               deleteEmpty: me.create ? false : true,
+               deleteEmpty: me.isCreate ? false : true,
                name: 'basedn',
                fieldLabel: gettext('Base DN')
            },
            {
                xtype: 'proxmoxtextfield',
                allowBlank: true,
-               deleteEmpty: me.create ? false : true,
+               deleteEmpty: me.isCreate ? false : true,
                name: 'groupbasedn',
                fieldLabel: gettext('Base DN for Groups')
            },
            {
                xtype: 'proxmoxtextfield',
                allowBlank: true,
-               deleteEmpty: me.create ? false : true,
+               deleteEmpty: me.isCreate ? false : true,
                name: 'mailattr',
                fieldLabel: gettext('EMail attribute name(s)')
            },
            {
                xtype: 'proxmoxtextfield',
                allowBlank: true,
-               deleteEmpty: me.create ? false : true,
+               deleteEmpty: me.isCreate ? false : true,
                name: 'accountattr',
                fieldLabel: gettext('Account attribute name')
            },
            {
                xtype: 'proxmoxtextfield',
                allowBlank: true,
-               deleteEmpty: me.create ? false : true,
+               deleteEmpty: me.isCreate ? false : true,
                name: 'filter',
                fieldLabel: gettext('LDAP filter')
            },
            {
                xtype: 'proxmoxtextfield',
                allowBlank: true,
-               deleteEmpty: me.create ? false : true,
+               deleteEmpty: me.isCreate ? false : true,
                name: 'groupclass',
                fieldLabel: gettext('Group objectclass')
            }
@@ -176,9 +175,9 @@ Ext.define('PMG.LDAPEdit', {
     initComponent : function() {
        var me = this;
 
-       me.create = me.profileId ? false : true;
+       me.isCreate = me.profileId ? false : true;
 
-       if (me.create) {
+       if (me.isCreate) {
             me.url = '/api2/extjs/config/ldap';
             me.method = 'POST';
        } else {
@@ -187,7 +186,7 @@ Ext.define('PMG.LDAPEdit', {
        }
 
        var ipanel = Ext.create('PMG.LDAPInputPanel', {
-           create: me.create,
+           isCreate: me.isCreate,
            profileId: me.profileId
        });
 
@@ -199,7 +198,7 @@ Ext.define('PMG.LDAPEdit', {
 
        me.callParent();
 
-       if (!me.create) {
+       if (!me.isCreate) {
            me.load({
                success:  function(response, options) {
                    var values = response.result.data;
index 977af50d7032902fd0e6b3a3330ed94482aa8b56..955b3fae0971590341ec31c9b6758eaf213dfc94 100644 (file)
@@ -80,11 +80,10 @@ Ext.define('PMG.MyNetworks', {
                text: gettext('Create'),
                handler: function() {
                    /*jslint confusion: true*/
-                   /* create is function and bool */
                    var config = {
                        method: 'POST',
                        url: "/api2/extjs/config/mynetworks",
-                       create: true,
+                       isCreate: true,
                        subject: gettext("Trusted Network"),
                        items: [
                            {
index e30ed2d524165699bcfc29782bee0c446cfe3356..6f98454b97992a87f68454a9109686a32a496b35 100644 (file)
@@ -102,8 +102,6 @@ Ext.define('PMG.ObjectGroupList', {
            waitMsgTarget: me
        });
 
-       /*jslint confusion: true*/
-       /* create is a boolean below, a function above */
        var tbar = [
             {
                xtype: 'proxmoxButton',
@@ -118,7 +116,7 @@ Ext.define('PMG.ObjectGroupList', {
                    var config = {
                        method: 'POST',
                        url: "/api2/extjs" + me.baseurl,
-                       create: true,
+                       isCreate: true,
                        width: 400,
                        subject: me.subject,
                        items: me.inputItems
@@ -132,7 +130,6 @@ Ext.define('PMG.ObjectGroupList', {
             },
            remove_btn
         ];
-       /*jslint confusion: false*/
 
        Proxmox.Utils.monStoreErrors(me, me.store, true);
 
index 387355a857be5081bde43b5bbf186a7aba97f2d1..8945b2d3512a7c3e0d0fae9add2944b475928516 100644 (file)
@@ -80,11 +80,10 @@ Ext.define('PMG.RelayDomains', {
                text: gettext('Create'),
                handler: function() {
                    /*jslint confusion: true*/
-                   /* create is a function and boolean */
                    var config = {
                        method: 'POST',
                        url: "/api2/extjs/config/domains",
-                       create: true,
+                       isCreate: true,
                        subject: gettext("Relay Domain"),
                        items: [
                            {
index 94b19d45a4c2db1eeaaf6895f1ea6949e1737ed4..82e4c30157a2800f8362a4f5dc28cbbccd444ffb 100644 (file)
@@ -1,7 +1,6 @@
 /*global Proxmox*/
 /*jslint confusion: true*/
-/* create is a function and boolean,
- * bind is a function and object,
+/* bind is a function and object,
  * callback is a function and string
  */
 Ext.define('pmg-rule-list', {
@@ -86,7 +85,7 @@ Ext.define('PMG.RulesConfiguration', {
            var win = Ext.create('PMG.RuleEditor', {
                url: '/api2/extjs/config/ruledb/rules/',
                method: 'POST',
-               create: true,
+               isCreate: true,
                listeners: {
                    destroy: function() {
                        me.lookupReference('rulegrid').getStore().load();
index ab37f677d8e989bfa8eaac2918fcf97b47b4a055..b5e20d8b4f0006c916088ac893173b689111d4a0 100644 (file)
@@ -100,8 +100,6 @@ Ext.define('PMG.Transport', {
            win.show();
        };
 
-       /*jslint confusion: true*/
-       /*create is a function and boolean */
        var tbar = [
             {
                xtype: 'proxmoxButton',
@@ -116,7 +114,7 @@ Ext.define('PMG.Transport', {
                    var config = {
                        method: 'POST',
                        url: "/api2/extjs/config/transport",
-                       create: true,
+                       isCreate: true,
                        subject: gettext("Transport"),
                        items: create_properties
                    };
@@ -129,7 +127,6 @@ Ext.define('PMG.Transport', {
             },
            remove_btn
         ];
-       /*jslint confusion: false*/
 
        Proxmox.Utils.monStoreErrors(me, store, true);
 
index 523bd17fd559e16984c8781500c1d4ed18b0831a..c1912423789083e57fa3be706b0505f3246d8167 100644 (file)
@@ -38,16 +38,13 @@ Ext.define('PMG.UserBlackWhiteList', {
                });
            });
 
-           /*jslint confusion: true*/
-           /* create is an function */
            var config = {
                method: 'POST',
                url: url,
-               create: true,
+               isCreate: true,
                isAdd: true,
                items: items
            };
-           /*jslint confusion: false*/
 
            if (me.listname === 'blacklist') {
                config.subject = gettext("Blacklist");
index f8c27b4537ce35dfb299454f4ff7f90e8f12fdc3..e3ab5a296970680e4dee4a3e6c5838e674b732eb 100644 (file)
@@ -20,7 +20,7 @@ Ext.define('PMG.UserEdit', {
        var userid = initialConfig.userid;
        var baseurl = '/api2/extjs/access/users';
 
-       me.create = !userid;
+       me.isCreate = !userid;
        me.url = userid ?  baseurl + '/' + userid : baseurl;
        me.method = userid ? 'PUT' : 'POST';
        me.autoLoad = userid ? true : false;
@@ -40,7 +40,7 @@ Ext.define('PMG.UserEdit', {
                fieldLabel: gettext('User name'),
                allowBlank: false,
                cbind: {
-                   submitValue: '{create}',
+                   submitValue: '{isCreate}',
                    xtype: '{useridXType}'
                }
            },
@@ -60,8 +60,8 @@ Ext.define('PMG.UserEdit', {
                     }
                },
                cbind: {
-                   hidden: '{!create}',
-                   disabled: '{!create}'
+                   hidden: '{!isCreate}',
+                   disabled: '{!isCreate}'
                }
            },
            {
@@ -74,8 +74,8 @@ Ext.define('PMG.UserEdit', {
                allowBlank: false,
                submitValue: false,
                cbind: {
-                   hidden: '{!create}',
-                   disabled: '{!create}'
+                   hidden: '{!isCreate}',
+                   disabled: '{!isCreate}'
                }
            },
            {
@@ -117,7 +117,7 @@ Ext.define('PMG.UserEdit', {
                name: 'firstname',
                fieldLabel: gettext('First Name'),
                cbind: {
-                   deleteEmpty: '{!create}'
+                   deleteEmpty: '{!isCreate}'
                }
            },
            {
@@ -125,7 +125,7 @@ Ext.define('PMG.UserEdit', {
                name: 'lastname',
                fieldLabel: gettext('Last Name'),
                cbind: {
-                   deleteEmpty: '{!create}'
+                   deleteEmpty: '{!isCreate}'
                }
            },
            {
@@ -134,7 +134,7 @@ Ext.define('PMG.UserEdit', {
                fieldLabel: gettext('E-Mail'),
                vtype: 'proxmoxMail',
                cbind: {
-                   deleteEmpty: '{!create}'
+                   deleteEmpty: '{!isCreate}'
                }
            }
        ],
@@ -146,7 +146,7 @@ Ext.define('PMG.UserEdit', {
                fieldLabel: gettext('Comment'),
                cbind: {
                    disabled: '{isSuperUser}',
-                   deleteEmpty: '{!create}'
+                   deleteEmpty: '{!isCreate}'
                }
            },
            {
@@ -154,7 +154,7 @@ Ext.define('PMG.UserEdit', {
                name: 'keys',
                fieldLabel: gettext('Key IDs'),
                cbind: {
-                   deleteEmpty: '{!create}'
+                   deleteEmpty: '{!isCreate}'
                }
            }
        ]
@@ -170,7 +170,7 @@ Ext.define('PMG.UserEdit', {
            values.expire = 0;
        }
 
-       if (me.create) {
+       if (me.isCreate) {
            values.userid = values.username + '@pmg';
        }