blob: 6c0908a03cbdc992df02abf7607ac9ce033afa70 [file] [log] [blame]
<!--
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-confirm-dialog/gr-confirm-dialog.html">
<link rel="import" href="../../shared/gr-overlay/gr-overlay.html">
<link rel="import" href="../../shared/gr-rest-api-interface/gr-rest-api-interface.html">
<link rel="import" href="../gr-create-change-dialog/gr-create-change-dialog.html">
<dom-module id="gr-project-commands">
<template>
<style include="shared-styles">
main {
margin: 2em 1em;
}
.loading {
display: none;
}
#loading.loading {
display: block;
}
#loading:not(.loading) {
display: none;
}
</style>
<style include="gr-form-styles"></style>
<main class="gr-form-styles read-only">
<h1 id="Title">Project Commands</h1>
<div id="loading" class$="[[_computeLoadingClass(_loading)]]">Loading...</div>
<div id="loadedContent" class$="[[_computeLoadingClass(_loading)]]">
<h2 id="options">Command</h2>
<div id="form">
<fieldset>
<h3 id="createChange">Create Change</h3>
<fieldset>
<gr-button id="createNewChange" on-tap="_createNewChange">
Create Change
</gr-button>
</fieldset>
<h3 id="runGC" hidden$="[[!_projectConfig.actions.gc.enabled]]">
Run GC
</h3>
<fieldset>
<gr-button
on-tap="_handleRunningGC"
hidden$="[[!_projectConfig.actions.gc.enabled]]">
Run GC
</gr-button>
</fieldset>
</fieldset>
</div>
</div>
</main>
<gr-overlay id="createChangeOverlay" with-backdrop>
<gr-confirm-dialog
id="createChangeDialog"
confirm-label="Create"
disabled="[[!_canCreate]]"
on-confirm="_handleCreateChange"
on-cancel="_handleCloseCreateChange">
<div class="header">
Create Change
</div>
<div class="main">
<gr-create-change-dialog
id="createNewChangeModal"
can-create="{{_canCreate}}"
project-name="[[project]]"></gr-create-change-dialog>
</div>
</gr-confirm-dialog>
</gr-overlay>
<gr-rest-api-interface id="restAPI"></gr-rest-api-interface>
</template>
<script src="gr-project-commands.js"></script>
</dom-module>