summaryrefslogtreecommitdiffstats
path: root/polygerrit-ui/app/elements/change/gr-file-list-header/gr-file-list-header.html
diff options
context:
space:
mode:
Diffstat (limited to 'polygerrit-ui/app/elements/change/gr-file-list-header/gr-file-list-header.html')
-rw-r--r--polygerrit-ui/app/elements/change/gr-file-list-header/gr-file-list-header.html235
1 files changed, 135 insertions, 100 deletions
diff --git a/polygerrit-ui/app/elements/change/gr-file-list-header/gr-file-list-header.html b/polygerrit-ui/app/elements/change/gr-file-list-header/gr-file-list-header.html
index fb862603e3..22c476cc42 100644
--- a/polygerrit-ui/app/elements/change/gr-file-list-header/gr-file-list-header.html
+++ b/polygerrit-ui/app/elements/change/gr-file-list-header/gr-file-list-header.html
@@ -1,4 +1,5 @@
<!--
+@license
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,12 +19,16 @@ limitations under the License.
<link rel="import" href="../../../behaviors/gr-patch-set-behavior/gr-patch-set-behavior.html">
<link rel="import" href="../../../styles/shared-styles.html">
<link rel="import" href="../../core/gr-navigation/gr-navigation.html">
+<link rel="import" href="../../diff/gr-diff-mode-selector/gr-diff-mode-selector.html">
<link rel="import" href="../../diff/gr-patch-range-select/gr-patch-range-select.html">
+<link rel="import" href="../../edit/gr-edit-controls/gr-edit-controls.html">
<link rel="import" href="../../shared/gr-editable-label/gr-editable-label.html">
+<link rel="import" href="../../shared/gr-linked-chip/gr-linked-chip.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">
<link rel="import" href="../../shared/gr-button/gr-button.html">
-
+<link rel="import" href="../../shared/gr-icons/gr-icons.html">
+<link rel="import" href="../gr-file-list-constants.html">
<dom-module id="gr-file-list-header">
<template>
@@ -34,31 +39,26 @@ limitations under the License.
.collapseToggleButton {
text-decoration: none;
}
- .patchInfoEdit.patchInfo-header {
- background-color: #fcfad6;
- }
.patchInfoOldPatchSet.patchInfo-header {
- background-color: #fff9c4;
+ background-color: var(--emphasis-color);
}
.patchInfo-header {
- background-color: #fafafa;
- border-bottom: 1px solid #ddd;
- border-top: 1px solid #ddd;
- display: flex;
- min-height: 3.2em;
- padding: .5em var(--default-horizontal-margin);
- }
- .patchInfo-header-wrapper {
align-items: center;
+ background-color: var(--table-header-background-color);
+ border-top: 1px solid var(--border-color);
display: flex;
- width: 100%;
+ padding: 6px var(--default-horizontal-margin);
}
.patchInfo-left {
+ align-items: baseline;
+ display: flex;
+ }
+ .patchInfoContent {
align-items: center;
display: flex;
flex-wrap: wrap;
}
- .patchInfo-header-wrapper .container.latestPatchContainer {
+ .patchInfo-header .container.latestPatchContainer {
display: none;
}
.patchInfoOldPatchSet .container.latestPatchContainer {
@@ -73,66 +73,77 @@ limitations under the License.
.mobile {
display: none;
}
- #diffPrefsContainer,
- .rightControls {
- align-self: flex-end;
- margin: auto 0 auto auto;
- }
- .showOnEdit {
- display: none;
- }
- .editLoaded .hideOnEdit {
- display: none;
- }
- .editLoaded .showOnEdit {
- display: initial;
- }
- .patchInfo-header-wrapper .container {
+ .patchInfo-header .container {
align-items: center;
display: flex;
}
- #modeSelect {
- margin-left: .1em;
+ .downloadContainer,
+ .uploadContainer,
+ .includedInContainer {
+ margin-right: 16px;
}
- .fileList-header {
- align-items: center;
- display: flex;
- font-weight: bold;
- height: 2.25em;
- margin: 0 calc(var(--default-horizontal-margin) / 2);
- padding: 0 .25em;
+ .includedInContainer.hide,
+ .uploadContainer.hide {
+ display: none;
}
.rightControls {
+ align-self: flex-end;
+ margin: auto 0 auto auto;
align-items: center;
display: flex;
flex-wrap: wrap;
font-weight: normal;
justify-content: flex-end;
}
- .separator {
- background-color: rgba(0, 0, 0, .3);
- height: 1.5em;
- margin: 0 .6em;
- width: 1px;
+ #collapseBtn,
+ .expanded #expandBtn,
+ .fileViewActions{
+ display: none;
}
- .separator.transparent {
- background-color: transparent;
+ .expanded #expandBtn {
+ display: none;
+ }
+ gr-linked-chip {
+ --linked-chip-text-color: var(--primary-text-color);
}
- .expandInline {
- padding-right: .25em;
+ .expanded #collapseBtn,
+ .openFile .fileViewActions {
+ align-items: center;
+ display: flex;
+ }
+ .rightControls gr-button,
+ gr-patch-range-select {
+ margin: 0 -4px;
+ }
+ .fileViewActions gr-button {
+ margin: 0;
+ --gr-button: {
+ padding: 2px 4px;
+ }
}
- .editLoaded .hideOnEdit {
+ .editMode .hideOnEdit {
display: none;
}
- .editLoaded .showOnEdit {
+ .showOnEdit {
+ display: none;
+ }
+ .editMode .showOnEdit {
display: initial;
}
+ .editMode .showOnEdit.flexContainer {
+ align-items: center;
+ display: flex;
+ }
.label {
- font-family: var(--font-family-bold);
- margin-right: 1em;
+ font-weight: var(--font-weight-bold);
+ margin-right: 24px;
}
- .container.includedInContainer.hide {
- display: none;
+ gr-commit-info,
+ gr-edit-controls {
+ margin-right: -5px;
+ }
+ .fileViewActionsLabel {
+ margin-right: .2rem;
}
@media screen and (max-width: 50em) {
.patchInfo-header .desktop {
@@ -140,18 +151,19 @@ limitations under the License.
}
}
</style>
- <div class$="patchInfo-header [[_computeEditLoadedClass(editLoaded)]] [[_computePatchInfoClass(patchNum, allPatchSets)]]">
- <div class="patchInfo-header-wrapper">
- <div class="patchInfo-left">
- <h3 class="label">Files</h3>
+ <div class$="patchInfo-header [[_computeEditModeClass(editMode)]] [[_computePatchInfoClass(patchNum, allPatchSets)]]">
+ <div class="patchInfo-left">
+ <h3 class="label">Files</h3>
+ <div class="patchInfoContent">
<gr-patch-range-select
id="rangeSelect"
- comments="[[comments]]"
+ change-comments="[[changeComments]]"
change-num="[[changeNum]]"
patch-num="[[patchNum]]"
base-patch-num="[[basePatchNum]]"
available-patches="[[allPatchSets]]"
revisions="[[change.revisions]]"
+ revision-info="[[revisionInfo]]"
on-patch-range-change="_handlePatchChange">
</gr-patch-range-select>
<span class="separator"></span>
@@ -163,53 +175,66 @@ limitations under the License.
<span class="separator"></span>
<a href$="[[changeUrl]]">Go to latest patch set</a>
</span>
- <span class="container downloadContainer desktop">
+ <span class="container descriptionContainer hideOnEdit">
<span class="separator"></span>
- <gr-button link
- class="download"
- on-tap="_handleDownloadTap">Download</gr-button>
+ <template
+ is="dom-if"
+ if="[[_patchsetDescription]]">
+ <gr-linked-chip
+ id="descriptionChip"
+ text="[[_patchsetDescription]]"
+ removable="[[!_descriptionReadOnly]]"
+ on-remove="_handleDescriptionRemoved"></gr-linked-chip>
+ </template>
+ <template
+ is="dom-if"
+ if="[[!_patchsetDescription]]">
+ <gr-editable-label
+ id="descriptionLabel"
+ uppercase
+ class="descriptionLabel"
+ label-text="Add patchset description"
+ value="[[_patchsetDescription]]"
+ placeholder="[[_computeDescriptionPlaceholder(_descriptionReadOnly)]]"
+ read-only="[[_descriptionReadOnly]]"
+ on-changed="_handleDescriptionChanged"></gr-editable-label>
+ </template>
</span>
- <span class$="container includedInContainer [[_hideIncludedIn(change)]] desktop">
+ </div>
+ </div>
+ <div class$="rightControls [[_computeExpandedClass(filesExpanded)]]">
+ <span class="showOnEdit flexContainer">
+ <gr-edit-controls
+ id="editControls"
+ patch-num="[[patchNum]]"
+ change="[[change]]"></gr-edit-controls>
<span class="separator"></span>
+ </span>
+ <span class$="[[_computeUploadHelpContainerClass(change, account)]]">
<gr-button link
- class="includedIn"
- on-tap="_handleIncludedInTap">Included In</gr-button>
+ class="upload"
+ on-tap="_handleUploadTap">Update Change</gr-button>
</span>
- <span class="container descriptionContainer hideOnEdit">
- <span class="separator"></span>
- <gr-editable-label
- id="descriptionLabel"
- class="descriptionLabel"
- label-text="Add patchset description"
- value="[[_computePatchSetDescription(change, patchNum)]]"
- placeholder="[[_computeDescriptionPlaceholder(_descriptionReadOnly)]]"
- read-only="[[_descriptionReadOnly]]"
- on-changed="_handleDescriptionChanged"></gr-editable-label>
- </span>
- </div>
- <span id="diffPrefsContainer"
- class="hideOnEdit"
- hidden$="[[_computePrefsButtonHidden(diffPrefs, loggedIn)]]"
- hidden>
+ <span class="downloadContainer desktop">
<gr-button link
- class="prefsButton desktop"
- on-tap="_handlePrefsTap">Diff Preferences</gr-button>
+ class="download"
+ on-tap="_handleDownloadTap">Download</gr-button>
+ </span>
+ <span class$="includedInContainer [[_hideIncludedIn(change)]] desktop">
+ <gr-button link
+ class="includedIn"
+ on-tap="_handleIncludedInTap">Included In</gr-button>
</span>
- </div>
- </div>
- <div class="fileList-header">
- <div class="rightControls">
<template is="dom-if"
if="[[_fileListActionsVisible(shownFileCount, _maxFilesForBulkActions)]]">
<gr-button
id="expandBtn"
link
- on-tap="_expandAllDiffs">Show diffs</gr-button>
- <span class="separator"></span>
+ on-tap="_expandAllDiffs">Expand All</gr-button>
<gr-button
id="collapseBtn"
link
- on-tap="_collapseAllDiffs">Hide diffs</gr-button>
+ on-tap="_collapseAllDiffs">Collapse All</gr-button>
</template>
<template is="dom-if"
if="[[!_fileListActionsVisible(shownFileCount, _maxFilesForBulkActions)]]">
@@ -217,15 +242,25 @@ limitations under the License.
Bulk actions disabled because there are too many files.
</div>
</template>
- <span class="separator"></span>
- <gr-select
- id="modeSelect"
- bind-value="{{diffViewMode}}">
- <select>
- <option value="SIDE_BY_SIDE">Side By Side</option>
- <option value="UNIFIED_DIFF">Unified</option>
- </select>
- </gr-select>
+ <div class="fileViewActions">
+ <span class="separator"></span>
+ <span class="fileViewActionsLabel">Diff view:</span>
+ <gr-diff-mode-selector
+ id="modeSelect"
+ mode="{{diffViewMode}}"
+ save-on-change="[[loggedIn]]"></gr-diff-mode-selector>
+ <span id="diffPrefsContainer"
+ class="hideOnEdit"
+ hidden$="[[_computePrefsButtonHidden(diffPrefs, loggedIn)]]"
+ hidden>
+ <gr-button
+ link
+ has-tooltip
+ title="Diff preferences"
+ class="prefsButton desktop"
+ on-tap="_handlePrefsTap"><iron-icon icon="gr-icons:settings"></iron-icon></gr-button>
+ </span>
+ </div>
</div>
</div>
<gr-rest-api-interface id="restAPI"></gr-rest-api-interface>