Merge "Move Save button to left side and mark as tertiary"

This commit is contained in:
Wyatt Allen
2017-10-30 16:30:24 +00:00
committed by Gerrit Code Review
5 changed files with 37 additions and 8 deletions

View File

@@ -60,7 +60,7 @@ limitations under the License.
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.actions gr-button { .actions .right gr-button {
margin-left: 1em; margin-left: 1em;
} }
.peopleContainer, .peopleContainer,
@@ -267,6 +267,16 @@ limitations under the License.
</section> </section>
<section class="actions"> <section class="actions">
<div class="left"> <div class="left">
<template is="dom-if" if="[[canBeStarted]]">
<gr-button
link
tertiary
disabled="[[_isState(knownLatestState, 'not-latest')]]"
class="action save"
has-tooltip
title="[[_saveTooltip]]"
on-tap="_saveTapHandler">Save</gr-button>
</template>
<span <span
id="checkingStatusLabel" id="checkingStatusLabel"
hidden$="[[!_isState(knownLatestState, 'checking')]]"> hidden$="[[!_isState(knownLatestState, 'checking')]]">
@@ -290,14 +300,9 @@ limitations under the License.
primary primary
disabled="[[_computeSendButtonDisabled(knownLatestState, _sendButtonLabel, diffDrafts, draft, _reviewersMutated, _labelsChanged, _includeComments)]]" disabled="[[_computeSendButtonDisabled(knownLatestState, _sendButtonLabel, diffDrafts, draft, _reviewersMutated, _labelsChanged, _includeComments)]]"
class="action send" class="action send"
has-tooltip
title$="[[_computeSendButtonTooltip(canBeStarted)]]"
on-tap="_sendTapHandler">[[_sendButtonLabel]]</gr-button> on-tap="_sendTapHandler">[[_sendButtonLabel]]</gr-button>
<template is="dom-if" if="[[canBeStarted]]">
<gr-button
link
disabled="[[_isState(knownLatestState, 'not-latest')]]"
class="action save"
on-tap="_saveTapHandler">Save</gr-button>
</template>
</div> </div>
</section> </section>
</div> </div>

View File

@@ -39,6 +39,12 @@
SEND: 'Send', SEND: 'Send',
}; };
const ButtonTooltips = {
SAVE: 'Save reply but do not send',
START_REVIEW: 'Mark as ready for review and send reply',
SEND: 'Send reply',
};
// TODO(logan): Remove once the fix for issue 6841 is stable on // TODO(logan): Remove once the fix for issue 6841 is stable on
// googlesource.com. // googlesource.com.
const START_REVIEW_MESSAGE = 'This change is ready for review.'; const START_REVIEW_MESSAGE = 'This change is ready for review.';
@@ -188,6 +194,11 @@
type: Boolean, type: Boolean,
value: false, value: false,
}, },
_saveTooltip: {
type: String,
value: ButtonTooltips.SAVE,
readOnly: true,
},
}, },
FocusTarget, FocusTarget,
@@ -798,6 +809,10 @@
return canBeStarted ? ButtonLabels.START_REVIEW : ButtonLabels.SEND; return canBeStarted ? ButtonLabels.START_REVIEW : ButtonLabels.SEND;
}, },
_computeSendButtonTooltip(canBeStarted) {
return canBeStarted ? ButtonTooltips.START_REVIEW : ButtonTooltips.SEND;
},
_computeCCsEnabled(serverConfig) { _computeCCsEnabled(serverConfig) {
return serverConfig && serverConfig.note_db_enabled; return serverConfig && serverConfig.note_db_enabled;
}, },

View File

@@ -41,6 +41,9 @@ limitations under the License.
font-family: var(--font-family-bold); font-family: var(--font-family-bold);
text-transform: none; text-transform: none;
} }
:host([link][tertiary]) {
color: var(--color-link-tertiary);
}
:host([link]) paper-button { :host([link]) paper-button {
margin: 0; margin: 0;
padding: 0; padding: 0;

View File

@@ -28,6 +28,11 @@
value: false, value: false,
reflectToAttribute: true, reflectToAttribute: true,
}, },
tertiary: {
type: Boolean,
value: false,
reflectToAttribute: true,
},
disabled: { disabled: {
type: Boolean, type: Boolean,
observer: '_disabledChanged', observer: '_disabledChanged',

View File

@@ -38,6 +38,7 @@ limitations under the License.
/* Follow are a part of the design refresh */ /* Follow are a part of the design refresh */
--color-link: #2a66d9; --color-link: #2a66d9;
--color-link-tertiary: #000;
/* 12% darker */ /* 12% darker */
--color-button-hover: #0B47BA; --color-button-hover: #0B47BA;
} }