From eb971a03200ffb26279f8986a2023cc09b72815d Mon Sep 17 00:00:00 2001 From: Aditya Toshniwal Date: Mon, 8 Jun 2020 12:26:12 +0530 Subject: [PATCH] =?UTF-8?q?Update=20Codemirror=20version=C2=A0to=20the=20l?= =?UTF-8?q?atest=20which=20allows=20us=20to=20set=20screen=20reader=20labe?= =?UTF-8?q?ls=20on=20Codemirror=C2=A0editor.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refs #5197 --- web/package.json | 2 +- web/pgadmin/browser/static/js/browser.js | 1 + web/pgadmin/static/js/backform.pgadmin.js | 4 ++++ web/pgadmin/tools/datagrid/static/js/show_data.js | 1 + web/pgadmin/tools/debugger/static/js/direct.js | 1 + web/pgadmin/tools/sqleditor/static/js/sqleditor.js | 1 + web/yarn.lock | 8 ++++---- 7 files changed, 13 insertions(+), 5 deletions(-) diff --git a/web/package.json b/web/package.json index 50fa28b73..6e316c670 100644 --- a/web/package.json +++ b/web/package.json @@ -67,7 +67,7 @@ "bootstrap4-toggle": "3.4.0", "bowser": "2.1.2", "browserify": "~16.2.3", - "codemirror": "^5.50.0", + "codemirror": "^5.54.0", "css-loader": "2.1.0", "cssnano": "^4.1.10", "dropzone": "^5.5.1", diff --git a/web/pgadmin/browser/static/js/browser.js b/web/pgadmin/browser/static/js/browser.js index 2a96396fd..9c68af1e5 100644 --- a/web/pgadmin/browser/static/js/browser.js +++ b/web/pgadmin/browser/static/js/browser.js @@ -428,6 +428,7 @@ define('pgadmin.browser', [ mode: 'text/x-pgsql', readOnly: true, extraKeys: pgAdmin.Browser.editor_shortcut_keys, + screenReaderLabel: gettext('SQL'), }); /* Cache may take time to load for the first time * Reflect the changes once cache is available diff --git a/web/pgadmin/static/js/backform.pgadmin.js b/web/pgadmin/static/js/backform.pgadmin.js index e8133a9ff..d7cb3b710 100644 --- a/web/pgadmin/static/js/backform.pgadmin.js +++ b/web/pgadmin/static/js/backform.pgadmin.js @@ -1810,12 +1810,15 @@ define([ // Use the Backform Control's render function Backform.Control.prototype.render.apply(this, arguments); + var field = _.defaults(this.field.toJSON(), this.defaults); + this.sqlCtrl = CodeMirror.fromTextArea( (this.$el.find('textarea')[0]), { lineNumbers: true, mode: 'text/x-pgsql', readOnly: true, extraKeys: pgAdmin.Browser.editor_shortcut_keys, + screenReaderLabel: field.label, }); this.reflectPreferences(); @@ -2574,6 +2577,7 @@ define([ lineNumbers: true, mode: 'text/x-pgsql', extraKeys: pgAdmin.Browser.editor_shortcut_keys, + screenReaderLabel: data.label, }); self.reflectPreferences(); diff --git a/web/pgadmin/tools/datagrid/static/js/show_data.js b/web/pgadmin/tools/datagrid/static/js/show_data.js index b6973133b..81d61f658 100644 --- a/web/pgadmin/tools/datagrid/static/js/show_data.js +++ b/web/pgadmin/tools/datagrid/static/js/show_data.js @@ -193,6 +193,7 @@ function initFilterDialog(alertify, pgBrowser) { lineWrapping: that.preferences.wrap_code, autoCloseBrackets: that.preferences.insert_pair_brackets, matchBrackets: that.preferences.brace_matching, + screenReaderLabel: gettext('Filter SQL'), }); let sql_font_size = SqlEditorUtils.calcFontSize(that.preferences.sql_font_size); diff --git a/web/pgadmin/tools/debugger/static/js/direct.js b/web/pgadmin/tools/debugger/static/js/direct.js index 5011c4a5a..ee41f9c7f 100644 --- a/web/pgadmin/tools/debugger/static/js/direct.js +++ b/web/pgadmin/tools/debugger/static/js/direct.js @@ -1806,6 +1806,7 @@ define([ lineWrapping: pgAdmin.Browser.editor_options.wrapCode, autoCloseBrackets: pgAdmin.Browser.editor_options.insert_pair_brackets, matchBrackets: pgAdmin.Browser.editor_options.brace_matching, + screenReaderLabel: gettext('Debugger SQL editor'), }); // Useful for keyboard navigation, when user presses escape key we will diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js index d883f250f..0f3874e25 100644 --- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js +++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js @@ -374,6 +374,7 @@ define('tools.querytool', [ extraKeys: pgBrowser.editor_shortcut_keys, scrollbarStyle: 'simple', dragDrop: false, + screenReaderLabel: gettext('SQL editor'), }); if(self.handler.is_query_tool) { diff --git a/web/yarn.lock b/web/yarn.lock index 151e98cb3..d636df5cb 100644 --- a/web/yarn.lock +++ b/web/yarn.lock @@ -2363,10 +2363,10 @@ coa@^2.0.2: chalk "^2.4.1" q "^1.1.2" -codemirror@^5.50.0: - version "5.52.2" - resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.52.2.tgz#c29e1f7179f85eb0dd17c0586fa810e4838ff584" - integrity sha512-WCGCixNUck2HGvY8/ZNI1jYfxPG5cRHv0VjmWuNzbtCLz8qYA5d+je4QhSSCtCaagyeOwMi/HmmPTjBgiTm2lQ== +codemirror@^5.54.0: + version "5.54.0" + resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.54.0.tgz#82b6adf662b29eeb7b867fe7839d49e25e4a0b38" + integrity sha512-Pgf3surv4zvw+KaW3doUU7pGjF0BPU8/sj7eglWJjzni46U/DDW8pu3nZY0QgQKUcICDXRkq8jZmq0y6KhxM3Q== collection-visit@^1.0.0: version "1.0.0"