Commit be041911 authored by dpapad's avatar dpapad Committed by Commit Bot

WebUI user-manager: Remove supervised users related dead code.

This code should have been removed as part of
https://chromium-review.googlesource.com/c/chromium/src/+/1029952/

Bug: 902959,828890
Change-Id: Ib7e00a646c864bea6b741924d6c592197ff2863d
Reviewed-on: https://chromium-review.googlesource.com/c/1327227Reviewed-by: default avatarEsmael El-Moslimany <aee@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606972}
parent 79e3e459
...@@ -20,33 +20,14 @@ ...@@ -20,33 +20,14 @@
</style> </style>
<cr-view-manager id="animatedPages" role="main"> <cr-view-manager id="animatedPages" role="main">
<div id="create-user-page" slot="view" on-keydown="stopPropagation_"> <div id="create-user-page" slot="view" on-keydown="stopPropagation_">
<!-- Keep the page alive while visiting the Learn More page. --> <template is="dom-if" if="[[shouldShowCreateProfile_(selectedPage_)]]"
<template is="dom-if" restamp>
if="[[isPresentIn_(selectedPage_,
'create-user-page',
'supervised-learn-more-page')]]" restamp>
<create-profile></create-profile> <create-profile></create-profile>
</template> </template>
</div> </div>
<div id="user-pods-page" slot="view"> <div id="user-pods-page" slot="view">
<slot></slot> <slot></slot>
</div> </div>
<div id="supervised-learn-more-page" slot="view"
on-keydown="stopPropagation_">
<template is="dom-if"
if="[[isPresentIn_(selectedPage_, 'supervised-learn-more-page')]]">
<supervised-user-learn-more></supervised-user-learn-more>
</template>
</div>
<div id="supervised-create-confirm-page" slot="view"
on-keydown="stopPropagation_">
<template is="dom-if"
if="[[isPresentIn_(selectedPage_,
'supervised-create-confirm-page')]]">
<supervised-user-create-confirm profile-info="[[pageData_]]">
</supervised-user-create-confirm>
</template>
</div>
</cr-view-manager> </cr-view-manager>
</template> </template>
<script src="user_manager_pages.js"></script> <script src="user_manager_pages.js"></script>
......
...@@ -66,14 +66,8 @@ Polymer({ ...@@ -66,14 +66,8 @@ Polymer({
e.stopPropagation(); e.stopPropagation();
}, },
/** /** @return {boolean} */
* Returns True if the first argument is present in the given set of values. shouldShowCreateProfile_: function() {
* @param {string} selectedPage ID of the currently selected page. return this.selectedPage_ == 'create-user-page';
* @param {...string} var_args Pages IDs to check the first argument against.
* @return {boolean}
*/
isPresentIn_: function(selectedPage, var_args) {
const pages = Array.prototype.slice.call(arguments, 1);
return pages.indexOf(selectedPage) !== -1;
} }
}); });
...@@ -20,10 +20,9 @@ cr.define('user_manager.user_manager_pages_tests', function() { ...@@ -20,10 +20,9 @@ cr.define('user_manager.user_manager_pages_tests', function() {
}); });
test('User Pods page is the default visible page', function() { test('User Pods page is the default visible page', function() {
assertTrue(pagesElement.isPresentIn_( const activeView =
pagesElement.selectedPage_, 'user-pods-page')); pagesElement.shadowRoot.querySelector('div.active[slot="view"]');
assertFalse(pagesElement.isPresentIn_( assertEquals('user-pods-page', activeView.id);
pagesElement.selectedPage_, 'create-user-page'));
}); });
test('Change page listener works', function() { test('Change page listener works', function() {
......
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