fixup!: Merge branch 'stable-3.2' into stable-3.3 Cleanup the UI code which was not done in the previous merge commit. Delete the html files and port all changes to *_html.js files. Change-Id: I1cbb7054b262167f1a908a6ed90f5cbf46e7714c
diff --git a/gr-task-plugin/gr-task-plugin-tasks_html.js b/gr-task-plugin/gr-task-plugin-tasks_html.js index 0d1a383..df1644f 100644 --- a/gr-task-plugin/gr-task-plugin-tasks_html.js +++ b/gr-task-plugin/gr-task-plugin-tasks_html.js
@@ -50,7 +50,9 @@ [[task.message]] </li> </template> - <gr-task-plugin-tasks - tasks="[[task.sub_tasks]]" - show_all$="[[show_all]]"> </gr-task-plugin-tasks> + <ul style="list-style-type:none; margin: 0 0 0 0; padding: 0 0 0 2em;"> + <gr-task-plugin-tasks + tasks="[[task.sub_tasks]]" + show_all$="[[show_all]]"> </gr-task-plugin-tasks> + </ul> </template>`;
diff --git a/gr-task-plugin/gr-task-plugin.html b/gr-task-plugin/gr-task-plugin.html deleted file mode 100644 index c6c3746..0000000 --- a/gr-task-plugin/gr-task-plugin.html +++ /dev/null
@@ -1,146 +0,0 @@ -<!-- -Copyright (C) 2019 The Android Open Source Project - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> - -<dom-module id="gr-task-plugin"> - <template> - <style> - ul { - padding-left: 0.5em; - margin-top: 0; - } - h3 { padding-left: 0.1em; } - .cursor { cursor: pointer; } - #tasks_header { - align-items: center; - background-color: #fafafa; - border-top: 1px solid #ddd; - display: flex; - padding: 6px 1rem; - } - .links { - color: blue; - cursor: pointer; - text-decoration: underline; - } - .no-margins { margin: 0 0 0 0; } - </style> - - <div id="tasks" hidden$="[[!_tasks.length]]"> - <div id="tasks_header" style="display: flex;"> - <iron-icon - icon="gr-icons:expand-less" - hidden$="[[!_expand_all]]" - on-tap="_switch_expand" - class="cursor"> </iron-icon> - <iron-icon - icon="gr-icons:expand-more" - hidden$="[[_expand_all]]" - on-tap="_switch_expand" - class="cursor"> </iron-icon> - <div style="display: flex; align-items: center; column-gap: 1em;"> - <h3 class="no-margins" on-tap="_switch_expand" class="cursor"> Tasks </h3> - <template is="dom-if" if="[[_is_show_all(_show_all)]]"> - <p class="no-margins">All ([[_all_count]]) | - <span - on-click="_needs_and_blocked_tap" - class="links">Needs ([[_ready_count]]) + Blocked ([[_fail_count]])</span> - <p> - </template> - <template is="dom-if" if="[[!_is_show_all(_show_all)]]"> - <p class="no-margins"> <span - class="links" - on-click="_show_all_tap">All ([[_all_count]])</span> - | Needs ([[_ready_count]]) + Blocked ([[_fail_count]])</p> - </template> - </div> - </div> - <div hidden$="[[!_expand_all]]"> - <ul style="list-style-type:none;"> - <gr-task-plugin-tasks - tasks="[[_tasks]]" - show_all$="[[_show_all]]"> </gr-task-plugin-tasks> - </ul> - </div> - </div> - </template> - <script src="gr-task-plugin.js"></script> -</dom-module> - -<dom-module id="gr-task-plugin-tasks"> - <template> - <template is="dom-repeat" as="task" items="[[tasks]]"> - <template is="dom-if" if="[[_can_show(show_all, task)]]"> - <li style="padding: 0.2em;"> - <style> - /* Matching colors with core code. */ - .green { - color: #9fcc6b; - } - .red { - color: #FFA62F; - } - </style> - <template is="dom-if" if="[[task.icon.id]]"> - <gr-tooltip-content - has-tooltip - title="In Progress"> - <iron-icon - icon="gr-icons:hourglass" - class="green" - hidden$="[[!task.in_progress]]"> - </iron-icon> - </gr-tooltip-content> - <gr-tooltip-content - has-tooltip - title$="[[task.icon.tooltip]]"> - <iron-icon - icon="[[task.icon.id]]" - class$="[[task.icon.color]]"> - </iron-icon> - </gr-tooltip-content> - </template> - [[task.message]] - </li> - </template> - <ul style="list-style-type:none; margin: 0 0 0 0; padding: 0 0 0 2em;"> - <gr-task-plugin-tasks - tasks="[[task.sub_tasks]]" - show_all$="[[show_all]]"> </gr-task-plugin-tasks> - </ul> - </template> - </template> - <script> - Polymer({ - is: 'gr-task-plugin-tasks', - properties: { - tasks: { - type: Array, - notify: true, - value() { return []; }, - }, - - show_all: { - type: String, - notify: true, - }, - }, - - _can_show(show, task) { - return show === 'true' || task.showOnFilter; - }, - }); - </script> -</dom-module>
diff --git a/gr-task-plugin/gr-task-plugin_html.js b/gr-task-plugin/gr-task-plugin_html.js index 8fa4b32..71c995c 100644 --- a/gr-task-plugin/gr-task-plugin_html.js +++ b/gr-task-plugin/gr-task-plugin_html.js
@@ -38,6 +38,7 @@ display: flex; padding: 6px 1rem; } + .no-margins { margin: 0 0 0 0; } </style> <div id="tasks" hidden$="[[!_tasks.length]]"> @@ -53,16 +54,16 @@ on-tap="_switch_expand" class="cursor"> </iron-icon> <div style="display: flex; align-items: center; column-gap: 1em;"> - <h3 on-tap="_switch_expand" class="cursor"> Tasks </h3> + <h3 class="no-margins" on-tap="_switch_expand" class="cursor"> Tasks </h3> <template is="dom-if" if="[[_is_show_all(_show_all)]]"> - <p>All ([[_all_count]]) | + <p class="no-margins" >All ([[_all_count]]) | <span on-click="_needs_and_blocked_tap" class="links">Needs + Blocked ([[_ready_count]], [[_fail_count]])</span> <p> </template> <template is="dom-if" if="[[!_is_show_all(_show_all)]]"> - <p> <span + <p class="no-margins" > <span class="links" on-click="_show_all_tap">All ([[_all_count]])</span> | Needs + Blocked ([[_ready_count]], [[_fail_count]])</p>