Replace Alertify alert and confirm with React-based model dialog. Fixes #7053

This commit is contained in:
Akshay Joshi
2021-12-07 18:52:40 +05:30
parent e327066523
commit fd53e4f5f9
62 changed files with 393 additions and 398 deletions

View File

@@ -17,9 +17,9 @@ import SchemaView, { SCHEMA_STATE_ACTIONS } from '../../../pgadmin/static/js/Sch
import BaseUISchema from '../../../pgadmin/static/js/SchemaView/base_schema.ui';
import _ from 'lodash';
import { getNodeExclusionConstraintSchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/static/js/exclusion_constraint.ui';
import * as legacyConnector from 'sources/helpers/legacyConnector';
import * as nodeAjax from '../../../pgadmin/browser/static/js/node_ajax';
import TableSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.ui';
import Notify from '../../../pgadmin/static/js/helpers/Notifier';
class SchemaInColl extends BaseUISchema {
constructor(schemaObj) {
@@ -259,7 +259,7 @@ describe('ExclusionConstraintSchema', ()=>{
beforeEach(()=>{
spyOn(schemaObj.exColumnSchema, 'setOperClassOptions').and.callThrough();
spyOn(schemaObj.fieldOptions, 'getOperClass').and.returnValue(operClassOptions);
confirmSpy = spyOn(legacyConnector.pgAlertify(), 'confirm').and.callThrough();
confirmSpy = spyOn(Notify, 'confirm').and.callThrough();
deferredDepChange = _.find(schemaObj.fields, (f)=>f.id=='amname')?.deferredDepChange;
});

View File

@@ -16,8 +16,8 @@ import {messages} from '../fake_messages';
import SchemaView, { SCHEMA_STATE_ACTIONS } from '../../../pgadmin/static/js/SchemaView';
import _ from 'lodash';
import { getNodeTableSchema, LikeSchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.ui';
import * as legacyConnector from 'sources/helpers/legacyConnector';
import * as nodeAjax from '../../../pgadmin/browser/static/js/node_ajax';
import Notify from '../../../pgadmin/static/js/helpers/Notifier';
function getFieldDepChange(schema, id) {
return _.find(schema.fields, (f)=>f.id==id)?.depChange;
@@ -154,7 +154,7 @@ describe('TableSchema', ()=>{
beforeEach(()=>{
spyOn(schemaObj,'changeColumnOptions').and.callThrough();
spyOn(schemaObj, 'getTableOid').and.returnValue(140391);
confirmSpy = spyOn(legacyConnector.pgAlertify(), 'confirm').and.callThrough();
confirmSpy = spyOn(Notify, 'confirm').and.callThrough();
deferredDepChange = _.find(schemaObj.fields, (f)=>f.id=='typname')?.deferredDepChange;
schemaObj.ofTypeTables = [
{label: 'type1', oftype_columns: oftypeColumns}