diff --git a/docs/en_US/release_notes_5_0.rst b/docs/en_US/release_notes_5_0.rst index 411550923..2b3ba847e 100644 --- a/docs/en_US/release_notes_5_0.rst +++ b/docs/en_US/release_notes_5_0.rst @@ -19,6 +19,7 @@ Housekeeping ************ | `Issue #5017 `_ - Use cheroot as the default production server for pgAdmin4. +| `Issue #6207 `_ - Updated the JS dependencies to the latest. Bug fixes ********* diff --git a/web/.eslintrc.js b/web/.eslintrc.js index 9b75cd809..ce89c7b0e 100644 --- a/web/.eslintrc.js +++ b/web/.eslintrc.js @@ -18,16 +18,23 @@ module.exports = { 'eslint:recommended', 'plugin:react/recommended', ], - 'parser': 'babel-eslint', + 'parser': '@babel/eslint-parser', 'parserOptions': { + 'requireConfigFile': false, 'ecmaVersion': 2018, 'ecmaFeatures': { - 'jsx': true + 'jsx': true, }, 'sourceType': 'module', + 'babelOptions': { + 'plugins': [ + '@babel/plugin-syntax-jsx', + ], + }, }, 'plugins': [ - 'react' + 'react', + '@babel', ], 'globals': { '_': true, @@ -36,28 +43,31 @@ module.exports = { 'rules': { 'indent': [ 'error', - 2 + 2, ], 'linebreak-style': 0, 'quotes': [ 'error', - 'single' + 'single', ], 'semi': [ 'error', - 'always' + 'always', ], 'comma-dangle': [ 'error', - 'always-multiline' + 'only-multiline', ], - 'no-console': ["error", { allow: ["warn", "error"] }], + 'no-console': ['error', { allow: ['warn', 'error'] }], // We need to exclude below for RegEx case - "no-useless-escape": 0, + 'no-useless-escape': 0, + 'no-prototype-builtins': 0, + 'no-global-assign': 0, + 'no-import-assign': 0, }, 'settings': { 'react': { 'version': 'detect', }, - } + }, }; diff --git a/web/package.json b/web/package.json index 9e55eb674..a1cef7cff 100644 --- a/web/package.json +++ b/web/package.json @@ -8,93 +8,96 @@ "license": "PostgreSQL", "devDependencies": { "@babel/core": "^7.10.2", + "@babel/eslint-parser": "^7.12.13", + "@babel/eslint-plugin": "^7.12.13", "@babel/plugin-proposal-object-rest-spread": "^7.9.6", "@babel/preset-env": "^7.10.2", "@emotion/core": "^10.0.14", "@emotion/styled": "^10.0.14", - "autoprefixer": "^9.6.4", + "autoprefixer": "^10.2.4", "axios-mock-adapter": "^1.17.0", - "babel-eslint": "^10.1.0", "babel-loader": "^8.1.0", - "copy-webpack-plugin": "^5.1.0", + "browserify": "^17.0.0", + "buffer": "^6.0.3", + "copy-webpack-plugin": "^7.0.0", "core-js": "^3.2.1", - "cross-env": "^5.2.0", + "cross-env": "^7.0.3", + "css-minimizer-webpack-plugin": "^1.2.0", "enzyme": "^3.11.0", "enzyme-adapter-react-16": "^1.15.2", - "eslint": "5.15.1", + "eslint": "^7.19.0", "eslint-plugin-react": "^7.20.5", - "file-loader": "^3.0.1", - "iconfont-webpack-plugin": "^4.2.1", - "image-webpack-loader": "^4.6.0", - "is-docker": "^1.1.0", - "jasmine-core": "~3.3.0", + "exports-loader": "^2.0.0", + "image-minimizer-webpack-plugin": "^2.2.0", + "imagemin-gifsicle": "^7.0.0", + "imagemin-mozjpeg": "^9.0.0", + "imagemin-optipng": "^8.0.0", + "imagemin-pngquant": "^9.0.1", + "imagemin-svgo": "^8.0.0", + "is-docker": "^2.1.1", + "jasmine-core": "^3.6.0", "jasmine-enzyme": "^7.1.2", - "karma": "^4.0.1", + "karma": "^6.1.0", "karma-babel-preprocessor": "^8.0.0", - "karma-browserify": "~6.0.0", - "karma-chrome-launcher": "^2.2.0", - "karma-jasmine": "~2.0.1", + "karma-browserify": "^8.0.0", + "karma-chrome-launcher": "^3.1.0", + "karma-jasmine": "^4.0.1", "karma-jasmine-html-reporter": "^1.4.0", "karma-requirejs": "~1.1.0", "karma-source-map-support": "^1.4.0", "karma-sourcemap-loader": "^0.3.7", - "karma-webpack": "~4.0.0-rc.6", - "mini-css-extract-plugin": "^0.5.0", - "optimize-css-assets-webpack-plugin": "^5.0.1", + "karma-webpack": "^5.0.0", + "mini-css-extract-plugin": "^1.3.5", "popper.js": "^1.14.7", - "postcss-loader": "^3.0.0", + "postcss-loader": "^5.0.0", + "process": "^0.11.10", "prop-types": "^15.7.2", - "raw-loader": "^3.1.0", "resize-observer-polyfill": "^1.5.1", "resolve-url-loader": "^3.1.2", "sass": "^1.24.4", - "sass-loader": "^7.1.0", + "sass-loader": "^11.0.0", "sass-resources-loader": "^2.0.0", - "style-loader": "^0.23.1", - "terser-webpack-plugin": "^2.2.2", - "url-loader": "^1.1.2", - "webpack": "^4.41.2", - "webpack-bundle-analyzer": "^3.5.1", - "webpack-cli": "^3.3.11", - "webpack-require-from": "^1.8.0", - "yarn-audit-html": "^1.1.0" + "style-loader": "^2.0.0", + "terser-webpack-plugin": "^5.1.1", + "webfonts-loader": "^7.1.1", + "webpack": "^5.21.2", + "webpack-bundle-analyzer": "^4.4.0", + "webpack-cli": "^4.5.0", + "yarn-audit-html": "^2.0.0" }, "dependencies": { "@babel/plugin-proposal-class-properties": "^7.10.4", - "@babel/preset-react": "^7.10.4", + "@babel/preset-react": "^7.12.13", "@fortawesome/fontawesome-free": "^5.14.0", "@projectstorm/react-diagrams": "^6.3.0", "@simonwep/pickr": "^1.5.1", "@tippyjs/react": "^4.2.0", "acitree": "git+https://github.com/imsurinder90/jquery-aciTree.git#rc.7", "alertifyjs": "git+https://github.com/EnterpriseDB/AlertifyJS/#72c1d794f5b6d4ec13a68d123c08f19021afe263", - "axios": "^0.18.1", + "axios": "^0.21.1", "babelify": "~10.0.0", "backbone": "1.4.0", "backform": "^0.2.0", "backgrid-filter": "^0.3.7", "backgrid-select-all": "^0.3.5", - "bignumber.js": "^8.1.1", + "bignumber.js": "^9.0.1", "bootstrap": "^4.3.1", "bootstrap-datepicker": "^1.8.0", - "bootstrap4-toggle": "3.4.0", - "bowser": "2.1.2", - "browserify": "~16.2.3", + "bootstrap4-toggle": "^3.6.1", "chart.js": "^2.9.3", "closest": "^0.0.1", - "codemirror": "^5.54.0", - "css-loader": "2.1.0", + "codemirror": "^5.59.2", + "css-loader": "^5.0.1", "cssnano": "^4.1.10", "dagre": "^0.8.4", - "dropzone": "^5.5.1", - "exports-loader": "~0.7.0", + "dropzone": "^5.7.4", "html2canvas": "^1.0.0-rc.7", "immutability-helper": "^3.0.0", - "imports-loader": "^0.8.0", - "ip-address": "^5.8.9", + "imports-loader": "^2.0.0", + "ip-address": "^7.1.0", "istanbul-instrumenter-loader": "^3.0.1", "jquery": "^3.5.1", - "jquery-contextmenu": "^2.8.0", + "jquery-contextmenu": "^2.9.2", "jquery-ui": "^1.12.1", "json-bignumber": "^1.0.1", "karma-coverage": "^2.0.3", @@ -102,27 +105,26 @@ "lodash": "4.*", "ml-matrix": "^6.5.0", "moment": "^2.24.0", - "moment-timezone": "^0.5.23", + "moment-timezone": "^0.5.33", "mousetrap": "^1.6.3", "pathfinding": "^0.4.18", "paths-js": "^0.4.9", + "postcss": "^8.2.4", "raf": "^3.4.1", - "react": "^16.13.1", - "react-dom": "^16.13.1", - "react-to-print": "^2.10.3", + "react": "^16.14.0", + "react-dom": "^16.14.0", "requirejs": "~2.3.6", - "select2": "^4.0.6-rc.1", + "select2": "^4.0.13", "shim-loader": "^1.0.1", "slickgrid": "git+https://github.com/6pac/SlickGrid.git#2.3.16", - "snapsvg": "^0.5.1", + "snapsvg-cjs": "^0.0.6", "split.js": "^1.5.10", "tablesorter": "^2.31.2", "tempusdominus-bootstrap-4": "^5.1.2", "tempusdominus-core": "^5.0.3", "underscore": "^1.9.1", - "watchify": "~3.11.1", "webcabin-docker": "git+https://github.com/EnterpriseDB/wcDocker/#c4a3398b89588408dc705895675bce7bd7660d36", - "wkx": "^0.4.6" + "wkx": "^0.5.0" }, "scripts": { "linter": "yarn eslint --no-eslintrc -c .eslintrc.js --ext .js .", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.js index 03effb67e..6819025a5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.js @@ -920,7 +920,7 @@ define('pgadmin.node.foreign_key', [ self.listenTo(collection, 'remove', self.render); }, formatter: { - fromRaw: function (rawValue,model,) { + fromRaw: function (rawValue,model) { var remote_tables = [], m = model.get('columns'); if (m.length > 0) { diff --git a/web/pgadmin/browser/static/css/browser.css b/web/pgadmin/browser/static/css/browser.css index cc32c35d3..b4de47c0f 100644 --- a/web/pgadmin/browser/static/css/browser.css +++ b/web/pgadmin/browser/static/css/browser.css @@ -47,16 +47,3 @@ .pgadmin_header_logo { cursor: default; } - -.icon-drop-cascade:before { - font-icon: url('../img/drop_cascade.svg'); - font-size: 1.6em !important; -} - -.icon-filter-table-toolbar:before { - font-icon: url('../img/row_filter.svg'); -} - -.icon-query-tool:before { - font-icon: url('../img/query_tool.svg'); -} diff --git a/web/pgadmin/browser/static/js/collection.js b/web/pgadmin/browser/static/js/collection.js index d412d67ad..14020af78 100644 --- a/web/pgadmin/browser/static/js/collection.js +++ b/web/pgadmin/browser/static/js/collection.js @@ -54,7 +54,7 @@ define([ name: 'show_query_tool', node: this.type, module: this, applies: ['context'], callback: 'show_query_tool', priority: 998, label: gettext('Query Tool'), - icon: 'pg-font-icon icon-query-tool', + icon: 'pg-font-icon icon-query_tool', }]); // show search objects same as query tool @@ -261,7 +261,7 @@ define([ type: 'delete', tooltip: gettext('Drop Cascade'), extraClasses: ['btn-primary-icon m-1', 'delete_multiple_cascade'], - icon: 'pg-font-icon icon-drop-cascade', + icon: 'pg-font-icon icon-drop_cascade', disabled: (_.isFunction(that.canDropCascade)) ? !(that.canDropCascade.apply(self, [data, item])) : (!that.canDropCascade), register: function(btn) { btn.on('click',() => { diff --git a/web/pgadmin/browser/static/js/node.js b/web/pgadmin/browser/static/js/node.js index 201dfbfcf..7c2f666e0 100644 --- a/web/pgadmin/browser/static/js/node.js +++ b/web/pgadmin/browser/static/js/node.js @@ -198,7 +198,7 @@ define('pgadmin.browser.node', [ callback: 'show_query_tool', priority: 998, label: gettext('Query Tool'), - icon: 'pg-font-icon icon-query-tool', + icon: 'pg-font-icon icon-query_tool', enable: enable, }]); diff --git a/web/pgadmin/browser/static/js/preferences.js b/web/pgadmin/browser/static/js/preferences.js index f63406cba..c5eafacd2 100644 --- a/web/pgadmin/browser/static/js/preferences.js +++ b/web/pgadmin/browser/static/js/preferences.js @@ -47,23 +47,10 @@ _.extend(pgBrowser, { /* Get cached preference */ get_preference: function(module, preference){ const self = this; - // If cache is not yet loaded then keep checking - if(_.size(self.preferences_cache) == 0) { - var check_preference = function() { - if(self.preferences_cache.length > 0) { - clearInterval(preferenceTimeout); - return _.findWhere( - self.preferences_cache, {'module': module, 'name': preference} - ); - } - }, - preferenceTimeout = setInterval(check_preference, 1000); - } - else { - return _.findWhere( - self.preferences_cache, {'module': module, 'name': preference} - ); - } + + return _.findWhere( + self.preferences_cache, {'module': module, 'name': preference} + ); }, /* Get all the preferences of a module */ diff --git a/web/pgadmin/browser/static/js/toolbar.js b/web/pgadmin/browser/static/js/toolbar.js index 3703ccc6d..09baaf228 100644 --- a/web/pgadmin/browser/static/js/toolbar.js +++ b/web/pgadmin/browser/static/js/toolbar.js @@ -20,7 +20,7 @@ let _defaultToolBarButtons = [ { label: gettext('Query Tool'), ariaLabel: gettext('Query Tool'), - btnClass: 'pg-font-icon icon-query-tool', + btnClass: 'pg-font-icon icon-query_tool', text: '', toggled: false, toggleClass: '', @@ -30,7 +30,7 @@ let _defaultToolBarButtons = [ { label: gettext('View Data'), ariaLabel: gettext('View Data'), - btnClass: 'pg-font-icon sql-icon-lg icon-view-data', + btnClass: 'pg-font-icon sql-icon-lg icon-view_data', text: '', toggled: false, toggleClass: '', @@ -40,7 +40,7 @@ let _defaultToolBarButtons = [ { label: gettext('Filtered Rows'), ariaLabel: gettext('Filtered Rows'), - btnClass: 'pg-font-icon icon-filter-table-toolbar', + btnClass: 'pg-font-icon icon-row_filter', text: '', toggled: false, toggleClass: '', diff --git a/web/pgadmin/feature_tests/query_tool_journey_test.py b/web/pgadmin/feature_tests/query_tool_journey_test.py index 59c0aa940..4ec636302 100644 --- a/web/pgadmin/feature_tests/query_tool_journey_test.py +++ b/web/pgadmin/feature_tests/query_tool_journey_test.py @@ -373,7 +373,7 @@ class QueryToolJourneyTest(BaseFeatureTest): icon_classes = query_history_selected_icon.get_attribute('class') icon_classes = icon_classes.split(" ") self.assertTrue( - icon in icon_classes or 'icon-save-data-changes' in + icon in icon_classes or 'icon-save_data_changes' in icon_classes or 'icon-commit' in icon_classes or 'fa-play' in icon_classes) # Move to next entry diff --git a/web/pgadmin/misc/bgprocess/static/css/bgprocess.css b/web/pgadmin/misc/bgprocess/static/css/bgprocess.css index 4e3cc0412..c5f431a35 100644 --- a/web/pgadmin/misc/bgprocess/static/css/bgprocess.css +++ b/web/pgadmin/misc/bgprocess/static/css/bgprocess.css @@ -57,7 +57,3 @@ ol.pg-bg-process-logs { .pg-bg-bgprocess:hover .bg-close { opacity: 0.95; } - -.icon-storage-manager:before { - font-icon: url('../img/storage_manager.svg'); -} diff --git a/web/pgadmin/misc/bgprocess/static/js/bgprocess.js b/web/pgadmin/misc/bgprocess/static/js/bgprocess.js index cbd8ecde6..fa3bf9480 100644 --- a/web/pgadmin/misc/bgprocess/static/js/bgprocess.js +++ b/web/pgadmin/misc/bgprocess/static/js/bgprocess.js @@ -428,7 +428,7 @@ define('misc.bgprocess', [ if(self.current_storage_dir && isServerMode) { //for backup & exports with server mode, operate over storage manager if($btn_storage_manager.length == 0) { - var str_storage_manager_btn = ' '; + var str_storage_manager_btn = ' '; container.find('.bg-process-details .bg-btn-section').prepend(str_storage_manager_btn); $btn_storage_manager = container.find('.bg-process-storage-manager'); } diff --git a/web/pgadmin/misc/static/explain/js/explain.js b/web/pgadmin/misc/static/explain/js/explain.js index 48ac1d567..75a8220a8 100644 --- a/web/pgadmin/misc/static/explain/js/explain.js +++ b/web/pgadmin/misc/static/explain/js/explain.js @@ -1209,8 +1209,8 @@ define('pgadmin.misc.explain', [ // Assumption container is a jQuery object DrawJSONPlan: function(container, plan, isDownload, _ctx) { let self = this; - require.ensure(['snapsvg'], function(require) { - var module = require('snapsvg'); + require.ensure(['snap.svg'], function(require) { + var module = require('snap.svg'); initSnap(module); self.goForDraw(container, plan, isDownload, _ctx); }, function(error){ diff --git a/web/pgadmin/static/css/style.css b/web/pgadmin/static/css/style.css index e5ff31306..c2a776c8e 100644 --- a/web/pgadmin/static/css/style.css +++ b/web/pgadmin/static/css/style.css @@ -1,23 +1,23 @@ -@import '~alertifyjs/build/css/alertify.css'; -@import '~alertifyjs/build/css/themes/bootstrap.css'; -@import '~@fortawesome/fontawesome-free/css/all.css'; -@import '~bootstrap-datepicker/dist/css/bootstrap-datepicker3.css'; -@import '~tempusdominus-bootstrap-4/build/css/tempusdominus-bootstrap-4.css'; -@import '~bootstrap4-toggle/css/bootstrap4-toggle.css'; -@import '~backgrid-filter/backgrid-filter.css'; -@import '~jquery-contextmenu/dist/jquery.contextMenu.css'; -@import '~webcabin-docker/Build/wcDocker.css'; -@import '~acitree/css/aciTree.css'; -@import '~leaflet/dist/leaflet.css'; -@import '../../../node_modules/select2/dist/css/select2.css'; +@import 'node_modules/alertifyjs/build/css/alertify.css'; +@import 'node_modules/alertifyjs/build/css/themes/bootstrap.css'; +@import 'node_modules/@fortawesome/fontawesome-free/css/all.css'; +@import 'node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker3.css'; +@import 'node_modules/tempusdominus-bootstrap-4/build/css/tempusdominus-bootstrap-4.css'; +@import 'node_modules/bootstrap4-toggle/css/bootstrap4-toggle.min.css'; +@import 'node_modules/backgrid-filter/backgrid-filter.css'; +@import 'node_modules/jquery-contextmenu/dist/jquery.contextMenu.css'; +@import 'node_modules/webcabin-docker/Build/wcDocker.css'; +@import 'node_modules/acitree/css/aciTree.css'; +@import 'node_modules/select2/dist/css/select2.min.css'; +@import 'node_modules/leaflet/dist/leaflet.css'; -@import '~codemirror/lib/codemirror.css'; -@import '~codemirror/addon/dialog/dialog.css'; -@import '~codemirror/addon/scroll/simplescrollbars.css'; +@import 'node_modules/codemirror/lib/codemirror.css'; +@import 'node_modules/codemirror/addon/dialog/dialog.css'; +@import 'node_modules/codemirror/addon/scroll/simplescrollbars.css'; -@import '~slickgrid/slick.grid.css'; -@import '~slickgrid/slick-default-theme.css'; -@import '~slickgrid/css/smoothness/jquery-ui-1.11.3.custom.css'; +@import 'node_modules/slickgrid/slick.grid.css'; +@import 'node_modules/slickgrid/slick-default-theme.css'; +@import 'node_modules/slickgrid/css/smoothness/jquery-ui-1.11.3.custom.css'; @import '../vendor/backgrid/backgrid.css'; @import '../vendor/backgrid/backgrid-select-all.css'; diff --git a/web/pgadmin/tools/sqleditor/static/img/commit.svg b/web/pgadmin/static/img/fonticon/commit.svg similarity index 100% rename from web/pgadmin/tools/sqleditor/static/img/commit.svg rename to web/pgadmin/static/img/fonticon/commit.svg diff --git a/web/pgadmin/tools/schema_diff/static/img/compare.svg b/web/pgadmin/static/img/fonticon/compare.svg similarity index 100% rename from web/pgadmin/tools/schema_diff/static/img/compare.svg rename to web/pgadmin/static/img/fonticon/compare.svg diff --git a/web/pgadmin/tools/sqleditor/static/img/connect.svg b/web/pgadmin/static/img/fonticon/connected.svg similarity index 100% rename from web/pgadmin/tools/sqleditor/static/img/connect.svg rename to web/pgadmin/static/img/fonticon/connected.svg diff --git a/web/pgadmin/tools/sqleditor/static/img/disconnect.svg b/web/pgadmin/static/img/fonticon/disconnected.svg similarity index 100% rename from web/pgadmin/tools/sqleditor/static/img/disconnect.svg rename to web/pgadmin/static/img/fonticon/disconnected.svg diff --git a/web/pgadmin/browser/static/img/drop_cascade.svg b/web/pgadmin/static/img/fonticon/drop_cascade.svg similarity index 100% rename from web/pgadmin/browser/static/img/drop_cascade.svg rename to web/pgadmin/static/img/fonticon/drop_cascade.svg diff --git a/web/pgadmin/browser/static/img/query_tool.svg b/web/pgadmin/static/img/fonticon/query_tool.svg similarity index 100% rename from web/pgadmin/browser/static/img/query_tool.svg rename to web/pgadmin/static/img/fonticon/query_tool.svg diff --git a/web/pgadmin/tools/sqleditor/static/img/rollback.svg b/web/pgadmin/static/img/fonticon/rollback.svg similarity index 100% rename from web/pgadmin/tools/sqleditor/static/img/rollback.svg rename to web/pgadmin/static/img/fonticon/rollback.svg diff --git a/web/pgadmin/browser/static/img/row_filter.svg b/web/pgadmin/static/img/fonticon/row_filter.svg similarity index 100% rename from web/pgadmin/browser/static/img/row_filter.svg rename to web/pgadmin/static/img/fonticon/row_filter.svg diff --git a/web/pgadmin/tools/sqleditor/static/img/save_data_changes.svg b/web/pgadmin/static/img/fonticon/save_data_changes.svg similarity index 100% rename from web/pgadmin/tools/sqleditor/static/img/save_data_changes.svg rename to web/pgadmin/static/img/fonticon/save_data_changes.svg diff --git a/web/pgadmin/misc/bgprocess/static/img/storage_manager.svg b/web/pgadmin/static/img/fonticon/storage_manager.svg similarity index 100% rename from web/pgadmin/misc/bgprocess/static/img/storage_manager.svg rename to web/pgadmin/static/img/fonticon/storage_manager.svg diff --git a/web/pgadmin/tools/sqleditor/static/img/view_data.svg b/web/pgadmin/static/img/fonticon/view_data.svg similarity index 100% rename from web/pgadmin/tools/sqleditor/static/img/view_data.svg rename to web/pgadmin/static/img/fonticon/view_data.svg diff --git a/web/pgadmin/static/js/browser/server_groups/servers/model_validation.js b/web/pgadmin/static/js/browser/server_groups/servers/model_validation.js index d542aa072..b95d578f4 100644 --- a/web/pgadmin/static/js/browser/server_groups/servers/model_validation.js +++ b/web/pgadmin/static/js/browser/server_groups/servers/model_validation.js @@ -113,11 +113,15 @@ export class ModelValidation { checkForValidIp(ipAddress, msg) { if (ipAddress) { - const isIpv6Address = new Address6(ipAddress).isValid(); - const isIpv4Address = new Address4(ipAddress).isValid(); - if (!isIpv4Address && !isIpv6Address) { - this.err['hostaddr'] = msg; - this.errmsg = msg; + try { + new Address4(ipAddress); + } catch(e) { + try { + new Address6(ipAddress); + } catch(e) { + this.err['hostaddr'] = msg; + this.errmsg = msg; + } } } else { this.model.errorModel.unset('hostaddr'); diff --git a/web/pgadmin/static/js/pgadmin.fonticon.js b/web/pgadmin/static/js/pgadmin.fonticon.js new file mode 100644 index 000000000..a47f21c5c --- /dev/null +++ b/web/pgadmin/static/js/pgadmin.fonticon.js @@ -0,0 +1,11 @@ +module.exports = { + 'files': [ + '../img/fonticon/*.svg', + ], + 'css': false, + 'fontName': 'pgfonticon', + 'classPrefix': 'icon-', + 'baseSelector': '.pg-font-icon', + 'types': ['eot', 'woff', 'woff2', 'ttf', 'svg'], + 'embed': true, +}; diff --git a/web/pgadmin/static/js/sqleditor/history/query_sources.js b/web/pgadmin/static/js/sqleditor/history/query_sources.js index 43960e05c..5e28c351a 100644 --- a/web/pgadmin/static/js/sqleditor/history/query_sources.js +++ b/web/pgadmin/static/js/sqleditor/history/query_sources.js @@ -21,15 +21,15 @@ export const QuerySources = { ICON_CSS_CLASS: 'fa fa-list-alt', }, COMMIT: { - ICON_CSS_CLASS: 'icon-commit', + ICON_CSS_CLASS: 'pg-font-icon icon-commit', }, ROLLBACK: { - ICON_CSS_CLASS: 'icon-rollback', + ICON_CSS_CLASS: 'pg-font-icon icon-rollback', }, SAVE_DATA: { - ICON_CSS_CLASS: 'icon-save-data-changes', + ICON_CSS_CLASS: 'pg-font-icon icon-save_data_changes', }, VIEW_DATA: { - ICON_CSS_CLASS: 'icon-view-data', + ICON_CSS_CLASS: 'pg-font-icon picon-view_data', }, }; diff --git a/web/pgadmin/static/js/sqleditor_utils.js b/web/pgadmin/static/js/sqleditor_utils.js index 6aa58a3d7..5f5b149e0 100644 --- a/web/pgadmin/static/js/sqleditor_utils.js +++ b/web/pgadmin/static/js/sqleditor_utils.js @@ -135,7 +135,7 @@ define(['jquery', 'underscore', 'sources/gettext', 'sources/url_for'], if(sqlEditorUtils.previousStatus != status && !$status_el.hasClass('fa-query_tool_connected')) { $status_el.removeClass() - .addClass('pg-font-icon icon-query-tool-connected'); + .addClass('pg-font-icon icon-connected'); is_status_changed = true; } } @@ -153,10 +153,10 @@ define(['jquery', 'underscore', 'sources/gettext', 'sources/url_for'], msg = gettext('An unexpected error occurred - ' + 'ensure you are logged into the application.'); $el.attr('data-content', msg); - if(!$status_el.hasClass('icon-query-tool-disconnected')) { + if(!$status_el.hasClass('icon-disconnected')) { $el.popover('hide'); $status_el.removeClass() - .addClass('pg-icon-font icon-query-tool-disconnected'); + .addClass('pg-icon-font icon-disconnected'); } } }) @@ -173,10 +173,10 @@ define(['jquery', 'underscore', 'sources/gettext', 'sources/url_for'], // Set bootstrap popover $el.attr('data-content', msg); // Add error class - if(!$status_el.hasClass('icon-query-tool-disconnected')) { + if(!$status_el.hasClass('icon-disconnected')) { $el.popover('hide'); $status_el.removeClass() - .addClass('pg-font-icon icon-query-tool-disconnected'); + .addClass('pg-font-icon icon-disconnected'); } }); }, diff --git a/web/pgadmin/static/scss/_pgadmin.style.scss b/web/pgadmin/static/scss/_pgadmin.style.scss index 2e8f46ad8..94a11e509 100644 --- a/web/pgadmin/static/scss/_pgadmin.style.scss +++ b/web/pgadmin/static/scss/_pgadmin.style.scss @@ -1064,11 +1064,6 @@ table.table-empty-rows{ .pg-font-icon { &:before { - font-style: normal; - font-weight: normal; - font-stretch: normal; - font-size: 100%; - line-height: 1; vertical-align: middle; } } diff --git a/web/pgadmin/static/scss/_tippy.overrides.scss b/web/pgadmin/static/scss/_tippy.overrides.scss index 9750434b7..27e959dbb 100644 --- a/web/pgadmin/static/scss/_tippy.overrides.scss +++ b/web/pgadmin/static/scss/_tippy.overrides.scss @@ -1,4 +1,4 @@ -@import "~node_modules/tippy.js/dist/tippy.css"; +@import "node_modules/tippy.js/dist/tippy.css"; .tippy-box { background-color: $popover-bg; diff --git a/web/pgadmin/static/scss/pgadmin.scss b/web/pgadmin/static/scss/pgadmin.scss index cc751b77e..6c38c6f77 100644 --- a/web/pgadmin/static/scss/pgadmin.scss +++ b/web/pgadmin/static/scss/pgadmin.scss @@ -12,7 +12,7 @@ $theme-colors: ( --border-color: #{$border-color}; } -@import "node_modules/bootstrap/scss/bootstrap"; +@import "bootstrap/scss/bootstrap"; @import 'webcabin.pgadmin'; @import 'bootstrap.overrides'; @import 'backgrid.overrides'; diff --git a/web/pgadmin/templates/base.html b/web/pgadmin/templates/base.html index aff877261..7d3743543 100644 --- a/web/pgadmin/templates/base.html +++ b/web/pgadmin/templates/base.html @@ -26,16 +26,14 @@ {% block css_link %}{% endblock %} - - - - - - + + + @@ -71,7 +69,7 @@ {% block body %}{% endblock %} - diff --git a/web/pgadmin/tools/datagrid/static/js/datagrid.js b/web/pgadmin/tools/datagrid/static/js/datagrid.js index adc6651bf..a4f2cf648 100644 --- a/web/pgadmin/tools/datagrid/static/js/datagrid.js +++ b/web/pgadmin/tools/datagrid/static/js/datagrid.js @@ -112,7 +112,7 @@ define('pgadmin.datagrid', [ enable: query_tool_menu_enabled, priority: 1, label: gettext('Query Tool'), - icon: 'pg-font-icon icon-query-tool', + icon: 'pg-font-icon icon-query_tool', data:{ data_disabled: gettext('Please select a database from the browser tree to access Query Tool.'), }, diff --git a/web/pgadmin/tools/datagrid/static/js/datagrid_panel_title.js b/web/pgadmin/tools/datagrid/static/js/datagrid_panel_title.js index b3bd793e0..2f7d0eaee 100644 --- a/web/pgadmin/tools/datagrid/static/js/datagrid_panel_title.js +++ b/web/pgadmin/tools/datagrid/static/js/datagrid_panel_title.js @@ -64,11 +64,11 @@ export function setQueryToolDockerTitle(panel, is_query_tool, panel_title, is_fi else if (is_query_tool == 'false' || is_query_tool == false) { // Edit grid titles panel_tooltip = gettext('View/Edit Data - ') + panel_title; - panel_icon = 'pg-font-icon icon-view-data'; + panel_icon = 'pg-font-icon icon-view_data'; } else { // Query tool titles panel_tooltip = gettext('Query Tool - ') + panel_title; - panel_icon = 'pg-font-icon icon-query-tool'; + panel_icon = 'pg-font-icon icon-query_tool'; } panel.title(''+ _.escape(panel_title) +''); diff --git a/web/pgadmin/tools/datagrid/templates/datagrid/index.html b/web/pgadmin/tools/datagrid/templates/datagrid/index.html index d9d0d2254..6931d5a91 100644 --- a/web/pgadmin/tools/datagrid/templates/datagrid/index.html +++ b/web/pgadmin/tools/datagrid/templates/datagrid/index.html @@ -22,7 +22,7 @@ title="" aria-label="show query tool" tabindex="0"> - +
@@ -60,7 +60,7 @@ title="" accesskey="" tabindex="0" disabled> - +
@@ -416,7 +416,7 @@ data-panel-visible="visible" accesskey="" tabindex="0"> -
diff --git a/web/pgadmin/tools/erd/static/js/erd_tool/ui_components/ConnectionBar.jsx b/web/pgadmin/tools/erd/static/js/erd_tool/ui_components/ConnectionBar.jsx index 3b71dbcc0..7aae1a216 100644 --- a/web/pgadmin/tools/erd/static/js/erd_tool/ui_components/ConnectionBar.jsx +++ b/web/pgadmin/tools/erd/static/js/erd_tool/ui_components/ConnectionBar.jsx @@ -30,8 +30,8 @@ export default function ConnectionBar({statusId, status, bgcolor, fgcolor, title data-panel-visible="visible" tabIndex="0"> diff --git a/web/pgadmin/tools/schema_diff/static/css/schema_diff.css b/web/pgadmin/tools/schema_diff/static/css/schema_diff.css index e9fe70fbc..4236dae9d 100644 --- a/web/pgadmin/tools/schema_diff/static/css/schema_diff.css +++ b/web/pgadmin/tools/schema_diff/static/css/schema_diff.css @@ -1,5 +1,4 @@ -.icon-schema-diff:before { - font-icon: url('../img/compare.svg'); +.icon-compare:before { font-size: 1.3em !important; } diff --git a/web/pgadmin/tools/schema_diff/static/js/schema_diff.backform.js b/web/pgadmin/tools/schema_diff/static/js/schema_diff.backform.js index cb704e168..316d98d94 100644 --- a/web/pgadmin/tools/schema_diff/static/js/schema_diff.backform.js +++ b/web/pgadmin/tools/schema_diff/static/js/schema_diff.backform.js @@ -59,7 +59,7 @@ let SchemaDiffSqlControl = Backform.TextareaControl.prototype.initialize.apply(this, arguments); this.sqlCtrl = null; - _.bindAll(this, 'onFocus', 'onBlur', 'refreshTextArea', 'copyData',); + _.bindAll(this, 'onFocus', 'onBlur', 'refreshTextArea', 'copyData'); }, render: function() { let obj = Backform.SqlFieldControl.prototype.render.apply(this, arguments); @@ -317,7 +317,7 @@ let SchemaDiffHeaderView = Backform.Form.extend({
- +