From 7e3a9328909c1c0449d858b0f92edd12e46e9432 Mon Sep 17 00:00:00 2001 From: Akshay Joshi Date: Fri, 9 Jun 2023 15:28:46 +0530 Subject: [PATCH] Fixed SonarQube Bugs --- Dockerfile | 18 +- web/pgadmin/dashboard/static/js/Graphs.jsx | 10 +- web/pgadmin/misc/cloud/static/js/biganimal.js | 2 +- web/pgadmin/static/bundle/app.js | 6 +- .../js/components/PgTree/scss/styles.scss | 189 ++++-------------- .../python_test_utils/test_utils.py | 3 +- 6 files changed, 56 insertions(+), 172 deletions(-) diff --git a/Dockerfile b/Dockerfile index 14d868c0d..816f0a1bb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -62,7 +62,7 @@ RUN export CPPFLAGS="-DPNG_ARM_NEON_OPT=0" && \ # Next, create the base environment for Python ######################################################################### -FROM alpine:latest as env-builder +FROM alpine:latest AS env-builder # Install dependencies COPY requirements.txt / @@ -90,7 +90,7 @@ RUN apk add --no-cache \ # Now, create a documentation build container for the Sphinx docs ######################################################################### -FROM env-builder as docs-builder +FROM env-builder AS docs-builder # Install Sphinx RUN /venv/bin/python3 -m pip install --no-cache-dir sphinx @@ -114,14 +114,14 @@ RUN rm -rf /pgadmin4/docs/en_US/_build/html/_static/*.png # Create additional builders to get all of the PostgreSQL utilities ######################################################################### -FROM postgres:10-alpine as pg10-builder -FROM postgres:11-alpine as pg11-builder -FROM postgres:12-alpine as pg12-builder -FROM postgres:13-alpine as pg13-builder -FROM postgres:14-alpine as pg14-builder -FROM postgres:15-alpine as pg15-builder +FROM postgres:10-alpine AS pg10-builder +FROM postgres:11-alpine AS pg11-builder +FROM postgres:12-alpine AS pg12-builder +FROM postgres:13-alpine AS pg13-builder +FROM postgres:14-alpine AS pg14-builder +FROM postgres:15-alpine AS pg15-builder -FROM alpine:latest as tool-builder +FROM alpine:latest AS tool-builder # Copy the PG binaries COPY --from=pg10-builder /usr/local/bin/pg_dump /usr/local/pgsql/pgsql-10/ diff --git a/web/pgadmin/dashboard/static/js/Graphs.jsx b/web/pgadmin/dashboard/static/js/Graphs.jsx index 58346e353..02ba4051f 100644 --- a/web/pgadmin/dashboard/static/js/Graphs.jsx +++ b/web/pgadmin/dashboard/static/js/Graphs.jsx @@ -212,11 +212,11 @@ export default function Graphs({preferences, sid, did, pageVisible, enablePoll=t
{pollDelay}
{chartDrawnOnce && 16384)) || (cloudDetails.volume_IOPS == 'io2' && (cloudDetails.volume_size < 4 || cloudDetails.volume_size > 16384)) || (cloudDetails.volume_IOPS != 'io2' && cloudDetails.volume_IOPS != 3000) || diff --git a/web/pgadmin/static/bundle/app.js b/web/pgadmin/static/bundle/app.js index 982088073..430fa1c16 100644 --- a/web/pgadmin/static/bundle/app.js +++ b/web/pgadmin/static/bundle/app.js @@ -17,9 +17,9 @@ import Theme from '../js/Theme'; define('app', [ 'sources/pgadmin', 'bundled_browser', ], function(pgAdmin) { - let initializeModules = function(Object) { - for (let key in Object) { - let module = Object[key]; + let initializeModules = function(obj) { + for (let key in obj) { + let module = obj[key]; if (module && module.init && typeof module.init == 'function') { try { diff --git a/web/pgadmin/static/js/components/PgTree/scss/styles.scss b/web/pgadmin/static/js/components/PgTree/scss/styles.scss index 57370bb46..b0d9aa3d3 100644 --- a/web/pgadmin/static/js/components/PgTree/scss/styles.scss +++ b/web/pgadmin/static/js/components/PgTree/scss/styles.scss @@ -38,8 +38,8 @@ align-items: center; white-space: nowrap; padding: 2px 0; - cursor: pointer !important; - color: $tree-text-fg !important; + padding-left: 2px; + cursor: default; &:before { content: ''; @@ -86,6 +86,31 @@ -560px 0 0 0 $color-gray-light; } + &.red { + filter: saturate(.5); + + .file-icon:after { + content: ''; + height: 8px; + width: 8px; + font-weight: bold; + display: inline-block; + background: #da2d38; + position: relative; + border-radius: 4px; + left: -7px; + box-sizing: border-box; + } + } + + &.magenta span.file-name { + color: magenta; + } + + &.big { + font-family: monospace; + } + &:hover, &.pseudo-active { background-color: $tree-bg-hover !important; @@ -112,8 +137,17 @@ } } + &.dragging { + background: #2a2a2a; + } + + &.dragover { + background-color: #313131; + } + i { display: inline-block; + font: normal normal normal 18px/1 $font-family-icon; font-size: 18px; text-align: center; height: 21px !important; @@ -229,157 +263,6 @@ } } -.file-tree { - font-family: 'Segoe UI'; - font-size: 15px; - color: #c1c1c1; - background-color: #1f1f1f; - display: inline-block; - - &, - & * { - box-sizing: border-box; - } -} - -.file-entry { - font: inherit; - text-align: left; - display: flex; - align-items: center; - white-space: nowrap; - padding: 2px 0; - padding-left: 2px; - cursor: default; - - &.red { - filter: saturate(.5); - - .file-icon:after { - content: ''; - height: 8px; - width: 8px; - font-weight: bold; - display: inline-block; - background: #da2d38; - position: relative; - border-radius: 4px; - left: -7px; - box-sizing: border-box; - } - } - - &.magenta span.file-name { - color: magenta; - } - - &.big { - font-family: monospace; - } - - &:hover, - &.pseudo-active { - background-color: #2d2d2d; - } - - &.active, - &.prompt { - background-color: #333333; - } - - &.dragging { - background: #2a2a2a; - } - - &.dragover { - background-color: #313131; - } - - i { - display: inline-block; - font: normal normal normal 18px/1 "default-icons"; - font-size: 18px; - text-align: center; - height: 18px; - width: 18px; - - &:before { - height: inherit; - width: inherit; - display: inline-block; - } - } - - span.file-label { - display: flex; - align-items: center; - } - - &.prompt.new .file-label, - &.file .file-label { - margin-left: 18px; - } - - span.file-name { - font: inherit; - flex-grow: 1; - user-select: none; - cursor: default; - color: $color-fg; - margin-left: 3px; - - & input[type='text'] { - display: block; - width: 94%; - margin: 0; - font: inherit; - border-radius: 3px; - padding: 1px 2px; - border: 0; - background: #2d2d2d; - color: inherit; - outline: none; - position: relative; - z-index: 1; - margin-top: -2px; - top: 1px; - left: -2px; - - &:focus { - box-shadow: 0px 0px 1px 1px #1ead7f; - } - - &.invalid { - box-shadow: 0px 0px 1px 1px #a51c15; - - &+span.prompt-err-msg { - position: relative; - display: block; - - &:after { - content: 'Invalid filename'; - position: absolute; - background: rgb(105, 30, 30); - width: 94%; - padding: 1px 2px; - box-sizing: border-box; - border-radius: 0px 0px 4px 4px; - box-shadow: 0px 0px 0px 1px #a51c15; - font-size: 14px; - z-index: 2; - } - } - } - - &.invalid-input-pulse { - &+span.prompt-err-msg { - animation: pulsate-err-msg .3s ease-in-out 2; - } - } - } - } -} - @for $i from 2 through 20 { .file-entry.depth-#{$i} { padding-left: 16px * ($i - 1); diff --git a/web/regression/python_test_utils/test_utils.py b/web/regression/python_test_utils/test_utils.py index dcb286e6f..d0f35e131 100644 --- a/web/regression/python_test_utils/test_utils.py +++ b/web/regression/python_test_utils/test_utils.py @@ -1446,7 +1446,8 @@ def get_remote_webdriver(hub_url, browser, browser_ver, test_name, url_client): print("Specified browser does not exist.") # maximize browser window - driver_local.maximize_window() + if driver_local: + driver_local.maximize_window() # driver_local.implicitly_wait(2) return driver_local