Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2835)

Unified Diff: Tools/GardeningServer/ui/ct-failure-card.html

Issue 565523002: [Sheriff-o-matic] Refactor cards and get rid of ct-failure-cards (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix includes. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Tools/GardeningServer/ui/ct-failure-card.html
diff --git a/Tools/GardeningServer/ui/ct-failure-card.html b/Tools/GardeningServer/ui/ct-failure-card.html
deleted file mode 100644
index 2ca4363f18740bc3f09932d5dc38914c2b374cfd..0000000000000000000000000000000000000000
--- a/Tools/GardeningServer/ui/ct-failure-card.html
+++ /dev/null
@@ -1,158 +0,0 @@
-<!--
-Copyright 2014 The Chromium Authors. All rights reserved.
-Use of this source code is governed by a BSD-style license that can be
-found in the LICENSE file.
--->
-
-<link rel="import" href="../model/ct-builder-list.html">
-<link rel="import" href="ct-bot-failure-card.html">
-<link rel="import" href="ct-builder-failure-card.html">
-<link rel="import" href="ct-trooper-card.html">
-<link rel="import" href="../bower_components/paper-dialog/paper-dialog.html">
-<link rel="import" href="../bower_components/paper-dialog/paper-dialog-transition.html">
-<link rel="import" href="../bower_components/paper-input/paper-input.html">
-
-<polymer-element name="ct-failure-card" attributes="group commitLog tree bug">
- <template>
- <style>
- :host {
- display: block;
- }
-
- #container {
- display: flex;
- }
-
- /* FIXME: All this paper-button styling should go in a cr-button component so that
- we can use buttons in different places and have them all look the same. */
- paper-button {
- -webkit-user-select: none;
- background: #f5f5f5;
- border-radius: 2px;
- border: 1px solid #dcdcdc;
- color: #444;
- padding: 0 16px;
- margin-bottom: 5px;
- text-align: center;
- }
-
- paper-button:focus {
- border: 1px solid #4d90fe;
- outline: none;
- }
-
- paper-button:active {
- box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
- }
-
- paper-button:active, paper-button:hover {
- background: #f8f8f8;
- border-color: #c6c6c6;
- box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.1);
- color: #222;
- }
-
- #buttons {
- display: flex;
- flex-direction: column;
- }
-
- .card {
- display: flex;
- flex: 1;
- }
-
- .snoozed {
- opacity: 0.5;
- }
- </style>
- <div id="container">
- <div class="card {{ { snoozed: group.isSnoozed } | tokenList }}">
- <!-- FIXME: Refactor the buttons into their own widget so we don't need cards within cards -->
- <template if="{{ group.data.category == 'sheriff' }}">
- <ct-bot-failure-card class='card' group="{{ group.data }}" builderList="{{ _builderList }}"></ct-bot-failure-card>
- </template>
- <template if="{{ group.data.category == 'builder' }}">
- <ct-builder-failure-card class='card' group="{{ group.data }}" builderList="{{ _builderList }}"></ct-builder-failure-card>
- </template>
- <template if="{{ group.data.category == 'trooper' }}">
- <ct-trooper-card class='card' group="{{ group.data }}"></ct-trooper-card>
- </template>
- </div>
- <div id="buttons">
- <paper-button id="examine" on-tap="{{ examine }}" label="Examine"></paper-button>
- <template if="{{ !group.isSnoozed }}">
- <paper-button id="snooze" on-tap="{{ snooze }}" label="Snooze"></paper-button>
- </template>
- <template if="{{ group.isSnoozed }}">
- <paper-button id="snooze" on-tap="{{ unsnooze }}" label="Unsnooze"></paper-button>
- </template>
- <paper-button id="link-bug" on-tap="{{ linkBug }}" label="Link Bug"></paper-button>
- <template if="{{ group.bug !== undefined }}">
- <div>
- <a href="{{ group.bug }}">
- {{ group.bugLabel }}</a>
- </div>
- </template>
- </div>
-
- <paper-dialog heading="Enter bug number" transition="paper-transition-center" id="bugDialog">
- <paper-input label="Bug# or URL" floatingLabel autofocus id="bug"></paper-input>
- <paper-button label="Remove bug link" on-tap="{{ removeBug }}" dismissive id="dialogRemoveBug"></paper-button>
- <paper-button label="OK" on-tap="{{ saveBug }}" affirmative id="dialogOk"></paper-button>
- </paper-dialog>
- </div>
- </template>
- <script>
- Polymer({
- group: null,
- commitLog: null,
- _builderList: null,
- tree: '',
-
- observe: {
- group: '_updateCommitList',
- commitLog: '_updateCommitList',
- 'group.data.failures': '_updateBuilderList',
- 'group.data.failure': '_updateBuilderList',
- },
-
- examine: function() {
- this.fire('ct-examine-failures', this.group);
- },
-
- snooze: function() {
- this.group.snoozeUntil(Date.now() + 60 * 60 * 1000);
- },
-
- unsnooze: function() {
- this.group.unsnooze();
- },
-
- _updateCommitList: function() {
- if (this.group && this.group.commitList && this.commitLog)
- this.group.commitList.update(this.commitLog);
- },
-
- _updateBuilderList: function() {
- if (this.group.data.category == 'sheriff')
- this._builderList = new CTBuilderList(this.group.data.failures);
- else if (this.group.data.category == 'builder')
- this._builderList = new CTBuilderList(this.group.data.failure);
- },
-
- linkBug: function() {
- this.$.bug.value = this.group.bug;
- this.$.bugDialog.toggle();
- },
-
- saveBug: function() {
- this.group.setBug(this.$.bug.value);
- },
-
- removeBug: function() {
- this.group.clearBug();
- },
- });
- </script>
-</polymer-element>

Powered by Google App Engine
This is Rietveld 408576698