blob: c657bdaf2351e9b642d1093cb9fe5d6b10bca49e [file] [log] [blame]
<!--
@license
Copyright (C) 2019 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="./rv-reviewer.html">
<dom-module id="rv-filter-section">
<template>
<style include="shared-styles">
:host {
display: block;
margin-bottom: 1em;
}
fieldset {
border: 1px solid var(--border-color);
}
.name {
align-items: center;
display: flex;
}
.header {
align-items: center;
background: var(--table-header-background-color);
border-bottom: 1px dotted var(--border-color);
display: flex;
justify-content: space-between;
min-height: 3em;
padding: 0 .7em;
}
#addReviewer {
display: flex;
}
#editFilterInput {
width: 30vw;
max-width: 500px;
margin-left: 3px;
}
#mainContainer {
display: block;
}
</style>
<style include="gr-form-styles"></style>
<fieldset id="section"
class$="gr-form-styles">
<div id="mainContainer">
<div class="header">
<div class="name">
<h3>Filter:</h3>
<input
id="editFilterInput"
bind-value="{{filter}}"
is="iron-input"
type="text"
disabled="[[_computeFilterInputDisabled(canModifyConfig, _originalFilter)]]">
<gr-button
id="cancelBtn"
on-tap="_handleCancel"
hidden$="[[_computeCancelHidden(filter, _originalFilter)]]">Cancel</gr-button>
</div><!-- name -->
</div><!-- header -->
<div class="reviewers">
<template
is="dom-repeat"
items="{{reviewers}}">
<rv-reviewer
reviewer="{{item}}"
can-modify-config="[[canModifyConfig]]"
plugin-rest-api="[[pluginRestApi]]"
repo-name="[[repoName]]"
on-reviewer-deleted="_handleReviewerDeleted"
on-reviewer-added="_handleReviewerAdded">
</rv-reviewer>
</template>
<div id="addReviewer">
<gr-button
link
id="addBtn"
on-tap="_handleAddReviewer"
hidden="[[_computeAddBtnHidden(canModifyConfig, _editingReviewer)]]">Add Reviewer</gr-button>
</div><!-- addReviewer -->
</div><!-- reviewers -->
</div>
</fieldset>
</template>
<script src="./rv-filter-section.js"></script>
</dom-module>