You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by gn...@apache.org on 2017/02/21 10:40:30 UTC
ambari git commit: AMBARI-20080. WFM does not issue confirmation
message when workflow is suspended or killed.(Padma Priya N via gauravn7)
Repository: ambari
Updated Branches:
refs/heads/branch-2.5 fa13f66c8 -> 3ba9b3553
AMBARI-20080. WFM does not issue confirmation message when workflow is suspended or killed.(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/3ba9b355
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3ba9b355
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3ba9b355
Branch: refs/heads/branch-2.5
Commit: 3ba9b3553cfafcdaad4350d92aca867468d2e7cf
Parents: fa13f66
Author: Gaurav Nagar <gr...@gmail.com>
Authored: Tue Feb 21 16:10:19 2017 +0530
Committer: Gaurav Nagar <gr...@gmail.com>
Committed: Tue Feb 21 16:10:19 2017 +0530
----------------------------------------------------------------------
.../main/resources/ui/app/components/job-row.js | 6 ++++++
.../resources/ui/app/components/search-table.js | 17 ++++++++++++++++-
.../ui/app/templates/components/search-table.hbs | 11 ++++++++---
3 files changed, 30 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/3ba9b355/contrib/views/wfmanager/src/main/resources/ui/app/components/job-row.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/job-row.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/job-row.js
index 1dd580e..2b40392 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/components/job-row.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/job-row.js
@@ -72,9 +72,15 @@ export default Ember.Component.extend({
}else if(action === 'kill'){
this.set('job.status','KILLED');
}
+ this.sendAction('showMessage', {type:'success', message:`${action.toUpperCase()} action complete. Job is ${this.get('job.status')}`});
}.bind(this)).catch(function(e){
this.set('showError', true);
this.set('showLoader', false);
+ var message = `${action.toUpperCase()} action for could not be completed`;
+ if(this.get('userName') !== this.get('job.user')){
+ message = `${message}. ${this.get('userName')} is not the job owner.`
+ }
+ this.sendAction('showMessage', {type:'error', message:message});
console.error(e);
}.bind(this));
if(action === 'rerun' && this.get('job').bundleJobId){
http://git-wip-us.apache.org/repos/asf/ambari/blob/3ba9b355/contrib/views/wfmanager/src/main/resources/ui/app/components/search-table.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/search-table.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/search-table.js
index b2f2a57..c8df452 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/components/search-table.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/search-table.js
@@ -28,15 +28,21 @@ export default Ember.Component.extend({
var roundedStart = this.get('jobs.start') - this.get('jobs.start') % 10;
return (roundedStart / this.get('jobs.pageSize'))+1;
}),
+ userName : Ember.computed.alias('userInfo.userName'),
rendered : function(){
this.sendAction('onSearch', this.get('history').getSearchParams());
}.on('didInsertElement'),
isUpdated : function(){
if(this.get('showActionError')){
- this.$('#alert').fadeOut(2500, ()=>{
+ this.$('#error-alert').fadeOut(5000, ()=>{
this.set("showActionError", false);
});
}
+ if(this.get('showActionSuccess')){
+ this.$('#success-alert').fadeOut(5000, ()=>{
+ this.set("showActionSuccess", false);
+ });
+ }
}.on('didUpdate'),
actions: {
selectAll() {
@@ -131,6 +137,15 @@ export default Ember.Component.extend({
}else{
this.set('showBulkAction', false);
}
+ },
+ showMessage(messageInfo){
+ if(messageInfo.type === 'error'){
+ this.set('showActionError', true);
+ this.set('errorMessage', messageInfo.message);
+ }else{
+ this.set('showActionSuccess', true);
+ this.set('successMessage', messageInfo.message);
+ }
}
}
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/3ba9b355/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/search-table.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/search-table.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/search-table.hbs
index 5c15493..d28a497 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/search-table.hbs
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/search-table.hbs
@@ -16,8 +16,13 @@
* limitations under the License.
}}
{{#if showActionError}}
-<div id="alert"class="alert alert-danger alert-dismissible fade in workflow-error" role="alert">
- <span>Action could not be completed.</span>
+<div id="error-alert"class="alert alert-danger alert-dismissible fade in workflow-error" role="alert">
+ <span>{{errorMessage}}</span>
+</div>
+{{/if}}
+{{#if showActionSuccess}}
+<div id="success-alert"class="alert alert-success alert-dismissible fade in workflow-error" role="alert">
+ <span>{{successMessage}}. Refresh to see the latest status.</span>
</div>
{{/if}}
<table id="search-table" class="table search-table listing table-striped table-hover table-bordered" cellspacing="0" width="100%">
@@ -54,7 +59,7 @@
<tbody>
{{#if jobs.jobs}}
{{#each jobs.jobs as |job idx|}}
- {{#job-row job=job onAction="onAction" showJobDetails="showJobDetails" rowSelected="rowSelected" userName=userName showError=showActionError}}{{/job-row}}
+ {{#job-row job=job onAction="onAction" showJobDetails="showJobDetails" rowSelected="rowSelected" userName=userName showMessage="showMessage"}}{{/job-row}}
{{/each}}
{{/if}}
</tbody>