Browse Source

AMBARI-5315. Jobs UI - Jobs without link to job details page (alexantonenko)

Alex Antonenko 11 years ago
parent
commit
8faae789ec

+ 3 - 0
ambari-web/app/controllers/main/jobs_controller.js

@@ -47,6 +47,7 @@ App.MainJobsController = Em.Controller.extend({
   }.observes('content.length', 'content.@each.id', 'content.@each.startTime', 'content.@each.endTime', 'sortProperties', 'sortAscending'),
   
   contentAndSortUpdater: function() {
+    this.set('sortingDone', false);
     var content = this.get('content');
     var sortedContent = content.toArray();
     var sortProperty = this.get('sortProperty');
@@ -83,6 +84,7 @@ App.MainJobsController = Em.Controller.extend({
       }
     }
     sortedContent.length = 0;
+    this.set('sortingDone', true);
   },
 
   navIDs: {
@@ -101,6 +103,7 @@ App.MainJobsController = Em.Controller.extend({
   sortingColumn: null,
   sortProperty: 'id',
   sortAscending: true,
+  sortingDone: true,
 
   sortingColumnObserver: function () {
     if(this.get('sortingColumn')){

+ 7 - 0
ambari-web/app/styles/apps.less

@@ -392,6 +392,13 @@
 
   #jobs-table {
 
+    .is-not-link{
+      pointer-events: none;
+      cursor: default;
+      color: #000000;
+      text-decoration: none;
+    }
+
     .apply-btn {
       font-size: 12px;
       padding: 0px 8px;

+ 11 - 12
ambari-web/app/views/main/jobs_view.js

@@ -160,8 +160,6 @@ App.MainJobsView = App.TableView.extend({
         this.set('disabled', false);
       }
     }.observes('parentView.hasBackLinks'),
-    attributeBindings: ['disabled'],
-    disabled: false,
     change: function () {
       this.get('controller').set('navIDs.nextID', '');
       this.get('parentView').saveDisplayLength();
@@ -243,19 +241,20 @@ App.MainJobsView = App.TableView.extend({
 
   jobNameView: Em.View.extend({
     classNames: ['job-link'],
+    tagName: 'a',
+    classNameBindings: ['isLink'],
+    attributeBindings: ['rel', 'job.queryText:data-original-title', 'href'],
     rel: 'tooltip',
     href: '#',
-    template: Ember.Handlebars.compile('{{job.name}}'),
-    attributeBindings: function () {
-      var attributes = ['rel', 'job.queryText:data-original-title'];
+    isLink: 'is-not-link',
+    isLinkObserver: function () {
       if (this.get('job.hasTezDag')) {
-        attributes.push('href');
-      };
-      return attributes;
-    }.property('job.hasTezDag'),
-    tagName: function () {
-      return this.get('job.hasTezDag') ? 'a' : 'span';
-    }.property('job.hasTezDag'),
+        this.set('isLink', "");
+      }else{
+        this.set('isLink', "is-not-link");
+      }
+    }.observes('controller.sortingDone'),
+    template: Ember.Handlebars.compile('{{job.name}}'),
     click: function(event) {
       if (this.get('job.hasTezDag')) {
         App.router.transitionTo('main.jobs.jobDetails', this.get('job'));