diff --git a/web/pgadmin/browser/server_groups/servers/databases/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/__init__.py index 52fb050d8..5e2ed1c8a 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/__init__.py @@ -251,9 +251,16 @@ class DatabaseView(PGChildNodeView): 'datlastsysoid'] return last_system_oid - def get_nodes(self, gid, sid, show_system_templates=False): + def get_nodes(self, gid, sid, is_schema_diff=False): res = [] last_system_oid = self.retrieve_last_system_oid() + + # if is_schema_diff then no need to show system templates. + if is_schema_diff and self.manager.db_info is not None and \ + self.manager.did in self.manager.db_info: + last_system_oid = \ + self.manager.db_info[self.manager.did]['datlastsysoid'] + server_node_res = self.manager db_disp_res = None @@ -303,8 +310,8 @@ class DatabaseView(PGChildNodeView): return res @check_precondition(action="nodes") - def nodes(self, gid, sid): - res = self.get_nodes(gid, sid) + def nodes(self, gid, sid, is_schema_diff=False): + res = self.get_nodes(gid, sid, is_schema_diff) return make_json_response( data=res, diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/__init__.py index 00afd63bb..83cc0de59 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/__init__.py @@ -413,7 +413,7 @@ class SchemaView(PGChildNodeView): ) @check_precondition - def nodes(self, gid, sid, did, scid=None): + def nodes(self, gid, sid, did, scid=None, is_schema_diff=False): """ This function will create all the child nodes within the collection Here it will create all the schema node. @@ -422,6 +422,8 @@ class SchemaView(PGChildNodeView): gid: Server Group ID sid: Server ID did: Database ID + scid: Schema ID + is_schema_diff: True if called by schema diff tool Returns: JSON of available schema child nodes @@ -437,9 +439,13 @@ class SchemaView(PGChildNodeView): ["'%s'"] * len(schema_restrictions.split(','))) param = schema_res % (tuple(schema_restrictions.split(','))) + show_system_objects = self.blueprint.show_system_objects + if is_schema_diff: + show_system_objects = False + SQL = render_template( "/".join([self.template_path, self._SQL_PREFIX + self._NODES_SQL]), - show_sysobj=self.blueprint.show_system_objects, + show_sysobj=show_system_objects, _=gettext, scid=scid, schema_restrictions=param diff --git a/web/pgadmin/tools/schema_diff/__init__.py b/web/pgadmin/tools/schema_diff/__init__.py index ed0856003..194f5ad39 100644 --- a/web/pgadmin/tools/schema_diff/__init__.py +++ b/web/pgadmin/tools/schema_diff/__init__.py @@ -388,7 +388,8 @@ def databases(sid): view = SchemaDiffRegistry.get_node_view('database') server = Server.query.filter_by(id=sid).first() - response = view.nodes(gid=server.servergroup_id, sid=sid) + response = view.nodes(gid=server.servergroup_id, sid=sid, + is_schema_diff=True) databases = json.loads(response.data)['data'] for db in databases: res.append({ @@ -653,7 +654,8 @@ def get_schemas(sid, did): try: view = SchemaDiffRegistry.get_node_view('schema') server = Server.query.filter_by(id=sid).first() - response = view.nodes(gid=server.servergroup_id, sid=sid, did=did) + response = view.nodes(gid=server.servergroup_id, sid=sid, did=did, + is_schema_diff=True) schemas = json.loads(response.data)['data'] return schemas except Exception as e: diff --git a/web/pgadmin/tools/schema_diff/static/css/schema_diff.css b/web/pgadmin/tools/schema_diff/static/css/schema_diff.css index b5cb8ef51..e9fe70fbc 100644 --- a/web/pgadmin/tools/schema_diff/static/css/schema_diff.css +++ b/web/pgadmin/tools/schema_diff/static/css/schema_diff.css @@ -3,18 +3,6 @@ font-size: 1.3em !important; } -.icon-schema-diff-white { - display: inline-block; - align-content: center; - vertical-align: sub; - height: 18px; - width: 18px; - background-size: 20px !important; - background-repeat: no-repeat; - background-position-x: center; - background-position-y: center; - } - .icon-script { display: inline-block; align-content: center; diff --git a/web/pgadmin/tools/schema_diff/static/js/schema_diff.backform.js b/web/pgadmin/tools/schema_diff/static/js/schema_diff.backform.js index 6cc99b840..55ef1e5f4 100644 --- a/web/pgadmin/tools/schema_diff/static/js/schema_diff.backform.js +++ b/web/pgadmin/tools/schema_diff/static/js/schema_diff.backform.js @@ -317,7 +317,7 @@ let SchemaDiffHeaderView = Backform.Form.extend({
- +