summaryrefslogtreecommitdiffstats
path: root/polygerrit-ui/app/elements/admin/gr-admin-view/gr-admin-view.html
blob: b6a6d271a44a31d3b45f5bbf1c8d99ba12bfcd6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<!--
@license
Copyright (C) 2017 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="../../../behaviors/base-url-behavior/base-url-behavior.html">
<link rel="import" href="../../../behaviors/gr-admin-nav-behavior/gr-admin-nav-behavior.html">
<link rel="import" href="../../../behaviors/gr-url-encoding-behavior/gr-url-encoding-behavior.html">
<link rel="import" href="../../../styles/gr-menu-page-styles.html">
<link rel="import" href="../../../styles/gr-page-nav-styles.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-dropdown-list/gr-dropdown-list.html">
<link rel="import" href="../../shared/gr-icons/gr-icons.html">
<link rel="import" href="../../shared/gr-js-api-interface/gr-js-api-interface.html">
<link rel="import" href="../../shared/gr-page-nav/gr-page-nav.html">
<link rel="import" href="../../shared/gr-rest-api-interface/gr-rest-api-interface.html">
<link rel="import" href="../gr-admin-group-list/gr-admin-group-list.html">
<link rel="import" href="../gr-group/gr-group.html">
<link rel="import" href="../gr-group-audit-log/gr-group-audit-log.html">
<link rel="import" href="../gr-group-members/gr-group-members.html">
<link rel="import" href="../gr-plugin-list/gr-plugin-list.html">
<link rel="import" href="../gr-repo/gr-repo.html">
<link rel="import" href="../gr-repo-access/gr-repo-access.html">
<link rel="import" href="../gr-repo-commands/gr-repo-commands.html">
<link rel="import" href="../gr-repo-dashboards/gr-repo-dashboards.html">
<link rel="import" href="../gr-repo-detail-list/gr-repo-detail-list.html">
<link rel="import" href="../gr-repo-list/gr-repo-list.html">

<dom-module id="gr-admin-view">
  <template>
    <style include="shared-styles"></style>
    <style include="gr-menu-page-styles"></style>
    <style include="gr-page-nav-styles">
      gr-dropdown-list {
        --trigger-style: {
          text-transform: none;
        }
      }
      .breadcrumbText {
        /* Same as dropdown trigger so chevron spacing is consistent. */
        padding: 5px 4px;
      }
      iron-icon {
        margin: 0 .2em;
      }
      .breadcrumb {
        align-items: center;
        display: flex;
      }
      .mainHeader {
        align-items: baseline;
        border-bottom: 1px solid var(--border-color);
        display: flex;
      }
      .selectText {
        display: none;
      }
      .selectText.show {
        display: inline-block;
      }
      main.breadcrumbs:not(.table) {
        margin-top: 1em;
      }
    </style>
    <gr-page-nav class="navStyles">
      <ul class="sectionContent">
        <template id="adminNav" is="dom-repeat" items="[[_filteredLinks]]">
          <li class$="sectionTitle [[_computeSelectedClass(item.view, params)]]">
            <a class="title" href="[[_computeLinkURL(item)]]"
                  rel="noopener">[[item.name]]</a>
          </li>
          <template is="dom-repeat" items="[[item.children]]" as="child">
            <li class$="[[_computeSelectedClass(child.view, params)]]">
              <a href$="[[_computeLinkURL(child)]]"
                  rel="noopener">[[child.name]]</a>
            </li>
          </template>
          <template is="dom-if" if="[[item.subsection]]">
            <!--If a section has a subsection, render that.-->
            <li class$="[[_computeSelectedClass(item.subsection.view, params)]]">
              <a class="title" href$="[[_computeLinkURL(item.subsection)]]"
                  rel="noopener">
                [[item.subsection.name]]</a>
            </li>
            <!--Loop through the links in the sub-section.-->
            <template is="dom-repeat"
                items="[[item.subsection.children]]" as="child">
              <li class$="subsectionItem [[_computeSelectedClass(child.view, params, child.detailType)]]">
                <a href$="[[_computeLinkURL(child)]]">[[child.name]]</a>
              </li>
            </template>
          </template>
        </template>
      </ul>
    </gr-page-nav>
    <template is="dom-if" if="[[_subsectionLinks.length]]">
      <section class="mainHeader">
        <span class="breadcrumb">
          <span class="breadcrumbText">[[_breadcrumbParentName]]</span>
          <iron-icon icon="gr-icons:chevron-right"></iron-icon>
        </span>
        <gr-dropdown-list
            lowercase
            id="pageSelect"
            value="[[_computeSelectValue(params)]]"
            items="[[_subsectionLinks]]"
            on-value-change="_handleSubsectionChange">
        </gr-dropdown-list>
      </section>
    </template>
    <template is="dom-if" if="[[_showRepoList]]" restamp="true">
      <main class="table">
        <gr-repo-list class="table" params="[[params]]"></gr-repo-list>
      </main>
    </template>
    <template is="dom-if" if="[[_showGroupList]]" restamp="true">
      <main class="table">
        <gr-admin-group-list class="table" params="[[params]]">
        </gr-admin-group-list>
      </main>
    </template>
    <template is="dom-if" if="[[_showPluginList]]" restamp="true">
      <main class="table">
        <gr-plugin-list class="table" params="[[params]]"></gr-plugin-list>
      </main>
    </template>
    <template is="dom-if" if="[[_showRepoMain]]" restamp="true">
      <main class="breadcrumbs">
        <gr-repo repo="[[params.repo]]"></gr-repo>
      </main>
    </template>
    <template is="dom-if" if="[[_showGroup]]" restamp="true">
      <main class="breadcrumbs">
        <gr-group
            group-id="[[params.groupId]]"
            on-name-changed="_updateGroupName"></gr-group>
      </main>
    </template>
    <template is="dom-if" if="[[_showGroupMembers]]" restamp="true">
      <main class="breadcrumbs">
        <gr-group-members
            group-id="[[params.groupId]]"></gr-group-members>
      </main>
    </template>
    <template is="dom-if" if="[[_showRepoDetailList]]" restamp="true">
      <main class="table breadcrumbs">
        <gr-repo-detail-list
            params="[[params]]"
            class="table"></gr-repo-detail-list>
      </main>
    </template>
    <template is="dom-if" if="[[_showGroupAuditLog]]" restamp="true">
      <main class="table breadcrumbs">
        <gr-group-audit-log
            group-id="[[params.groupId]]"
            class="table"></gr-group-audit-log>
      </main>
    </template>
    <template is="dom-if" if="[[_showRepoCommands]]" restamp="true">
      <main class="breadcrumbs">
        <gr-repo-commands
            repo="[[params.repo]]"></gr-repo-commands>
      </main>
    </template>
    <template is="dom-if" if="[[_showRepoAccess]]" restamp="true">
      <main class="breadcrumbs">
        <gr-repo-access
            path="[[path]]"
            repo="[[params.repo]]"></gr-repo-access>
      </main>
    </template>
    <template is="dom-if" if="[[_showRepoDashboards]]" restamp="true">
      <main class="table breadcrumbs">
        <gr-repo-dashboards repo="[[params.repo]]"></gr-repo-dashboards>
      </main>
    </template>
    <gr-rest-api-interface id="restAPI"></gr-rest-api-interface>
    <gr-js-api-interface id="jsAPI"></gr-js-api-interface>
  </template>
  <script src="gr-admin-view.js"></script>
</dom-module>