Browse Source

[oozie] Support editing description of workflows, coordinators, bundles

Romain Rigaux 10 years ago
parent
commit
cd0e578

File diff suppressed because it is too large
+ 0 - 0
apps/oozie/src/oozie/fixtures/initial_oozie_examples.json


+ 2 - 0
apps/oozie/src/oozie/models2.py

@@ -1579,6 +1579,7 @@ class Coordinator(Job):
           'name': 'My Coordinator',
           'variables': [], # Aka workflow parameters
           'properties': {
+              'description': '',
               'deployment_dir': '',
               'schema_version': 'uri:oozie:coordinator:0.2',
               'frequency_number': 1,
@@ -1868,6 +1869,7 @@ class Bundle(Job):
           'name': 'My Bundle',
           'coordinators': [],
           'properties': {
+              'description': '',
               'deployment_dir': '',
               'schema_version': 'uri:oozie:bundle:0.2',
               'kickoff': datetime.today(),

+ 3 - 0
apps/oozie/src/oozie/templates/editor2/bundle_editor.mako

@@ -82,6 +82,9 @@ ${ commonheader(_("Bundle Editor"), "Oozie", user) | n,unicode }
     <div class="inline object-name">
       <span data-bind="editable: $root.bundle.name, editableOptions: {enabled: $root.isEditing(), placement: 'right'}"></span>
     </div>
+    <div class="inline object-description">
+      <span data-bind="editable: $root.bundle.properties.description, editableOptions: {enabled: $root.isEditing(), placement: 'right', emptytext: '${_('Add a description...')}'}"></span>
+    </div>
   </form>
 </div>
 

+ 3 - 0
apps/oozie/src/oozie/templates/editor2/coordinator_editor.mako

@@ -87,6 +87,9 @@ ${ commonheader(_("Coordinator Editor"), "Oozie", user) | n,unicode }
     <div class="inline object-name">
       <span data-bind="editable: $root.coordinator.name, editableOptions: {enabled: $root.isEditing(), placement: 'right'}"></span>
     </div>
+    <div class="inline object-description">
+      <span data-bind="editable: $root.coordinator.properties.description, editableOptions: {enabled: $root.isEditing(), placement: 'right', emptytext: '${_('Add a description...')}'}"></span>
+    </div>
   </form>
 </div>
 

+ 3 - 0
apps/oozie/src/oozie/views/editor2.py

@@ -218,6 +218,7 @@ def save_workflow(request):
   workflow_doc.update_data({'workflow': workflow})
   workflow_doc.update_data({'layout': layout})
   workflow_doc.name = workflow['name']
+  workflow_doc.description = workflow['properties']['description']
   workflow_doc.save()
 
   response['status'] = 0
@@ -503,6 +504,7 @@ def save_coordinator(request):
 
   coordinator_doc.update_data(coordinator_data)
   coordinator_doc.name = coordinator_data['name']
+  coordinator_doc.description = coordinator_data['properties']['description']
   coordinator_doc.save()
 
   response['status'] = 0
@@ -654,6 +656,7 @@ def save_bundle(request):
 
   bundle_doc.update_data(bundle_data)
   bundle_doc.name = bundle_data['name']
+  bundle_doc.description = bundle_data['properties']['description']
   bundle_doc.save()
 
   response['status'] = 0

Some files were not shown because too many files changed in this diff