~joetalbott/ubuntu-ci-services-itself/webui_equal_height

« back to all changes in this revision

Viewing changes to webui/webui_complete.js

  • Committer: Joe Talbott
  • Date: 2014-03-17 16:18:43 UTC
  • Revision ID: joe.talbott@canonical.com-20140317161843-3mo3nujisic2uqpw
webui - Table updates.

* Add separate tables for 'Completed' and 'Failed' tickets.
* Add ordering by Workflow Step (asc.) and update date (desc.)
* Add ticket ID and update date to tables (requested by asac)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
YUI().use('io', 'jsonp', 'webui', 'datatable-mutable', function(Y) {
2
2
 
3
 
  var table = new Y.webui.make_main_table('#table');
4
 
  if (Y.webui.main_table) {
5
 
    Y.webui.main_table.showMessage("loading data...");
 
3
  var table = new Y.webui.make_completed_table('#table');
 
4
  if (Y.webui.completed_table) {
 
5
    Y.webui.completed_table.showMessage("loading data...");
6
6
  }
7
7
 
8
8
  Y.io(Y.webui.url_prefix + "ticketstatus/?current_workflow_step=1000", {
15
15
        try {
16
16
          data = Y.JSON.parse(r.responseText);
17
17
        } catch (e) {
18
 
          Y.webui.main_table.showMessage(json_error_msg);
 
18
          Y.webui.completed_table.showMessage(json_error_msg);
19
19
          return;
20
20
        }
21
21
 
27
27
          }
28
28
          Y.webui.check_statuses();
29
29
        }
30
 
        if (Y.webui.main_table.data.size() === 0) {
31
 
          Y.webui.main_table.showMessage("No results found");
 
30
        if (Y.webui.completed_table.data.size() === 0) {
 
31
          Y.webui.completed_table.showMessage("No results found");
32
32
        }
33
33
        Y.webui.done_loading = true;
34
34
      },