Bladeren bron

PR798 [oozie] Fix workflow widget id colliding bug (#798)

* Fix bug in oozie worklow graph node status (#10)

* removed comment in mako template
Thai Bui 6 jaren geleden
bovenliggende
commit
8d23228

+ 1 - 1
apps/oozie/src/oozie/models2.py

@@ -587,7 +587,7 @@ def _update_adj_list(adj_list):
     elif adj_list[node]['node_type'] == 'end':
     elif adj_list[node]['node_type'] == 'end':
       adj_list[node]['uuid'] = '33430f0f-ebfa-c3ec-f237-3e77efa03d0a'
       adj_list[node]['uuid'] = '33430f0f-ebfa-c3ec-f237-3e77efa03d0a'
     else:
     else:
-      adj_list[node]['uuid'] = node[-4:] + str(uuid.uuid4())[4:]
+      adj_list[node]['uuid'] = node + str(uuid.uuid4())[len(node):]
 
 
     uuids[id] = adj_list[node]['uuid']
     uuids[id] = adj_list[node]['uuid']
     id += 1
     id += 1

+ 4 - 3
apps/oozie/src/oozie/templates/dashboard/list_oozie_workflow_graph.mako

@@ -84,13 +84,14 @@ ${ dashboard.import_layout() }
             if (data.actions) {
             if (data.actions) {
               % if layout_json != '':
               % if layout_json != '':
                 ko.utils.arrayForEach(data.actions, function (action) {
                 ko.utils.arrayForEach(data.actions, function (action) {
-                  var _w, actionId = action.id.substr(action.id.length - 4);
+                  var _w, actionId = action.id.substr(action.id.lastIndexOf('@'));
                   if (actionId === '@End') {
                   if (actionId === '@End') {
                     _w = viewModel.getWidgetById('33430f0f-ebfa-c3ec-f237-3e77efa03d0a');
                     _w = viewModel.getWidgetById('33430f0f-ebfa-c3ec-f237-3e77efa03d0a');
                   }
                   }
                   else {
                   else {
-                    if ($("[id^=wdg_" + actionId.toLowerCase() + "]").length > 0) {
-                      _w = viewModel.getWidgetById($("[id^=wdg_" + actionId.toLowerCase() + "]").attr("id").substr(4));
+                    var actionName = actionId.toLowerCase().substr(1)
+                    if ($("[id^=wdg_" + actionName + "]").length > 0) {
+                      _w = viewModel.getWidgetById($("[id^=wdg_" + actionName + "]").attr("id").substr(4));
                     }
                     }
                     else {
                     else {
                       _w = viewModel.getWidgetById('33430f0f-ebfa-c3ec-f237-3e77efa03d0a');
                       _w = viewModel.getWidgetById('33430f0f-ebfa-c3ec-f237-3e77efa03d0a');