@robotical/webapp-types 3.16.26 → 3.16.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-types/src/application/ApplicationManager/ApplicationManager.js +25 -4
- package/dist-types/src/components/modals/DisconnectConfirmation/index.js +2 -2
- package/dist-types/src/components/modals/DisconnectConfirmation/styles.d.ts +1 -0
- package/dist-types/src/components/modals/DisconnectConfirmation/styles.js +3 -2
- package/dist-types/src/components/modals/InBtButAPressed/index.js +1 -1
- package/dist-types/src/components/modals/LEDLightsOrQRVerificationModal/index.js +2 -1
- package/dist-types/src/components/modals/VerificationModalPhoneApp/index.js +2 -2
- package/dist-types/src/i18n.js +30 -27
- package/dist-types/src/state-observables/modal/ModalObserver.d.ts +3 -0
- package/dist-types/src/state-observables/modal/ModalState.d.ts +5 -2
- package/dist-types/src/state-observables/modal/ModalState.js +17 -3
- package/dist-types/src/store/SelectedRaftContext.js +1 -1
- package/dist-types/src/utils/feedback/feedbackConnectionEligibility.d.ts +1 -1
- package/dist-types/src/utils/feedback/feedbackConnectionEligibility.js +1 -1
- package/dist-types/src/utils/feedback/submitFeedback.js +2 -2
- package/package.json +1 -1
|
@@ -60,6 +60,20 @@ import i18n from "../../i18n";
|
|
|
60
60
|
import InUnpluggedModalContent from "../../components/modals/InUnplugged";
|
|
61
61
|
var SHOW_LOGS = true;
|
|
62
62
|
var TAG = "ApplicationManager";
|
|
63
|
+
var UNSUPPORTED_WEB_BLUETOOTH_BROWSER_MESSAGE = "This browser can't connect to Marty or Cog over Bluetooth. Please use Chrome or Edge, or use the iPad app.";
|
|
64
|
+
var canUseWebBluetooth = function () {
|
|
65
|
+
var bluetooth = navigator.bluetooth;
|
|
66
|
+
return window.isSecureContext && !!bluetooth && typeof bluetooth.requestDevice === "function";
|
|
67
|
+
};
|
|
68
|
+
var getModalLogoForRaftType = function (raftType) {
|
|
69
|
+
if (raftType === RaftTypeE.COG) {
|
|
70
|
+
return "cog";
|
|
71
|
+
}
|
|
72
|
+
if (raftType === RaftTypeE.MARTY) {
|
|
73
|
+
return "marty";
|
|
74
|
+
}
|
|
75
|
+
return "none";
|
|
76
|
+
};
|
|
63
77
|
var ApplicationManager = /** @class */ (function () {
|
|
64
78
|
function ApplicationManager() {
|
|
65
79
|
// locale
|
|
@@ -408,17 +422,24 @@ var ApplicationManager = /** @class */ (function () {
|
|
|
408
422
|
ApplicationManager.prototype.connectGeneric = function (afterRaftConnectedCb, uuids, shouldShowQrModal) {
|
|
409
423
|
if (shouldShowQrModal === void 0) { shouldShowQrModal = true; }
|
|
410
424
|
return __awaiter(this, void 0, void 0, function () {
|
|
411
|
-
var verificationMethod, isQRVerification, e_1, newRaft, e_2;
|
|
425
|
+
var verificationMethod, cancelVerificationResult, isQRVerification, e_1, newRaft, e_2;
|
|
412
426
|
var _this = this;
|
|
413
427
|
return __generator(this, function (_a) {
|
|
414
428
|
switch (_a.label) {
|
|
415
429
|
case 0:
|
|
430
|
+
if (!isPhoneApp() && !canUseWebBluetooth()) {
|
|
431
|
+
this.toaster.error(i18n.t("connection.unsupported_web_bluetooth_browser", {
|
|
432
|
+
defaultValue: UNSUPPORTED_WEB_BLUETOOTH_BROWSER_MESSAGE,
|
|
433
|
+
}), { autoClose: false });
|
|
434
|
+
return [2 /*return*/];
|
|
435
|
+
}
|
|
416
436
|
verificationMethod = { action: "led" };
|
|
417
437
|
if (!shouldShowQrModal) return [3 /*break*/, 2];
|
|
438
|
+
cancelVerificationResult = { action: "cancel" };
|
|
418
439
|
return [4 /*yield*/, modalState.setModal(createElement(LEDLightsOrQRVerificationModal, {
|
|
419
440
|
targetRaftType: RaftTypeE.COG,
|
|
420
441
|
allowSwitchToMarty: true,
|
|
421
|
-
}), i18n.t("connection.verification_method"))];
|
|
442
|
+
}), i18n.t("connection.verification_method"), true, true, cancelVerificationResult)];
|
|
422
443
|
case 1:
|
|
423
444
|
verificationMethod =
|
|
424
445
|
(_a.sent()) || { action: "cancel" };
|
|
@@ -503,7 +524,7 @@ var ApplicationManager = /** @class */ (function () {
|
|
|
503
524
|
case 0:
|
|
504
525
|
_a.trys.push([0, 4, , 5]);
|
|
505
526
|
if (!!skipConfirmation) return [3 /*break*/, 2];
|
|
506
|
-
return [4 /*yield*/, modalState.setModal(createElement(DisconnectConfirmationModal), "Are you sure you want to disconnect from your ".concat(raft.getFriendlyName(), "?"))];
|
|
527
|
+
return [4 /*yield*/, modalState.setModal(createElement(DisconnectConfirmationModal), "Are you sure you want to disconnect from your ".concat(raft.getFriendlyName(), "?"), getModalLogoForRaftType(raft.type))];
|
|
507
528
|
case 1:
|
|
508
529
|
confirmDisconnect = _a.sent();
|
|
509
530
|
if (!confirmDisconnect) {
|
|
@@ -758,7 +779,7 @@ var ApplicationManager = /** @class */ (function () {
|
|
|
758
779
|
foundRICs = [];
|
|
759
780
|
notFoundTimeout = setTimeout(function () {
|
|
760
781
|
if (foundRICs.length === 0) {
|
|
761
|
-
_this.toaster.error("Make sure the
|
|
782
|
+
_this.toaster.error("Make sure the device is powered on and in range!");
|
|
762
783
|
}
|
|
763
784
|
window.applicationManager.stopDiscovery();
|
|
764
785
|
secondaryModalState.closeModalWithoutAnimation();
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import modalState from "../../../state-observables/modal/ModalState";
|
|
3
3
|
import { RED } from "../../../styles/colors";
|
|
4
4
|
import SimpleButton from "../../disposables/buttons/SimpleButton";
|
|
5
|
-
import { Container } from "./styles";
|
|
5
|
+
import { ButtonRow, Container } from "./styles";
|
|
6
6
|
export default function DisconnectConfirmationModal() {
|
|
7
|
-
return (
|
|
7
|
+
return (_jsx(Container, { children: _jsxs(ButtonRow, { children: [_jsx(SimpleButton, { onClick: function () { return modalState.closeModal(false); }, title: "Cancel" }), _jsx(SimpleButton, { onClick: function () { return modalState.closeModal(true); }, title: "Disconnect", colour: RED })] }) }));
|
|
8
8
|
}
|
|
@@ -3,5 +3,6 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
return cooked;
|
|
4
4
|
};
|
|
5
5
|
import styled from "styled-components";
|
|
6
|
-
export var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: grid;\n
|
|
7
|
-
var
|
|
6
|
+
export var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: grid;\n justify-items: center;\n row-gap: 1.5rem;\n"], ["\n display: grid;\n justify-items: center;\n row-gap: 1.5rem;\n"])));
|
|
7
|
+
export var ButtonRow = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: grid;\n grid-auto-flow: column;\n column-gap: 2rem;\n width: 100%;\n\n @media (max-width: 480px) {\n grid-auto-flow: row;\n row-gap: 1rem;\n }\n"], ["\n display: grid;\n grid-auto-flow: column;\n column-gap: 2rem;\n width: 100%;\n\n @media (max-width: 480px) {\n grid-auto-flow: row;\n row-gap: 1rem;\n }\n"])));
|
|
8
|
+
var templateObject_1, templateObject_2;
|
|
@@ -16,6 +16,6 @@ function InBtButAPressedModalContent() {
|
|
|
16
16
|
modalState.closeModal();
|
|
17
17
|
}, 1000);
|
|
18
18
|
};
|
|
19
|
-
return (_jsxs(StyledView, { children: [_jsx(ModalTitle, { children: modalText }), modalText !== "Disconnected!" && (_jsx(ModalText, { children: "Someone has pressed the \"MODE\"/\"A\" button on
|
|
19
|
+
return (_jsxs(StyledView, { children: [_jsx(ModalTitle, { children: modalText }), modalText !== "Disconnected!" && (_jsx(ModalText, { children: "Someone has pressed the \"MODE\"/\"A\" button on Marty, if you would like to change mode you must first disconnect from the app and then press the A again!" })), _jsx(StyledImage, { src: imageAbutton }), modalText !== "Disconnected!" && (_jsxs(ButtonsView, { children: [_jsx(SimpleButton, { title: "Cancel", onClick: function () { return modalState.closeModal(); } }), _jsx(SimpleButton, { title: "Disconnect", onClick: disconnectHandler })] }))] }));
|
|
20
20
|
}
|
|
21
21
|
export default InBtButAPressedModalContent;
|
|
@@ -64,6 +64,7 @@ export default function LEDLightsOrQRVerificationModal(_a) {
|
|
|
64
64
|
var _c = useState(true), qrSelected = _c[0], setQRSelected = _c[1];
|
|
65
65
|
var _d = useState(undefined), serialNoFromQR = _d[0], setSerialNoFromQR = _d[1];
|
|
66
66
|
var _e = useState(false), isButtonToConnectVisible = _e[0], setIsButtonToConnectVisible = _e[1];
|
|
67
|
+
var cancelResult = { action: "cancel" };
|
|
67
68
|
useEffect(function () {
|
|
68
69
|
if (serialNoFromQR) {
|
|
69
70
|
setIsButtonToConnectVisible(true);
|
|
@@ -112,7 +113,7 @@ export default function LEDLightsOrQRVerificationModal(_a) {
|
|
|
112
113
|
var id = _a.id, title = _a.title, subtitle = _a.subtitle, icon = _a.icon;
|
|
113
114
|
return (_jsxs("button", __assign({ type: "button", className: qrSelected && id === 'qr' ? [styles.card, styles.qrselected].join(" ") : styles.card, onClick: function () { return handleSelect(id); }, "aria-label": title, "aria-pressed": id === "qr" ? qrSelected : false }, { children: [_jsx("div", __assign({ className: styles.icon }, { children: icon })), _jsx("h3", __assign({ className: styles.title }, { children: title })), _jsx("p", __assign({ className: styles.subtitle }, { children: subtitle }))] }), id));
|
|
114
115
|
}) })) :
|
|
115
|
-
_jsx("div", __assign({ className: styles.cogNote }, { children: _jsxs("strong", { children: ["Don't forget to ", _jsx("span", __assign({ className: styles.cogNoteHighlight }, { children: "turn on" })), " your Cog!"] }) }))] }), qrSelected && _jsx(QRContent, { setSerialNo: setSerialNoFromQR }), _jsxs("div", __assign({ className: styles.buttonsContainer }, { children: [isButtonToConnectVisible && _jsx("button", __assign({ type: "button", className: styles.connectButton, onClick: handleConnect }, { children: t('connection.qr_connect_button') })), _jsx("button", __assign({ type: "button", className: styles.cancelButton, onClick: function () { return modalState.closeModal(
|
|
116
|
+
_jsx("div", __assign({ className: styles.cogNote }, { children: _jsxs("strong", { children: ["Don't forget to ", _jsx("span", __assign({ className: styles.cogNoteHighlight }, { children: "turn on" })), " your Cog!"] }) }))] }), qrSelected && _jsx(QRContent, { setSerialNo: setSerialNoFromQR }), _jsxs("div", __assign({ className: styles.buttonsContainer }, { children: [isButtonToConnectVisible && _jsx("button", __assign({ type: "button", className: styles.connectButton, onClick: handleConnect }, { children: t('connection.qr_connect_button') })), _jsx("button", __assign({ type: "button", className: styles.cancelButton, onClick: function () { return modalState.closeModal(cancelResult); } }, { children: t('connection.cancel') }))] }))] })));
|
|
116
117
|
}
|
|
117
118
|
function QRContent(_a) {
|
|
118
119
|
var _this = this;
|
|
@@ -215,11 +215,11 @@ function VerificationModalPhoneApp(_a) {
|
|
|
215
215
|
}); };
|
|
216
216
|
var contentJSX = null;
|
|
217
217
|
if (foundRICsState.length === 0) {
|
|
218
|
-
contentJSX = _jsxs("div", __assign({ className: "verification-modal-container" }, { children: [!isScanning && _jsx("p", __assign({ style: { alignSelf: 'center' } }, { children: t("verification_modal_phone.no_robots_found", "No
|
|
218
|
+
contentJSX = _jsxs("div", __assign({ className: "verification-modal-container" }, { children: [!isScanning && _jsx("p", __assign({ style: { alignSelf: 'center' } }, { children: t("verification_modal_phone.no_robots_found", "No devices found") })), _jsx("div", __assign({ className: "verification-modal-martys-container" }, { children: isScanning && _jsxs("div", __assign({ style: { margin: "auto", width: "50px", height: "50px" } }, { children: [" ", _jsx(LoadingSpinner, {}), " "] })) })), _jsxs("div", __assign({ className: "verification-modal-bottom-btns-container" }, { children: [_jsx(SVGImageButton, { onClick: onScanAgain, title: t("verification_modal_phone.scan_again", "SCAN AGAIN"), SVGImage: RefreshSVG, backgroundColour: MAIN_BLUE, titleColour: WHITE, SVGColour: WHITE }), _jsx("div", { className: "dummy-gap" }), _jsx(SimpleButton, { onClick: onCancel, title: t("verification_modal_phone.cancel", "CANCEL") })] }))] }));
|
|
219
219
|
}
|
|
220
220
|
else {
|
|
221
221
|
contentJSX = _jsxs("div", __assign({ className: "verification-modal-container" }, { children: [_jsxs("div", __assign({ className: "verification-modal-martys-container" }, { children: [isScanning && _jsxs("div", __assign({ style: { margin: "auto", width: "50px", height: "50px" } }, { children: [" ", _jsx(LoadingSpinner, {}), " "] })), foundRICsState.map(function (raftObj, raftIdx) {
|
|
222
|
-
return _jsxs(Fragment, { children: [_jsxs("button", __assign({ type: "button", className: "verification-modal-marty-name-row-container", onClick: function () { return onSelectRaft(raftIdx); }, "aria-label": "".concat(t("verification_modal_phone.select_robot", "Select
|
|
222
|
+
return _jsxs(Fragment, { children: [_jsxs("button", __assign({ type: "button", className: "verification-modal-marty-name-row-container", onClick: function () { return onSelectRaft(raftIdx); }, "aria-label": "".concat(t("verification_modal_phone.select_robot", "Select device"), " ").concat(raftObj._localName) }, { children: [_jsx("p", __assign({ className: "verification-modal-marty-name" }, { children: raftObj._localName })), _jsx("div", __assign({ className: "verification-modal-marty-signal-container" }, { children: _jsx(RICSignal, { signalStrength: raftObj._rssi }) })), _jsx(BluetoothSVG, { fill: MAIN_BLUE, "aria-hidden": "true" })] })), selectedRICIdx === raftIdx && _jsxs("div", { children: [_jsx("p", __assign({ className: "verification-modal-martys-back-hint" }, { children: isLoading ? t("verification_modal_phone.loading", "Loading...") : t("verification_modal_phone.look_on_back", { raftType: connectedRaft === null || connectedRaft === void 0 ? void 0 : connectedRaft.type }) })), _jsxs("div", __assign({ className: "verification-modal-led-row-container" }, { children: [_jsx(LEDs, { coloursArr: randomColours, connectedRaft: connectedRaft }), !isLoading && _jsx(SimpleButton, { onClick: onCancel, title: t("verification_modal_phone.no", "No"), borderColour: "red", colour: "white", textColour: "red" }), !isLoading && _jsx(SimpleButton, { onClick: onYes, title: t("connection.yes") })] }))] })] }, raftIdx);
|
|
223
223
|
})] })), _jsxs("div", __assign({ className: "verification-modal-bottom-btns-container" }, { children: [_jsx(SVGImageButton, { onClick: onScanAgain, title: t("connection.scan_again"), SVGImage: RefreshSVG, backgroundColour: MAIN_BLUE, titleColour: WHITE, SVGColour: WHITE, disabled: isScanning }), _jsx("div", { className: "dummy-gap" }), _jsx(SimpleButton, { onClick: onCancel, title: t("connection.cancel") })] }))] }));
|
|
224
224
|
}
|
|
225
225
|
return contentJSX;
|
package/dist-types/src/i18n.js
CHANGED
|
@@ -134,7 +134,7 @@ var resources = {
|
|
|
134
134
|
"analytics": {
|
|
135
135
|
"accept": "YES, I ACCEPT!",
|
|
136
136
|
"analytics_consent_modal_title": "Help Us Improve!",
|
|
137
|
-
"info_1": "To help us improve your experience, we’d like to gather some info about your
|
|
137
|
+
"info_1": "To help us improve your experience, we’d like to gather some info about your device and the features of the app you use. Using this app requires us to store a session cookie in your device storage. The cookie doesn’t contain any personal information and simply lets our app remember your device between sessions.",
|
|
138
138
|
"info_2": "All data is strictly anonymous, confidential, and will never be shared outside of Robotical.",
|
|
139
139
|
"info_3": "Any questions, let us know at hello@robotical.io.",
|
|
140
140
|
"more_info": "MORE INFORMATION",
|
|
@@ -162,7 +162,7 @@ var resources = {
|
|
|
162
162
|
"calibrating_white": "Calibrating on white surface...",
|
|
163
163
|
"finish_calibration": "Finish Calibration",
|
|
164
164
|
"lift_in_air": "Lift Marty about 30cm into the air, then start calibration.",
|
|
165
|
-
"lift_in_air_warning": "
|
|
165
|
+
"lift_in_air_warning": "Marty is not in the air. Please lift it up.",
|
|
166
166
|
"lift_in_air_error": "Please lift Marty into the air and try again.",
|
|
167
167
|
"place_on_white_finish": "Place Marty on a white surface and finish calibration!",
|
|
168
168
|
"start_air_calibration": "Start Air Calibration",
|
|
@@ -196,6 +196,7 @@ var resources = {
|
|
|
196
196
|
"cog_configuration": {
|
|
197
197
|
"coming_soon": "Coming Soon...",
|
|
198
198
|
"not_supported": "Cog configuration is not supported on this device.",
|
|
199
|
+
"update_cog_ipad_message": "Cog updates cannot run from this iPad. Open {{updateUrl}} in Chrome on a laptop, desktop, or Chromebook, then connect Cog to that computer with a USB cable.",
|
|
199
200
|
"update_cog_link": "You can update your Cog <0>here</0>.",
|
|
200
201
|
"your_cog_version": "Your Cog Version is",
|
|
201
202
|
"up_to_date": "Cog up to date"
|
|
@@ -217,6 +218,7 @@ var resources = {
|
|
|
217
218
|
"update_marty": "Update Your Marty",
|
|
218
219
|
"wifi": "Wifi",
|
|
219
220
|
"marty_up_to_date": "Marty up to date",
|
|
221
|
+
"update_marty_ipad_message": "Marty updates cannot run from this iPad. Open {{updateUrl}} in Chrome on a laptop, desktop, or Chromebook, then connect Marty to that computer with a USB cable.",
|
|
220
222
|
"update_marty_link": "You can update your Marty <0>here</0>."
|
|
221
223
|
},
|
|
222
224
|
"connection": {
|
|
@@ -225,11 +227,11 @@ var resources = {
|
|
|
225
227
|
"unplugged_modal_body": "Your Marty is currently in unplugged mode. If you want to dissconect Marty from unplugged mode, please press the \"MODE\"/\"A\" button on the back of Marty and try again!",
|
|
226
228
|
"unplugged_modal_button": "Got it!",
|
|
227
229
|
"cancel": "Cancel",
|
|
228
|
-
"choose_robot_cta": "Choose
|
|
229
|
-
"choose_robot_prompt": "Choose the
|
|
230
|
-
"choose_robot_title": "Choose a
|
|
230
|
+
"choose_robot_cta": "Choose device to connect",
|
|
231
|
+
"choose_robot_prompt": "Choose the device you want to connect.",
|
|
232
|
+
"choose_robot_title": "Choose a Device",
|
|
231
233
|
"cog_verification_prompt": "Choose how you want to verify your Cog connection.",
|
|
232
|
-
"connect_another_robot": "Connect another
|
|
234
|
+
"connect_another_robot": "Connect another device",
|
|
233
235
|
"connect_cog": "Connect Cog",
|
|
234
236
|
"connect_cog_subtitle": "Choose Bluetooth verification with LED lights or QR.",
|
|
235
237
|
"connect_marty": "Connect Marty",
|
|
@@ -238,6 +240,7 @@ var resources = {
|
|
|
238
240
|
"connecting_to": "Connecting to",
|
|
239
241
|
"connecting_loading": "This shouldn't take long!",
|
|
240
242
|
"connecting_msg": "Connecting...",
|
|
243
|
+
"unsupported_web_bluetooth_browser": "This browser can't connect to Marty or Cog over Bluetooth. Please use Chrome or Edge, or use the iPad app.",
|
|
241
244
|
"led_subtitle": "Check LED signals for verification.",
|
|
242
245
|
"led_title": "LED Lights Verification",
|
|
243
246
|
"looking_for_raft": "Looking for {{raftType}}...",
|
|
@@ -294,7 +297,7 @@ var resources = {
|
|
|
294
297
|
"title": "HELP & SUPPORT",
|
|
295
298
|
"troubleshooting_bluetooth": "Please make sure that your device's bluetooth is turned on.",
|
|
296
299
|
"troubleshooting_heading": "Troubleshooting:",
|
|
297
|
-
"troubleshooting_robot": "Make sure your
|
|
300
|
+
"troubleshooting_robot": "Make sure your device is on with Bluetooth enabled and that you are nearby.",
|
|
298
301
|
"warranty_dashboard": "Warranty Service Dashboard",
|
|
299
302
|
"warranty_registration": "Warranty Service Registration",
|
|
300
303
|
"translation_credits": "Translation Credits"
|
|
@@ -326,39 +329,39 @@ var resources = {
|
|
|
326
329
|
"activities": "Activities",
|
|
327
330
|
"games": "Cog Games",
|
|
328
331
|
"home": "Home",
|
|
329
|
-
"not_connected_robot_msg_for_configuration_page": "Oops! It looks like you’re not connected to a
|
|
332
|
+
"not_connected_robot_msg_for_configuration_page": "Oops! It looks like you’re not connected to a device. Connect to a device via Bluetooth to access the configuration page"
|
|
330
333
|
},
|
|
331
334
|
"report_issue": {
|
|
332
335
|
"app_issue_desc": "Report an application issue.",
|
|
333
336
|
"app_issue_title": "App Issue",
|
|
334
337
|
"cancel": "Cancel",
|
|
335
|
-
"robot_issue_desc": "Report a
|
|
336
|
-
"robot_issue_register": "Register your
|
|
337
|
-
"robot_issue_title": "
|
|
338
|
+
"robot_issue_desc": "Report a device issue.",
|
|
339
|
+
"robot_issue_register": "Register your device in the service program to report a device issue.",
|
|
340
|
+
"robot_issue_title": "Device Issue",
|
|
338
341
|
"title": "What type of issue you'd like to report"
|
|
339
342
|
},
|
|
340
343
|
"select_all": "Select All",
|
|
341
344
|
"service_program": {
|
|
342
|
-
"add_another_robot_bt": "Add Another
|
|
343
|
-
"add_more_robots": "Add more
|
|
344
|
-
"add_more_robots_info_bt_1": "Turn on your
|
|
345
|
-
"add_more_robots_info_bt_2": "Repeat this process for each additional
|
|
346
|
-
"add_more_robots_info_paragraph": "Please scan the code on the
|
|
347
|
-
"add_more_robots_info_title": "Effortlessly add multiple
|
|
348
|
-
"add_more_robots_title": "Add more
|
|
349
|
-
"add_more_robots_tooltip": "Add more
|
|
350
|
-
"add_robots_bt": "Add
|
|
351
|
-
"add_robots_qr": "Add
|
|
345
|
+
"add_another_robot_bt": "Add Another Device via Bluetooth",
|
|
346
|
+
"add_more_robots": "Add more devices",
|
|
347
|
+
"add_more_robots_info_bt_1": "Turn on your device, click the \"Add Another Device\" button and select it from the list of available devices.",
|
|
348
|
+
"add_more_robots_info_bt_2": "Repeat this process for each additional device you wish to associate with the warranty account.",
|
|
349
|
+
"add_more_robots_info_paragraph": "Please scan the code on the device (if there is no code, please use the Bluetooth method)",
|
|
350
|
+
"add_more_robots_info_title": "Effortlessly add multiple devices to the same warranty account by following these simple steps.",
|
|
351
|
+
"add_more_robots_title": "Add more devices",
|
|
352
|
+
"add_more_robots_tooltip": "Add more devices associated with this email and school.",
|
|
353
|
+
"add_robots_bt": "Add Devices via Bluetooth",
|
|
354
|
+
"add_robots_qr": "Add Devices via QR Code",
|
|
352
355
|
"after_registration_bold": "After",
|
|
353
|
-
"after_registration_info": "registration is complete, you can visit the Warranty Dashboard to manage your
|
|
356
|
+
"after_registration_info": "registration is complete, you can visit the Warranty Dashboard to manage your devices, view their warranty status, manage analytics consent, and more.",
|
|
354
357
|
"agree_terms_prefix": "I agree to the",
|
|
355
358
|
"cancel": "Cancel",
|
|
356
|
-
"connect_or_add_robot": "Please connect to a
|
|
359
|
+
"connect_or_add_robot": "Please connect to a device or click 'Add More Devices' to add additional devices.",
|
|
357
360
|
"email_label": "Email:",
|
|
358
361
|
"email_send_error": "Something went wrong while sending the email. Please try again later.",
|
|
359
362
|
"enter_email": "Please enter a valid email address.",
|
|
360
363
|
"getting_serials": "Getting serial numbers...",
|
|
361
|
-
"info_paragraph_1": "Your Marty comes with a free 2 years warranty - please activate it by linking your
|
|
364
|
+
"info_paragraph_1": "Your Marty comes with a free 2 years warranty - please activate it by linking your Marty to an e-mail address.",
|
|
362
365
|
"info_title": "Activate Marty's Warranty",
|
|
363
366
|
"info_why_error": "If you report an error through the app, we'll reach out through this email address. Please use the best e-mail address to discuss technical support for your Martys. This address will only be used for support-related communication.",
|
|
364
367
|
"info_why_fault": "If your Marty develops a fault, an error log can be sent to Robotical so we can fix the issue immediately or get you a replacement.",
|
|
@@ -366,7 +369,7 @@ var resources = {
|
|
|
366
369
|
"must_agree_terms": "You must agree to the warranty terms to use this service.",
|
|
367
370
|
"registering": "Registering...",
|
|
368
371
|
"registration_email_sent": "Registration email sent to {{email}}! To complete the registration, please click the link in the email.",
|
|
369
|
-
"scanning": "Scanning for more
|
|
372
|
+
"scanning": "Scanning for more devices...",
|
|
370
373
|
"school_label": "School/Establishment (if applicable):",
|
|
371
374
|
"serial_already_registered": "Serial number {{serial}} is already registered. It will not be added to the list.",
|
|
372
375
|
"serial_label": "Serial Number(s):",
|
|
@@ -384,7 +387,7 @@ var resources = {
|
|
|
384
387
|
"student": "I am a student",
|
|
385
388
|
"student_desc": "Play, Program and Learn!",
|
|
386
389
|
"teacher": "I am a teacher",
|
|
387
|
-
"teacher_desc": "Register your Marty and manage your
|
|
390
|
+
"teacher_desc": "Register your Marty and manage your devices.",
|
|
388
391
|
"title": "Who are you?"
|
|
389
392
|
},
|
|
390
393
|
"verification_modal_phone": {
|
|
@@ -392,7 +395,7 @@ var resources = {
|
|
|
392
395
|
"loading": "Loading...",
|
|
393
396
|
"look_on_back": "Look on the back of the {{raftType}}, do these lights appear?",
|
|
394
397
|
"no": "No",
|
|
395
|
-
"no_robots_found": "No
|
|
398
|
+
"no_robots_found": "No devices found",
|
|
396
399
|
"scan_again": "SCAN AGAIN",
|
|
397
400
|
"yes": "Yes"
|
|
398
401
|
},
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
export type ModalContentType = ReactNode;
|
|
3
|
+
export type ModalLogoType = "robotical" | "marty" | "cog" | "none";
|
|
3
4
|
export type ModalEventTopics = "SetModal" | "CloseModal" | "CloseModalWithoutAnimation" | "UpdateModalProps";
|
|
4
5
|
export type ModalStateData = {
|
|
5
6
|
modalContent?: ModalContentType;
|
|
6
7
|
modalTitle?: string;
|
|
8
|
+
closeModalReturnValue?: unknown;
|
|
9
|
+
modalLogo?: ModalLogoType;
|
|
7
10
|
newWindowLink?: string;
|
|
8
11
|
withCloseButton?: boolean;
|
|
9
12
|
withLogo?: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ModalContentType, ModalEventTopics, ModalObservable, ModalObserver, ModalStateData } from "./ModalObserver";
|
|
1
|
+
import type { ModalContentType, ModalEventTopics, ModalLogoType, ModalObservable, ModalObserver, ModalStateData } from "./ModalObserver";
|
|
2
2
|
type ModalReturnValue = any;
|
|
3
|
+
type ModalLogoInput = boolean | ModalLogoType;
|
|
3
4
|
declare class ModalState implements ModalObservable {
|
|
4
5
|
modalContent: ModalContentType | null;
|
|
5
6
|
modalTitle: string;
|
|
@@ -8,10 +9,12 @@ declare class ModalState implements ModalObservable {
|
|
|
8
9
|
private _modalResolve;
|
|
9
10
|
private _modalReject;
|
|
10
11
|
constructor();
|
|
11
|
-
setModal(modalContent: ModalContentType, modalTitle: string,
|
|
12
|
+
setModal(modalContent: ModalContentType, modalTitle: string, modalLogoInput?: ModalLogoInput, withCloseButton?: boolean, closeModalReturnValue?: ModalReturnValue): Promise<ModalReturnValue>;
|
|
12
13
|
closeModal(modalReturnValue?: ModalReturnValue, onCloseCb?: () => void): void;
|
|
13
14
|
closeModalWithoutAnimation(modalReturnValue?: ModalReturnValue, onCloseCb?: () => void): void;
|
|
14
15
|
updateModalProps(updatedProps: {
|
|
16
|
+
closeModalReturnValue?: ModalReturnValue;
|
|
17
|
+
modalLogo?: ModalLogoType;
|
|
15
18
|
modalTitle?: string;
|
|
16
19
|
withCloseButton?: boolean;
|
|
17
20
|
}): void;
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
var normalizeModalLogo = function (modalLogoInput) {
|
|
2
|
+
if (typeof modalLogoInput === "string") {
|
|
3
|
+
return {
|
|
4
|
+
modalLogo: modalLogoInput,
|
|
5
|
+
withLogo: modalLogoInput !== "none",
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
return {
|
|
9
|
+
modalLogo: modalLogoInput ? "robotical" : "none",
|
|
10
|
+
withLogo: modalLogoInput,
|
|
11
|
+
};
|
|
12
|
+
};
|
|
1
13
|
var ModalState = /** @class */ (function () {
|
|
2
14
|
function ModalState() {
|
|
3
15
|
this._observers = {};
|
|
@@ -5,15 +17,17 @@ var ModalState = /** @class */ (function () {
|
|
|
5
17
|
this._modalResolve = function () { };
|
|
6
18
|
this._modalReject = function () { };
|
|
7
19
|
}
|
|
8
|
-
ModalState.prototype.setModal = function (modalContent, modalTitle,
|
|
20
|
+
ModalState.prototype.setModal = function (modalContent, modalTitle, modalLogoInput, withCloseButton, closeModalReturnValue) {
|
|
9
21
|
var _this = this;
|
|
10
|
-
if (
|
|
22
|
+
if (modalLogoInput === void 0) { modalLogoInput = true; }
|
|
23
|
+
if (withCloseButton === void 0) { withCloseButton = false; }
|
|
24
|
+
var _a = normalizeModalLogo(modalLogoInput), modalLogo = _a.modalLogo, withLogo = _a.withLogo;
|
|
11
25
|
this._modalPromise = new Promise(function (resolve, reject) {
|
|
12
26
|
_this._modalResolve = resolve;
|
|
13
27
|
_this._modalReject = reject;
|
|
14
28
|
_this.modalContent = modalContent;
|
|
15
29
|
_this.modalTitle = modalTitle;
|
|
16
|
-
_this.publish("SetModal", { modalContent: modalContent, modalTitle: modalTitle, withLogo: withLogo });
|
|
30
|
+
_this.publish("SetModal", { modalContent: modalContent, modalTitle: modalTitle, modalLogo: modalLogo, withLogo: withLogo, withCloseButton: withCloseButton, closeModalReturnValue: closeModalReturnValue });
|
|
17
31
|
});
|
|
18
32
|
return this._modalPromise;
|
|
19
33
|
};
|
|
@@ -37,7 +37,7 @@ var ConnectedRaftContext = createContext({
|
|
|
37
37
|
// Provider component
|
|
38
38
|
export var ConnectedRaftContentProvider = function (_a) {
|
|
39
39
|
var children = _a.children;
|
|
40
|
-
var _b = useState([{ id: NewRobotIdE.NEW, isSelected: true, name: "Connect to new
|
|
40
|
+
var _b = useState([{ id: NewRobotIdE.NEW, isSelected: true, name: "Connect to new device", type: RaftTypeE.undefined }]), connectedRafts = _b[0], setConnectedRafts = _b[1];
|
|
41
41
|
var _c = useState(0), nameUpdatedState = _c[0], setNameUpdatedState = _c[1];
|
|
42
42
|
useEffect(function () {
|
|
43
43
|
window.applicationManager.connectedRaftsContext = connectedRafts;
|
|
@@ -15,7 +15,7 @@ export type FeedbackRobotConnectionDetails = {
|
|
|
15
15
|
selectedRaftType: RaftTypeE.MARTY | RaftTypeE.COG;
|
|
16
16
|
selectedRaftSerialNumber: string | null;
|
|
17
17
|
};
|
|
18
|
-
export declare const FEEDBACK_REQUIRES_ROBOT_CONNECTION_MESSAGE = "Please connect to a
|
|
18
|
+
export declare const FEEDBACK_REQUIRES_ROBOT_CONNECTION_MESSAGE = "Please connect to a device before sending feedback.";
|
|
19
19
|
export declare function hasActiveRobotConnection(applicationManager?: ApplicationManagerWithConnections | undefined): boolean;
|
|
20
20
|
export declare function getActiveFeedbackRobotConnection(applicationManager?: ApplicationManagerWithConnections | undefined): FeedbackRobotConnectionDetails | null;
|
|
21
21
|
export declare function isRobotConnectionRequiredForFeedbackSource(source: string): boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RaftTypeE } from "../../types/raft";
|
|
2
|
-
export var FEEDBACK_REQUIRES_ROBOT_CONNECTION_MESSAGE = "Please connect to a
|
|
2
|
+
export var FEEDBACK_REQUIRES_ROBOT_CONNECTION_MESSAGE = "Please connect to a device before sending feedback.";
|
|
3
3
|
function getApplicationManager() {
|
|
4
4
|
if (typeof window === "undefined") {
|
|
5
5
|
return undefined;
|
|
@@ -183,10 +183,10 @@ export function buildFeedbackText(record) {
|
|
|
183
183
|
lines.push("Page: ".concat(page));
|
|
184
184
|
}
|
|
185
185
|
if (selectedRaftType) {
|
|
186
|
-
lines.push("
|
|
186
|
+
lines.push("Device type: ".concat(selectedRaftType));
|
|
187
187
|
}
|
|
188
188
|
if (selectedRaftSerialNumber) {
|
|
189
|
-
lines.push("
|
|
189
|
+
lines.push("Device serial number: ".concat(selectedRaftSerialNumber));
|
|
190
190
|
}
|
|
191
191
|
if (record.context) {
|
|
192
192
|
var contextWithoutPage = Object.fromEntries(Object.entries(record.context).filter(function (_a) {
|