@mirai/core 0.3.381 → 0.3.383
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/README.md +24 -0
- package/__tests__/Booking/__mocks__/booking-delete.json +1 -0
- package/__tests__/Booking/__mocks__/booking-get.json +105 -0
- package/__tests__/Booking/booking.constants.js +8 -0
- package/__tests__/Booking/workflows/cancel.workflow.js +20 -0
- package/__tests__/Booking/workflows/index.js +5 -0
- package/__tests__/Booking/workflows/openMobileMenu.workflow.js +4 -0
- package/__tests__/Booking/workflows/print.workflow.js +13 -0
- package/__tests__/Booking/workflows/resend.workflow.js +18 -0
- package/__tests__/Booking/workflows/review.workflow.js +17 -0
- package/__tests__/Checkout/workflows/form.workflow.js +1 -1
- package/__tests__/Checkout/workflows/review.workflow.js +1 -1
- package/__tests__/Session/workflows/bookings.workflow.js +3 -3
- package/__tests__/Session/workflows/logout.workflow.js +3 -3
- package/__tests__/Session/workflows/profile.workflow.js +3 -3
- package/__tests__/Signup/workflows/index.js +1 -0
- package/__tests__/Signup/workflows/signup.workflow.js +3 -3
- package/__tests__/Signup/workflows/signupError.workflow.js +22 -0
- package/__tests__/booking.spec.jsx +34 -0
- package/__tests__/{bookingQuery/bookingQuey._spec.js → bookingQuey._spec.js} +1 -2
- package/__tests__/buttonFinder.spec.js +16 -0
- package/__tests__/{Checkout/checkout.spec.jsx → checkout.spec.jsx} +6 -4
- package/__tests__/constants.js +3 -1
- package/__tests__/{Finder/finder.spec.js → finder.spec.js} +14 -13
- package/__tests__/{Rates/rates.spec.jsx → rates.spec.jsx} +1 -1
- package/__tests__/session.spec.js +32 -0
- package/__tests__/{Signup/signup.spec.js → signup.spec.js} +8 -4
- package/build/components/Booking/Booking.js +1 -0
- package/build/components/Booking/Booking.js.map +1 -1
- package/build/components/Booking/partials/Booking.Menu.js +4 -2
- package/build/components/Booking/partials/Booking.Menu.js.map +1 -1
- package/build/components/Booking/partials/Booking.Modal.js +4 -2
- package/build/components/Booking/partials/Booking.Modal.js.map +1 -1
- package/build/components/Booking/partials/__tests__/__snapshots__/Booking.Menu.test.js.snap +20 -0
- package/build/components/Booking/partials/__tests__/__snapshots__/Booking.Modal.test.js.snap +8 -0
- package/build/components/BookingQuery/BookingQuery.js +1 -1
- package/build/components/BookingQuery/BookingQuery.js.map +1 -1
- package/build/components/ButtonFinder/ButtonFinder.js +59 -0
- package/build/components/ButtonFinder/ButtonFinder.js.map +1 -0
- package/build/components/ButtonFinder/ButtonFinder.l10n.js +13 -0
- package/build/components/ButtonFinder/ButtonFinder.l10n.js.map +1 -0
- package/build/components/ButtonFinder/ButtonFinder.module.css +17 -0
- package/build/components/ButtonFinder/__tests__/__snapshots__/ButtonFinder.test.js.snap +8380 -0
- package/build/components/ButtonFinder/index.js +13 -0
- package/build/components/ButtonFinder/index.js.map +1 -0
- package/build/components/Session/Session.Account.js +2 -3
- package/build/components/Session/Session.Account.js.map +1 -1
- package/build/components/Session/__tests__/__snapshots__/Session.test.js.snap +2 -2
- package/build/components/__shared__/ButtonPayment/components/FormSipay/__tests__/__snapshots__/FormSipay.test.js.snap +6 -6
- package/build/components/__shared__/Occupation/__tests__/__snapshots__/Occupation.test.js.snap +4 -4
- package/build/components/index.js +2 -0
- package/build/components/index.js.map +1 -1
- package/build/helpers/sanitizeComponent.js +1 -0
- package/build/helpers/sanitizeComponent.js.map +1 -1
- package/package.json +1 -1
- package/public/routes/Home.jsx +2 -1
- package/public/routes/routes.module.css +4 -1
- package/public/themes/monalisa.theme.css +11 -30
- package/__tests__/Session/session.spec.js +0 -17
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "ButtonFinder", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _ButtonFinder.ButtonFinder;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _ButtonFinder = require("./ButtonFinder");
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_ButtonFinder","require"],"sources":["../../../src/components/ButtonFinder/index.js"],"sourcesContent":["export { ButtonFinder } from './ButtonFinder';\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA"}
|
|
@@ -140,8 +140,7 @@ const Account = _ref => {
|
|
|
140
140
|
options: session ? [...options, {
|
|
141
141
|
icon: _helpers2.ICON.LOGOUT,
|
|
142
142
|
label: translate(_Session2.L10N.CTA_LOGOUT),
|
|
143
|
-
value: 'logout'
|
|
144
|
-
testId: 'session-logout'
|
|
143
|
+
value: 'logout'
|
|
145
144
|
}] : null,
|
|
146
145
|
onPress: handlePress,
|
|
147
146
|
testId: "profile-menu"
|
|
@@ -151,7 +150,7 @@ const Account = _ref => {
|
|
|
151
150
|
__html: (0, _helpers2.template)(ghost.outerHTML, session, translate)
|
|
152
151
|
} : undefined,
|
|
153
152
|
className: style.pressable,
|
|
154
|
-
testId: "show-
|
|
153
|
+
testId: "show-profile-menu"
|
|
155
154
|
}, !ghost ? /*#__PURE__*/_react.default.createElement(_ui.View, {
|
|
156
155
|
row: true,
|
|
157
156
|
className: (0, _ui.styles)(style.account, compacted && style.compacted)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Session.Account.js","names":["_dataSources","require","_locale","_services","_ui","_propTypes","_interopRequireDefault","_react","_interopRequireWildcard","_helpers","_SessionAccount","_Session","_Session2","style","_Core","_helpers2","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","Account","_ref","compacted","ghost","isMobile","useDevice","translate","useLocale","ref","useRef","value","components","club","authentication","type","AUTH_TYPE","MIRAI","cookies","hotel","url","hotelUrl","id","session","store","useStore","menu","setMenu","useState","useEffect","handleClickOutside","_ref2","_ref$current","target","current","contains","undefined","document","addEventListener","PESTANA","pestana","token","ServiceUser","logout","removeEventListener","handlePress","handleLogout","getProfileUrl","location","href","profile","window","reload","concat","process","env","SERVICE_USER","ENDPOINT","EXTERNAL_LOGOUT","toUrlParams","idtokenprovider","domain","email","firstName","lastName","level","options","icon","ICON","PERSON","label","L10N","ACTION_MANAGE_ACCOUNT","testId","LIST","ACTION_MY_BOOKINGS","divider","LEVEL","children","createElement","Info","View","role","Menu","visible","LOGOUT","CTA_LOGOUT","onPress","Pressable","dangerouslySetInnerHTML","__html","template","outerHTML","className","pressable","row","styles","account","avatar","Text","action","bold","substr","toUpperCase","exports","displayName","propTypes","PropTypes","bool","any"],"sources":["../../../src/components/Session/Session.Account.jsx"],"sourcesContent":["import { useStore } from '@mirai/data-sources';\nimport { useLocale } from '@mirai/locale';\nimport { ServiceUser } from '@mirai/services';\nimport { Menu, Pressable, styles, Text, useDevice, View } from '@mirai/ui';\nimport PropTypes from 'prop-types';\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { getProfileUrl } from './helpers';\nimport { Info } from './Session.Account.Info';\nimport { ENDPOINT } from './Session.constants';\nimport { L10N } from './Session.l10n';\nimport * as style from './Session.module.css';\nimport { AUTH_TYPE } from '../../Core.constants';\nimport { ICON, template, toUrlParams } from '../helpers';\n\nconst Account = ({ compacted = false, ghost }) => {\n const { isMobile } = useDevice();\n const { translate } = useLocale();\n const ref = useRef(null);\n const {\n set,\n value: {\n components = {},\n club: { authentication: { type = AUTH_TYPE.MIRAI } = {} } = {},\n cookies,\n hotel: { url: hotelUrl } = {},\n id,\n session,\n ...store\n },\n } = useStore();\n\n const [menu, setMenu] = useState(false);\n\n useEffect(() => {\n const handleClickOutside = ({ target }) => {\n if (!ref.current?.contains(target)) setMenu(undefined);\n };\n document.addEventListener('click', handleClickOutside, true);\n\n if (type === AUTH_TYPE.PESTANA) {\n const { pestana: token } = cookies;\n\n if (session && !token) {\n ServiceUser.logout();\n set({ session: undefined });\n }\n }\n return () => document.removeEventListener('click', handleClickOutside, true);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handlePress = (value) => {\n if (!value) return setMenu(!menu);\n\n setMenu(false);\n if (value === 'logout') return handleLogout();\n\n const url = getProfileUrl({ id, value, ...store });\n if (!url) return;\n\n document.location.href = url;\n };\n\n const handleLogout = () => {\n ServiceUser.logout();\n\n if (type === AUTH_TYPE.MIRAI) {\n set({ session: undefined });\n\n if (components.profile) window.location.href = hotelUrl;\n else window.location.reload();\n\n return;\n }\n\n const url = `${process.env.SERVICE_USER}/${ENDPOINT.EXTERNAL_LOGOUT}${toUrlParams({\n idtokenprovider: id,\n domain: document.location.href,\n })}`;\n\n document.location.href = url;\n };\n\n const { email, firstName = '', lastName = '', level } = session || {};\n\n let options =\n type === AUTH_TYPE.MIRAI\n ? [\n {\n icon: ICON.PERSON,\n label: translate(L10N.ACTION_MANAGE_ACCOUNT),\n value: 'profile',\n testId: 'session-profile',\n },\n { icon: ICON.LIST, label: translate(L10N.ACTION_MY_BOOKINGS), value: 'bookings', testId: 'session-bookings' },\n ]\n : [];\n if (level) options = [{ divider: true, label: translate(L10N.LEVEL, { level }) }, ...options];\n if (!ghost && (compacted || isMobile))\n options = [\n {\n children: <Info {...{ email, firstName, lastName }} />,\n divider: true,\n },\n ...options,\n ];\n\n return (\n <View role=\"account\" ref={ref}>\n <Menu\n visible={menu}\n options={\n session\n ? [\n ...options,\n { icon: ICON.LOGOUT, label: translate(L10N.CTA_LOGOUT), value: 'logout', testId: 'session-logout' },\n ]\n : null\n }\n onPress={handlePress}\n testId=\"profile-menu\"\n >\n <Pressable\n onPress={() => setMenu(!menu)}\n dangerouslySetInnerHTML={ghost ? { __html: template(ghost.outerHTML, session, translate) } : undefined}\n className={style.pressable}\n testId=\"show-session-menu\"\n >\n {!ghost ? (\n <View row className={styles(style.account, compacted && style.compacted)}>\n <View row className={style.avatar}>\n <Text action bold>\n {`${firstName.substr(0, 1)}`.toUpperCase()}\n </Text>\n </View>\n {!isMobile && !compacted && <Info {...{ email, firstName, lastName }} />}\n </View>\n ) : null}\n </Pressable>\n </Menu>\n </View>\n );\n};\n\nAccount.displayName = 'Mirai:Core:Session:Account';\n\nAccount.propTypes = {\n compacted: PropTypes.bool,\n ghost: PropTypes.any,\n};\n\nexport { Account };\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,GAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,MAAA,GAAAC,uBAAA,CAAAP,OAAA;AAEA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,eAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AACA,IAAAW,SAAA,GAAAX,OAAA;AACA,IAAAY,KAAA,GAAAL,uBAAA,CAAAP,OAAA;AACA,IAAAa,KAAA,GAAAb,OAAA;AACA,IAAAc,SAAA,GAAAd,OAAA;AAAyD,SAAAe,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,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services","_ui","_propTypes","_interopRequireDefault","_react","_interopRequireWildcard","_helpers","_SessionAccount","_Session","_Session2","style","_Core","_helpers2","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","Account","_ref","compacted","ghost","isMobile","useDevice","translate","useLocale","ref","useRef","value","components","club","authentication","type","AUTH_TYPE","MIRAI","cookies","hotel","url","hotelUrl","id","session","store","useStore","menu","setMenu","useState","useEffect","handleClickOutside","_ref2","_ref$current","target","current","contains","undefined","document","addEventListener","PESTANA","pestana","token","ServiceUser","logout","removeEventListener","handlePress","handleLogout","getProfileUrl","location","href","profile","window","reload","concat","process","env","SERVICE_USER","ENDPOINT","EXTERNAL_LOGOUT","toUrlParams","idtokenprovider","domain","email","firstName","lastName","level","options","icon","ICON","PERSON","label","L10N","ACTION_MANAGE_ACCOUNT","testId","LIST","ACTION_MY_BOOKINGS","divider","LEVEL","children","createElement","Info","View","role","Menu","visible","LOGOUT","CTA_LOGOUT","onPress","Pressable","dangerouslySetInnerHTML","__html","template","outerHTML","className","pressable","row","styles","account","avatar","Text","action","bold","substr","toUpperCase","exports","displayName","propTypes","PropTypes","bool","any"],"sources":["../../../src/components/Session/Session.Account.jsx"],"sourcesContent":["import { useStore } from '@mirai/data-sources';\nimport { useLocale } from '@mirai/locale';\nimport { ServiceUser } from '@mirai/services';\nimport { Menu, Pressable, styles, Text, useDevice, View } from '@mirai/ui';\nimport PropTypes from 'prop-types';\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { getProfileUrl } from './helpers';\nimport { Info } from './Session.Account.Info';\nimport { ENDPOINT } from './Session.constants';\nimport { L10N } from './Session.l10n';\nimport * as style from './Session.module.css';\nimport { AUTH_TYPE } from '../../Core.constants';\nimport { ICON, template, toUrlParams } from '../helpers';\n\nconst Account = ({ compacted = false, ghost }) => {\n const { isMobile } = useDevice();\n const { translate } = useLocale();\n const ref = useRef(null);\n const {\n set,\n value: {\n components = {},\n club: { authentication: { type = AUTH_TYPE.MIRAI } = {} } = {},\n cookies,\n hotel: { url: hotelUrl } = {},\n id,\n session,\n ...store\n },\n } = useStore();\n\n const [menu, setMenu] = useState(false);\n\n useEffect(() => {\n const handleClickOutside = ({ target }) => {\n if (!ref.current?.contains(target)) setMenu(undefined);\n };\n document.addEventListener('click', handleClickOutside, true);\n\n if (type === AUTH_TYPE.PESTANA) {\n const { pestana: token } = cookies;\n\n if (session && !token) {\n ServiceUser.logout();\n set({ session: undefined });\n }\n }\n return () => document.removeEventListener('click', handleClickOutside, true);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handlePress = (value) => {\n if (!value) return setMenu(!menu);\n\n setMenu(false);\n if (value === 'logout') return handleLogout();\n\n const url = getProfileUrl({ id, value, ...store });\n if (!url) return;\n\n document.location.href = url;\n };\n\n const handleLogout = () => {\n ServiceUser.logout();\n\n if (type === AUTH_TYPE.MIRAI) {\n set({ session: undefined });\n\n if (components.profile) window.location.href = hotelUrl;\n else window.location.reload();\n\n return;\n }\n\n const url = `${process.env.SERVICE_USER}/${ENDPOINT.EXTERNAL_LOGOUT}${toUrlParams({\n idtokenprovider: id,\n domain: document.location.href,\n })}`;\n\n document.location.href = url;\n };\n\n const { email, firstName = '', lastName = '', level } = session || {};\n\n let options =\n type === AUTH_TYPE.MIRAI\n ? [\n {\n icon: ICON.PERSON,\n label: translate(L10N.ACTION_MANAGE_ACCOUNT),\n value: 'profile',\n testId: 'session-profile',\n },\n { icon: ICON.LIST, label: translate(L10N.ACTION_MY_BOOKINGS), value: 'bookings', testId: 'session-bookings' },\n ]\n : [];\n if (level) options = [{ divider: true, label: translate(L10N.LEVEL, { level }) }, ...options];\n if (!ghost && (compacted || isMobile))\n options = [\n {\n children: <Info {...{ email, firstName, lastName }} />,\n divider: true,\n },\n ...options,\n ];\n\n return (\n <View role=\"account\" ref={ref}>\n <Menu\n visible={menu}\n options={\n session ? [...options, { icon: ICON.LOGOUT, label: translate(L10N.CTA_LOGOUT), value: 'logout' }] : null\n }\n onPress={handlePress}\n testId=\"profile-menu\"\n >\n <Pressable\n onPress={() => setMenu(!menu)}\n dangerouslySetInnerHTML={ghost ? { __html: template(ghost.outerHTML, session, translate) } : undefined}\n className={style.pressable}\n testId=\"show-profile-menu\"\n >\n {!ghost ? (\n <View row className={styles(style.account, compacted && style.compacted)}>\n <View row className={style.avatar}>\n <Text action bold>\n {`${firstName.substr(0, 1)}`.toUpperCase()}\n </Text>\n </View>\n {!isMobile && !compacted && <Info {...{ email, firstName, lastName }} />}\n </View>\n ) : null}\n </Pressable>\n </Menu>\n </View>\n );\n};\n\nAccount.displayName = 'Mirai:Core:Session:Account';\n\nAccount.propTypes = {\n compacted: PropTypes.bool,\n ghost: PropTypes.any,\n};\n\nexport { Account };\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,GAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,MAAA,GAAAC,uBAAA,CAAAP,OAAA;AAEA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,eAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AACA,IAAAW,SAAA,GAAAX,OAAA;AACA,IAAAY,KAAA,GAAAL,uBAAA,CAAAP,OAAA;AACA,IAAAa,KAAA,GAAAb,OAAA;AACA,IAAAc,SAAA,GAAAd,OAAA;AAAyD,SAAAe,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,C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,OAAA,CAAAvG,OAAA,GAAAA,OAAA;AAEFA,OAAO,CAACwG,WAAW,GAAG,4BAA4B;AAElDxG,OAAO,CAACyG,SAAS,GAAG;EAClBvG,SAAS,EAAEwG,kBAAS,CAACC,IAAI;EACzBxG,KAAK,EAAEuG,kBAAS,CAACE;AACnB,CAAC"}
|
|
@@ -207,7 +207,7 @@ exports[`component:<Session> Using ghost feature with an stored session 1`] = `
|
|
|
207
207
|
>
|
|
208
208
|
<ui-pressable
|
|
209
209
|
class="pressable"
|
|
210
|
-
data-testid="show-
|
|
210
|
+
data-testid="show-profile-menu"
|
|
211
211
|
tabindex="0"
|
|
212
212
|
>
|
|
213
213
|
<div>
|
|
@@ -921,7 +921,7 @@ exports[`component:<Session> with an stored session 1`] = `
|
|
|
921
921
|
>
|
|
922
922
|
<ui-pressable
|
|
923
923
|
class="pressable"
|
|
924
|
-
data-testid="show-
|
|
924
|
+
data-testid="show-profile-menu"
|
|
925
925
|
tabindex="0"
|
|
926
926
|
>
|
|
927
927
|
<ui-view
|
|
@@ -5,7 +5,7 @@ exports[`component:<FormSipay> inherit:className 1`] = `
|
|
|
5
5
|
<ui-view
|
|
6
6
|
class="view mirai"
|
|
7
7
|
>
|
|
8
|
-
<ui-notification
|
|
8
|
+
<ui-notification-warning
|
|
9
9
|
class="view row notification warning inline large wide"
|
|
10
10
|
>
|
|
11
11
|
<ui-icon
|
|
@@ -34,7 +34,7 @@ exports[`component:<FormSipay> inherit:className 1`] = `
|
|
|
34
34
|
payments.notification.loading
|
|
35
35
|
</ui-text>
|
|
36
36
|
</ui-view>
|
|
37
|
-
</ui-notification>
|
|
37
|
+
</ui-notification-warning>
|
|
38
38
|
<button
|
|
39
39
|
data-amount="0"
|
|
40
40
|
data-autosave="true"
|
|
@@ -58,7 +58,7 @@ exports[`component:<FormSipay> renders 1`] = `
|
|
|
58
58
|
<ui-view
|
|
59
59
|
class="view"
|
|
60
60
|
>
|
|
61
|
-
<ui-notification
|
|
61
|
+
<ui-notification-warning
|
|
62
62
|
class="view row notification warning inline large wide"
|
|
63
63
|
>
|
|
64
64
|
<ui-icon
|
|
@@ -87,7 +87,7 @@ exports[`component:<FormSipay> renders 1`] = `
|
|
|
87
87
|
payments.notification.loading
|
|
88
88
|
</ui-text>
|
|
89
89
|
</ui-view>
|
|
90
|
-
</ui-notification>
|
|
90
|
+
</ui-notification-warning>
|
|
91
91
|
<button
|
|
92
92
|
data-amount="0"
|
|
93
93
|
data-autosave="true"
|
|
@@ -112,7 +112,7 @@ exports[`component:<FormSipay> testID 1`] = `
|
|
|
112
112
|
class="view"
|
|
113
113
|
data-testid="mirai"
|
|
114
114
|
>
|
|
115
|
-
<ui-notification
|
|
115
|
+
<ui-notification-warning
|
|
116
116
|
class="view row notification warning inline large wide"
|
|
117
117
|
>
|
|
118
118
|
<ui-icon
|
|
@@ -141,7 +141,7 @@ exports[`component:<FormSipay> testID 1`] = `
|
|
|
141
141
|
payments.notification.loading
|
|
142
142
|
</ui-text>
|
|
143
143
|
</ui-view>
|
|
144
|
-
</ui-notification>
|
|
144
|
+
</ui-notification-warning>
|
|
145
145
|
<button
|
|
146
146
|
data-amount="0"
|
|
147
147
|
data-autosave="true"
|
package/build/components/__shared__/Occupation/__tests__/__snapshots__/Occupation.test.js.snap
CHANGED
|
@@ -6,7 +6,7 @@ exports[` 1`] = `
|
|
|
6
6
|
class="view"
|
|
7
7
|
l10n="[object Object]"
|
|
8
8
|
>
|
|
9
|
-
<ui-notification
|
|
9
|
+
<ui-notification-warning
|
|
10
10
|
class="view row notification warning outlined small"
|
|
11
11
|
>
|
|
12
12
|
<ui-icon
|
|
@@ -35,7 +35,7 @@ exports[` 1`] = `
|
|
|
35
35
|
finder.notification.warning_occupation
|
|
36
36
|
</ui-text>
|
|
37
37
|
</ui-view>
|
|
38
|
-
</ui-notification>
|
|
38
|
+
</ui-notification-warning>
|
|
39
39
|
<ui-scrollview
|
|
40
40
|
class="scrollview vertical"
|
|
41
41
|
>
|
|
@@ -2127,7 +2127,7 @@ exports[`component:<Occupation> prop:value prop:error 1`] = `
|
|
|
2127
2127
|
class="view"
|
|
2128
2128
|
l10n="[object Object]"
|
|
2129
2129
|
>
|
|
2130
|
-
<ui-notification
|
|
2130
|
+
<ui-notification-error
|
|
2131
2131
|
class="view row notification error outlined small"
|
|
2132
2132
|
>
|
|
2133
2133
|
<ui-icon
|
|
@@ -2166,7 +2166,7 @@ exports[`component:<Occupation> prop:value prop:error 1`] = `
|
|
|
2166
2166
|
fields
|
|
2167
2167
|
</ui-text>
|
|
2168
2168
|
</ui-view>
|
|
2169
|
-
</ui-notification>
|
|
2169
|
+
</ui-notification-error>
|
|
2170
2170
|
<ui-scrollview
|
|
2171
2171
|
class="scrollview vertical"
|
|
2172
2172
|
>
|
|
@@ -7,6 +7,7 @@ exports.COMPONENTS = void 0;
|
|
|
7
7
|
var _BannerLoyalty = require("./BannerLoyalty");
|
|
8
8
|
var _Booking = require("./Booking");
|
|
9
9
|
var _BookingQuery = require("./BookingQuery");
|
|
10
|
+
var _ButtonFinder = require("./ButtonFinder");
|
|
10
11
|
var _Chat = require("./Chat");
|
|
11
12
|
var _Checkout = require("./Checkout");
|
|
12
13
|
var _Deals = require("./Deals");
|
|
@@ -21,6 +22,7 @@ const COMPONENTS = exports.COMPONENTS = {
|
|
|
21
22
|
bannerLoyalty: _BannerLoyalty.BannerLoyalty,
|
|
22
23
|
booking: _Booking.Booking,
|
|
23
24
|
bookingQuery: _BookingQuery.BookingQuery,
|
|
25
|
+
buttonFinder: _ButtonFinder.ButtonFinder,
|
|
24
26
|
chat: _Chat.Chat,
|
|
25
27
|
checkout: _Checkout.Checkout,
|
|
26
28
|
deals: _Deals.Deals,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_BannerLoyalty","require","_Booking","_BookingQuery","_Chat","_Checkout","_Deals","_Environment","_Finder","_Header","_Profile","_Rates","_Session","_Signup","COMPONENTS","exports","bannerLoyalty","BannerLoyalty","booking","Booking","bookingQuery","BookingQuery","chat","Chat","checkout","Checkout","deals","Deals","environment","Environment","finder","Finder","header","Header","profile","Profile","rates","Rates","session","Session","signup","Signup"],"sources":["../../src/components/index.js"],"sourcesContent":["import { BannerLoyalty } from './BannerLoyalty';\nimport { Booking } from './Booking';\nimport { BookingQuery } from './BookingQuery';\nimport { Chat } from './Chat';\nimport { Checkout } from './Checkout';\nimport { Deals } from './Deals';\nimport { Environment } from './Environment';\nimport { Finder } from './Finder';\nimport { Header } from './Header';\nimport { Profile } from './Profile';\nimport { Rates } from './Rates';\nimport { Session } from './Session';\nimport { Signup } from './Signup';\n\nexport const COMPONENTS = {\n bannerLoyalty: BannerLoyalty,\n booking: Booking,\n bookingQuery: BookingQuery,\n chat: Chat,\n checkout: Checkout,\n deals: Deals,\n environment: Environment,\n finder: Finder,\n header: Header,\n profile: Profile,\n rates: Rates,\n session: Session,\n signup: Signup,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,
|
|
1
|
+
{"version":3,"file":"index.js","names":["_BannerLoyalty","require","_Booking","_BookingQuery","_ButtonFinder","_Chat","_Checkout","_Deals","_Environment","_Finder","_Header","_Profile","_Rates","_Session","_Signup","COMPONENTS","exports","bannerLoyalty","BannerLoyalty","booking","Booking","bookingQuery","BookingQuery","buttonFinder","ButtonFinder","chat","Chat","checkout","Checkout","deals","Deals","environment","Environment","finder","Finder","header","Header","profile","Profile","rates","Rates","session","Session","signup","Signup"],"sources":["../../src/components/index.js"],"sourcesContent":["import { BannerLoyalty } from './BannerLoyalty';\nimport { Booking } from './Booking';\nimport { BookingQuery } from './BookingQuery';\nimport { ButtonFinder } from './ButtonFinder';\nimport { Chat } from './Chat';\nimport { Checkout } from './Checkout';\nimport { Deals } from './Deals';\nimport { Environment } from './Environment';\nimport { Finder } from './Finder';\nimport { Header } from './Header';\nimport { Profile } from './Profile';\nimport { Rates } from './Rates';\nimport { Session } from './Session';\nimport { Signup } from './Signup';\n\nexport const COMPONENTS = {\n bannerLoyalty: BannerLoyalty,\n booking: Booking,\n bookingQuery: BookingQuery,\n buttonFinder: ButtonFinder,\n chat: Chat,\n checkout: Checkout,\n deals: Deals,\n environment: Environment,\n finder: Finder,\n header: Header,\n profile: Profile,\n rates: Rates,\n session: Session,\n signup: Signup,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,QAAA,GAAAZ,OAAA;AACA,IAAAa,OAAA,GAAAb,OAAA;AAEO,MAAMc,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG;EACxBE,aAAa,EAAEC,4BAAa;EAC5BC,OAAO,EAAEC,gBAAO;EAChBC,YAAY,EAAEC,0BAAY;EAC1BC,YAAY,EAAEC,0BAAY;EAC1BC,IAAI,EAAEC,UAAI;EACVC,QAAQ,EAAEC,kBAAQ;EAClBC,KAAK,EAAEC,YAAK;EACZC,WAAW,EAAEC,wBAAW;EACxBC,MAAM,EAAEC,cAAM;EACdC,MAAM,EAAEC,cAAM;EACdC,OAAO,EAAEC,gBAAO;EAChBC,KAAK,EAAEC,YAAK;EACZC,OAAO,EAAEC,gBAAO;EAChBC,MAAM,EAAEC;AACV,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitizeComponent.js","names":["sanitizeComponent","el","getAttribute","innerHTML","error","console","warn","setAttribute","exports"],"sources":["../../src/helpers/sanitizeComponent.js"],"sourcesContent":["export const sanitizeComponent = (el) => {\n if (!el.getAttribute('data-ready')) {\n try {\n el.innerHTML = '';\n } catch (error) {\n console.warn(`WARNING: element has an issue using innerHTML.`, { el });\n }\n el.setAttribute('data-ready', 'true');\n }\n};\n"],"mappings":";;;;;;AAAO,MAAMA,iBAAiB,GAAIC,EAAE,IAAK;EACvC,IAAI,CAACA,EAAE,CAACC,YAAY,CAAC,YAAY,CAAC,EAAE;IAClC,IAAI;MACFD,EAAE,CAACE,SAAS,GAAG,EAAE;IACnB,CAAC,CAAC,OAAOC,KAAK,EAAE;
|
|
1
|
+
{"version":3,"file":"sanitizeComponent.js","names":["sanitizeComponent","el","getAttribute","innerHTML","error","console","warn","setAttribute","exports"],"sources":["../../src/helpers/sanitizeComponent.js"],"sourcesContent":["export const sanitizeComponent = (el) => {\n if (!el.getAttribute('data-ready')) {\n try {\n el.innerHTML = '';\n } catch (error) {\n // eslint-disable-next-line no-console\n console.warn(`WARNING: element has an issue using innerHTML.`, { el });\n }\n el.setAttribute('data-ready', 'true');\n }\n};\n"],"mappings":";;;;;;AAAO,MAAMA,iBAAiB,GAAIC,EAAE,IAAK;EACvC,IAAI,CAACA,EAAE,CAACC,YAAY,CAAC,YAAY,CAAC,EAAE;IAClC,IAAI;MACFD,EAAE,CAACE,SAAS,GAAG,EAAE;IACnB,CAAC,CAAC,OAAOC,KAAK,EAAE;MACd;MACAC,OAAO,CAACC,IAAI,mDAAmD;QAAEL;MAAG,CAAC,CAAC;IACxE;IACAA,EAAE,CAACM,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC;EACvC;AACF,CAAC;AAACC,OAAA,CAAAR,iBAAA,GAAAA,iBAAA"}
|
package/package.json
CHANGED
package/public/routes/Home.jsx
CHANGED
|
@@ -39,7 +39,8 @@ export const Home = () => {
|
|
|
39
39
|
<Text headline={!isMobile} level={3} className={[style.pitch, style.text]}>
|
|
40
40
|
Experience the calming atmosphere of our serene guest rooms, each designed with your comfort in mind.
|
|
41
41
|
</Text>
|
|
42
|
-
|
|
42
|
+
|
|
43
|
+
<View data-mirai-component="buttonFinder" />
|
|
43
44
|
</View>
|
|
44
45
|
<View className={style.backgroundImage} />
|
|
45
46
|
</View>
|
|
@@ -128,7 +128,6 @@
|
|
|
128
128
|
margin: 0 auto;
|
|
129
129
|
position: sticky;
|
|
130
130
|
top: var(--mirai-ui-space-M);
|
|
131
|
-
z-index: 1;
|
|
132
131
|
}
|
|
133
132
|
|
|
134
133
|
.finder .resident > [data-role='text'] {
|
|
@@ -225,6 +224,10 @@
|
|
|
225
224
|
max-width: 50%;
|
|
226
225
|
}
|
|
227
226
|
|
|
227
|
+
body:not([data-mirai-modal='true']) .finder.centered {
|
|
228
|
+
z-index: 1;
|
|
229
|
+
}
|
|
230
|
+
|
|
228
231
|
.texts {
|
|
229
232
|
gap: var(--mirai-ui-space-L);
|
|
230
233
|
max-width: 50%;
|
|
@@ -14,11 +14,12 @@
|
|
|
14
14
|
--mirai-ui-font-medium-weight: 500;
|
|
15
15
|
--mirai-ui-font-bold-weight: 600;
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
--mirai-ui-font-
|
|
20
|
-
--mirai-ui-font-
|
|
21
|
-
--mirai-ui-font-bold
|
|
17
|
+
--mirai-ui-text-brand-font: 'Playfair Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
|
|
18
|
+
Arial, sans-serif;
|
|
19
|
+
--mirai-ui-font-brand-weight: 700;
|
|
20
|
+
--mirai-ui-text-brand-font-weight: 700;
|
|
21
|
+
--mirai-ui-text-brand-font-bold: var(--mirai-ui-text-brand-font);
|
|
22
|
+
--mirai-ui-text-brand-font-bold-weight: var(--mirai-ui-text-brand-font-weight);
|
|
22
23
|
|
|
23
24
|
/* palette */
|
|
24
25
|
--mirai-ui-accent: #f0a42b;
|
|
@@ -27,34 +28,14 @@
|
|
|
27
28
|
--mirai-ui-accent-border: #f9dbaa;
|
|
28
29
|
--mirai-ui-accent-dark: #cc8b25;
|
|
29
30
|
|
|
30
|
-
/*
|
|
31
|
-
|
|
32
|
-
--mirai-ui-
|
|
33
|
-
|
|
34
|
-
--mirai-ui-
|
|
35
|
-
|
|
36
|
-
--mirai-ui-text-brand-font: 'Playfair Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
|
|
37
|
-
Arial, sans-serif;
|
|
38
|
-
--mirai-ui-text-brand-font-weight: 700;
|
|
39
|
-
--mirai-ui-text-brand-font-bold: var(--mirai-ui-text-brand-font);
|
|
40
|
-
--mirai-ui-text-brand-font-bold-weight: var(--mirai-ui-text-brand-font-weight);
|
|
31
|
+
/* --mirai-ui-accent: #007bff;
|
|
32
|
+
--mirai-ui-accent-background: #e6f0ff;
|
|
33
|
+
--mirai-ui-accent-light: #339dff;
|
|
34
|
+
--mirai-ui-accent-border: #99cfff;
|
|
35
|
+
--mirai-ui-accent-dark: #0056b3; */
|
|
41
36
|
|
|
42
37
|
/* Finder */
|
|
43
38
|
--mirai-finder-button-font-weight: 900;
|
|
44
|
-
|
|
45
|
-
/* Booking */
|
|
46
|
-
/* --corporative-color: #003580;
|
|
47
|
-
--mirai-finder-background: #ffb700;
|
|
48
|
-
--mirai-finder-border-radius: var(--mirai-ui-input-text-radius);
|
|
49
|
-
--mirai-finder-padding: var(--mirai-ui-space-XXS); */
|
|
50
|
-
|
|
51
|
-
/* Airbnb */
|
|
52
|
-
/* --corporative-color: #ff385c;
|
|
53
|
-
--mirai-finder-border-radius: var(--mirai-ui-space-XL);
|
|
54
|
-
--mirai-finder-field-height: calc(var(--mirai-field-height) * 1.2);
|
|
55
|
-
--mirai-finder-padding: var(--mirai-ui-space-XS);
|
|
56
|
-
--mirai-finder-column-border-radius: var(--mirai-ui-space-M);
|
|
57
|
-
--mirai-finder-column-padding: var(--mirai-ui-space-M); */
|
|
58
39
|
}
|
|
59
40
|
|
|
60
41
|
body {
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { test } from '@playwright/test';
|
|
2
|
-
|
|
3
|
-
import { bookings, forgotPassword, login, logout, profile } from './workflows';
|
|
4
|
-
|
|
5
|
-
test.beforeEach(async ({ context }) => {
|
|
6
|
-
await context.addInitScript(() => (window.IS_PLAYWRIGHT = true));
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
test('Session workflows', async ({ page }) => {
|
|
10
|
-
await page.goto('http://local.mirai.com:8080', { waitUntil: 'networkidle', timeout: 10000 });
|
|
11
|
-
|
|
12
|
-
await login({ page });
|
|
13
|
-
await profile({ page });
|
|
14
|
-
await bookings({ page });
|
|
15
|
-
await logout({ page });
|
|
16
|
-
await forgotPassword({ page });
|
|
17
|
-
});
|