Files
gerrit/polygerrit-ui/app/elements/admin/gr-repo-dashboards/gr-repo-dashboards.html
Becky Siegel 0f429c827b Fix link generation in gr-repo-dashboards
Previously, link generation called a function that navigates, causing
the page to navigate to the first item in the list.

Instead, use existing attributes to generate the url rather than
navigate.

Bug: Issue 8730
Change-Id: Ic94f37fc8656f4be598f2c9dcc07c5d3b1238bbc
2018-04-25 09:50:25 -07:00

70 lines
2.6 KiB
HTML

<!--
@license
Copyright (C) 2018 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.
-->
<link rel="import" href="../../../bower_components/polymer/polymer.html">
<link rel="import" href="../../../styles/shared-styles.html">
<link rel="import" href="../../core/gr-navigation/gr-navigation.html">
<link rel="import" href="../../shared/gr-rest-api-interface/gr-rest-api-interface.html">
<dom-module id="gr-repo-dashboards">
<template>
<style include="shared-styles">
:host {
display: block;
margin-bottom: 2em;
}
.loading #dashboards,
#loadingContainer {
display: none;
}
.loading #loadingContainer {
display: block;
}
</style>
<style include="gr-table-styles"></style>
<table id="list" class$="genericList [[_computeLoadingClass(_loading)]]">
<tr class="headerRow">
<th class="topHeader">Dashboard name</th>
<th class="topHeader">Dashboard title</th>
<th class="topHeader">Dashboard description</th>
<th class="topHeader">Inherited from</th>
<th class="topHeader">Default</th>
</tr>
<tr id="loadingContainer">
<td>Loading...</td>
</tr>
<tbody id="dashboards">
<template is="dom-repeat" items="[[_dashboards]]">
<tr class="groupHeader">
<td colspan="5">[[item.section]]</td>
</tr>
<template is="dom-repeat" items="[[item.dashboards]]">
<tr class="table">
<td class="name"><a href$="[[_getUrl(item.project, item.sections)]]">[[item.path]]</a></td>
<td class="title">[[item.title]]</td>
<td class="desc">[[item.description]]</td>
<td class="inherited">[[_computeInheritedFrom(item.project, item.defining_project)]]</td>
<td class="default">[[_computeIsDefault(item.is_default)]]</td>
</tr>
</template>
</template>
</tbody>
</table>
<gr-rest-api-interface id="restAPI"></gr-rest-api-interface>
</template>
<script src="gr-repo-dashboards.js"></script>
</dom-module>