mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Added validation in schema diff which will not allow the user to compare the same objects.
This commit is contained in:
committed by
Akshay Joshi
parent
ebf5e871e0
commit
5839e7cda8
@@ -156,6 +156,20 @@ export default class SchemaDiffUI {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if user has selected the same options for comparison on the GUI
|
||||||
|
let opts = [['source_sid', 'target_sid'], ['source_did', 'target_did'], ['source_scid', 'target_scid']];
|
||||||
|
let isSameOptsSelected = true;
|
||||||
|
for (let opt of opts) {
|
||||||
|
if (url_params[opt[0]] && url_params[opt[1]] &&
|
||||||
|
(parseInt(url_params[opt[0]]) !== parseInt(url_params[opt[1]]))) {
|
||||||
|
isSameOptsSelected = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isSameOptsSelected) {
|
||||||
|
Alertify.alert(gettext('Selection Error'), gettext('Please select the different source and target.'));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
this.selection = JSON.parse(JSON.stringify(url_params));
|
this.selection = JSON.parse(JSON.stringify(url_params));
|
||||||
|
|
||||||
url_params['trans_id'] = self.trans_id;
|
url_params['trans_id'] = self.trans_id;
|
||||||
|
|||||||
Reference in New Issue
Block a user