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

Unified Diff: dashboard/dashboard/elements/speed-releasing-page.html

Issue 2588203002: Added in a revision picker with dummy data (Closed)
Patch Set: figuring out what is on this branch Created 3 years, 11 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
« no previous file with comments | « dashboard/dashboard/elements/revision-picker.html ('k') | dashboard/dashboard/elements/test-picker.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dashboard/dashboard/elements/speed-releasing-page.html
diff --git a/dashboard/dashboard/elements/speed-releasing-page.html b/dashboard/dashboard/elements/speed-releasing-page.html
new file mode 100644
index 0000000000000000000000000000000000000000..6bd12a1e346736b927ab60cbeb7d94fd2e526838
--- /dev/null
+++ b/dashboard/dashboard/elements/speed-releasing-page.html
@@ -0,0 +1,168 @@
+<!DOCTYPE html>
+<!--
+Copyright 2016 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 type="text/css" rel="stylesheet" href="/dashboard/static/base.css">
+<link rel="import" href="/components/paper-button/paper-button.html">
+<link rel="import" href="/components/paper-dropdown-menu/paper-dropdown-menu.html">
+<link rel="import" href="/components/paper-item/paper-item.html">
+<link rel="import" href="/components/paper-listbox/paper-listbox.html">
+<link rel="import" href="/components/polymer/polymer.html">
+<link rel="import" href="/dashboard/elements/revision-picker.html">
+<link rel="import" href="/dashboard/elements/test-picker.html">
+<link rel="import" href="/dashboard/static/simple_xhr.html">
+<link rel="import" href="/dashboard/static/uri.html">
+
+<link rel="import" href="/tracing/base/unit.html">
+
+<dom-module id="speed-releasing-page">
+ <template>
+ <style>
+ .error {
+ color: #dd4b39;
+ font-weight: bold;
+ }
+
+ .center {
+ margin: auto;
+ padding: 10px;
+ }
+ /* The content container contains everything below the sheriff select menu.
+ */
+ #content {
+ display: inline-flex;
+ display: -webkit-inline-flex;
+ flex-direction: column;
+ -webkit-flex-direction: column;
+ align-items: flex-start;
+ -webkit-align-items: flex-start;
+ }
+
+
+ #loading-spinner {
+ width: 100%;
+ display: flex;
+ justify-content: center;
+ }
+ </style>
+
+ <template is="dom-if" if="{{loading}}">
+ <div id="loading-spinner"><img src="//www.google.com/images/loading.gif"></div>
+ </template>
+ <template is="dom-if" if="{{!loading}}">
+ <template is="dom-if" if="{{error}}">
+ <div class="error">{{error}}</div>
+ </template>
+ <template is="dom-if" if="{{!error}}">
+ <div id="content">
+ <test-picker id="testPicker" xsrf-token="{{xsrfToken}}"
+ test-suites="{{testSuites}}"
+ speed-releasing="true"></test-picker>
+ <revision-picker></revision-picker>
+ </div>
+ </template>
+ </template>
+ </template>
+ <script>
+ 'use strict';
+ Polymer({
+
+ is: 'speed-releasing-page',
+ properties: {
+
+ loading: {
+ type: Boolean,
+ value: false, // TODO MAKE THIS WORK
+ notify: true
+ },
+ error: {
+ type: String,
+ value: '',
+ notify: true
+ },
+ testSuites: {
+ type: Object,
+ value: () => { return {}; }
+ },
+ isInternalUser: {
+ type: Boolean,
+ value: false
+ },
+ loginUrl: {
+ type: String,
+ value: ''
+ },
+ xsrfToken: {
+ type: String,
+ value: ''
+ },
+
+ },
+ ready: function() {
+ simple_xhr.send('/speed_releasing', uri.getAllParameters(),
+ function(response) {
+ this.isInternalUser = response['is_internal_user'];
+ this.loginUrl = response['login_url'];
+ // this.revisionInfo = response['revision_info'];
+ // this.warningBug = response['warning_bug'];
+ // this.warningMessage = response['warning_message'];
+ // if (this.warningMessage) {
+ // this.fire('display-toast', {
+ // 'content': this.$.warningtoast,
+ // 'error': true
+ // });
+ // }
+ this.xsrfToken = response['xsrf_token'];
+ this.testSuites = response['test_suites'];
+ console.log(this.testSuites);
+ // for (var i = 0; i < this.charts.length; i++) {
+ // this.setChartData(this.charts[i]);
+ // }
+ }.bind(this),
+ function(error) {
+
+ }.bind(this));
+
+ // window.addEventListener('pagestaterequest',
+ // this.onPageStateRequest.bind(this));
+
+ // this.testPicker.addEventListener(
+ // 'add', this.onAddChartButtonClicked.bind(this));
+
+ // window.addEventListener('uriload', this.onUriLoad.bind(this));
+ // this.uriController = new uri.Controller(this.getPageState.bind(this));
+ // this.uriController.load();
+
+ // console.log(this.testPicker);
+ window.addEventListener(
+ 'add', this.onAddTestButtonClicked.bind(this));
+ },
+
+ onAddTestButtonClicked: function(event) {
+ console.log('add');
+ // this.testPicker = this.$['test-picker'];
+ this.testPicker = document.querySelector('#testPicker');
+ var selection = this.testPicker.getCurrentSelection();
+ console.log(selection.testPathDict_);
+
+ var params = {
+ test_path: Object.keys(selection.testPathDict_)[0]
+ };
+
+ simple_xhr.send('/speed_releasing_data', params,
+ function(response) {
+ // this.xsrfToken = response['xsrf_token'];
+ // this.testSuites = response['test_path'];
+ console.log(response['value']);
+ }.bind(this),
+ function(error) {
+
+ }.bind(this));
+ },
+
+ });
+ </script>
+</dom-module>
« no previous file with comments | « dashboard/dashboard/elements/revision-picker.html ('k') | dashboard/dashboard/elements/test-picker.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698