Commit fa0729eb authored by Gordon Seto's avatar Gordon Seto Committed by Commit Bot

[CrOS Settings] Add 'Skip & Setup new profile' button to button bar

Add UI for button to skip the profile discovery page and go to the
activation code page.

Bug: 1093185
Change-Id: I558f2df186829ddb9147dff19a0e34289fa20a34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2528142
Commit-Queue: Gordon Seto <gordonseto@google.com>
Reviewed-by: default avatarAzeem Arshad <azeemarshad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825968}
parent 8e919b58
...@@ -264,6 +264,9 @@ ...@@ -264,6 +264,9 @@
<message name="IDS_CELLULAR_SETUP_NEXT_LABEL" desc="Label for button that advances to next step during cellular setup"> <message name="IDS_CELLULAR_SETUP_NEXT_LABEL" desc="Label for button that advances to next step during cellular setup">
Next Next
</message> </message>
<message name="IDS_CELLULAR_SETUP_SKIP_DISCOVERY_LABEL" desc="Label for button that skips the multiple profile selection step and sets up a new profile during eSIM cellular setup">
Skip &amp; Set up new profile
</message>
<message name="IDS_CELLULAR_SETUP_ESIM_PAGE_ACTIVATION_CODE" desc="Label for activation code input box"> <message name="IDS_CELLULAR_SETUP_ESIM_PAGE_ACTIVATION_CODE" desc="Label for activation code input box">
Activation code Activation code
</message> </message>
......
c3e2157a5e4c36dbb471ffacb5843357522d38f5
\ No newline at end of file
...@@ -29,6 +29,7 @@ constexpr webui::LocalizedString kLocalizedStringsWithoutPlaceholders[] = { ...@@ -29,6 +29,7 @@ constexpr webui::LocalizedString kLocalizedStringsWithoutPlaceholders[] = {
IDS_CELLULAR_SETUP_ESTABLISH_NETWORK_CONNECTION}, IDS_CELLULAR_SETUP_ESTABLISH_NETWORK_CONNECTION},
{"next", IDS_CELLULAR_SETUP_NEXT_LABEL}, {"next", IDS_CELLULAR_SETUP_NEXT_LABEL},
{"tryAgain", IDS_CELLULAR_SETUP_TRY_AGAIN_LABEL}, {"tryAgain", IDS_CELLULAR_SETUP_TRY_AGAIN_LABEL},
{"skipDiscovery", IDS_CELLULAR_SETUP_SKIP_DISCOVERY_LABEL},
{"simDetectPageTitle", IDS_CELLULAR_SETUP_SIM_DETECT_PAGE_TITLE}, {"simDetectPageTitle", IDS_CELLULAR_SETUP_SIM_DETECT_PAGE_TITLE},
{"simDetectPageErrorTitle", IDS_CELLULAR_SETUP_SIM_DETECT_PAGE_ERROR_TITLE}, {"simDetectPageErrorTitle", IDS_CELLULAR_SETUP_SIM_DETECT_PAGE_ERROR_TITLE},
{"simDetectPageErrorMessage", {"simDetectPageErrorMessage",
......
...@@ -34,6 +34,7 @@ suite('CellularSetupButtonBarTest', function() { ...@@ -34,6 +34,7 @@ suite('CellularSetupButtonBarTest', function() {
next: state, next: state,
tryAgain: state, tryAgain: state,
done: state, done: state,
skipDiscovery: state,
}; };
Polymer.dom.flush(); Polymer.dom.flush();
} }
...@@ -69,6 +70,7 @@ suite('CellularSetupButtonBarTest', function() { ...@@ -69,6 +70,7 @@ suite('CellularSetupButtonBarTest', function() {
assertTrue(isButtonShownAndEnabled(buttonBar.$$('#tryAgain'))); assertTrue(isButtonShownAndEnabled(buttonBar.$$('#tryAgain')));
assertTrue(isButtonShownAndEnabled(buttonBar.$$('#next'))); assertTrue(isButtonShownAndEnabled(buttonBar.$$('#next')));
assertTrue(isButtonShownAndEnabled(buttonBar.$$('#done'))); assertTrue(isButtonShownAndEnabled(buttonBar.$$('#done')));
assertTrue(isButtonShownAndEnabled(buttonBar.$$('#skipDiscovery')));
}); });
test('individual buttons appear but are diabled', function() { test('individual buttons appear but are diabled', function() {
...@@ -78,6 +80,7 @@ suite('CellularSetupButtonBarTest', function() { ...@@ -78,6 +80,7 @@ suite('CellularSetupButtonBarTest', function() {
assertTrue(isButtonShownAndDisabled(buttonBar.$$('#tryAgain'))); assertTrue(isButtonShownAndDisabled(buttonBar.$$('#tryAgain')));
assertTrue(isButtonShownAndDisabled(buttonBar.$$('#next'))); assertTrue(isButtonShownAndDisabled(buttonBar.$$('#next')));
assertTrue(isButtonShownAndDisabled(buttonBar.$$('#done'))); assertTrue(isButtonShownAndDisabled(buttonBar.$$('#done')));
assertTrue(isButtonShownAndDisabled(buttonBar.$$('#skipDiscovery')));
}); });
test('individual buttons are hidden', function() { test('individual buttons are hidden', function() {
...@@ -87,5 +90,6 @@ suite('CellularSetupButtonBarTest', function() { ...@@ -87,5 +90,6 @@ suite('CellularSetupButtonBarTest', function() {
assertTrue(isButtonHidden(buttonBar.$$('#tryAgain'))); assertTrue(isButtonHidden(buttonBar.$$('#tryAgain')));
assertTrue(isButtonHidden(buttonBar.$$('#next'))); assertTrue(isButtonHidden(buttonBar.$$('#next')));
assertTrue(isButtonHidden(buttonBar.$$('#done'))); assertTrue(isButtonHidden(buttonBar.$$('#done')));
assertTrue(isButtonHidden(buttonBar.$$('#skipDiscovery')));
}); });
}); });
...@@ -30,6 +30,13 @@ ...@@ -30,6 +30,13 @@
[[i18n('back')]] [[i18n('back')]]
</cr-button> </cr-button>
<div id="flex"></div> <div id="flex"></div>
<cr-button id="cancel"
class="cancel-button"
on-click="onCancelButtonClicked_"
disabled="[[isButtonDisabled_(Button.CANCEL, buttonState.*)]]"
hidden$="[[isButtonHidden_(Button.CANCEL, buttonState.*)]]">
[[i18n('cancel')]]
</cr-button>
<cr-button id="tryAgain" <cr-button id="tryAgain"
class="action-button" class="action-button"
on-click="onTryAgainButtonClicked_" on-click="onTryAgainButtonClicked_"
...@@ -38,18 +45,18 @@ ...@@ -38,18 +45,18 @@
[[i18n('tryAgain')]] [[i18n('tryAgain')]]
</cr-button> </cr-button>
<cr-button id="done" <cr-button id="done"
class="action-button" class="action-button"
on-click="onDoneButtonClicked_" on-click="onDoneButtonClicked_"
disabled="[[isButtonDisabled_(Button.DONE, buttonState.*)]]" disabled="[[isButtonDisabled_(Button.DONE, buttonState.*)]]"
hidden$="[[isButtonHidden_(Button.DONE, buttonState.*)]]"> hidden$="[[isButtonHidden_(Button.DONE, buttonState.*)]]">
[[i18n('done')]] [[i18n('done')]]
</cr-button> </cr-button>
<cr-button id="cancel" <cr-button id="skipDiscovery"
class="cancel-button" class="action-button"
on-click="onCancelButtonClicked_" on-click="onNextButtonClicked_"
disabled="[[isButtonDisabled_(Button.CANCEL, buttonState.*)]]" disabled="[[isButtonDisabled_(Button.SKIP_DISCOVERY, buttonState.*)]]"
hidden$="[[isButtonHidden_(Button.CANCEL, buttonState.*)]]"> hidden$="[[isButtonHidden_(Button.SKIP_DISCOVERY, buttonState.*)]]">
[[i18n('cancel')]] [[i18n('skipDiscovery')]]
</cr-button> </cr-button>
<cr-button id="next" <cr-button id="next"
class="action-button" class="action-button"
......
...@@ -89,6 +89,8 @@ Polymer({ ...@@ -89,6 +89,8 @@ Polymer({
return this.buttonState.next; return this.buttonState.next;
case cellularSetup.Button.TRY_AGAIN: case cellularSetup.Button.TRY_AGAIN:
return this.buttonState.tryAgain; return this.buttonState.tryAgain;
case cellularSetup.Button.SKIP_DISCOVERY:
return this.buttonState.skipDiscovery;
default: default:
assertNotReached(); assertNotReached();
return cellularSetup.ButtonState.SHOWN_AND_ENABLED; return cellularSetup.ButtonState.SHOWN_AND_ENABLED;
......
...@@ -27,6 +27,7 @@ cr.define('cellularSetup', function() { ...@@ -27,6 +27,7 @@ cr.define('cellularSetup', function() {
DONE: 3, DONE: 3,
NEXT: 4, NEXT: 4,
TRY_AGAIN: 5, TRY_AGAIN: 5,
SKIP_DISCOVERY: 6,
}; };
/** /**
...@@ -36,6 +37,7 @@ cr.define('cellularSetup', function() { ...@@ -36,6 +37,7 @@ cr.define('cellularSetup', function() {
* done: (!cellularSetup.ButtonState|undefined), * done: (!cellularSetup.ButtonState|undefined),
* next: (!cellularSetup.ButtonState|undefined), * next: (!cellularSetup.ButtonState|undefined),
* tryAgain: (!cellularSetup.ButtonState|undefined), * tryAgain: (!cellularSetup.ButtonState|undefined),
* skipDiscovery: (!cellularSetup.ButtonState|undefined),
* }} * }}
*/ */
/* #export */ let ButtonBarState; /* #export */ let ButtonBarState;
......
...@@ -54,7 +54,8 @@ cr.define('cellular_setup', function() { ...@@ -54,7 +54,8 @@ cr.define('cellular_setup', function() {
cellularSetup.ButtonState.HIDDEN, cellularSetup.ButtonState.HIDDEN,
done: cellularSetup.ButtonState.HIDDEN, done: cellularSetup.ButtonState.HIDDEN,
next: cellularSetup.ButtonState.SHOWN_BUT_DISABLED, next: cellularSetup.ButtonState.SHOWN_BUT_DISABLED,
tryAgain: cellularSetup.ButtonState.HIDDEN tryAgain: cellularSetup.ButtonState.HIDDEN,
skipDiscovery: cellularSetup.ButtonState.HIDDEN,
}; };
}, },
......
...@@ -212,6 +212,7 @@ cr.define('cellularSetup', function() { ...@@ -212,6 +212,7 @@ cr.define('cellularSetup', function() {
done: cellularSetup.ButtonState.HIDDEN, done: cellularSetup.ButtonState.HIDDEN,
next: cellularSetup.ButtonState.SHOWN_BUT_DISABLED, next: cellularSetup.ButtonState.SHOWN_BUT_DISABLED,
tryAgain: cellularSetup.ButtonState.HIDDEN, tryAgain: cellularSetup.ButtonState.HIDDEN,
skipDiscovery: cellularSetup.ButtonState.HIDDEN,
}; };
break; break;
case PSimUIState.ACTIVATION_SUCCESS: case PSimUIState.ACTIVATION_SUCCESS:
...@@ -223,6 +224,7 @@ cr.define('cellularSetup', function() { ...@@ -223,6 +224,7 @@ cr.define('cellularSetup', function() {
done: cellularSetup.ButtonState.HIDDEN, done: cellularSetup.ButtonState.HIDDEN,
next: cellularSetup.ButtonState.SHOWN_AND_ENABLED, next: cellularSetup.ButtonState.SHOWN_AND_ENABLED,
tryAgain: cellularSetup.ButtonState.HIDDEN, tryAgain: cellularSetup.ButtonState.HIDDEN,
skipDiscovery: cellularSetup.ButtonState.HIDDEN,
}; };
break; break;
case PSimUIState.WAITING_FOR_ACTIVATION_TO_FINISH: case PSimUIState.WAITING_FOR_ACTIVATION_TO_FINISH:
...@@ -233,6 +235,7 @@ cr.define('cellularSetup', function() { ...@@ -233,6 +235,7 @@ cr.define('cellularSetup', function() {
done: cellularSetup.ButtonState.SHOWN_AND_ENABLED, done: cellularSetup.ButtonState.SHOWN_AND_ENABLED,
next: cellularSetup.ButtonState.HIDDEN, next: cellularSetup.ButtonState.HIDDEN,
tryAgain: cellularSetup.ButtonState.HIDDEN, tryAgain: cellularSetup.ButtonState.HIDDEN,
skipDiscovery: cellularSetup.ButtonState.HIDDEN,
}; };
break; break;
default: default:
......
...@@ -47,7 +47,8 @@ Polymer({ ...@@ -47,7 +47,8 @@ Polymer({
backward: cellularSetup.ButtonState.HIDDEN, backward: cellularSetup.ButtonState.HIDDEN,
cancel: cellularSetup.ButtonState.SHOWN_AND_ENABLED, cancel: cellularSetup.ButtonState.SHOWN_AND_ENABLED,
done: cellularSetup.ButtonState.HIDDEN, done: cellularSetup.ButtonState.HIDDEN,
tryAgain: cellularSetup.ButtonState.HIDDEN tryAgain: cellularSetup.ButtonState.HIDDEN,
skipDiscovery: cellularSetup.ButtonState.HIDDEN,
}; };
if (selectedPage === cellularSetup.CellularSetupPageName.PSIM_FLOW_UI || if (selectedPage === cellularSetup.CellularSetupPageName.PSIM_FLOW_UI ||
selectedPage === cellularSetup.CellularSetupPageName.ESIM_FLOW_UI) { selectedPage === cellularSetup.CellularSetupPageName.ESIM_FLOW_UI) {
......
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