diff --git a/web/pgadmin/tools/erd/static/js/erd_tool/dialogs/DialogWrapper.js b/web/pgadmin/tools/erd/static/js/erd_tool/dialogs/DialogWrapper.js index c46bde715..b43d1415e 100644 --- a/web/pgadmin/tools/erd/static/js/erd_tool/dialogs/DialogWrapper.js +++ b/web/pgadmin/tools/erd/static/js/erd_tool/dialogs/DialogWrapper.js @@ -10,6 +10,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import SchemaView from '../../../../../../static/js/SchemaView'; +import Theme from '../../../../../../static/js/Theme'; export default class DialogWrapper { constructor(dialogContainerSelector, dialogTitle, typeOfDialog, alertify, serverInfo) { @@ -84,22 +85,24 @@ export default class DialogWrapper { createDialog(container) { let self = this; ReactDOM.render( - Promise.resolve({})} - schema={this.dialogSchema} - viewHelperProps={{ - mode: 'create', - keepCid: true, - serverInfo: this.serverInfo, - }} - onSave={this.onSaveClick.bind(this)} - onClose={()=>self.close()} - onDataChange={()=>{/*This is intentional (SonarQube)*/}} - hasSQL={false} - disableSqlHelp={true} - disableDialogHelp={true} - />, container); + + Promise.resolve({})} + schema={this.dialogSchema} + viewHelperProps={{ + mode: 'create', + keepCid: true, + serverInfo: this.serverInfo, + }} + onSave={this.onSaveClick.bind(this)} + onClose={()=>self.close()} + onDataChange={()=>{/*This is intentional (SonarQube)*/}} + hasSQL={false} + disableSqlHelp={true} + disableDialogHelp={true} + /> + , container); } cleanupDialog(container) { diff --git a/web/regression/javascript/SchemaView/SchemaView.spec.js b/web/regression/javascript/SchemaView/SchemaView.spec.js index a66c67a68..36757abba 100644 --- a/web/regression/javascript/SchemaView/SchemaView.spec.js +++ b/web/regression/javascript/SchemaView/SchemaView.spec.js @@ -17,6 +17,7 @@ import {messages} from '../fake_messages'; import SchemaView from '../../../pgadmin/static/js/SchemaView'; import * as legacyConnector from 'sources/helpers/legacyConnector'; import Notify from '../../../pgadmin/static/js/helpers/Notifier'; +import Theme from '../../../pgadmin/static/js/Theme'; const initData = { id: 1, @@ -83,23 +84,25 @@ describe('SchemaView', ()=>{ getSQLValue=jasmine.createSpy('onEdit').and.returnValue(Promise.resolve('select 1;')), ctrlMount = (props)=>{ ctrl?.unmount(); - ctrl = mount(); + ctrl = mount( + + ); }, simulateValidData = ()=>{ ctrl.find('MappedFormControl[id="field1"]').find('input').simulate('change', {target: {value: 'val1'}}); @@ -473,22 +476,24 @@ describe('SchemaView', ()=>{ let ctrl; beforeEach(()=>{ ctrl?.unmount(); - ctrl = mount({/*This is intentional (SonarQube)*/}} - onClose={()=>{/*This is intentional (SonarQube)*/}} - onHelp={()=>{/*This is intentional (SonarQube)*/}} - onEdit={()=>{/*This is intentional (SonarQube)*/}} - onDataChange={()=>{/*This is intentional (SonarQube)*/}} - confirmOnCloseReset={false} - hasSQL={true} - getSQLValue={()=>'select 1;'} - disableSqlHelp={false} - />); + ctrl = mount( + {/*This is intentional (SonarQube)*/}} + onClose={()=>{/*This is intentional (SonarQube)*/}} + onHelp={()=>{/*This is intentional (SonarQube)*/}} + onEdit={()=>{/*This is intentional (SonarQube)*/}} + onDataChange={()=>{/*This is intentional (SonarQube)*/}} + confirmOnCloseReset={false} + hasSQL={true} + getSQLValue={()=>'select 1;'} + disableSqlHelp={false} + /> + ); }); it('init', ()=>{ @@ -506,17 +511,19 @@ describe('SchemaView', ()=>{ ctrl = null; beforeEach(()=>{ - ctrl = mount(); + ctrl = mount( + + ); }); it('init', (done)=>{ diff --git a/web/regression/javascript/genericFunctions.jsx b/web/regression/javascript/genericFunctions.jsx index 2d93807d9..abecedd90 100644 --- a/web/regression/javascript/genericFunctions.jsx +++ b/web/regression/javascript/genericFunctions.jsx @@ -13,57 +13,64 @@ import pgAdmin from 'sources/pgadmin'; import SchemaView from '../../pgadmin/static/js/SchemaView'; import pgWindow from 'sources/window'; import fakePgAdmin from './fake_pgadmin'; +import Theme from 'sources/Theme'; export let getEditView = (schemaObj, getInitData)=> { - return {/*This is intentional (SonarQube)*/}} - onClose={()=>{/*This is intentional (SonarQube)*/}} - onHelp={()=>{/*This is intentional (SonarQube)*/}} - onEdit={()=>{/*This is intentional (SonarQube)*/}} - onDataChange={()=>{/*This is intentional (SonarQube)*/}} - confirmOnCloseReset={false} - hasSQL={false} - disableSqlHelp={false} - disableDialogHelp={false} - />; + return + {/*This is intentional (SonarQube)*/}} + onClose={()=>{/*This is intentional (SonarQube)*/}} + onHelp={()=>{/*This is intentional (SonarQube)*/}} + onEdit={()=>{/*This is intentional (SonarQube)*/}} + onDataChange={()=>{/*This is intentional (SonarQube)*/}} + confirmOnCloseReset={false} + hasSQL={false} + disableSqlHelp={false} + disableDialogHelp={false} + /> + ; }; export let getCreateView = (schemaObj)=> { - return {/*This is intentional (SonarQube)*/}} - onClose={()=>{/*This is intentional (SonarQube)*/}} - onHelp={()=>{/*This is intentional (SonarQube)*/}} - onEdit={()=>{/*This is intentional (SonarQube)*/}} - onDataChange={()=>{/*This is intentional (SonarQube)*/}} - confirmOnCloseReset={false} - hasSQL={false} - disableSqlHelp={false} - disableDialogHelp={false} - />; + return + {/*This is intentional (SonarQube)*/}} + onClose={()=>{/*This is intentional (SonarQube)*/}} + onHelp={()=>{/*This is intentional (SonarQube)*/}} + onEdit={()=>{/*This is intentional (SonarQube)*/}} + onDataChange={()=>{/*This is intentional (SonarQube)*/}} + confirmOnCloseReset={false} + hasSQL={false} + disableSqlHelp={false} + disableDialogHelp={false} + /> + ; }; export let getPropertiesView = (schemaObj, getInitData)=> { - return {/*This is intentional (SonarQube)*/}} - onEdit={()=>{/*This is intentional (SonarQube)*/}} - />; + return + {/*This is intentional (SonarQube)*/}} + onEdit={()=>{/*This is intentional (SonarQube)*/}} + /> + ; }; export let genericBeforeEach = ()=> { diff --git a/web/regression/javascript/schema_ui_files/backup.ui.spec.js b/web/regression/javascript/schema_ui_files/backup.ui.spec.js index 24da2e144..44652d1b2 100644 --- a/web/regression/javascript/schema_ui_files/backup.ui.spec.js +++ b/web/regression/javascript/schema_ui_files/backup.ui.spec.js @@ -13,6 +13,7 @@ import { createMount } from '@material-ui/core/test-utils'; import pgAdmin from 'sources/pgadmin'; import SchemaView from '../../../pgadmin/static/js/SchemaView'; import BackupSchema, {getSectionSchema, getTypeObjSchema, getSaveOptSchema, getQueryOptionSchema, getDisabledOptionSchema, getMiscellaneousSchema} from '../../../pgadmin/tools/backup/static/js/backup.ui'; +import Theme from '../../../pgadmin/static/js/Theme'; describe('BackupSchema', ()=>{ @@ -41,21 +42,23 @@ describe('BackupSchema', ()=>{ ); it('create object backup', ()=>{ - mount({/*This is intentional (SonarQube)*/}} - onClose={()=>{/*This is intentional (SonarQube)*/}} - onHelp={()=>{/*This is intentional (SonarQube)*/}} - onDataChange={()=>{/*This is intentional (SonarQube)*/}} - confirmOnCloseReset={false} - hasSQL={false} - disableSqlHelp={false} - disableDialogHelp={false} - />); + mount( + {/*This is intentional (SonarQube)*/}} + onClose={()=>{/*This is intentional (SonarQube)*/}} + onHelp={()=>{/*This is intentional (SonarQube)*/}} + onDataChange={()=>{/*This is intentional (SonarQube)*/}} + confirmOnCloseReset={false} + hasSQL={false} + disableSqlHelp={false} + disableDialogHelp={false} + /> + ); }); @@ -76,21 +79,23 @@ describe('BackupSchema', ()=>{ ); it('create server backup', ()=>{ - mount({/*This is intentional (SonarQube)*/}} - onClose={()=>{/*This is intentional (SonarQube)*/}} - onHelp={()=>{/*This is intentional (SonarQube)*/}} - onDataChange={()=>{/*This is intentional (SonarQube)*/}} - confirmOnCloseReset={false} - hasSQL={false} - disableSqlHelp={false} - disableDialogHelp={false} - />); + mount( + {/*This is intentional (SonarQube)*/}} + onClose={()=>{/*This is intentional (SonarQube)*/}} + onHelp={()=>{/*This is intentional (SonarQube)*/}} + onDataChange={()=>{/*This is intentional (SonarQube)*/}} + confirmOnCloseReset={false} + hasSQL={false} + disableSqlHelp={false} + disableDialogHelp={false} + /> + ); }); }); diff --git a/web/regression/javascript/schema_ui_files/backupGlobal.ui.spec.js b/web/regression/javascript/schema_ui_files/backupGlobal.ui.spec.js index 19de7213e..1990f76de 100644 --- a/web/regression/javascript/schema_ui_files/backupGlobal.ui.spec.js +++ b/web/regression/javascript/schema_ui_files/backupGlobal.ui.spec.js @@ -12,6 +12,7 @@ import '../helper/enzyme.helper'; import { createMount } from '@material-ui/core/test-utils'; import SchemaView from '../../../pgadmin/static/js/SchemaView'; import BackupGlobalSchema, {getMiscellaneousSchema} from '../../../pgadmin/tools/backup/static/js/backupGlobal.ui'; +import Theme from '../../../pgadmin/static/js/Theme'; describe('BackupGlobalSchema', ()=>{ @@ -31,21 +32,23 @@ describe('BackupGlobalSchema', ()=>{ ); it('create', ()=>{ - mount({/*This is intentional (SonarQube)*/}} - onClose={()=>{/*This is intentional (SonarQube)*/}} - onHelp={()=>{/*This is intentional (SonarQube)*/}} - onDataChange={()=>{/*This is intentional (SonarQube)*/}} - confirmOnCloseReset={false} - hasSQL={false} - disableSqlHelp={false} - disableDialogHelp={false} - />); + mount( + {/*This is intentional (SonarQube)*/}} + onClose={()=>{/*This is intentional (SonarQube)*/}} + onHelp={()=>{/*This is intentional (SonarQube)*/}} + onDataChange={()=>{/*This is intentional (SonarQube)*/}} + confirmOnCloseReset={false} + hasSQL={false} + disableSqlHelp={false} + disableDialogHelp={false} + /> + ); }); }); diff --git a/web/regression/javascript/schema_ui_files/debugger_args.ui.spec.js b/web/regression/javascript/schema_ui_files/debugger_args.ui.spec.js index 4934e81ff..11ae12293 100644 --- a/web/regression/javascript/schema_ui_files/debugger_args.ui.spec.js +++ b/web/regression/javascript/schema_ui_files/debugger_args.ui.spec.js @@ -15,6 +15,7 @@ import { createMount } from '@material-ui/core/test-utils'; import SchemaView from '../../../pgadmin/static/js/SchemaView'; import {DebuggerArgumentSchema} from '../../../pgadmin/tools/debugger/static/js/components/DebuggerArgs.ui'; import {genericBeforeEach} from '../genericFunctions'; +import Theme from '../../../pgadmin/static/js/Theme'; describe('DebuggerArgs', () => { let mount; @@ -35,16 +36,18 @@ describe('DebuggerArgs', () => { }); it('create', () => { - mount( {/*This is intentional (SonarQube)*/}} - showFooter={false} - isTabView={false} - />); + mount( + {/*This is intentional (SonarQube)*/}} + showFooter={false} + isTabView={false} + /> + ); }); }); diff --git a/web/regression/javascript/schema_ui_files/foreign_table.ui.spec.js b/web/regression/javascript/schema_ui_files/foreign_table.ui.spec.js index 6242e494c..c7da5e3a2 100644 --- a/web/regression/javascript/schema_ui_files/foreign_table.ui.spec.js +++ b/web/regression/javascript/schema_ui_files/foreign_table.ui.spec.js @@ -14,6 +14,7 @@ import SchemaView from '../../../pgadmin/static/js/SchemaView'; import BaseUISchema from 'sources/SchemaView/base_schema.ui'; import ForeignTableSchema, { ColumnSchema, CheckConstraintSchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/static/js/foreign_table.ui'; import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions'; +import Theme from '../../../pgadmin/static/js/Theme'; class MockSchema extends BaseUISchema { get baseFields() { @@ -263,22 +264,24 @@ describe('ForeignTableColumnSchema', ()=>{ let initData = ()=>Promise.resolve({typlen: 1, inheritedid: 1, inheritedfrom: 'public'}); - mount({/*This is intentional (SonarQube)*/}} - onClose={()=>{/*This is intentional (SonarQube)*/}} - onHelp={()=>{/*This is intentional (SonarQube)*/}} - onEdit={()=>{/*This is intentional (SonarQube)*/}} - onDataChange={()=>{/*This is intentional (SonarQube)*/}} - confirmOnCloseReset={false} - hasSQL={false} - disableSqlHelp={false} - />); + mount( + {/*This is intentional (SonarQube)*/}} + onClose={()=>{/*This is intentional (SonarQube)*/}} + onHelp={()=>{/*This is intentional (SonarQube)*/}} + onEdit={()=>{/*This is intentional (SonarQube)*/}} + onDataChange={()=>{/*This is intentional (SonarQube)*/}} + confirmOnCloseReset={false} + hasSQL={false} + disableSqlHelp={false} + /> + ); }); @@ -311,22 +314,24 @@ describe('ForeignTableColumnSchema', ()=>{ }); - mount({/*This is intentional (SonarQube)*/}} - onClose={()=>{/*This is intentional (SonarQube)*/}} - onHelp={()=>{/*This is intentional (SonarQube)*/}} - onEdit={()=>{/*This is intentional (SonarQube)*/}} - onDataChange={()=>{/*This is intentional (SonarQube)*/}} - confirmOnCloseReset={false} - hasSQL={false} - disableSqlHelp={false} - />); + mount( + {/*This is intentional (SonarQube)*/}} + onClose={()=>{/*This is intentional (SonarQube)*/}} + onHelp={()=>{/*This is intentional (SonarQube)*/}} + onEdit={()=>{/*This is intentional (SonarQube)*/}} + onDataChange={()=>{/*This is intentional (SonarQube)*/}} + confirmOnCloseReset={false} + hasSQL={false} + disableSqlHelp={false} + /> + ); }); }); diff --git a/web/regression/javascript/schema_ui_files/grant_wizard.ui.spec.js b/web/regression/javascript/schema_ui_files/grant_wizard.ui.spec.js index 6ca190ac0..454c1849c 100644 --- a/web/regression/javascript/schema_ui_files/grant_wizard.ui.spec.js +++ b/web/regression/javascript/schema_ui_files/grant_wizard.ui.spec.js @@ -14,6 +14,7 @@ import SchemaView from '../../../pgadmin/static/js/SchemaView'; import BaseUISchema from 'sources/SchemaView/base_schema.ui'; import GrantWizardPrivilegeSchema from '../../../pgadmin/tools/grant_wizard/static/js/privilege_schema.ui'; import {genericBeforeEach} from '../genericFunctions'; +import Theme from '../../../pgadmin/static/js/Theme'; class MockSchema extends BaseUISchema { get baseFields() { @@ -42,16 +43,18 @@ describe('GrantWizard', () => { }); it('create', () => { - mount( {/*This is intentional (SonarQube)*/}} - showFooter={false} - isTabView={false} - />); + mount( + {/*This is intentional (SonarQube)*/}} + showFooter={false} + isTabView={false} + /> + ); }); }); diff --git a/web/regression/javascript/schema_ui_files/import_export_servers.ui.spec.js b/web/regression/javascript/schema_ui_files/import_export_servers.ui.spec.js index 4e25d017e..dc7085e97 100644 --- a/web/regression/javascript/schema_ui_files/import_export_servers.ui.spec.js +++ b/web/regression/javascript/schema_ui_files/import_export_servers.ui.spec.js @@ -13,6 +13,7 @@ import { createMount } from '@material-ui/core/test-utils'; import SchemaView from '../../../pgadmin/static/js/SchemaView'; import ImportExportSelectionSchema from '../../../pgadmin/tools/import_export_servers/static/js/import_export_selection.ui'; import {genericBeforeEach} from '../genericFunctions'; +import Theme from '../../../pgadmin/static/js/Theme'; describe('ImportExportServers', () => { let mount; @@ -33,30 +34,34 @@ describe('ImportExportServers', () => { }); it('import', () => { - mount( {/*This is intentional (SonarQube)*/}} - showFooter={false} - isTabView={false} - />); + mount( + {/*This is intentional (SonarQube)*/}} + showFooter={false} + isTabView={false} + /> + ); }); it('export', () => { schemaObj = new ImportExportSelectionSchema( {imp_exp: 'e', filename: 'test.json'}); - mount( {/*This is intentional (SonarQube)*/}} - showFooter={false} - isTabView={false} - />); + mount( + {/*This is intentional (SonarQube)*/}} + showFooter={false} + isTabView={false} + /> + ); }); });