[oozie] Prevent page break when hiding workflow graph
workflow_layout needs to be empty string in order to prevent JS errors.
@@ -399,8 +399,8 @@ def list_oozie_workflow(request, job_id):
return render('dashboard/list_oozie_workflow_graph.mako', request, {
'oozie_workflow': oozie_workflow,
'workflow_graph': workflow_graph,
- 'layout_json': json.dumps(workflow_data.get('layout', ''), cls=JSONEncoderForHTML),
- 'workflow_json': json.dumps(workflow_data.get('workflow', ''), cls=JSONEncoderForHTML),
+ 'layout_json': json.dumps(workflow_data.get('layout', ''), cls=JSONEncoderForHTML) if workflow_data else '',
+ 'workflow_json': json.dumps(workflow_data.get('workflow', ''), cls=JSONEncoderForHTML) if workflow_data else '',
'credentials_json': json.dumps(credentials.credentials.keys(), cls=JSONEncoderForHTML) if credentials else '',
'workflow_properties_json': json.dumps(WORKFLOW_NODE_PROPERTIES, cls=JSONEncoderForHTML),
'doc_uuid': doc.uuid if doc else '',
@@ -429,8 +429,8 @@ def list_oozie_workflow(request, job_id):
'parameters': dict((var, val) for var, val in parameters.iteritems() if var not in ParameterForm.NON_PARAMETERS and var != 'oozie.use.system.libpath' or var == 'oozie.wf.application.path'),
'has_job_edition_permission': has_job_edition_permission,
'workflow_graph': workflow_graph,
- 'layout_json': json.dumps(workflow_data.get('layout', ''), cls=JSONEncoderForHTML),
- 'workflow_json': json.dumps(workflow_data.get('workflow', ''), cls=JSONEncoderForHTML),
+ 'layout_json': json.dumps(workflow_data.get('layout', ''), cls=JSONEncoderForHTML) if workflow_data else '',
+ 'workflow_json': json.dumps(workflow_data.get('workflow', ''), cls=JSONEncoderForHTML) if workflow_data else '',
'credentials_json': json.dumps(credentials.credentials.keys(), cls=JSONEncoderForHTML) if credentials else '',
'workflow_properties_json': json.dumps(WORKFLOW_NODE_PROPERTIES, cls=JSONEncoderForHTML),
'doc_uuid': doc.uuid if doc else '',
