From 8f4d1f14f2175ed8f33e410493f630379a69579a Mon Sep 17 00:00:00 2001 From: Akshay Joshi Date: Wed, 6 Feb 2019 16:45:18 +0530 Subject: [PATCH] 1) Fix alignment of import/export toggle switch. Fixes #3963 2) Remove unnecessary options for toggle switch which are already the default options. --- docs/en_US/release_notes_4_3.rst | 12 ++++++++++++ .../servers/databases/casts/static/js/cast.js | 5 ----- .../databases/extensions/static/js/extension.js | 5 ----- .../databases/languages/static/js/language.js | 4 ---- .../databases/schemas/domains/static/js/domain.js | 9 --------- .../schemas/functions/static/js/function.js | 4 ---- .../schemas/functions/static/js/trigger_function.js | 4 ---- .../schemas/sequences/static/js/sequence.js | 4 ---- .../schemas/tables/indexes/static/js/index.js | 4 ---- .../servers/databases/static/js/database.js | 8 -------- .../server_groups/servers/roles/static/js/role.js | 7 ------- .../static/scss/_bootstrap4-toggle.overrides.scss | 1 + .../tools/import_export/static/js/import_export.js | 3 +-- .../user_management/static/js/user_management.js | 4 ---- 14 files changed, 14 insertions(+), 60 deletions(-) create mode 100644 docs/en_US/release_notes_4_3.rst diff --git a/docs/en_US/release_notes_4_3.rst b/docs/en_US/release_notes_4_3.rst new file mode 100644 index 000000000..9abdb340f --- /dev/null +++ b/docs/en_US/release_notes_4_3.rst @@ -0,0 +1,12 @@ +*********** +Version 4.3 +*********** + +Release date: 2019-03-07 + +This release contains a number of fixes reported since the release of pgAdmin4 4.2 + +Bug fixes +********* + +| `Bug #3963 `_ - Fix alignment of import/export toggle switch. \ No newline at end of file diff --git a/web/pgadmin/browser/server_groups/servers/databases/casts/static/js/cast.js b/web/pgadmin/browser/server_groups/servers/databases/casts/static/js/cast.js index fa48fb810..268cf9705 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/casts/static/js/cast.js +++ b/web/pgadmin/browser/server_groups/servers/databases/casts/static/js/cast.js @@ -260,11 +260,6 @@ define('pgadmin.node.cast', [ },{ id: 'syscast', label: gettext('System cast?'), cell: 'switch', type: 'switch', mode: ['properties'], disabled: true, - options: { - 'onText': gettext('Yes'), 'offText': gettext('No'), - 'onColor': 'success', 'offColor': 'primary', - 'size': 'small', - }, },{ id: 'description', label: gettext('Comment'), type: 'multiline', cellHeaderClasses: 'width_percent_50', diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/static/js/extension.js b/web/pgadmin/browser/server_groups/servers/databases/extensions/static/js/extension.js index 121b805c2..64ab3e4ea 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/extensions/static/js/extension.js +++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/static/js/extension.js @@ -205,11 +205,6 @@ define('pgadmin.node.extension', [ { id: 'relocatable', label: gettext('Relocatable?'), cell: 'switch', group: gettext('Definition'), type: 'switch', mode: ['properties'], - options: { - 'onText': gettext('Yes'), 'offText': gettext('No'), - 'onColor': 'success', 'offColor': 'primary', - 'size': 'small', - }, }, { id: 'version', label: gettext('Version'), cell: 'string', diff --git a/web/pgadmin/browser/server_groups/servers/databases/languages/static/js/language.js b/web/pgadmin/browser/server_groups/servers/databases/languages/static/js/language.js index 44a9f6a97..af6869f35 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/languages/static/js/language.js +++ b/web/pgadmin/browser/server_groups/servers/databases/languages/static/js/language.js @@ -135,10 +135,6 @@ define('pgadmin.node.language', [ type: 'multiline', },{ id: 'trusted', label: gettext('Trusted?'), type: 'switch', - options: { - 'onText': gettext('Yes'), 'offText': gettext('No'), - 'onColor': 'success', 'offColor': 'primary', - }, group: gettext('Definition'), mode: ['edit', 'properties', 'create'], deps: ['name'], disabled: function(m) { if (m.isNew()) { diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/static/js/domain.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/static/js/domain.js index 2cb5175bf..908bf27a7 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/static/js/domain.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/static/js/domain.js @@ -180,11 +180,6 @@ define('pgadmin.node.domain', [ },{ id: 'sysdomain', label: gettext('System domain?'), cell: 'boolean', type: 'switch', mode: ['properties'], - options: { - 'onText': gettext('Yes'), 'offText': gettext('No'), - 'onColor': 'success', 'offColor': 'primary', - 'size': 'small', - }, },{ id: 'description', label: gettext('Comment'), cell: 'string', type: 'multiline', @@ -261,10 +256,6 @@ define('pgadmin.node.domain', [ },{ id: 'typnotnull', label: gettext('Not Null?'), cell: 'boolean', type: 'switch', group: gettext('Definition'), - options: { - 'onText': gettext('Yes'), 'offText': gettext('No'), - 'onColor': 'success', 'offColor': 'primary', - }, },{ id: 'collname', label: gettext('Collation'), cell: 'string', control: 'node-ajax-options', type: 'text', url: 'get_collations', diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/function.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/function.js index 2848119f3..4a1ed4000 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/function.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/function.js @@ -283,10 +283,6 @@ define('pgadmin.node.function', [ id: 'proisstrict', label: gettext('Strict?'), type: 'switch', group: gettext('Options'), disabled: 'isDisabled', deps: ['lanname'], - options: { - 'onText': gettext('Yes'), 'offText': gettext('No'), - 'onColor': 'success', 'offColor': 'primary', - }, },{ id: 'prosecdef', label: gettext('Security of definer?'), group: gettext('Options'), type: 'switch', diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/trigger_function.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/trigger_function.js index 8069889ea..cf07f10ab 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/trigger_function.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/trigger_function.js @@ -217,10 +217,6 @@ define('pgadmin.node.trigger_function', [ },{ id: 'proisstrict', label: gettext('Strict?'), type: 'switch', disabled: 'isDisabled', group: gettext('Options'), - options: { - 'onText': gettext('Yes'), 'offText': gettext('No'), - 'onColor': 'success', 'offColor': 'primary', - }, },{ id: 'prosecdef', label: gettext('Security of definer?'), group: gettext('Options'), cell:'boolean', type: 'switch', diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/static/js/sequence.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/static/js/sequence.js index 9c78f4601..dd0f54f61 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/static/js/sequence.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/static/js/sequence.js @@ -157,10 +157,6 @@ define('pgadmin.node.sequence', [ },{ id: 'cycled', label: gettext('Cycled'), type: 'switch', mode: ['properties', 'create', 'edit'], group: gettext('Definition'), - options: { - 'onText': gettext('Yes'), 'offText': gettext('No'), - 'onColor': 'success', 'offColor': 'primary', - }, }, pgBrowser.SecurityGroupSchema,{ id: 'acl', label: gettext('Privileges'), type: 'text', group: gettext('Security'), mode: ['properties'], disabled: true, diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/static/js/index.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/static/js/index.js index 63c6b9190..903ec9e45 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/static/js/index.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/static/js/index.js @@ -147,8 +147,6 @@ define('pgadmin.node.index', [ deps: ['amname'], options: { 'onText': 'DESC', 'offText': 'ASC', - 'onColor': 'success', 'offColor': 'primary', - 'size': 'small', }, },{ id: 'nulls', label: gettext('NULLs'), @@ -170,8 +168,6 @@ define('pgadmin.node.index', [ deps: ['amname', 'sort_order'], options: { 'onText': 'FIRST', 'offText': 'LAST', - 'onColor': 'success', 'offColor': 'primary', - 'size': 'small', }, }, ], diff --git a/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js b/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js index 95467fe59..a57ec66ae 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js +++ b/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js @@ -385,18 +385,10 @@ define('pgadmin.node.database', [ id: 'is_template', label: gettext('Template?'), editable: false, type: 'switch', group: gettext('Definition'), disabled: true, mode: ['properties', 'edit'], - options: { - 'onText': gettext('Yes'), 'offText': gettext('No'), - 'onColor': 'success', 'offColor': 'primary', - }, },{ id: 'datallowconn', label: gettext('Allow connections?'), editable: false, type: 'switch', group: gettext('Definition'), mode: ['properties'], disabled: true, - options: { - 'onText': gettext('Yes'), 'offText': gettext('No'), - 'onColor': 'success', 'offColor': 'primary', - }, },{ id: 'datacl', label: gettext('Privileges'), type: 'collection', model: pgBrowser.Node.PrivilegeRoleModel.extend({ 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 dd4539297..cae69338d 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 @@ -415,7 +415,6 @@ define('pgadmin.node.role', [ },{ 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'), @@ -423,7 +422,6 @@ define('pgadmin.node.role', [ },{ 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'), @@ -441,7 +439,6 @@ define('pgadmin.node.role', [ id: 'rolcreaterole', label: gettext('Create roles?'), 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', @@ -453,14 +450,12 @@ define('pgadmin.node.role', [ id: 'rolcreatedb', label: gettext('Create databases?'), 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', - 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, @@ -471,7 +466,6 @@ define('pgadmin.node.role', [ id: 'rolinherit', group: gettext('Privileges'), label: gettext('Inherit rights from the parent roles?'), 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', @@ -479,7 +473,6 @@ define('pgadmin.node.role', [ id: 'rolreplication', group: gettext('Privileges'), label: gettext('Can initiate streaming replication and backups?'), 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, diff --git a/web/pgadmin/static/scss/_bootstrap4-toggle.overrides.scss b/web/pgadmin/static/scss/_bootstrap4-toggle.overrides.scss index 8d7c98b7a..a27aee6d8 100644 --- a/web/pgadmin/static/scss/_bootstrap4-toggle.overrides.scss +++ b/web/pgadmin/static/scss/_bootstrap4-toggle.overrides.scss @@ -18,6 +18,7 @@ .toggle input[type="checkbox"] { display: block; opacity: 0; + margin-top: 0px !important; } .toggle:focus-within { diff --git a/web/pgadmin/tools/import_export/static/js/import_export.js b/web/pgadmin/tools/import_export/static/js/import_export.js index 53c788bac..6de7254cf 100644 --- a/web/pgadmin/tools/import_export/static/js/import_export.js +++ b/web/pgadmin/tools/import_export/static/js/import_export.js @@ -55,8 +55,7 @@ Backform, commonUtils, supportedNodes options: { 'onText': gettext('Import'), 'offText': gettext('Export'), - 'onColor': 'success', - 'offColor': 'primary', + width: '65', }, }, { type: 'nested', diff --git a/web/pgadmin/tools/user_management/static/js/user_management.js b/web/pgadmin/tools/user_management/static/js/user_management.js index 2c67ecded..07102662e 100644 --- a/web/pgadmin/tools/user_management/static/js/user_management.js +++ b/web/pgadmin/tools/user_management/static/js/user_management.js @@ -312,10 +312,6 @@ define([ type: 'switch', cell: 'switch', cellHeaderClasses: 'width_percent_10', - options: { - 'onText': gettext('Yes'), - 'offText': gettext('No'), - }, editable: function(m) { if (m instanceof Backbone.Collection) { return true;