Merge lp:~cprov/uci-engine/webui-create-ticket-link into lp:uci-engine

Proposed by Celso Providelo
Status: Merged
Approved by: Celso Providelo
Approved revision: 886
Merged at revision: 889
Proposed branch: lp:~cprov/uci-engine/webui-create-ticket-link
Merge into: lp:uci-engine
Diff against target: 133 lines (+28/-20)
2 files modified
webui/common/static/common/webui.css (+9/-0)
webui/tickets/static/tickets/webui.js (+19/-20)
To merge this branch: bzr merge lp:~cprov/uci-engine/webui-create-ticket-link
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Canonical CI Engineering Pending
Review via email: mp+240909@code.launchpad.net

Commit message

Adding a '+ Add Ticket' link at the bottom of the tickets list.

Description of the change

Adding a '+ Add Ticket' link at the bottom of the tickets list.

Also doing a small cleanup for using Y.log and removing an unused global reference to the main table.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:886
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1687/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1687/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'webui/common/static/common/webui.css'
2--- webui/common/static/common/webui.css 2014-11-06 02:50:14 +0000
3+++ webui/common/static/common/webui.css 2014-11-06 16:51:53 +0000
4@@ -224,6 +224,15 @@
5 font-weight: bold;
6 }
7
8+a#add-ticket {
9+ display: inline-block;
10+ background-color: #c03f11;
11+ color: white;
12+ border-radius: 4px;
13+ margin-right: 1em;
14+ padding: 8px 14px;
15+}
16+
17 /* Login menu. */
18 div.yui3-login {
19 float: right;
20
21=== modified file 'webui/tickets/static/tickets/webui.js'
22--- webui/tickets/static/tickets/webui.js 2014-11-06 02:31:24 +0000
23+++ webui/tickets/static/tickets/webui.js 2014-11-06 16:51:53 +0000
24@@ -152,7 +152,7 @@
25 try {
26 wf_data = Y.JSON.parse(r.responseText).objects;
27 } catch (e) {
28- Y.webui.main_table.showMessage(json_error_msg);
29+ Y.log(json_error_msg);
30 return;
31 }
32 }
33@@ -192,9 +192,6 @@
34 },
35 get_ticket: function (ticket_id, elem) {
36
37- if (Y.webui.main_table) {
38- Y.webui.main_table.showMessage("loading data...");
39- }
40 // Load ticket information from TS.
41 Y.io(Y.webui.url_prefix + "fullticket/" + ticket_id + "/", {
42 sync: true,
43@@ -205,7 +202,7 @@
44 try {
45 data = Y.JSON.parse(r.responseText);
46 } catch (e) {
47- Y.webui.main_table.showMessage(json_error_msg);
48+ Y.log(json_error_msg);
49 return;
50 }
51
52@@ -217,8 +214,8 @@
53
54 },
55 failure: function (tx, r, e) {
56- console.log("failure loading fullticket (" +
57- ticket_id + "): ", tx, r, e);
58+ Y.log("failure loading fullticket (" +
59+ ticket_id + "): ", tx, r, e);
60 }
61 }
62 });
63@@ -258,7 +255,7 @@
64 // Link the artifact to the tempurl or fallback to the original
65 // TS reference.
66 if (tempurl === undefined) {
67- console.log('No tempurl for:', data.name);
68+ Y.log('No tempurl for: ' + data.name);
69 link.set('href', data.reference);
70 } else {
71 link.set('href', tempurl);
72@@ -826,8 +823,8 @@
73 Y.webui.tempurls = Y.JSON.parse(r.responseText);
74 },
75 failure: function (tx, r, e) {
76- console.log("Failure loading tempurls (" +
77- ticket_id_or_uuid + "): ", tx, r, e);
78+ Y.log("Failure loading tempurls (" +
79+ ticket_id_or_uuid + "): ", tx, r, e);
80 }
81 }
82 });
83@@ -877,9 +874,8 @@
84 }
85 },
86 failure: function (tx, r, e) {
87- console.log(
88- "Failure finding ticket alternative key (" +
89- ticket_id_or_uuid + "): ", tx, r, e);
90+ Y.log("Failure finding ticket alternative key (" +
91+ ticket_id_or_uuid + "): ", tx, r, e);
92 }
93 }
94 });
95@@ -938,9 +934,17 @@
96
97 // Paginator container.
98 var paginator = Y.Node.create('<div>')
99- .set('id', 'paginator')
100+ .set('id', 'paginator');
101 Y.one('#main-content').appendChild(paginator);
102
103+ // Add new ticket content.
104+ var new_ticket_link = Y.Node.create(
105+ '<a id="add-ticket" href="create" ' +
106+ 'class="button right space-top"' +
107+ '>+ Add Ticket</a>'
108+ );
109+ Y.one('#main-content').appendChild(new_ticket_link);
110+
111 // Row formatters ...
112 var link_it = function (o) {
113 return '<a class="row_link" href="/ticket/' +
114@@ -981,7 +985,7 @@
115
116 ds.on('response', function(e) {
117 if (e.data.status !== 200) {
118- console.log('Datasource loading failure!', e);
119+ Y.log('Datasource loading failure!' + e);
120 }
121 });
122
123@@ -1009,11 +1013,6 @@
124
125 // Finally render the ticket list.
126 dt.render(container);
127-
128- // Globalize datatable, for UI notifications when loading
129- // workflow steps and statuses. Although, they are most likely
130- // to be overridden by datasource updates.
131- Y.webui.main_table = dt;
132 }
133 };
134

Subscribers

People subscribed via source and target branches