This is an automated email from the ASF dual-hosted git repository.
oleewere pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/branch-2.7 by this push:
new 8c8fb06 AMBARI-24491. Workflow Manager should add / string to the
beginning of app path (#2524)
8c8fb06 is described below
commit 8c8fb065f3a4996405e06227f1db64cc3afabdeb
Author: Olivér Szabó <[email protected]>
AuthorDate: Fri Oct 26 22:02:43 2018 +0200
AMBARI-24491. Workflow Manager should add / string to the beginning of app
path (#2524)
---
.../main/resources/ui/app/components/spark-action.js | 18 ++++++++++++++++++
.../src/main/resources/ui/app/styles/app.less | 3 +++
.../ui/app/templates/components/spark-action.hbs | 7 +++++++
3 files changed, 28 insertions(+)
diff --git
a/contrib/views/wfmanager/src/main/resources/ui/app/components/spark-action.js
b/contrib/views/wfmanager/src/main/resources/ui/app/components/spark-action.js
index 1a778c4..513b77c 100644
---
a/contrib/views/wfmanager/src/main/resources/ui/app/components/spark-action.js
+++
b/contrib/views/wfmanager/src/main/resources/ui/app/components/spark-action.js
@@ -54,6 +54,7 @@ export default Ember.Component.extend(Validations,{
this.set('isJar', this.get('actionModel.jar') &&
this.get('actionModel.jar').endsWith('.jar'));
this.sendAction('register','sparkAction', this);
}.on('init'),
+ appendNameNode: false,
initialize : function(){
this.on('fileSelected',function(fileName){
this.set(this.get('filePathModel'), fileName);
@@ -105,6 +106,20 @@ export default Ember.Component.extend(Validations,{
this.$('#collapseOne').collapse('show');
}
}.on('didUpdate'),
+ validateJarPathAndAppend() {
+ let nameNode = this.get('actionModel.nameNode'), jar =
this.get('actionModel.jar');
+ if(!jar) {
+ return;
+ }
+ this.toggleProperty('appendNameNode');
+ if(!jar.startsWith('${nameNode}') && this.get('appendNameNode')) {
+ this.set('actionModel.jar', `${nameNode}${jar}`);
+ } else if(jar.startsWith('${nameNode}') && this.get('appendNameNode')) {
+ this.set('actionModel.jar', `${jar}`);
+ } else {
+ this.set('actionModel.jar', jar.replace('${nameNode}', ''));
+ }
+ },
actions : {
openFileBrowser(model, context){
if(undefined === context){
@@ -116,6 +131,9 @@ export default Ember.Component.extend(Validations,{
register (name, context){
this.sendAction('register',name , context);
},
+ appendNamenode() {
+ this.validateJarPathAndAppend();
+ },
onMasterChange (elt){
var value = this.$(elt).val();
if(value !== 'other'){
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/styles/app.less
b/contrib/views/wfmanager/src/main/resources/ui/app/styles/app.less
index 9a35aca..95480d9 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/styles/app.less
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/styles/app.less
@@ -1824,4 +1824,7 @@ input:invalid {
.note-info {
position: relative;
top: 10px;
+}
+.spark-namenode {
+ top: 15px;
}
\ No newline at end of file
diff --git
a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/spark-action.hbs
b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/spark-action.hbs
index c8f14d3..bebe3d3 100644
---
a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/spark-action.hbs
+++
b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/spark-action.hbs
@@ -49,6 +49,13 @@
</div>
{{/if}}
<div class="form-group">
+ <label for="inputEmail" class="control-label col-xs-2">Append
master<span class="requiredField"> *</span></label>
+ <div class="col-xs-2 spark-namenode">
+ <input type="checkbox" name="master" checked={{appendNameNode}}
value="other" onchange={{action "appendNamenode" value="target"}}>
+ </div>
+ </div>
+
+ <div class="form-group">
<label for="inputEmail" class="control-label col-xs-2">Runs On<span
class="requiredField"> *</span></label>
{{#each mastersList as |master|}}
<div class="col-xs-2">