ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gna...@apache.org
Subject ambari git commit: AMBARI-20001. Workflow manager- preview workflow has xml encodings.(Padma priya N via gauravn7)
Date Tue, 14 Feb 2017 12:40:03 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 f8d337659 -> 67c3630f0


AMBARI-20001. Workflow manager- preview workflow has xml encodings.(Padma priya N via gauravn7)


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

Branch: refs/heads/branch-2.5
Commit: 67c3630f0daf6069ad62fa74c1996ff7c6a9f2ce
Parents: f8d3376
Author: Gaurav Nagar <grvngr@gmail.com>
Authored: Tue Feb 14 18:09:02 2017 +0530
Committer: Gaurav Nagar <grvngr@gmail.com>
Committed: Tue Feb 14 18:09:48 2017 +0530

----------------------------------------------------------------------
 .../src/main/resources/ui/app/components/job-config.js         | 6 ++++--
 .../src/main/resources/ui/app/components/preview-dialog.js     | 4 ++++
 .../wfmanager/src/main/resources/ui/app/components/save-wf.js  | 2 +-
 .../resources/ui/app/templates/components/preview-dialog.hbs   | 2 +-
 .../wfmanager/src/main/resources/ui/app/utils/common-utils.js  | 3 +++
 5 files changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/67c3630f/contrib/views/wfmanager/src/main/resources/ui/app/components/job-config.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/job-config.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/job-config.js
index dde012d..f364e30 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/components/job-config.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/job-config.js
@@ -17,6 +17,7 @@
 
 import Ember from 'ember';
 import Constants from '../utils/constants';
+import CommonUtils from '../utils/common-utils';
 import { validator, buildValidations } from 'ember-cp-validations';
 
 const Validations = buildValidations({
@@ -36,7 +37,6 @@ const Validations = buildValidations({
 export default Ember.Component.extend(Validations, {
   systemConfigs : Ember.A([]),
   showingFileBrowser : false,
-  jobXml : "",
   overwritePath : false,
   configMap : Ember.A([]),
   configPropsExists : false,
@@ -74,13 +74,15 @@ export default Ember.Component.extend(Validations, {
   }),
   initialize :function(){
     this.configureExecutionSettings();
-    this.set("jobXml", this.get("jobConfigs").xml);
     this.set('filePath', Ember.copy(this.get('jobFilePath')));
     Object.keys(this.get('validations.attrs')).forEach((attr)=>{
       var field = 'validations.attrs.'+ attr +'.isDirty';
       this.set(field, false);
     }, this);
   }.on('init'),
+  jobXml : Ember.computed('jobConfigs.xml', function(){
+    return CommonUtils.decodeXml(this.get('jobConfigs.xml'));
+  }),
   rendered : function(){
     this.$("#configureJob").on('hidden.bs.modal', function () {
       this.sendAction('closeJobConfigs');

http://git-wip-us.apache.org/repos/asf/ambari/blob/67c3630f/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 cd6c171..4842d27 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
@@ -16,8 +16,12 @@
 *    limitations under the License.
 */
 import Ember from 'ember';
+import CommonUtils from '../utils/common-utils';
 
 export default Ember.Component.extend({
+  decodedXml : Ember.computed('previewXml', function(){
+    return CommonUtils.decodeXml(this.get('previewXml'));
+  }),
   elementsInserted :function(){
     this.$('#previewModal').modal({
       backdrop: 'static',

http://git-wip-us.apache.org/repos/asf/ambari/blob/67c3630f/contrib/views/wfmanager/src/main/resources/ui/app/components/save-wf.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/save-wf.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/save-wf.js
index a2210a6..75cdaf9 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/components/save-wf.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/save-wf.js
@@ -45,7 +45,7 @@ export default Ember.Component.extend(Validations, {
     }
   }),
   jobXml : Ember.computed('jobConfigs', function(){
-    return this.get('jobConfigs.xml');
+    return CommonUtils.decodeXml(this.get('jobConfigs.xml'));
   }),
   jobJson : Ember.computed('jobConfigs', function(){
     return this.get('jobConfigs.json');

http://git-wip-us.apache.org/repos/asf/ambari/blob/67c3630f/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/preview-dialog.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/preview-dialog.hbs
b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/preview-dialog.hbs
index bbf7ce1..ad55fe1 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/preview-dialog.hbs
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/preview-dialog.hbs
@@ -24,7 +24,7 @@
       </div>
       <div class="modal-body">
       <div id="xmlCode">
-       {{ivy-codemirror value=previewXml options=(hash lineNumbers=false mode="xml" indentWithTabs=true
readOnly=true)}}
+       {{ivy-codemirror value=decodedXml options=(hash lineNumbers=false mode="xml" indentWithTabs=true
readOnly=true)}}
       </div>
         <!--pre class="preview-xml">{{previewXml}}</pre-->
       </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/67c3630f/contrib/views/wfmanager/src/main/resources/ui/app/utils/common-utils.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/utils/common-utils.js b/contrib/views/wfmanager/src/main/resources/ui/app/utils/common-utils.js
index e793aac..309c281 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/utils/common-utils.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/utils/common-utils.js
@@ -29,5 +29,8 @@ export default Ember.Object.create({
   },
   isSupportedAction(actionType){
     return Constants.actions.findBy('name', actionType)? true : false;
+  },
+  decodeXml(xml){
+    return xml && xml.length > 0 ? xml.replace(/&amp;/g, '&').replace(/&lt;/g,
'<').replace(/&gt;/g, '>').replace(/&quot;/g, '\"').replace(/&apos;/g, '\'')
: xml;
   }
 });


Mime
View raw message