Commit 221b9ce3 authored by yilkal's avatar yilkal Committed by Commit Bot

Improve the EduCoexisistence ui

This cl updates the css and style related javascript code
to ensure that:
1. we provide the right amount of space for the online flow.
2. the buttons are appropriately positioned.

Screenshots:
1. Error page in-session: https://screenshot.googleplex.com/BurFBisi6LzZXmh
2. Gaia in oobe: https://screenshot.googleplex.com/8gnN8kGjdKbXQAL
3. Gaia in add person flow:  https://screenshot.googleplex.com/7yqbR6d278rA3vv
3. Gaia in session: https://screenshot.googleplex.com/53mkzXwjzAxN6tb
Bug: 1143470

Change-Id: Ic6228c2dbb11a5848971375b7a7c669d3479f6ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2523727Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarAga Wronska <agawronska@chromium.org>
Commit-Queue: Yilkal Abe <yilkal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826467}
parent 5a75617f
<style>
:host([button-type='ok']) cr-button {
position: absolute;
}
:host([button-type='back']) cr-button {
position: absolute;
}
</style>
<cr-button class$="[[getClass_(buttonType)]]" on-tap="onTap_" <cr-button class$="[[getClass_(buttonType)]]" on-tap="onTap_"
disabled="[[disabled]]"> disabled="[[disabled]]">
<template is="dom-if" if="[[hasIconBeforeText_(buttonType)]]"> <template is="dom-if" if="[[hasIconBeforeText_(buttonType)]]">
......
...@@ -62,9 +62,11 @@ ...@@ -62,9 +62,11 @@
} }
.main-padding { .main-padding {
height: calc(100% - calc(64px -var(--dialog-top-border-size)));
padding-inline-end: 64px; padding-inline-end: 64px;
padding-inline-start: 64px; padding-inline-start: 64px;
padding-top: calc(64px - var(--dialog-top-border-size)); padding-top: calc(64px - var(--dialog-top-border-size));
width: 100%;
} }
.text-elide { .text-elide {
...@@ -94,14 +96,21 @@ ...@@ -94,14 +96,21 @@
flex-shrink: 0; flex-shrink: 0;
} }
.buttons-layout {
align-items: center;
display: flex;
justify-content: space-between;
width: 100%;
}
span[slot='buttons'] { span[slot='buttons'] {
display: flex; display: flex;
width: 100%; width: 100%;
} }
edu-login-button[button-type='ok'], edu-coexistence-button[button-type='back'] {
edu-login-button[button-type='back'] {
margin-inline-start: auto; margin-inline-start: auto;
} }
</style> </style>
</template> </template>
...@@ -14,6 +14,12 @@ ...@@ -14,6 +14,12 @@
</div> </div>
</span> </span>
<span slot="buttons"> <span slot="buttons">
<div class = "buttons-layout">
<span></span>
<span>
<edu-coexistence-button button-type="action"> <edu-coexistence-button button-type="action">
</edu-coexistence-button>
</span>
</div>
</span> </span>
</edu-coexistence-template> </edu-coexistence-template>
...@@ -14,6 +14,12 @@ ...@@ -14,6 +14,12 @@
</div> </div>
</span> </span>
<span slot="buttons"> <span slot="buttons">
<div class="buttons-layout">
<span></span>
<span>
<edu-coexistence-button button-type="action"> <edu-coexistence-button button-type="action">
</edu-coexistence-button>
</span>
</div>
</span> </span>
</edu-coexistence-template> </edu-coexistence-template>
...@@ -23,26 +23,26 @@ ...@@ -23,26 +23,26 @@
width: 100%; width: 100%;
} }
@media (orientation: landscape) {
.content-container { .content-container {
align-items: stretch; align-items: stretch;
height: 100%; height: 100%;
max-height: 900px; max-width: 768px;
max-width: 1400px;
width: 100%; width: 100%;
} }
@media (orientation: landscape) {
.content-container {
max-height: 640px;
}
} }
@media (orientation: portrait) { @media (orientation: portrait) {
.content-container { .content-container {
align-items: stretch; max-height: 768px;
height: 50%;
max-height: 900px;
max-width: 1400px;
width: 100%;
} }
} }
.main[scrollable].can-scroll:not(.is-scrolled):not(.scrolled-to-bottom) { .main[scrollable].can-scroll:not(.is-scrolled):not(.scrolled-to-bottom) {
background: var(--background-gradient-0); background: var(--background-gradient-0);
} }
......
<style include="edu-coexistence-css"> <style include="edu-coexistence-css">
.buttons {
width: 100%;
}
gaia-action-buttons {
padding-inline-start: 85%;
}
</style> </style>
<edu-coexistence-template> <edu-coexistence-template>
<span slot="main"> <span slot="main">
<div class="container">
<webview id="signinFrame" hidden$="[[loading_]]" class="signin-frame" <webview id="signinFrame" hidden$="[[loading_]]" class="signin-frame"
allowscaling></webview> allowscaling></webview>
</div>
</span> </span>
<span slot="buttons"> <span slot="buttons">
<div class="buttons" hidden$="[[!showGaiaButtons_]]"> <div class="buttons-layout" hidden$="[[!showGaiaButtons_]]">
<div class="action-buttons">
<span> <span>
<edu-coexistence-button button-type="back" <edu-coexistence-button button-type="back"
on-go-back="handleGaiaLoginGoBack_"> on-go-back="handleGaiaLoginGoBack_">
</edu-coexistence-button> </edu-coexistence-button>
</span> </span>
<gaia-action-buttons authenticator="[[controller_.authExtHost_]]" <span>
<gaia-action-buttons id = "gaiaNextButton"
authenticator="[[controller_.authExtHost_]]"
hidden$="[[!showGaiaNextButton_]]"> hidden$="[[!showGaiaNextButton_]]">
</gaia-action-buttons> </gaia-action-buttons>
</div> </span>
</div> </div>
</span> </span>
......
...@@ -93,18 +93,13 @@ Polymer({ ...@@ -93,18 +93,13 @@ Polymer({
*/ */
configureUiForGaiaFlow(currentUrl) { configureUiForGaiaFlow(currentUrl) {
var mainDiv = this.$$('edu-coexistence-template').$$('div.main'); var mainDiv = this.$$('edu-coexistence-template').$$('div.main');
var contentDiv =
this.$$('edu-coexistence-template').$$('div.content-container');
if (currentUrl.hostname !== this.controller_.getFlowOriginHostname()) { if (currentUrl.hostname !== this.controller_.getFlowOriginHostname()) {
// Show the GAIA Buttons. // Show the GAIA Buttons.
this.showGaiaButtons_ = true; this.showGaiaButtons_ = true;
// Shrink the main div so that the buttons line up more closely with the // Shrink the main div so that the buttons line up more closely with the
// server rendered buttons. // server rendered buttons.
mainDiv.style.height = '80%'; mainDiv.style.height = 'calc(100% - 90px)';
// GAIA login renders better with this width constraint.
contentDiv.style.maxWidth = '900px';
// Don't show the "Next" button if the EDU authentication got forwarded to // Don't show the "Next" button if the EDU authentication got forwarded to
// a non-Google SSO page. // a non-Google SSO page.
...@@ -117,9 +112,6 @@ Polymer({ ...@@ -117,9 +112,6 @@ Polymer({
// Hide the GAIA Next button. // Hide the GAIA Next button.
this.showGaiaNextButton_ = false; this.showGaiaNextButton_ = false;
// Undo the GAIA login width constraint set above.
contentDiv.style.maxWidth = '1400px';
// Restore the main div to 100% // Restore the main div to 100%
mainDiv.style.height = '100%'; mainDiv.style.height = '100%';
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment