summaryrefslogtreecommitdiffstats
path: root/polygerrit-ui/app/elements/admin/gr-group/gr-group.html
blob: c2743b716e104abe9d4c7af1faf1b79ead7784bf (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
<!--
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="../../../bower_components/iron-autogrow-textarea/iron-autogrow-textarea.html">
<link rel="import" href="../../../bower_components/iron-input/iron-input.html">
<link rel="import" href="../../../styles/gr-form-styles.html">
<link rel="import" href="../../../styles/shared-styles.html">
<link rel="import" href="../../shared/gr-autocomplete/gr-autocomplete.html">
<link rel="import" href="../../shared/gr-copy-clipboard/gr-copy-clipboard.html">
<link rel="import" href="../../shared/gr-download-commands/gr-download-commands.html">
<link rel="import" href="../../shared/gr-rest-api-interface/gr-rest-api-interface.html">
<link rel="import" href="../../shared/gr-select/gr-select.html">

<dom-module id="gr-group">
  <template>
    <style include="shared-styles">
      main {
        margin: 2em 1em;
      }
      h3.edited:after {
        color: #444;
        content: ' *';
      }
      .loading {
        display: none;
      }
      #loading.loading {
        display: block;
      }
      #loading:not(.loading) {
        display: none;
      }
      .inputUpdateBtn {
        margin-top: .3em;
      }
    </style>
    <style include="gr-form-styles"></style>
    <main class="gr-form-styles read-only">
      <div id="loading" class$="[[_computeLoadingClass(_loading)]]">
        Loading...
      </div>
      <div id="loadedContent" class$="[[_computeLoadingClass(_loading)]]">
        <h1 id="Title">[[_groupName]]</h1>
        <h2 id="configurations">General</h2>
        <div id="form">
          <fieldset>
            <h3 id="groupUUID">Group UUID</h3>
            <fieldset>
              <gr-copy-clipboard
                  text="[[_groupConfig.id]]"></gr-copy-clipboard>
            </fieldset>
            <h3 id="groupName" class$="[[_computeHeaderClass(_rename)]]">
              Group Name
            </h3>
            <fieldset>
              <span class="value">
                <gr-autocomplete
                    id="groupNameInput"
                    text="{{_groupConfig.name}}"
                    disabled="[[_computeGroupDisabled(_groupOwner, _isAdmin)]]"></gr-autocomplete>
              </span>
              <span class="value" disabled$="[[_computeGroupDisabled(_groupOwner, _isAdmin)]]">
                <gr-button
                    id="inputUpdateNameBtn"
                    on-tap="_handleSaveName"
                    disabled="[[!_rename]]">
                  Rename Group</gr-button>
              </span>
            </fieldset>
            <h3 class$="[[_computeHeaderClass(_owner)]]">
              Owners
            </h3>
            <fieldset>
              <span class="value">
                <gr-autocomplete
                    id="groupOwnerInput"
                    text="{{_groupConfig.owner}}"
                    value="{{_groupConfigOwner}}"
                    query="[[_query]]"
                    disabled="[[_computeGroupDisabled(_groupOwner, _isAdmin)]]">
                </gr-autocomplete>
              </span>
              <span class="value" disabled$="[[_computeGroupDisabled(_groupOwner, _isAdmin)]]">
                <gr-button
                    on-tap="_handleSaveOwner"
                    disabled="[[!_owner]]">
                  Change Owners</gr-button>
              </span>
            </fieldset>
            <h3 class$="[[_computeHeaderClass(_description)]]">
              Description
            </h3>
            <fieldset>
              <div>
                <iron-autogrow-textarea
                    class="description"
                    autocomplete="on"
                    bind-value="{{_groupConfig.description}}"
                    disabled="[[_computeGroupDisabled(_groupOwner, _isAdmin)]]"></iron-autogrow-textarea>
              </div>
              <span class="value" disabled$="[[_computeGroupDisabled(_groupOwner, _isAdmin)]]">
                <gr-button
                    on-tap="_handleSaveDescription"
                    disabled="[[!_description]]">
                  Save Description
                </gr-button>
              </span>
            </fieldset>
            <h3 id="options" class$="[[_computeHeaderClass(_options)]]">
              Group Options
            </h3>
            <fieldset id="visableToAll">
              <section>
                <span class="title">
                  Make group visible to all registered users
                </span>
                <span class="value">
                  <gr-select
                      id="visibleToAll"
                      bind-value="{{_groupConfig.options.visible_to_all}}">
                    <select disabled$="[[_computeGroupDisabled(_groupOwner, _isAdmin)]]">
                      <template is="dom-repeat" items="[[_submitTypes]]">
                        <option value="[[item.value]]">[[item.label]]</option>
                      </template>
                    </select>
                  </gr-select>
                </span>
              </section>
              <span class="value" disabled$="[[_computeGroupDisabled(_groupOwner, _isAdmin)]]">
                <gr-button
                    on-tap="_handleSaveOptions"
                    disabled="[[!_options]]">
                  Save Group Options
                </gr-button>
              </span>
            </fieldset>
          </fieldset>
        </div>
      </div>
    </main>
    <gr-rest-api-interface id="restAPI"></gr-rest-api-interface>
  </template>
  <script src="gr-group.js"></script>
</dom-module>