Fixed an issue where Schema Diff does not work when the user language is set to any language other than English in Preferences. #6784

This commit is contained in:
Akshay Joshi 2023-10-26 11:49:55 +05:30
parent d74320f06e
commit c5f4a56c0c
3 changed files with 7 additions and 15 deletions

View File

@ -35,4 +35,5 @@ Bug fixes
| `Issue #2986 <https://github.com/pgadmin-org/pgadmin4/issues/2986>`_ - Fix an issue where the scroll position of panels was not remembered on Firefox. | `Issue #2986 <https://github.com/pgadmin-org/pgadmin4/issues/2986>`_ - Fix an issue where the scroll position of panels was not remembered on Firefox.
| `Issue #6602 <https://github.com/pgadmin-org/pgadmin4/issues/6602>`_ - Fix an issue where the default server-group is being deleted if the load-server json file contains no servers. | `Issue #6602 <https://github.com/pgadmin-org/pgadmin4/issues/6602>`_ - Fix an issue where the default server-group is being deleted if the load-server json file contains no servers.
| `Issue #6720 <https://github.com/pgadmin-org/pgadmin4/issues/6720>`_ - Fix an issue of the incorrect format (no indent) of SQL stored functions/procedures. | `Issue #6720 <https://github.com/pgadmin-org/pgadmin4/issues/6720>`_ - Fix an issue of the incorrect format (no indent) of SQL stored functions/procedures.
| `Issue #6784 <https://github.com/pgadmin-org/pgadmin4/issues/6784>`_ - Fixed an issue where Schema Diff does not work when the user language is set to any language other than English in Preferences.
| `Issue #6874 <https://github.com/pgadmin-org/pgadmin4/issues/6874>`_ - Fix an issue where the browser window stuck on spinning with an Oauth user without email. | `Issue #6874 <https://github.com/pgadmin-org/pgadmin4/issues/6874>`_ - Fix an issue where the browser window stuck on spinning with an Oauth user without email.

View File

@ -11,8 +11,8 @@
import copy import copy
import string import string
from pgadmin.tools.schema_diff.model import SchemaDiffModel
from flask import current_app from flask import current_app
from flask_babel import gettext
from pgadmin.utils.constants import PGADMIN_STRING_SEPARATOR from pgadmin.utils.constants import PGADMIN_STRING_SEPARATOR
count = 1 count = 1
@ -97,7 +97,7 @@ def _get_source_list(**kwargs):
'label': node_label, 'label': node_label,
'title': title, 'title': title,
'oid': source_object_id, 'oid': source_object_id,
'status': SchemaDiffModel.COMPARISON_STATUS['source_only'], 'status': gettext('Source Only'),
'source_ddl': source_ddl, 'source_ddl': source_ddl,
'target_ddl': '', 'target_ddl': '',
'diff_ddl': diff_ddl, 'diff_ddl': diff_ddl,
@ -178,7 +178,7 @@ def _get_target_list(removed, target_dict, node, target_params, view_object,
'label': node_label, 'label': node_label,
'title': title, 'title': title,
'oid': target_object_id, 'oid': target_object_id,
'status': SchemaDiffModel.COMPARISON_STATUS['target_only'], 'status': gettext('Target Only'),
'source_ddl': '', 'source_ddl': '',
'target_ddl': target_ddl, 'target_ddl': target_ddl,
'diff_ddl': diff_ddl, 'diff_ddl': diff_ddl,
@ -279,7 +279,7 @@ def _get_identical_and_different_list(intersect_keys, source_dict, target_dict,
'oid': source_object_id, 'oid': source_object_id,
'source_oid': source_object_id, 'source_oid': source_object_id,
'target_oid': target_object_id, 'target_oid': target_object_id,
'status': SchemaDiffModel.COMPARISON_STATUS['identical'], 'status': gettext('Identical'),
'group_name': group_name, 'group_name': group_name,
'dependencies': [], 'dependencies': [],
'source_scid': source_params['scid'] 'source_scid': source_params['scid']
@ -363,7 +363,7 @@ def _get_identical_and_different_list(intersect_keys, source_dict, target_dict,
'oid': source_object_id, 'oid': source_object_id,
'source_oid': source_object_id, 'source_oid': source_object_id,
'target_oid': target_object_id, 'target_oid': target_object_id,
'status': SchemaDiffModel.COMPARISON_STATUS['different'], 'status': gettext('Different'),
'source_ddl': source_ddl, 'source_ddl': source_ddl,
'target_ddl': target_ddl, 'target_ddl': target_ddl,
'diff_ddl': diff_ddl, 'diff_ddl': diff_ddl,

View File

@ -7,21 +7,12 @@
# #
########################################################################## ##########################################################################
from flask_babel import gettext
class SchemaDiffModel:
class SchemaDiffModel():
""" """
SchemaDiffModel SchemaDiffModel
""" """
COMPARISON_STATUS = {
'source_only': 'Source Only',
'target_only': 'Target Only',
'different': 'Different',
'identical': 'Identical'
}
def __init__(self, **kwargs): def __init__(self, **kwargs):
""" """
This method is used to initialize the class and This method is used to initialize the class and