AMBARI-19221. Preview xml feature is not functional across (Padma Priya via 
pallavkul)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/28f1f2e5
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/28f1f2e5
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/28f1f2e5

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 28f1f2e5e21583174be497eb1ad7c8f1a290332f
Parents: 6da5935
Author: pallavkul <[email protected]>
Authored: Tue Dec 20 17:34:44 2016 +0530
Committer: pallavkul <[email protected]>
Committed: Tue Dec 20 17:34:44 2016 +0530

----------------------------------------------------------------------
 .../main/resources/ui/app/components/bundle-config.js   |  3 +++
 .../main/resources/ui/app/components/coord-config.js    |  3 +++
 .../main/resources/ui/app/components/flow-designer.js   |  3 +++
 .../main/resources/ui/app/components/preview-dialog.js  | 12 ++++++++++--
 .../ui/app/templates/components/bundle-config.hbs       |  4 ++--
 .../ui/app/templates/components/coord-config.hbs        |  4 ++--
 .../ui/app/templates/components/flow-designer.hbs       |  4 ++--
 7 files changed, 25 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/28f1f2e5/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js
----------------------------------------------------------------------
diff --git 
a/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js 
b/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js
index 4f409a1..4a8ac90 100644
--- 
a/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js
+++ 
b/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js
@@ -254,6 +254,9 @@ export default Ember.Component.extend(Ember.Evented, 
Validations, {
       this.set("previewXml", vkbeautify.xml(bundleXml));
       this.set("showingPreview", true);
     },
+    closePreview(){
+      this.set("showingPreview", false);
+    },
     importBundleTest(){
       var deferred = this.importSampleBundle();
       deferred.promise.then(function(data){

http://git-wip-us.apache.org/repos/asf/ambari/blob/28f1f2e5/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js
----------------------------------------------------------------------
diff --git 
a/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js 
b/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js
index 23d1955..15eb1ce 100644
--- 
a/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js
+++ 
b/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js
@@ -453,6 +453,9 @@ export default Ember.Component.extend(Validations, 
Ember.Evented, {
       this.set("previewXml", vkbeautify.xml(coordinatorXml));
       this.set("showingPreview", true);
     },
+    closePreview(){
+      this.set("showingPreview", false);
+    },
     confirmReset(){
       this.set('showingResetConfirmation', true);
     },

http://git-wip-us.apache.org/repos/asf/ambari/blob/28f1f2e5/contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js
----------------------------------------------------------------------
diff --git 
a/contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js 
b/contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js
index 02682a4..28239fa 100644
--- 
a/contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js
+++ 
b/contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js
@@ -922,6 +922,9 @@ export default Ember.Component.extend(FindNodeMixin, 
Validations, {
         this.set("showingPreview",true);
       }
     },
+    closePreview(){
+      this.set("showingPreview", false);
+    },
     downloadWorkflowXml(){
       this.get('workflowContext').clearErrors();
       var 
workflowGenerator=WorkflowGenerator.create({workflow:this.get("workflow"),

http://git-wip-us.apache.org/repos/asf/ambari/blob/28f1f2e5/contrib/views/wfmanager/src/main/resources/ui/app/components/preview-dialog.js
----------------------------------------------------------------------
diff --git 
a/contrib/views/wfmanager/src/main/resources/ui/app/components/preview-dialog.js
 
b/contrib/views/wfmanager/src/main/resources/ui/app/components/preview-dialog.js
index 7e956a6..cd6c171 100644
--- 
a/contrib/views/wfmanager/src/main/resources/ui/app/components/preview-dialog.js
+++ 
b/contrib/views/wfmanager/src/main/resources/ui/app/components/preview-dialog.js
@@ -19,9 +19,17 @@ import Ember from 'ember';
 
 export default Ember.Component.extend({
   elementsInserted :function(){
+    this.$('#previewModal').modal({
+      backdrop: 'static',
+      keyboard: false
+    });
+    this.$('#previewModal').modal('show');
        var self = this;
          this.$('#previewModal').on('shown.bs.modal', function (e) {
            self.$('.CodeMirror')[0].CodeMirror.refresh();
-         }); 
-  }.on('didInsertElement'),
+         });
+    this.$('#previewModal').on('hidden.bs.modal', function () {
+      this.sendAction("closePreview");
+         }.bind(this));
+  }.on('didInsertElement')
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/28f1f2e5/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/bundle-config.hbs
----------------------------------------------------------------------
diff --git 
a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/bundle-config.hbs
 
b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/bundle-config.hbs
index 698535f..8293dbe 100644
--- 
a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/bundle-config.hbs
+++ 
b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/bundle-config.hbs
@@ -39,7 +39,7 @@
               </a>
             </li>
             <li>
-              <a class="pointer" href="#" data-toggle="modal" 
data-target="#previewModal"  title="Preview Xml" {{action "preview"}}>
+              <a class="pointer" href="#" data-toggle="modal" title="Preview 
Xml" {{action "preview"}}>
                   <i class="fa fa-eye marginright5"></i>Preview xml
                 </a>
               </li>
@@ -124,7 +124,7 @@
   okBtnText="Continue" cancelBtnText="Cancel" 
onOk="resetBundle"}}{{/confirmation-dialog}}
 {{/if}}
 {{#if showingPreview}}
-  {{#preview-dialog title="Bundle XML Preview" 
previewXml=previewXml}}{{/preview-dialog}}
+  {{#preview-dialog title="Bundle XML Preview" previewXml=previewXml 
closePreview="closePreview"}}{{/preview-dialog}}
 {{/if}}
 {{#if showVersionSettings}}
   {{bundle-version-settings schemaVersions=bundle.schemaVersions 
showVersionSettings="showVersionSettings" }}

http://git-wip-us.apache.org/repos/asf/ambari/blob/28f1f2e5/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/coord-config.hbs
----------------------------------------------------------------------
diff --git 
a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/coord-config.hbs
 
b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/coord-config.hbs
index f26c2ec..6b0ea84 100644
--- 
a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/coord-config.hbs
+++ 
b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/coord-config.hbs
@@ -39,7 +39,7 @@
                 </a>
              </li>
               <li>
-                <a class="pointer" href="#" data-toggle="modal" 
data-target="#previewModal"  title="Preview Xml" {{action "preview"}}>
+                <a class="pointer" href="#" data-toggle="modal" title="Preview 
Xml" {{action "preview"}}>
                   <i class="fa fa-eye marginright5"></i>Preview xml
                 </a>
               </li>
@@ -320,7 +320,7 @@ confirmationMessage="Any unsaved changes may be lost. Do 
you want to proceed res
 okBtnText="Continue" cancelBtnText="Cancel" 
onOk="resetCoordinator"}}{{/confirmation-dialog}}
 {{/if}}
 {{#if showingPreview}}
-{{#preview-dialog title="Coordinator XML Preview" 
previewXml=previewXml}}{{/preview-dialog}}
+{{#preview-dialog title="Coordinator XML Preview" previewXml=previewXml 
closePreview="closePreview"}}{{/preview-dialog}}
 {{/if}}
 {{#if showParameterSettings}}
 {{#workflow-parameters type='coord' closeWorkFlowParam="closeWorkFlowParam" 
saveWorkFlowParam="saveWorkFlowParam" 
parameters=parameters}}{{/workflow-parameters}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/28f1f2e5/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/flow-designer.hbs
----------------------------------------------------------------------
diff --git 
a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/flow-designer.hbs
 
b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/flow-designer.hbs
index fa3215a..101f861 100644
--- 
a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/flow-designer.hbs
+++ 
b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/flow-designer.hbs
@@ -61,7 +61,7 @@
                   </a>
                 </li>
                 <li>
-                  <a class="pointer" data-toggle="modal" 
data-target="#previewModal"  title="Preview workflow" {{action 
"previewWorkflow"}}>
+                  <a class="pointer" data-toggle="modal" title="Preview 
workflow" {{action "previewWorkflow"}}>
                     <i class="fa fa-eye marginright5"></i>Preview xml
                   </a>
                 </li>
@@ -333,7 +333,7 @@
   {{hdfs-browser closeFileBrowser="closeExportActionNodeFileBrowser" 
selectFileCallback=selectFileCallback filePath=exportActionNodeFilePath}}
 {{/if}}
 {{#if showingPreview}}
-  {{#preview-dialog title="Workflow XML Preview" 
previewXml=previewXml}}{{/preview-dialog}}
+  {{#preview-dialog title="Workflow XML Preview" previewXml=previewXml 
closePreview="closePreview"}}{{/preview-dialog}}
 {{/if}}
 {{#if showingConfirmationNewWorkflow}}
   {{#confirmation-dialog title="Confirm workflow reset"

Reply via email to