Make change number a hyperlink Tasks created from names-factory type change are shown as hyperlink to the respective change. Change-Id: I12d7cf6755900528fcca7b2f20dbd2dfba197e0a
diff --git a/gr-task-plugin/gr-task-plugin-tasks.js b/gr-task-plugin/gr-task-plugin-tasks.js index 54585d1..0f89fb6 100644 --- a/gr-task-plugin/gr-task-plugin-tasks.js +++ b/gr-task-plugin/gr-task-plugin-tasks.js
@@ -44,6 +44,10 @@ _can_show(show, task) { return show === 'true' || task.showOnFilter; } + + _getChangeUrl(change) { + return Gerrit.url(change.toString()); + } } customElements.define(GrTaskPluginTasks.is, GrTaskPluginTasks);
diff --git a/gr-task-plugin/gr-task-plugin-tasks_html.js b/gr-task-plugin/gr-task-plugin-tasks_html.js index df1644f..9122a9d 100644 --- a/gr-task-plugin/gr-task-plugin-tasks_html.js +++ b/gr-task-plugin/gr-task-plugin-tasks_html.js
@@ -47,7 +47,15 @@ </iron-icon> </gr-tooltip-content> </template> - [[task.message]] + <template is="dom-if" if="[[task.change]]"> + <a class="links" href$="[[_getChangeUrl(task.change)]]">[[task.change]]</a> + </template> + <template is="dom-if" if="[[!task.change]]"> + <template is="dom-if" if="[[!task.hint]]"> + [[task.name]] + </template> + </template> + <template is="dom-if" if="[[task.hint]]">[[task.hint]]</template> </li> </template> <ul style="list-style-type:none; margin: 0 0 0 0; padding: 0 0 0 2em;">
diff --git a/gr-task-plugin/gr-task-plugin.js b/gr-task-plugin/gr-task-plugin.js index 7e1add6..e5a3078 100644 --- a/gr-task-plugin/gr-task-plugin.js +++ b/gr-task-plugin/gr-task-plugin.js
@@ -22,10 +22,10 @@ const Defs = {}; /** * @typedef {{ - * message: string, * sub_tasks: Array<Defs.Task>, * hint: ?string, * name: string, + * change: ?number, * status: string * }} */ @@ -186,7 +186,6 @@ _addTasks(tasks) { // rename to process, remove DOM bits if (!tasks) return []; tasks.forEach(task => { - task.message = task.hint || task.name; task.icon = this._computeIcon(task); task.showOnFilter = this._computeShowOnNeedsAndBlockedFilter(task); this._compute_counts(task);