YARN-8276. [UI2] After version field became mandatory, form-based submission of 
new YARN service doesn't work. Contributed by Gergely Novák.

(cherry picked from commit 9c4cbed8d19ec0f486af454de6b117d77a0a0b84)


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

Branch: refs/remotes/origin/branch-3.1
Commit: ea2fa52d92b0779f216afa3311432ed59b4cd923
Parents: fce5463
Author: Sunil G <sun...@apache.org>
Authored: Mon Jun 4 00:06:56 2018 +0530
Committer: Sunil G <sun...@apache.org>
Committed: Mon Jun 4 00:09:44 2018 +0530

----------------------------------------------------------------------
 .../src/main/webapp/app/components/deploy-service.js     |  3 ++-
 .../src/main/webapp/app/models/yarn-servicedef.js        |  8 +++++++-
 .../webapp/app/templates/components/deploy-service.hbs   | 11 +++++++++++
 .../src/main/webapp/app/utils/info-seeder.js             |  1 +
 4 files changed, 21 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/ea2fa52d/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/deploy-service.js
----------------------------------------------------------------------
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/deploy-service.js
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/deploy-service.js
index 18e4d36..ff93985 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/deploy-service.js
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/deploy-service.js
@@ -152,7 +152,8 @@ export default Ember.Component.extend({
 
   isUserNameGiven: Ember.computed.empty('userName'),
 
-  isValidServiceDef: Ember.computed('serviceDef.name', 'serviceDef.queue', 
'serviceDef.serviceComponents.[]', function () {
+  isValidServiceDef: Ember.computed('serviceDef.name', 'serviceDef.queue',
+      'serviceDef.version', 'serviceDef.serviceComponents.[]', function () {
     return this.get('serviceDef').isValidServiceDef();
   }),
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/ea2fa52d/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-servicedef.js
----------------------------------------------------------------------
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-servicedef.js
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-servicedef.js
index 2a9953d..c0153a5 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-servicedef.js
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-servicedef.js
@@ -22,6 +22,7 @@ import Ember from 'ember';
 export default DS.Model.extend({
   name: DS.attr('string', {defaultValue: ''}),
   queue: DS.attr('string', {defaultValue: ''}),
+  version: DS.attr('string', {defaultValue: ''}),
   lifetime: DS.attr('string', {defaultValue: ''}),
   isCached: DS.attr('boolean', {defaultValue: false}),
 
@@ -44,6 +45,7 @@ export default DS.Model.extend({
   clear() {
     this.set('name', '');
     this.set('queue', '');
+    this.set('version', '');
     this.set('lifetime', '');
     this.get('serviceComponents').clear();
     this.get('serviceConfigs').clear();
@@ -52,7 +54,8 @@ export default DS.Model.extend({
   },
 
   isValidServiceDef() {
-    return this.get('name') !== '' && this.get('queue') !== '' &&  
this.get('serviceComponents.length') > 0;
+    return this.get('name') !== '' && this.get('queue') !== '' &&
+      this.get('version') !== '' && this.get('serviceComponents.length') > 0;
   },
 
   createNewServiceComponent() {
@@ -115,6 +118,7 @@ export default DS.Model.extend({
     var json = {
       name: "",
       queue: "",
+      version: "",
       lifetime: "-1",
       components: [],
       configuration: {
@@ -131,6 +135,7 @@ export default DS.Model.extend({
 
     json['name'] = this.get('name');
     json['queue'] = this.get('queue');
+    json['version'] = this.get('version');
 
     if (this.get('lifetime')) {
       json['lifetime'] = this.get('lifetime');
@@ -266,6 +271,7 @@ export default DS.Model.extend({
     var clone = this.createNewServiceDef();
     clone.set('name', this.get('name'));
     clone.set('queue', this.get('queue'));
+    clone.set('version', this.get('version'));
     clone.set('lifetime', this.get('lifetime'));
     clone.get('serviceComponents', this.get('serviceComponents'));
     clone.get('serviceConfigs', this.get('serviceConfigs'));

http://git-wip-us.apache.org/repos/asf/hadoop/blob/ea2fa52d/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/deploy-service.hbs
----------------------------------------------------------------------
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/deploy-service.hbs
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/deploy-service.hbs
index 2d18610..d348200 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/deploy-service.hbs
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/deploy-service.hbs
@@ -101,6 +101,17 @@
 
               <div class="row">
                 <div class="col-md-4">
+                  <div class="form-group shrink-height">
+                    <label class="required">Service Version</label>
+                    <span class="glyphicon glyphicon-info-sign info-icon" 
data-info="version"></span>
+                    {{input type="text" class="form-control" 
placeholder="1.0.0" value=serviceDef.version}}
+                  </div>
+                  <br>
+                </div>
+              </div>
+
+              <div class="row">
+                <div class="col-md-4">
                   <div class="form-group">
                     <label>Service Lifetime</label>
                     <span class="glyphicon glyphicon-info-sign info-icon" 
data-info="lifetime"></span>

http://git-wip-us.apache.org/repos/asf/hadoop/blob/ea2fa52d/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/utils/info-seeder.js
----------------------------------------------------------------------
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/utils/info-seeder.js
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/utils/info-seeder.js
index 3d01391..cfff9d0 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/utils/info-seeder.js
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/utils/info-seeder.js
@@ -19,6 +19,7 @@
 export default {
   serviceName: "A unique application name",
   queueName: "The YARN queue that this application should be submitted to",
+  version: "Version of the service",
   lifetime: "Life time (in seconds) of the application from the time it 
reaches the STARTED state (after which it is automatically destroyed by YARN). 
For unlimited lifetime do not set a lifetime value.",
   components: "One or more components of the application. If the application 
is HBase say, then the component can be a simple role like master or 
regionserver. If the application is a complex business webapp then a component 
can be other applications say Kafka or Storm. Thereby it opens up the support 
for complex and nested applications.",
   configurations: "Set of configuration properties that can be injected into 
the application components via envs, files and custom pluggable helper docker 
containers. Files of several standard formats like xml, properties, json, yaml 
and templates will be supported.",


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to