Skip to content

Commit

Permalink
Fixed an issue where Schema Diff does not work when the user language…
Browse files Browse the repository at this point in the history
… is set to any language other than English in Preferences. #6784
  • Loading branch information
akshay-joshi committed Oct 26, 2023
1 parent d74320f commit c5f4a56
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
1 change: 1 addition & 0 deletions docs/en_US/release_notes_7_9.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 #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 #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.
10 changes: 5 additions & 5 deletions web/pgadmin/tools/schema_diff/directory_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

import copy
import string
from pgadmin.tools.schema_diff.model import SchemaDiffModel
from flask import current_app
from flask_babel import gettext
from pgadmin.utils.constants import PGADMIN_STRING_SEPARATOR

count = 1
Expand Down Expand Up @@ -97,7 +97,7 @@ def _get_source_list(**kwargs):
'label': node_label,
'title': title,
'oid': source_object_id,
'status': SchemaDiffModel.COMPARISON_STATUS['source_only'],
'status': gettext('Source Only'),
'source_ddl': source_ddl,
'target_ddl': '',
'diff_ddl': diff_ddl,
Expand Down Expand Up @@ -178,7 +178,7 @@ def _get_target_list(removed, target_dict, node, target_params, view_object,
'label': node_label,
'title': title,
'oid': target_object_id,
'status': SchemaDiffModel.COMPARISON_STATUS['target_only'],
'status': gettext('Target Only'),
'source_ddl': '',
'target_ddl': target_ddl,
'diff_ddl': diff_ddl,
Expand Down Expand Up @@ -279,7 +279,7 @@ def _get_identical_and_different_list(intersect_keys, source_dict, target_dict,
'oid': source_object_id,
'source_oid': source_object_id,
'target_oid': target_object_id,
'status': SchemaDiffModel.COMPARISON_STATUS['identical'],
'status': gettext('Identical'),
'group_name': group_name,
'dependencies': [],
'source_scid': source_params['scid']
Expand Down Expand Up @@ -363,7 +363,7 @@ def _get_identical_and_different_list(intersect_keys, source_dict, target_dict,
'oid': source_object_id,
'source_oid': source_object_id,
'target_oid': target_object_id,
'status': SchemaDiffModel.COMPARISON_STATUS['different'],
'status': gettext('Different'),
'source_ddl': source_ddl,
'target_ddl': target_ddl,
'diff_ddl': diff_ddl,
Expand Down
11 changes: 1 addition & 10 deletions web/pgadmin/tools/schema_diff/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,12 @@
#
##########################################################################

from flask_babel import gettext


class SchemaDiffModel():
class SchemaDiffModel:
"""
SchemaDiffModel
"""

COMPARISON_STATUS = {
'source_only': 'Source Only',
'target_only': 'Target Only',
'different': 'Different',
'identical': 'Identical'
}

def __init__(self, **kwargs):
"""
This method is used to initialize the class and
Expand Down

0 comments on commit c5f4a56

Please sign in to comment.