1) Ensure View/Materialized View node should be visible after updating any property. Fixes #4109

2) Updated the icon for Materialized View.
This commit is contained in:
Akshay Joshi 2019-03-26 14:12:47 +05:30
parent a5ebdafb82
commit 9c2ea3ca11
2 changed files with 15 additions and 19 deletions

View File

@ -56,4 +56,5 @@ Bug fixes
| `Bug #4081 <https://redmine.postgresql.org/issues/4081>`_ - Fix the RE-SQL syntax for roles with a VALID UNTIL clause.
| `Bug #4090 <https://redmine.postgresql.org/issues/4090>`_ - Improve the German translation for Backup Server.
| `Bug #4099 <https://redmine.postgresql.org/issues/4099>`_ - Fix SQL help for EPAS 10+, and refactor the URL generation code into a testable function.
| `Bug #4100 <https://redmine.postgresql.org/issues/4100>`_ - Ensure sequences can be created with increment, start, minimum and maximum options set.
| `Bug #4100 <https://redmine.postgresql.org/issues/4100>`_ - Ensure sequences can be created with increment, start, minimum and maximum options set.
| `Bug #4109 <https://redmine.postgresql.org/issues/4109>`_ - Ensure View/Materialized View node should be visible after updating any property.

View File

@ -363,7 +363,8 @@ class ViewNode(PGChildNodeView, VacuumSettings):
rset['rows'][0]['oid'],
scid,
rset['rows'][0]['name'],
icon="icon-view"
icon="icon-view" if self.node_type == 'view'
else "icon-mview"
)
return make_json_response(
@ -389,7 +390,8 @@ class ViewNode(PGChildNodeView, VacuumSettings):
row['oid'],
scid,
row['name'],
icon="icon-view"
icon="icon-view" if self.node_type == 'view'
else "icon-mview"
))
return make_json_response(
@ -504,7 +506,8 @@ class ViewNode(PGChildNodeView, VacuumSettings):
view_id,
scid,
data['name'],
icon="icon-view"
icon="icon-view" if self.node_type == 'view'
else "icon-mview"
)
)
except Exception as e:
@ -520,36 +523,28 @@ class ViewNode(PGChildNodeView, VacuumSettings):
request.data, encoding='utf-8'
)
try:
SQL, nameOrError = self.getSQL(gid, sid, did, data, vid)
SQL, name = self.getSQL(gid, sid, did, data, vid)
if SQL is None:
return nameOrError
return name
SQL = SQL.strip('\n').strip(' ')
status, res = self.conn.execute_void(SQL)
if not status:
return internal_server_error(errormsg=res)
SQL = render_template("/".join(
[self.template_path, 'sql/view_id.sql']), data=data)
status, res_data = self.conn.execute_dict(SQL)
if not status:
return internal_server_error(errormsg=res)
view_id = res_data['rows'][0]['oid']
new_view_name = res_data['rows'][0]['relname']
# Get updated schema oid
SQL = render_template("/".join(
[self.template_path, 'sql/get_oid.sql']), vid=view_id)
[self.template_path, 'sql/get_oid.sql']), vid=vid)
status, scid = self.conn.execute_scalar(SQL)
if not status:
return internal_server_error(errormsg=res)
return jsonify(
node=self.blueprint.generate_browser_node(
view_id,
vid,
scid,
new_view_name,
icon="icon-view"
name,
icon="icon-view" if self.node_type == 'view'
else "icon-mview"
)
)
except Exception as e: