Commit 8af30130 authored by Denis Kuznetsov's avatar Denis Kuznetsov Committed by Commit Bot

Fix enrollment screen for attestation-based enrollment.

Remove separate ABE success screen.
Replace success text with dedicated polymer element.

TBR: alemate@chromium.org
Bug: 811556
Change-Id: Id26aae8ec6276d57148cbb2a101094f93d28e11c
Reviewed-on: https://chromium-review.googlesource.com/c/1329630
Commit-Queue: Denis Kuznetsov <antrim@chromium.org>
Reviewed-by: default avatarAlexander Hendrich <hendrich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610496}
parent 8af518d2
......@@ -2611,9 +2611,10 @@
<message name="IDS_ENTERPRISE_ENROLLMENT_SUCCESS_ILLUSTRATION_TITLE" desc="Accessible title of the enterprise enrollment screen illustration depicting successful enrollment.">
Successful enrollment illustration
</message>
<message name="IDS_ENTERPRISE_ENROLLMENT_ABE_SUCCESS" desc="Success message to be shown once attestation-based enterprise enrollment completes.">
<message name="IDS_ENTERPRISE_ENROLLMENT_SUCCESS_ABE_DOMAIN" desc="Success message to be shown once attestation-based enterprise enrollment completes.">
Your <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph> has successfully been enrolled for enterprise management by <ph name="BEGIN_BOLD">&lt;strong&gt;</ph><ph name="DOMAIN">$2<ex>acmecorp.com</ex></ph><ph name="END_BOLD">&lt;/strong&gt;</ph>.
<ph name="LINE_BREAK_AND_EMPTY_LINE">&lt;br&gt;&lt;br&gt;</ph>
</message>
<message name="IDS_ENTERPRISE_ENROLLMENT_SUCCESS_ABE_SUPPORT" desc="Recommendation to contact support. Shown once attestation-based enterprise enrollment completes.">
If this is unexpected, please contact support.
</message>
<message name="IDS_ENTERPRISE_ENROLLMENT_ASSET_ID_LABEL" desc="Label for asset id text box on the device naming screen in the enterprise enrollment dialog.">
......
......@@ -158,7 +158,7 @@ IN_PROC_BROWSER_TEST_F(EnrollmentScreenTest, EnrollmentSpinner) {
view->ShowAttestationBasedEnrollmentSuccessScreen("fake domain");
checker.ExpectTrue(
"window.getComputedStyle(document.getElementById('oauth-enroll-step-abe-"
"window.getComputedStyle(document.getElementById('oauth-enroll-step-"
"success')).display !== 'none'");
}
......
......@@ -25,6 +25,7 @@
// <include src="oobe_buttons.js">
// <include src="oobe_change_picture.js">
// <include src="oobe_dialog.js">
// <include src="oobe_enrollment.js">
// <include src="arc_terms_of_service.js">
// <include src="oobe_reset.js">
// <include src="oobe_reset_confirmation_overlay.js">
......
......@@ -31,6 +31,7 @@
// <include src="oobe_buttons.js">
// <include src="oobe_change_picture.js">
// <include src="oobe_dialog.js">
// <include src="oobe_enrollment.js">
// <include src="oobe_eula.js">
// <include src="oobe_hid_detection.js">
// <include src="oobe_reset.js">
......
......@@ -2,6 +2,7 @@
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-iconset-svg/iron-iconset-svg.html">
......@@ -32,3 +33,17 @@
</defs>
</svg>
</iron-iconset-svg>
<dom-module id="oobe-enrollment-success-with-domain">
<template>
<div hidden="[[enrollmentDomain]]">
[[i18nDynamic(locale,'oauthEnrollSuccessTitle')]]
</div>
<div hidden="[[!enrollmentDomain]]">
<div inner-h-t-m-l="[[localizedText_(locale, deviceName,
enrollmentDomain)]]">
</div>
<div>[[i18nDynamic(locale, 'oauthEnrollAbeSuccessSupport')]]</div>
</div>
</template>
</dom-module>
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
Polymer({
is: 'oobe-enrollment-success-with-domain',
behaviors: [I18nBehavior],
properties: {
/**
* Domain the device was enrolled to.
*/
enrollmentDomain: {
type: String,
value: '',
reflectToAttribute: true,
},
/**
* Name of the device that was enrolled.
*/
deviceName: {
type: String,
value: 'Chromebook',
},
},
localizedText_: function(locale, device, domain) {
return this.i18nAdvanced(
'oauthEnrollAbeSuccessDomain', {substitutions: [device, domain]});
}
});
......@@ -37,7 +37,6 @@
.oauth-enroll-state-ad-join #oauth-enroll-step-ad-join,
.oauth-enroll-state-license #oauth-enroll-step-license,
.oauth-enroll-state-success #oauth-enroll-step-success,
.oauth-enroll-state-abe-success #oauth-enroll-step-abe-success,
.oauth-enroll-state-working #oauth-enroll-step-working,
.oauth-enroll-state-attribute-prompt
#oauth-enroll-step-attribute-prompt {
......
......@@ -60,7 +60,9 @@
icon1x="oobe-enrollment-32:briefcase"
icon2x="oobe-enrollment-64:briefcase"></hd-iron-icon>
<h1 slot="title" i18n-content="oauthEnrollSuccessTitle"></h1>
<div slot="subtitle" i18n-content="oauthEnrollSuccess"></div>
<oobe-enrollment-success-with-domain id="oauth-enroll-success-subtitle"
slot="subtitle">
</oobe-enrollment-success-with-domain>
<div slot="footer" class="flex layout vertical center end-justified">
<img srcset="images/enrollment_success_illustration_1x.png 1x,
images/enrollment_success_illustration_2x.png 2x"
......@@ -73,29 +75,6 @@
</oobe-text-button>
</div>
</oobe-dialog>
</div>
<div id="oauth-enroll-step-abe-success" role="alert">
<oobe-dialog id="oauth-enroll-abe-success-card" has-buttons>
<hd-iron-icon slot="oobe-icon"
icon1x="oobe-enrollment-32:briefcase"
icon2x="oobe-enrollment-64:briefcase"></hd-iron-icon>
<h1 slot="title" i18n-content="oauthEnrollSuccessTitle"></h1>
<div slot="subtitle" id="oauth-enroll-abe-success-comment-no-domain"
i18n-content="oauthEnrollSuccess"></div>
<div slot="subtitle" id="oauth-enroll-abe-success-comment-domain"
hidden></div>
<div slot="footer" class="flex layout vertical center end-justified">
<img srcset="images/enrollment_success_illustration_1x.png 1x,
images/enrollment_success_illustration_2x.png 2x"
i18n-values="alt:enrollmentSuccessIllustrationTitle">
</div>
<div slot="bottom-buttons" class="layout horizontal end-justified">
<oobe-text-button inverse id="enroll-success-abe-done-button"
class="focus-on-show">
<div i18n-content="oauthEnrollDone"></div>
</oobe-text-button>
</div>
</oobe-dialog>
</div>
<div id="oauth-enroll-step-attribute-prompt">
<oobe-dialog id="oauth-enroll-attribute-prompt-card" has-buttons>
......
......@@ -17,7 +17,6 @@ login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() {
/** @const */ var STEP_ATTRIBUTE_PROMPT = 'attribute-prompt';
/** @const */ var STEP_ERROR = 'error';
/** @const */ var STEP_SUCCESS = 'success';
/** @const */ var STEP_ABE_SUCCESS = 'abe-success';
/* TODO(dzhioev): define this step on C++ side.
/** @const */ var STEP_ATTRIBUTE_PROMPT_ERROR = 'attribute-prompt-error';
......@@ -206,8 +205,6 @@ login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() {
$('enroll-success-done-button')
.addEventListener('tap', this.onEnrollmentFinished_.bind(this));
$('enroll-success-abe-done-button')
.addEventListener('tap', this.onEnrollmentFinished_.bind(this));
$('enroll-attributes-skip-button')
.addEventListener('tap', this.onSkipButtonClicked.bind(this));
......@@ -239,7 +236,6 @@ login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() {
this.licenseUi_.addEventListener('buttonclick', function() {
chrome.send('onLicenseTypeSelected', [this.licenseUi_.selected]);
}.bind(this));
},
/**
......@@ -321,12 +317,10 @@ login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() {
*/
showAttestationBasedEnrollmentSuccess: function(
device, enterpriseEnrollmentDomain) {
$('oauth-enroll-abe-success-comment-no-domain').hidden = true;
$('oauth-enroll-abe-success-comment-domain').hidden = false;
$('oauth-enroll-abe-success-comment-domain').innerHTML =
loadTimeData.getStringF(
'oauthEnrollAbeSuccess', device, enterpriseEnrollmentDomain);
this.showStep(STEP_ABE_SUCCESS);
$('oauth-enroll-success-subtitle').deviceName = device;
$('oauth-enroll-success-subtitle').enrollmentDomain =
enterpriseEnrollmentDomain;
this.showStep(STEP_SUCCESS);
},
/**
......@@ -393,8 +387,6 @@ login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() {
$('oauth-enroll-error-card').submitButton.focus();
} else if (step == STEP_SUCCESS) {
$('oauth-enroll-success-card').show();
} else if (step == STEP_ABE_SUCCESS) {
$('oauth-enroll-abe-success-card').show();
} else if (step == STEP_ATTRIBUTE_PROMPT) {
$('oauth-enroll-attribute-prompt-card').show();
} else if (step == STEP_ATTRIBUTE_PROMPT_ERROR) {
......
......@@ -567,7 +567,10 @@ void EnrollmentScreenHandler::DeclareLocalizedValues(
IDS_ENTERPRISE_ENROLLMENT_LOCATION_LABEL);
builder->Add("oauthEnrollWorking", IDS_ENTERPRISE_ENROLLMENT_WORKING_MESSAGE);
// Do not use AddF for this string as it will be rendered by the JS code.
builder->Add("oauthEnrollAbeSuccess", IDS_ENTERPRISE_ENROLLMENT_ABE_SUCCESS);
builder->Add("oauthEnrollAbeSuccessDomain",
IDS_ENTERPRISE_ENROLLMENT_SUCCESS_ABE_DOMAIN);
builder->Add("oauthEnrollAbeSuccessSupport",
IDS_ENTERPRISE_ENROLLMENT_SUCCESS_ABE_SUPPORT);
/* Active Directory strings */
builder->Add("oauthEnrollAdMachineNameInput", IDS_AD_DEVICE_NAME_INPUT_LABEL);
......
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