diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/static/js/trigger.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/static/js/trigger.js index 585f0828a..5fb42ac93 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/static/js/trigger.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/static/js/trigger.js @@ -17,25 +17,6 @@ define('pgadmin.node.trigger', [ gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify, SchemaChildTreeNode ) { - Backform.CustomSwitchControl = Backform.SwitchControl.extend({ - defaults: { - label: '', - options: { - onText: gettext('Yes'), - offText: gettext('No'), - onColor: 'success', - offColor: 'primary', - size: 'mini', - width: null, - height: null, - }, - controlLabelClassName: 'control-label pg-el-sm-5 pg-el-12', - controlsClassName: 'pgadmin-controls pg-el-sm-7 pg-el-12', - extraClasses: [], - helpMessage: null, - }, - className: 'pgadmin-control-group form-group col-6 row', - }); if (!pgBrowser.Nodes['coll-trigger']) { pgAdmin.Browser.Nodes['coll-trigger'] = @@ -396,7 +377,9 @@ define('pgadmin.node.trigger', [ id: 'evnt_insert', label: gettext('INSERT'), type: 'switch', mode: ['create','edit', 'properties'], group: gettext('Events'), - control: Backform.CustomSwitchControl, + extraToggleClasses: 'pg-el-sm-6', + controlLabelClassName: 'control-label pg-el-sm-5 pg-el-12', + controlsClassName: 'pgadmin-controls pg-el-sm-7 pg-el-12', disabled: function(m) { var evn_insert = m.get('evnt_insert'); if (!_.isUndefined(evn_insert) && m.node_info['server']['server_type'] == 'ppas') @@ -407,7 +390,9 @@ define('pgadmin.node.trigger', [ id: 'evnt_update', label: gettext('UPDATE'), type: 'switch', mode: ['create','edit', 'properties'], group: gettext('Events'), - control: Backform.CustomSwitchControl, + extraToggleClasses: 'pg-el-sm-6', + controlLabelClassName: 'control-label pg-el-sm-5 pg-el-12', + controlsClassName: 'pgadmin-controls pg-el-sm-7 pg-el-12', disabled: function(m) { var evn_update = m.get('evnt_update'); if (!_.isUndefined(evn_update) && m.node_info['server']['server_type'] == 'ppas') @@ -418,7 +403,9 @@ define('pgadmin.node.trigger', [ id: 'evnt_delete', label: gettext('DELETE'), type: 'switch', mode: ['create','edit', 'properties'], group: gettext('Events'), - control: Backform.CustomSwitchControl, + extraToggleClasses: 'pg-el-sm-6', + controlLabelClassName: 'control-label pg-el-sm-5 pg-el-12', + controlsClassName: 'pgadmin-controls pg-el-sm-7 pg-el-12', disabled: function(m) { var evn_delete = m.get('evnt_delete'); if (!_.isUndefined(evn_delete) && m.node_info['server']['server_type'] == 'ppas') @@ -428,7 +415,9 @@ define('pgadmin.node.trigger', [ },{ id: 'evnt_truncate', label: gettext('TRUNCATE'), type: 'switch', group: gettext('Events'), - control: Backform.CustomSwitchControl, + extraToggleClasses: 'pg-el-sm-6', + controlLabelClassName: 'control-label pg-el-sm-5 pg-el-12', + controlsClassName: 'pgadmin-controls pg-el-sm-7 pg-el-12', disabled: function(m) { var is_constraint_trigger = m.get('is_constraint_trigger'), is_row_trigger = m.get('is_row_trigger'), diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.js b/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.js index a300c70aa..1df971d7b 100644 --- a/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.js +++ b/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.js @@ -137,7 +137,8 @@ define('pgadmin.node.pga_jobstep', [ id: 'jstname', label: gettext('Name'), type: 'text', disabled: false, cellHeaderClasses: 'width_percent_60', },{ - id: 'jstenabled', label: gettext('Enabled?'), type: 'switch', + id: 'jstenabled', label: gettext('Enabled?'), + type: 'switch', disabled: function() { return false; }, },{ id: 'jstkind', label: gettext('Kind'), type: 'switch', diff --git a/web/pgadmin/browser/server_groups/servers/roles/static/js/role.js b/web/pgadmin/browser/server_groups/servers/roles/static/js/role.js index 91f7dcf33..dd4539297 100644 --- a/web/pgadmin/browser/server_groups/servers/roles/static/js/role.js +++ b/web/pgadmin/browser/server_groups/servers/roles/static/js/role.js @@ -70,32 +70,6 @@ define('pgadmin.node.role', [ }, }); - var switchOptions = { - 'onText': gettext('Yes'), 'offText': gettext('No'), - 'size': 'mini', onColor: 'success', - offColor: 'primary', - }; - - var RoleCustomSwitchControl = Backform.SwitchControl.extend({ - defaults: { - label: '', - options: { - onText: gettext('Yes'), - offText: gettext('No'), - onColor: 'success', - offColor: 'primary', - size: 'mini', - width: null, - height: null, - }, - controlLabelClassName: 'control-label pg-el-sm-4 pg-el-12', - controlsClassName: 'pgadmin-controls pg-el-sm-8 pg-el-12', - extraClasses: [], - helpMessage: null, - }, - className: 'pgadmin-control-group form-group pg-el-12 row', - }); - var RoleMembersControl = Backform.Control.extend({ defaults: _.defaults( {extraClasses: ['col-12 col-sm-12 col-md-12']}, @@ -439,13 +413,21 @@ define('pgadmin.node.role', [ label: gettext('Connection limit'), cell: 'integer', min : -1, mode: ['properties', 'edit', 'create'], disabled: 'readonly', },{ - id: 'rolcanlogin', label: gettext('Can login?'), type: 'switch', - group: gettext('Privileges'), options: switchOptions, - disabled: 'readonly', control: RoleCustomSwitchControl, + id: 'rolcanlogin', label: gettext('Can login?'), + type: 'switch', + options: {'onText': gettext('Yes'), 'offText': gettext('No')}, + controlLabelClassName: 'control-label pg-el-sm-4 pg-el-12', + controlsClassName: 'pgadmin-controls pg-el-sm-8 pg-el-12', + group: gettext('Privileges'), + disabled: 'readonly', },{ - id: 'rolsuper', label: gettext('Superuser'), type: 'switch', - group: gettext('Privileges'), options: switchOptions, - control: RoleCustomSwitchControl.extend({ + id: 'rolsuper', label: gettext('Superuser'), + type: 'switch', + options: {'onText': gettext('Yes'), 'offText': gettext('No')}, + controlLabelClassName: 'control-label pg-el-sm-4 pg-el-12', + controlsClassName: 'pgadmin-controls pg-el-sm-8 pg-el-12', + group: gettext('Privileges'), + control: Backform.SwitchControl.extend({ onChange: function() { Backform.SwitchControl.prototype.onChange.apply(this, arguments); @@ -457,35 +439,51 @@ define('pgadmin.node.role', [ disabled: 'readonly', },{ id: 'rolcreaterole', label: gettext('Create roles?'), - group: gettext('Privileges'), type: 'switch', - options: switchOptions, disabled: 'readonly', - control: RoleCustomSwitchControl, + group: gettext('Privileges'), + type: 'switch', + options: {'onText': gettext('Yes'), 'offText': gettext('No')}, + controlLabelClassName: 'control-label pg-el-sm-4 pg-el-12', + controlsClassName: 'pgadmin-controls pg-el-sm-8 pg-el-12', + disabled: 'readonly', },{ id: 'description', label: gettext('Comments'), type: 'multiline', group: null, mode: ['properties', 'edit', 'create'], - options: switchOptions, disabled: 'readonly', + disabled: 'readonly', },{ id: 'rolcreatedb', label: gettext('Create databases?'), - group: gettext('Privileges'), type: 'switch', - options: switchOptions, disabled: 'readonly', - control: RoleCustomSwitchControl, + group: gettext('Privileges'), + type: 'switch', + options: {'onText': gettext('Yes'), 'offText': gettext('No')}, + controlLabelClassName: 'control-label pg-el-sm-4 pg-el-12', + controlsClassName: 'pgadmin-controls pg-el-sm-8 pg-el-12', + disabled: 'readonly', },{ id: 'rolcatupdate', label: gettext('Update catalog?'), - type: 'switch', max_version: 90400, options: switchOptions, - control: RoleCustomSwitchControl, + type: 'switch', + options: {'onText': gettext('Yes'), 'offText': gettext('No')}, + controlLabelClassName: 'control-label pg-el-sm-4 pg-el-12', + controlsClassName: 'pgadmin-controls pg-el-sm-8 pg-el-12', + max_version: 90400, group: gettext('Privileges'), disabled: function(m) { return (m.get('read_only') || (!m.get('rolsuper'))); }, },{ id: 'rolinherit', group: gettext('Privileges'), label: gettext('Inherit rights from the parent roles?'), - type: 'switch', options: switchOptions, disabled: 'readonly', - control: RoleCustomSwitchControl, + type: 'switch', + options: {'onText': gettext('Yes'), 'offText': gettext('No')}, + controlLabelClassName: 'control-label pg-el-sm-4 pg-el-12', + controlsClassName: 'pgadmin-controls pg-el-sm-8 pg-el-12', + disabled: 'readonly', },{ id: 'rolreplication', group: gettext('Privileges'), label: gettext('Can initiate streaming replication and backups?'), - type: 'switch', min_version: 90100, options: switchOptions, - disabled: 'readonly', control: RoleCustomSwitchControl, + type: 'switch', + options: {'onText': gettext('Yes'), 'offText': gettext('No')}, + controlLabelClassName: 'control-label pg-el-sm-4 pg-el-12', + controlsClassName: 'pgadmin-controls pg-el-sm-8 pg-el-12', + min_version: 90100, + disabled: 'readonly', },{ id: 'rolmembership', label: gettext('Roles'), group: gettext('Membership'), type: 'collection', diff --git a/web/pgadmin/static/js/backform.pgadmin.js b/web/pgadmin/static/js/backform.pgadmin.js index f02a4b45f..d180bcbd4 100644 --- a/web/pgadmin/static/js/backform.pgadmin.js +++ b/web/pgadmin/static/js/backform.pgadmin.js @@ -439,10 +439,11 @@ define([ controlsClassName: Backform.controlsClassName, extraClasses: [], helpMessage: null, + extraToggleClasses: null, }, template: _.template([ '', - '
', + '
', '