Commit bb12d313 authored by Nnamdi Theodore Johnson-Kanu's avatar Nnamdi Theodore Johnson-Kanu Committed by Commit Bot

[CrOS cellular] Add click handler for empty network list

- Adds response to click event when no network found link is clicked in
  esim and psim internet subpage groups.

Bug: 1093185
Change-Id: Ib37f7806c19b8cf62517909d64f0570b190d615d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2515362
Commit-Queue: Nnamdi Theodore Johnson-kanu <tjohnsonkanu@google.com>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Reviewed-by: default avatarAzeem Arshad <azeemarshad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826123}
parent f0e246bb
......@@ -89,6 +89,7 @@ js_library("internet_detail_page") {
"..:metrics_recorder",
"..:os_route",
"../..:router",
"//ui/webui/resources/cr_components/chromeos/cellular_setup:cellular_types",
"//ui/webui/resources/cr_components/chromeos/network:cr_policy_network_behavior_mojo",
"//ui/webui/resources/cr_components/chromeos/network:network_apnlist",
"//ui/webui/resources/cr_components/chromeos/network:network_ip_config",
......@@ -131,6 +132,7 @@ js_library("internet_subpage") {
"..:route_origin_behavior",
"../..:router",
"../localized_link:localized_link",
"//ui/webui/resources/cr_components/chromeos/cellular_setup:cellular_types",
"//ui/webui/resources/cr_components/chromeos/network:cr_policy_network_behavior_mojo",
"//ui/webui/resources/cr_components/chromeos/network:network_listener_behavior",
"//ui/webui/resources/cr_components/chromeos/network:onc_mojo",
......@@ -189,6 +191,7 @@ js_library("cellular_setup_dialog") {
":cellular_setup_settings_delegate",
"//ui/webui/resources/cr_components/chromeos/cellular_setup:cellular_setup",
"//ui/webui/resources/cr_components/chromeos/cellular_setup:cellular_setup_delegate",
"//ui/webui/resources/cr_components/chromeos/cellular_setup:cellular_types",
"//ui/webui/resources/cr_elements/cr_dialog:cr_dialog",
]
}
......@@ -202,6 +205,7 @@ js_library("cellular_setup_settings_delegate") {
js_library("cellular_networks_list") {
deps = [
"//ui/webui/resources/cr_components/chromeos/cellular_setup:cellular_types",
"//ui/webui/resources/cr_components/chromeos/network:onc_mojo",
"//ui/webui/resources/js:i18n_behavior",
]
......@@ -357,6 +361,7 @@ js_library("internet_page.m") {
"//chrome/browser/resources/settings/settings_page:settings_subpage.m",
"//third_party/polymer/v3_0/components-chromium/iron-icon:iron-icon",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/webui/resources/cr_components/chromeos/cellular_setup:cellular_types.m",
"//ui/webui/resources/cr_components/chromeos/network:mojo_interface_provider.m",
"//ui/webui/resources/cr_components/chromeos/network:network_listener_behavior.m",
"//ui/webui/resources/cr_components/chromeos/network:onc_mojo.m",
......@@ -405,6 +410,7 @@ js_library("internet_subpage.m") {
"//third_party/polymer/v3_0/components-chromium/iron-flex-layout:iron-flex-layout-classes",
"//third_party/polymer/v3_0/components-chromium/iron-icon:iron-icon",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/webui/resources/cr_components/chromeos/cellular_setup:cellular_types.m",
"//ui/webui/resources/cr_components/chromeos/network:cr_policy_network_behavior_mojo.m",
"//ui/webui/resources/cr_components/chromeos/network:network_list.m",
"//ui/webui/resources/cr_components/chromeos/network:network_listener_behavior.m",
......@@ -491,6 +497,7 @@ js_library("cellular_networks_list.m") {
deps = [
"//chrome/browser/resources/settings/chromeos/localized_link:localized_link.m",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/webui/resources/cr_components/chromeos/cellular_setup:cellular_types.m",
"//ui/webui/resources/js:i18n_behavior.m",
]
extra_deps = [ ":cellular_networks_list_module" ]
......
......@@ -2,6 +2,7 @@
<link rel="import" href="chrome://resources/cr_components/chromeos/network/onc_mojo.html">
<link rel="import" href="chrome://resources/cr_components/chromeos/network/network_list_types.html">
<link rel="import" href="chrome://resources/cr_components/chromeos/cellular_setup/cellular_types.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html">
......
......@@ -117,11 +117,12 @@ Polymer({
* @private
*/
onEsimLearnMoreClicked_(event) {
// TODO(crbug.com/1093185): navigate to cellular dialog esim setup landing
// page
event.detail.event.preventDefault();
event.stopPropagation();
this.fire(
'show-cellular-setup',
{pageName: cellularSetup.CellularSetupPageName.ESIM_FLOW_UI});
},
/**
......@@ -129,9 +130,11 @@ Polymer({
* @private
*/
onPsimLearnMoreClicked_(event) {
// TODO(crbug.com/1093185): navigate to cellular dialog psim setup landing
// page
event.detail.event.preventDefault();
event.stopPropagation();
this.fire(
'show-cellular-setup',
{pageName: cellularSetup.CellularSetupPageName.PSIM_FLOW_UI});
},
});
......@@ -2,6 +2,7 @@
<link rel="import" href="chrome://resources/cr_components/chromeos/cellular_setup/cellular_setup.html">
<link rel="import" href="chrome://resources/cr_components/chromeos/cellular_setup/cellular_setup_delegate.html">
<link rel="import" href="chrome://resources/cr_components/chromeos/cellular_setup/cellular_types.html">
<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
......@@ -63,7 +64,8 @@
<div slot="body">
<cellular-setup
flow-title="{{dialogTitle_}}"
delegate="[[delegate_]]">
delegate="[[delegate_]]"
current-page-name="[[pageName]]">
</cellular-setup>
</div>
</cr-dialog>
......
......@@ -11,6 +11,12 @@ Polymer({
properties: {
/**
* Name of cellular dialog page to be selected.
* @type {!cellularSetup.CellularSetupPageName}
*/
pageName: String,
/**
* @private {!cellular_setup.CellularSetupDelegate}
*/
......
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_components/chromeos/cellular_setup/cellular_types.html">
<link rel="import" href="chrome://resources/cr_components/chromeos/network/mojo_interface_provider.html">
<link rel="import" href="chrome://resources/cr_components/chromeos/network/network_listener_behavior.html">
<link rel="import" href="chrome://resources/cr_components/chromeos/network/onc_mojo.html">
......@@ -155,7 +156,8 @@
<template is="dom-if" if="[[showCellularSetupDialog_]]" restamp>
<os-settings-cellular-setup-dialog id="cellularSetupDialog"
on-close="onCloseCellularSetupDialog_">
on-close="onCloseCellularSetupDialog_"
page-name="[[cellularSetupDialogPageName_]]">
</os-settings-cellular-setup-dialog>
</template>
</template>
......
......@@ -125,6 +125,12 @@ Polymer({
value: false,
},
/**
* Name of cellular setup dialog page.
* @private {!cellularSetup.CellularSetupPageName|null}
*/
cellularSetupDialogPageName_: String,
/** @private {!Map<string, Element>} */
focusConfig_: {
type: Object,
......@@ -313,9 +319,13 @@ Polymer({
}
},
/** @private */
onShowCellularSetupDialog_() {
/**
* @param {Event} event
* @private
*/
onShowCellularSetupDialog_(event) {
this.showCellularSetupDialog_ = true;
this.cellularSetupDialogPageName_ = event.detail.pageName;
},
/** @private */
......
......@@ -30,7 +30,7 @@ suite('CrComponentsCellularSetupTest', function() {
test('Page selection change', function() {
assertTrue(
cellularSetupPage.currentPageName_ ===
cellularSetupPage.currentPageName ===
cellularSetup.CellularSetupPageName.SETUP_FLOW_SELECTION);
const selectionFlow = cellularSetupPage.$$('setup-selection-flow');
......
......@@ -12,7 +12,7 @@
<template>
<iron-pages
attr-for-selected="id"
selected="[[currentPageName_]]"
selected="[[currentPageName]]"
selected-item="{{currentPage_}}">
<setup-selection-flow
selected-page="{{selectedFlow_}}"
......@@ -20,7 +20,7 @@
id="setup-selection-flow">
</setup-selection-flow>
<template is="dom-if"
if="[[isPSimSelected_(currentPageName_)]]" restamp>
if="[[isPSimSelected_(currentPageName)]]" restamp>
<psim-flow-ui
button-state="{{buttonState_}}"
name-of-carrier-pending-setup="{{flowTitle}}"
......@@ -29,7 +29,7 @@
</psim-flow-ui>
</template>
<template is="dom-if"
if="[[isESimSelected_(currentPageName_)]]" restamp>
if="[[isESimSelected_(currentPageName)]]" restamp>
<esim-flow-ui
button-state="{{buttonState_}}"
delegate="[[delegate]]"
......
......@@ -24,7 +24,7 @@ Polymer({
* Name of the currently displayed sub-page.
* @private {!cellularSetup.CellularSetupPageName|null}
*/
currentPageName_: {
currentPageName: {
type: String,
value: cellularSetup.CellularSetupPageName.SETUP_FLOW_SELECTION,
},
......
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