@syzy/apphost 1.0.1 → 1.0.3
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/App.d.ts +4 -0
- package/dist/App.js +83 -0
- package/dist/AppHostProvider.d.ts +6 -0
- package/dist/AppHostProvider.js +4 -0
- package/dist/AppHostRoutes.d.ts +1 -0
- package/dist/AppHostRoutes.js +7 -0
- package/dist/api/image-api.d.ts +8 -0
- package/dist/api/image-api.js +45 -0
- package/dist/api/mapping-api.d.ts +80 -0
- package/dist/api/mapping-api.js +427 -0
- package/dist/bookingModule/components/AmenityForm.d.ts +3 -0
- package/dist/bookingModule/components/AmenityForm.js +19 -0
- package/dist/bookingModule/components/BillingManagement.d.ts +3 -0
- package/dist/bookingModule/components/BillingManagement.js +17 -0
- package/dist/bookingModule/components/CreateRoomForm.d.ts +3 -0
- package/dist/bookingModule/components/CreateRoomForm.js +19 -0
- package/dist/bookingModule/components/ExtraRequirementForm.d.ts +3 -0
- package/dist/bookingModule/components/ExtraRequirementForm.js +19 -0
- package/dist/bookingModule/components/ReservationForm.d.ts +3 -0
- package/dist/bookingModule/components/ReservationForm.js +18 -0
- package/dist/bookingModule/components/RoomCategoryForm.d.ts +3 -0
- package/dist/bookingModule/components/RoomCategoryForm.js +19 -0
- package/dist/bookingModule/components/RoomCategoryPriceForm.d.ts +3 -0
- package/dist/bookingModule/components/RoomCategoryPriceForm.js +20 -0
- package/dist/bookingModule/components/RoomExtraRequirementCapture.d.ts +3 -0
- package/dist/bookingModule/components/RoomExtraRequirementCapture.js +18 -0
- package/dist/bookingModule/components/RoomFacilityForm.d.ts +3 -0
- package/dist/bookingModule/components/RoomFacilityForm.js +19 -0
- package/dist/bookingModule/components/RoomReservationAction.d.ts +3 -0
- package/dist/bookingModule/components/RoomReservationAction.js +18 -0
- package/dist/components/Home/Home.d.ts +3 -0
- package/dist/components/Home/Home.js +14 -0
- package/dist/components/Loader/Loader.d.ts +2 -0
- package/dist/components/Loader/Loader.js +5 -0
- package/dist/components/Login/Login.d.ts +7 -0
- package/dist/components/Login/Login.js +149 -0
- package/dist/components/Login/loginSchema.d.ts +27 -0
- package/dist/components/Login/loginSchema.js +41 -0
- package/dist/components/Mappings/BranchMapping/Branch.d.ts +5 -0
- package/dist/components/Mappings/BranchMapping/Branch.js +135 -0
- package/dist/components/Mappings/BranchMapping/BranchTableColumns.d.ts +10 -0
- package/dist/components/Mappings/BranchMapping/BranchTableColumns.js +21 -0
- package/dist/components/Mappings/BranchMapping/MappingFormBranchUser.d.ts +3 -0
- package/dist/components/Mappings/BranchMapping/MappingFormBranchUser.js +150 -0
- package/dist/components/Mappings/BranchMapping/MappingTableColumns.d.ts +14 -0
- package/dist/components/Mappings/BranchMapping/MappingTableColumns.js +29 -0
- package/dist/components/Mappings/BranchMapping/branchSchema.d.ts +37 -0
- package/dist/components/Mappings/BranchMapping/branchSchema.js +34 -0
- package/dist/components/Mappings/ComponentMapping/ComponentRoleMapping.d.ts +3 -0
- package/dist/components/Mappings/ComponentMapping/ComponentRoleMapping.js +98 -0
- package/dist/components/Mappings/ComponentMapping/componentRoleColumns.d.ts +3 -0
- package/dist/components/Mappings/ComponentMapping/componentRoleColumns.js +29 -0
- package/dist/components/Mappings/MappingForm/MappingForm.d.ts +35 -0
- package/dist/components/Mappings/MappingForm/MappingForm.js +142 -0
- package/dist/components/Mappings/MappingForm/mappingSchema.d.ts +23 -0
- package/dist/components/Mappings/MappingForm/mappingSchema.js +32 -0
- package/dist/components/Mappings/RoleMapping/MappingFormUserRole.d.ts +5 -0
- package/dist/components/Mappings/RoleMapping/MappingFormUserRole.js +194 -0
- package/dist/components/Mappings/RoleMapping/UserRoleTableColumns.d.ts +3 -0
- package/dist/components/Mappings/RoleMapping/UserRoleTableColumns.js +33 -0
- package/dist/components/NavBar/Sidebar.d.ts +4 -0
- package/dist/components/NavBar/Sidebar.js +56 -0
- package/dist/components/ProfileForm/ProfileForm.d.ts +3 -0
- package/dist/components/ProfileForm/ProfileForm.js +190 -0
- package/dist/components/ProfileForm/ProfileList.d.ts +3 -0
- package/dist/components/ProfileForm/ProfileList.js +33 -0
- package/dist/components/ProfileForm/profileColumns.d.ts +3 -0
- package/dist/components/ProfileForm/profileColumns.js +67 -0
- package/dist/components/ProfileForm/profileSchema.d.ts +52 -0
- package/dist/components/ProfileForm/profileSchema.js +50 -0
- package/dist/components/SettingsPage/SettingsPage.d.ts +3 -0
- package/dist/components/SettingsPage/SettingsPage.js +240 -0
- package/dist/components/api/settings-api.d.ts +26 -0
- package/dist/components/api/settings-api.js +131 -0
- package/dist/components/common/Form/FormActionButtons.d.ts +11 -0
- package/dist/components/common/Form/FormActionButtons.js +6 -0
- package/dist/components/common/Form/FormLabel.d.ts +8 -0
- package/dist/components/common/Form/FormLabel.js +6 -0
- package/dist/components/common/ListTable/ListHeader.d.ts +8 -0
- package/dist/components/common/ListTable/ListHeader.js +5 -0
- package/dist/components/common/ListTable/ListTable.d.ts +17 -0
- package/dist/components/common/ListTable/ListTable.js +31 -0
- package/dist/components/common/Modal/Modal.d.ts +11 -0
- package/dist/components/common/Modal/Modal.js +6 -0
- package/dist/config/EnvConfig.d.ts +13 -0
- package/dist/config/EnvConfig.js +13 -0
- package/dist/config/amplifyConfig.d.ts +1 -0
- package/dist/config/amplifyConfig.js +45 -0
- package/dist/configureAppHost.d.ts +6 -0
- package/dist/configureAppHost.js +5 -0
- package/dist/customGraphQL/customMutations.d.ts +3 -0
- package/dist/customGraphQL/customMutations.js +53 -0
- package/dist/customGraphQL/customQueries.d.ts +7 -0
- package/dist/customGraphQL/customQueries.js +104 -0
- package/dist/domain/input/input-types.d.ts +47 -0
- package/dist/domain/input/input-types.js +1 -0
- package/dist/domain/model/BranchDto.d.ts +9 -0
- package/dist/domain/model/BranchDto.js +8 -0
- package/dist/domain/model/ComponentMappingDto.d.ts +24 -0
- package/dist/domain/model/ComponentMappingDto.js +19 -0
- package/dist/domain/model/MappingDto.d.ts +30 -0
- package/dist/domain/model/MappingDto.js +16 -0
- package/dist/domain/model/PrefixDescriptionDto.d.ts +16 -0
- package/dist/domain/model/PrefixDescriptionDto.js +13 -0
- package/dist/domain/model/ProfileDto.d.ts +21 -0
- package/dist/domain/model/ProfileDto.js +20 -0
- package/dist/domain/model/RoleMappingDto.d.ts +14 -0
- package/dist/domain/model/RoleMappingDto.js +19 -0
- package/dist/domain/model/SettingsDto.d.ts +8 -0
- package/dist/domain/model/SettingsDto.js +7 -0
- package/dist/domain/model/UserMappingDto.d.ts +14 -0
- package/dist/domain/model/UserMappingDto.js +28 -0
- package/dist/domain/model/imageDto.d.ts +4 -0
- package/dist/domain/model/imageDto.js +1 -0
- package/dist/domain/type/EntityTypes.d.ts +5 -0
- package/dist/domain/type/EntityTypes.js +6 -0
- package/dist/domain/type/MappingOptions.d.ts +5 -0
- package/dist/domain/type/MappingOptions.js +1 -0
- package/dist/domain/type/MappingTypes.d.ts +6 -0
- package/dist/domain/type/MappingTypes.js +7 -0
- package/dist/domain/type/Nullable.d.ts +13 -0
- package/dist/domain/type/Nullable.js +1 -0
- package/dist/domain/type/ResettingPeriodOptions.d.ts +2 -0
- package/dist/domain/type/ResettingPeriodOptions.js +8 -0
- package/dist/domain/type/RolesEnum.d.ts +6 -0
- package/dist/domain/type/RolesEnum.js +7 -0
- package/dist/domain/type/SelectType.d.ts +16 -0
- package/dist/domain/type/SelectType.js +1 -0
- package/dist/domain/type/StatusEnum.d.ts +5 -0
- package/dist/domain/type/StatusEnum.js +6 -0
- package/dist/domain/type/signUpOptions.d.ts +2 -0
- package/dist/domain/type/signUpOptions.js +4 -0
- package/dist/domain/type/statusOptions.d.ts +2 -0
- package/dist/domain/type/statusOptions.js +4 -0
- package/dist/graphql/profileQueries.d.ts +4 -0
- package/dist/graphql/profileQueries.js +89 -0
- package/dist/hoc/withSyzyAuth.d.ts +2 -0
- package/dist/hoc/withSyzyAuth.js +87 -0
- package/dist/hooks/useCurrentUser.d.ts +3 -0
- package/dist/hooks/useCurrentUser.js +6 -0
- package/dist/hooks/useDispatch.d.ts +3 -0
- package/dist/hooks/useDispatch.js +7 -0
- package/dist/hooks/usePermission.d.ts +1 -0
- package/dist/hooks/usePermission.js +7 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -15
- package/dist/main.d.ts +4 -0
- package/dist/main.js +60 -0
- package/dist/services/Client.Service.d.ts +12 -0
- package/dist/services/Client.Service.js +96 -0
- package/dist/services/Storage-service.d.ts +2 -0
- package/dist/services/Storage-service.js +26 -0
- package/dist/services/navigationMenu.d.ts +1 -0
- package/dist/services/navigationMenu.js +9 -0
- package/dist/static/constants.d.ts +34 -0
- package/dist/static/constants.js +34 -0
- package/dist/store/AppAction.d.ts +11 -0
- package/dist/store/AppAction.js +5 -0
- package/dist/store/AppContext.d.ts +3 -0
- package/dist/store/AppContext.js +3 -0
- package/dist/store/AppContextType.d.ts +12 -0
- package/dist/store/AppContextType.js +6 -0
- package/dist/store/AppProvider.d.ts +7 -0
- package/dist/store/AppProvider.js +32 -0
- package/dist/store/HostedInContainerContext.d.ts +5 -0
- package/dist/store/HostedInContainerContext.js +11 -0
- package/dist/store/SesssionReducer.d.ts +4 -0
- package/dist/store/SesssionReducer.js +16 -0
- package/dist/types.d.ts +26 -0
- package/dist/types.js +14 -0
- package/dist/util/AuthUtils.d.ts +1 -0
- package/dist/util/AuthUtils.js +10 -0
- package/dist/util/LogEnum.d.ts +6 -0
- package/dist/util/LogEnum.js +7 -0
- package/dist/util/Logger.d.ts +6 -0
- package/dist/util/Logger.js +18 -0
- package/dist/util/SyzyDate.d.ts +69 -0
- package/dist/util/SyzyDate.js +265 -0
- package/dist/util/dateUtils.d.ts +10 -0
- package/dist/util/dateUtils.js +24 -0
- package/dist/util/hostedinContainer.d.ts +1 -0
- package/dist/util/hostedinContainer.js +9 -0
- package/dist/util/model-types.d.ts +96 -0
- package/dist/util/model-types.js +18 -0
- package/dist/util/prefixAndResettingValidation.d.ts +9 -0
- package/dist/util/prefixAndResettingValidation.js +54 -0
- package/dist/util/transformToData.d.ts +1 -0
- package/dist/util/transformToData.js +9 -0
- package/package.json +14 -9
- package/dist/__federation_shared_@tanstack/react-query-DHuUsaNz.js +0 -2517
- package/dist/__federation_shared_react-CikWE6qG.js +0 -7
- package/dist/__federation_shared_react-bootstrap-BKlZRvMR.js +0 -7516
- package/dist/__federation_shared_react-dom-vrQ70Ay8.js +0 -372
- package/dist/__federation_shared_react-router-dom-BKminmS4.js +0 -10448
- package/dist/__federation_shared_react-select-B6kehBDI.js +0 -4056
- package/dist/__federation_shared_react-toastify-B0S0UGr3.js +0 -412
- package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
- package/dist/_virtual___federation_fn_import-XZCKozko.js +0 -217
- package/dist/favicon.ico +0 -0
- package/dist/index-DgtWMtjZ.js +0 -184
- package/dist/index-eZknuYwc.js +0 -1219
- package/dist/jsx-runtime-D_t4bG-_.js +0 -264
- package/dist/manifest.webmanifest +0 -1
- package/dist/pwa/Hotel-icon.jpg +0 -0
- package/dist/pwa/apple-touch-icon-180x180.png +0 -0
- package/dist/pwa/favicon.ico +0 -0
- package/dist/pwa/maskable-icon-512x512.png +0 -0
- package/dist/pwa/pwa-192x192.png +0 -0
- package/dist/pwa/pwa-512x512.png +0 -0
- package/dist/pwa/pwa-64x64.png +0 -0
- package/dist/registerSW.js +0 -1
- package/dist/sw.js +0 -1
- package/dist/workbox-1ef09536.js +0 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { Suspense, useContext } from 'react';
|
|
3
|
+
import AppContext from '../../store/AppContext';
|
|
4
|
+
const RemoteAmenityForm = React.lazy(() => import("bookingUIApp/AmenityForm"));
|
|
5
|
+
const AmenityForm = () => {
|
|
6
|
+
const { user } = useContext(AppContext) ?? { user: undefined };
|
|
7
|
+
const rawBranch = user?.branchId ?? "";
|
|
8
|
+
const parts = rawBranch.split("#");
|
|
9
|
+
const branchId = parts[1];
|
|
10
|
+
const isSuperAdmin = user?.roles?.includes("SUPERADMIN") ?? false;
|
|
11
|
+
return (_jsx("div", { children: _jsx(Suspense, { children: _jsx(RemoteAmenityForm, { branchId: branchId, isSuperAdmin: isSuperAdmin, classNames: {
|
|
12
|
+
fontTitle: "font-title",
|
|
13
|
+
fontLabel: "font-label",
|
|
14
|
+
formGroup: "form-group",
|
|
15
|
+
buttonPrimary: "btn-primary-global",
|
|
16
|
+
buttonSecondary: "btn-secondary-global"
|
|
17
|
+
} }) }) }));
|
|
18
|
+
};
|
|
19
|
+
export default AmenityForm;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { Suspense, useContext } from "react";
|
|
3
|
+
import AppContext from "../../store/AppContext";
|
|
4
|
+
import logo from "../../../src/assets/images/Hotel-Logo.jpg";
|
|
5
|
+
const RemoteBillingManagement = React.lazy(() => import("bookingUIApp/BillingManagement"));
|
|
6
|
+
const BillingManagement = () => {
|
|
7
|
+
const { user } = useContext(AppContext) ?? { user: undefined };
|
|
8
|
+
const rawBranch = user?.branchId ?? "";
|
|
9
|
+
const parts = rawBranch.split("#");
|
|
10
|
+
const branchId = parts[1] ?? "";
|
|
11
|
+
return (_jsx("div", { children: _jsx(Suspense, { children: _jsx(RemoteBillingManagement, { branchId: branchId, logoUrl: logo, classNames: {
|
|
12
|
+
fontTitle: "font-title",
|
|
13
|
+
buttonPrimary: "btn-primary-global",
|
|
14
|
+
card: "card shadow-lg border-0",
|
|
15
|
+
} }) }) }));
|
|
16
|
+
};
|
|
17
|
+
export default BillingManagement;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { Suspense, useContext } from 'react';
|
|
3
|
+
import AppContext from '../../store/AppContext';
|
|
4
|
+
const RemoteCreateRoomForm = React.lazy(() => import("bookingUIApp/CreateRoomForm"));
|
|
5
|
+
const CreateRoomForm = () => {
|
|
6
|
+
const { user } = useContext(AppContext) ?? { user: undefined };
|
|
7
|
+
const rawBranch = user?.branchId ?? "";
|
|
8
|
+
const parts = rawBranch.split("#");
|
|
9
|
+
const branchId = parts[1];
|
|
10
|
+
const isSuperAdmin = user?.roles?.includes("SUPERADMIN") ?? false;
|
|
11
|
+
return (_jsx("div", { children: _jsx(Suspense, { children: _jsx(RemoteCreateRoomForm, { branchId: branchId, isSuperAdmin: isSuperAdmin, classNames: {
|
|
12
|
+
fontTitle: "font-title",
|
|
13
|
+
fontLabel: "font-label",
|
|
14
|
+
formGroup: "form-group",
|
|
15
|
+
buttonPrimary: "btn-primary-global",
|
|
16
|
+
buttonSecondary: "btn-secondary-global"
|
|
17
|
+
} }) }) }));
|
|
18
|
+
};
|
|
19
|
+
export default CreateRoomForm;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { Suspense, useContext } from 'react';
|
|
3
|
+
import AppContext from '../../store/AppContext';
|
|
4
|
+
const RemoteExtraRequirementForm = React.lazy(() => import("bookingUIApp/ExtraRequirementForm"));
|
|
5
|
+
const ExtraRequirementForm = () => {
|
|
6
|
+
const { user } = useContext(AppContext) ?? { user: undefined };
|
|
7
|
+
const rawBranch = user?.branchId ?? "";
|
|
8
|
+
const parts = rawBranch.split("#");
|
|
9
|
+
const branchId = parts[1];
|
|
10
|
+
const isSuperAdmin = user?.roles?.includes("SUPERADMIN") ?? false;
|
|
11
|
+
return (_jsx("div", { children: _jsx(Suspense, { children: _jsx(RemoteExtraRequirementForm, { branchId: branchId, isSuperAdmin: isSuperAdmin, classNames: {
|
|
12
|
+
fontTitle: "font-title",
|
|
13
|
+
fontLabel: "font-label",
|
|
14
|
+
formGroup: "form-group",
|
|
15
|
+
buttonPrimary: "btn-primary-global",
|
|
16
|
+
buttonSecondary: "btn-secondary-global"
|
|
17
|
+
} }) }) }));
|
|
18
|
+
};
|
|
19
|
+
export default ExtraRequirementForm;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { Suspense, useContext } from 'react';
|
|
3
|
+
import AppContext from '../../store/AppContext';
|
|
4
|
+
const RemoteReservationForm = React.lazy(() => import("bookingUIApp/ReservationForm"));
|
|
5
|
+
const ReservationForm = () => {
|
|
6
|
+
const { user } = useContext(AppContext) ?? { user: undefined };
|
|
7
|
+
const rawBranch = user?.branchId ?? "";
|
|
8
|
+
const parts = rawBranch.split("#");
|
|
9
|
+
const branchId = parts[1];
|
|
10
|
+
return (_jsx("div", { children: _jsx(Suspense, { children: _jsx(RemoteReservationForm, { branchId: branchId, classNames: {
|
|
11
|
+
fontTitle: "font-title",
|
|
12
|
+
fontLabel: "font-label",
|
|
13
|
+
formGroup: "form-group",
|
|
14
|
+
buttonPrimary: "btn-primary-global",
|
|
15
|
+
buttonSecondary: "btn-secondary-global"
|
|
16
|
+
} }) }) }));
|
|
17
|
+
};
|
|
18
|
+
export default ReservationForm;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { Suspense, useContext } from 'react';
|
|
3
|
+
import AppContext from '../../store/AppContext';
|
|
4
|
+
const RemoteRoomCategoryForm = React.lazy(() => import("bookingUIApp/RoomCategoryForm"));
|
|
5
|
+
const RoomCategoryForm = () => {
|
|
6
|
+
const { user } = useContext(AppContext) ?? { user: undefined };
|
|
7
|
+
const rawBranch = user?.branchId ?? "";
|
|
8
|
+
const parts = rawBranch.split("#");
|
|
9
|
+
const branchId = parts[1];
|
|
10
|
+
const isSuperAdmin = user?.roles?.includes("SUPERADMIN") ?? false;
|
|
11
|
+
return (_jsx("div", { children: _jsx(Suspense, { children: _jsx(RemoteRoomCategoryForm, { branchId: branchId, isSuperAdmin: isSuperAdmin, classNames: {
|
|
12
|
+
fontTitle: "font-title",
|
|
13
|
+
fontLabel: "font-label",
|
|
14
|
+
formGroup: "form-group",
|
|
15
|
+
buttonPrimary: "btn-primary-global",
|
|
16
|
+
buttonSecondary: "btn-secondary-global"
|
|
17
|
+
} }) }) }));
|
|
18
|
+
};
|
|
19
|
+
export default RoomCategoryForm;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { Suspense, useContext } from 'react';
|
|
3
|
+
import AppContext from '../../store/AppContext';
|
|
4
|
+
const RemoteRoomCategoryPriceForm = React.lazy(() => import("bookingUIApp/RoomCategoryPriceForm"));
|
|
5
|
+
const RoomCategoryPriceForm = () => {
|
|
6
|
+
const { user } = useContext(AppContext) ?? { user: undefined };
|
|
7
|
+
const rawBranch = user?.branchId ?? "";
|
|
8
|
+
const parts = rawBranch.split("#");
|
|
9
|
+
const branchId = parts[1];
|
|
10
|
+
const userId = `${parts[3]}#${parts[4]}`;
|
|
11
|
+
const isSuperAdmin = user?.roles?.includes("SUPERADMIN") ?? false;
|
|
12
|
+
return (_jsx("div", { children: _jsx(Suspense, { children: _jsx(RemoteRoomCategoryPriceForm, { branchId: branchId, isSuperAdmin: isSuperAdmin, userId: userId, classNames: {
|
|
13
|
+
fontTitle: "font-title",
|
|
14
|
+
fontLabel: "font-label",
|
|
15
|
+
formGroup: "form-group",
|
|
16
|
+
buttonPrimary: "btn-primary-global",
|
|
17
|
+
buttonSecondary: "btn-secondary-global"
|
|
18
|
+
} }) }) }));
|
|
19
|
+
};
|
|
20
|
+
export default RoomCategoryPriceForm;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { Suspense, useContext } from 'react';
|
|
3
|
+
import AppContext from '../../store/AppContext';
|
|
4
|
+
const RemoteRoomList = React.lazy(() => import("bookingUIApp/RoomList"));
|
|
5
|
+
const RoomExtraRequirementCapture = () => {
|
|
6
|
+
const { user } = useContext(AppContext) ?? { user: undefined };
|
|
7
|
+
const rawBranch = user?.branchId ?? "";
|
|
8
|
+
const parts = rawBranch.split("#");
|
|
9
|
+
const branchId = parts[1];
|
|
10
|
+
return (_jsx("div", { children: _jsxs(Suspense, { children: [_jsx("h3", { className: 'text-center mt-4', children: "Guest Requirement" }), _jsx(RemoteRoomList, { branchId: branchId, forExtraRequirementCapture: true, classNames: {
|
|
11
|
+
fontTitle: "font-title",
|
|
12
|
+
fontLabel: "font-label",
|
|
13
|
+
formGroup: "form-group",
|
|
14
|
+
buttonPrimary: "btn-primary-global",
|
|
15
|
+
buttonSecondary: "btn-secondary-global"
|
|
16
|
+
} })] }) }));
|
|
17
|
+
};
|
|
18
|
+
export default RoomExtraRequirementCapture;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { Suspense, useContext } from 'react';
|
|
3
|
+
import AppContext from '../../store/AppContext';
|
|
4
|
+
const RemoteRoomFacilityForm = React.lazy(() => import("bookingUIApp/RoomFacilityForm"));
|
|
5
|
+
const RoomFacilityForm = () => {
|
|
6
|
+
const { user } = useContext(AppContext) ?? { user: undefined };
|
|
7
|
+
const rawBranch = user?.branchId ?? "";
|
|
8
|
+
const parts = rawBranch.split("#");
|
|
9
|
+
const branchId = parts[1];
|
|
10
|
+
const isSuperAdmin = user?.roles?.includes("SUPERADMIN") ?? false;
|
|
11
|
+
return (_jsx("div", { children: _jsx(Suspense, { children: _jsx(RemoteRoomFacilityForm, { branchId: branchId, isSuperAdmin: isSuperAdmin, classNames: {
|
|
12
|
+
fontTitle: "font-title",
|
|
13
|
+
fontLabel: "font-label",
|
|
14
|
+
formGroup: "form-group",
|
|
15
|
+
buttonPrimary: "btn-primary-global",
|
|
16
|
+
buttonSecondary: "btn-secondary-global"
|
|
17
|
+
} }) }) }));
|
|
18
|
+
};
|
|
19
|
+
export default RoomFacilityForm;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { Suspense, useContext } from 'react';
|
|
3
|
+
import AppContext from '../../store/AppContext';
|
|
4
|
+
const RemoteRoomList = React.lazy(() => import("bookingUIApp/RoomList"));
|
|
5
|
+
const RoomReservationAction = () => {
|
|
6
|
+
const { user } = useContext(AppContext) ?? { user: undefined };
|
|
7
|
+
const rawBranch = user?.branchId ?? "";
|
|
8
|
+
const parts = rawBranch.split("#");
|
|
9
|
+
const branchId = parts[1];
|
|
10
|
+
return (_jsx("div", { children: _jsxs(Suspense, { children: [_jsx("h3", { className: 'text-center mt-4', children: "Reservation Action" }), _jsx(RemoteRoomList, { branchId: branchId, forRoomReservationAction: true, classNames: {
|
|
11
|
+
fontTitle: "font-title",
|
|
12
|
+
fontLabel: "font-label",
|
|
13
|
+
formGroup: "form-group",
|
|
14
|
+
buttonPrimary: "btn-primary-global",
|
|
15
|
+
buttonSecondary: "btn-secondary-global"
|
|
16
|
+
} })] }) }));
|
|
17
|
+
};
|
|
18
|
+
export default RoomReservationAction;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useContext } from "react";
|
|
3
|
+
import { EnvConfig } from "../../config/EnvConfig";
|
|
4
|
+
import AppContext from "../../store/AppContext";
|
|
5
|
+
const appName = EnvConfig.applicationName || "Application";
|
|
6
|
+
const ReservationCount = React.lazy(() => import("bookingUIApp/ReservationCount"));
|
|
7
|
+
const Home = () => {
|
|
8
|
+
const { user } = useContext(AppContext) ?? { user: undefined };
|
|
9
|
+
const rawBranch = user?.branchId ?? "";
|
|
10
|
+
const parts = rawBranch.split("#");
|
|
11
|
+
const branchId = parts[1];
|
|
12
|
+
return (_jsxs("div", { className: "d-fle justify-content-center align-items-center h-100 flex-wrap", children: [_jsx("div", { className: "px-3 w-100 col-12", children: _jsx(ReservationCount, { branchId: branchId }) }), _jsx("div", { className: "h-75 d-flex justify-content-center align-items-center", children: _jsxs("div", { className: "text-center", children: [_jsxs("h2", { className: "fw-bold", children: [appName, " Dash Board"] }), _jsx("br", {}), _jsxs("h5", { children: ["\uD83D\uDC4B Welcome To ", appName, "! \uD83D\uDE42"] })] }) })] }));
|
|
13
|
+
};
|
|
14
|
+
export default Home;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
const LoadingSpinner = () => {
|
|
3
|
+
return (_jsx("div", { className: "d-flex justify-content-center align-items-center h-100", children: _jsxs("div", { className: "text-center", children: [_jsx("div", { className: "spinner-border text-primary p-4", role: "status", children: _jsx("span", { className: "visually-hidden", children: "Loading..." }) }), _jsx("h5", { className: "mt-3", children: "Loading..." })] }) }));
|
|
4
|
+
};
|
|
5
|
+
export default LoadingSpinner;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { useForm } from "react-hook-form";
|
|
4
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
5
|
+
import { toast } from "react-toastify";
|
|
6
|
+
import "react-toastify/dist/ReactToastify.css";
|
|
7
|
+
import { useNavigate } from "react-router-dom";
|
|
8
|
+
import { FaEye, FaEyeSlash } from "react-icons/fa";
|
|
9
|
+
import logo from "../../../src/assets/images/Hotel-Logo.jpg";
|
|
10
|
+
import { signIn, signUp, confirmSignUp, confirmResetPassword, getCurrentUser, confirmSignIn, resetPassword } from "aws-amplify/auth";
|
|
11
|
+
import { signInSchema, registerSchema, confirmSignUpSchema, resetPasswordSchema, forceResetSchema, forgotPasswordSchema, } from "./loginSchema";
|
|
12
|
+
import { ALL, HIDE_SIGN_UP, HIDE_SIGN_UP_IS_NO } from "../../static/constants";
|
|
13
|
+
import { useGetSettingsByPkAndSk } from "../api/settings-api";
|
|
14
|
+
const LoginForm = ({ login }) => {
|
|
15
|
+
const [authMode, setAuthMode] = useState("signin");
|
|
16
|
+
const navigate = useNavigate();
|
|
17
|
+
const [tempUsername, setTempUsername] = useState("");
|
|
18
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
19
|
+
const { settingsByPkAndSk } = useGetSettingsByPkAndSk(ALL, HIDE_SIGN_UP);
|
|
20
|
+
const getSchema = () => {
|
|
21
|
+
switch (authMode) {
|
|
22
|
+
case "signin":
|
|
23
|
+
return signInSchema;
|
|
24
|
+
case "register":
|
|
25
|
+
return registerSchema;
|
|
26
|
+
case "confirm":
|
|
27
|
+
return confirmSignUpSchema;
|
|
28
|
+
case "forgot":
|
|
29
|
+
return forgotPasswordSchema;
|
|
30
|
+
case "reset":
|
|
31
|
+
return resetPasswordSchema;
|
|
32
|
+
case "forceReset":
|
|
33
|
+
return forceResetSchema;
|
|
34
|
+
default:
|
|
35
|
+
return signInSchema;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const { register, handleSubmit, formState: { errors }, reset, } = useForm({
|
|
39
|
+
resolver: zodResolver(getSchema()),
|
|
40
|
+
defaultValues: {
|
|
41
|
+
username: "",
|
|
42
|
+
email: "",
|
|
43
|
+
password: "",
|
|
44
|
+
confirmPassword: "",
|
|
45
|
+
confirmationCode: "",
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
reset({}, { keepValues: false });
|
|
50
|
+
}, [authMode, reset]);
|
|
51
|
+
const onSubmit = async (data) => {
|
|
52
|
+
try {
|
|
53
|
+
if (authMode === "signin") {
|
|
54
|
+
const res = await signIn({
|
|
55
|
+
username: data.username,
|
|
56
|
+
password: data.password,
|
|
57
|
+
});
|
|
58
|
+
if (res.nextStep?.signInStep === "CONFIRM_SIGN_IN_WITH_NEW_PASSWORD_REQUIRED") {
|
|
59
|
+
reset({
|
|
60
|
+
password: "",
|
|
61
|
+
confirmPassword: "",
|
|
62
|
+
});
|
|
63
|
+
setAuthMode("forceReset");
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (res.isSignedIn) {
|
|
67
|
+
const user = await getCurrentUser();
|
|
68
|
+
localStorage.setItem("lastUser", user.username);
|
|
69
|
+
login(true);
|
|
70
|
+
navigate("/");
|
|
71
|
+
reset();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (authMode === "register") {
|
|
75
|
+
const { nextStep } = await signUp({
|
|
76
|
+
username: data.username,
|
|
77
|
+
password: data.password,
|
|
78
|
+
options: { userAttributes: { email: data.email } },
|
|
79
|
+
});
|
|
80
|
+
if (nextStep?.signUpStep === "CONFIRM_SIGN_UP")
|
|
81
|
+
setAuthMode("confirm");
|
|
82
|
+
reset();
|
|
83
|
+
}
|
|
84
|
+
if (authMode === "confirm") {
|
|
85
|
+
await confirmSignUp({
|
|
86
|
+
username: data.username,
|
|
87
|
+
confirmationCode: data.confirmationCode,
|
|
88
|
+
});
|
|
89
|
+
setAuthMode("signin");
|
|
90
|
+
reset();
|
|
91
|
+
}
|
|
92
|
+
if (authMode === "forgot") {
|
|
93
|
+
try {
|
|
94
|
+
await resetPassword({ username: data.username });
|
|
95
|
+
toast.success("Verification code sent to your email!");
|
|
96
|
+
setTempUsername(data.username); // store username for next step
|
|
97
|
+
setAuthMode("reset");
|
|
98
|
+
reset({}, { keepValues: false });
|
|
99
|
+
}
|
|
100
|
+
catch (err) {
|
|
101
|
+
toast.error(err.message || "Failed to send reset code");
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (authMode === "reset") {
|
|
105
|
+
try {
|
|
106
|
+
await confirmResetPassword({
|
|
107
|
+
username: tempUsername,
|
|
108
|
+
confirmationCode: data.confirmationCode,
|
|
109
|
+
newPassword: data.password
|
|
110
|
+
});
|
|
111
|
+
toast.success("Password reset successfully!");
|
|
112
|
+
setAuthMode("signin");
|
|
113
|
+
reset();
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
if (error.name === "ExpiredCodeException") {
|
|
117
|
+
toast.error("Code expired. Request a new one.");
|
|
118
|
+
setAuthMode("forgot");
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (error.name === "CodeMismatchException" || error.name === "InvalidParameterException") {
|
|
122
|
+
toast.error("Invalid verification code. Please request a new one.");
|
|
123
|
+
setAuthMode("forgot");
|
|
124
|
+
setTempUsername("");
|
|
125
|
+
reset();
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
toast.error(error.message || "Failed to reset password");
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (authMode === "forceReset") {
|
|
132
|
+
await confirmSignIn({ challengeResponse: data.password });
|
|
133
|
+
login(true);
|
|
134
|
+
navigate("/");
|
|
135
|
+
reset();
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
catch (err) {
|
|
139
|
+
toast.error(err.message || "Something went wrong");
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
const renderInput = (label, type, name) => {
|
|
143
|
+
const isPassword = type === "password";
|
|
144
|
+
return (_jsxs("div", { className: "mb-3 position-relative", children: [_jsxs("div", { className: "input-group", children: [_jsx("input", { type: isPassword ? (showPassword ? "text" : "password") : type, placeholder: label, ...register(name), className: `form-control ${errors[name] ? "is-invalid" : ""}` }), isPassword && (_jsx("span", { className: "input-group-text bg-white", style: { cursor: "pointer" }, onClick: () => setShowPassword((prev) => !prev), children: showPassword ? _jsx(FaEye, { size: 18 }) : _jsx(FaEyeSlash, { size: 18 }) }))] }), errors[name] && (_jsx("div", { className: "invalid-feedback d-block", children: errors[name]?.message }))] }));
|
|
145
|
+
};
|
|
146
|
+
return (_jsx("div", { className: "d-flex justify-content-center align-items-center vh-100 bg-light", children: _jsx("div", { className: "card shadow-sm p-4 p-md-5 w-100", style: { maxWidth: "420px" }, children: _jsxs("form", { onSubmit: handleSubmit(onSubmit), children: [_jsx("div", { className: "d-flex justify-content-center", children: _jsx("img", { className: "w-75 mx-auto mb-4", src: logo }) }), _jsxs("h4", { className: "text-center mb-4 fw-bold", children: [authMode === "signin" && "Sign in to your account", authMode === "register" && "Create a new account", authMode === "confirm" && "Verify your email", authMode === "forgot" && "Forgot Password?", authMode === "reset" && "Reset Password", authMode === "forceReset" && "Set New Password"] }), authMode === "signin" && (_jsxs(_Fragment, { children: [renderInput("Username", "text", "username"), renderInput("Password", "password", "password"), _jsx("button", { type: "submit", className: "btn btn-primary w-100 mb-2", children: "Sign In" }), _jsxs("div", { className: "d-flex justify-content-between", children: [(settingsByPkAndSk && settingsByPkAndSk?.value === HIDE_SIGN_UP_IS_NO) &&
|
|
147
|
+
_jsx("button", { type: "button", className: "btn btn-link p-0", onClick: () => setAuthMode("register"), children: "Create Account" }), _jsx("button", { type: "button", className: "btn btn-link p-0", onClick: () => setAuthMode("forgot"), children: "Forgot Password?" })] })] })), authMode === "register" && (_jsxs(_Fragment, { children: [renderInput("Username", "text", "username"), renderInput("Email", "email", "email"), renderInput("Password", "password", "password"), renderInput("Confirm Password", "password", "confirmPassword"), _jsx("button", { type: "submit", className: "btn btn-success w-100 mb-2", children: "Register" }), _jsx("button", { type: "button", className: "btn btn-link w-100", onClick: () => setAuthMode("signin"), children: "Back to Sign In" })] })), authMode === "confirm" && (_jsxs(_Fragment, { children: [renderInput("Verification Code", "text", "confirmationCode"), _jsx("button", { type: "submit", className: "btn btn-primary w-100 mb-2", children: "Confirm" }), _jsx("button", { type: "button", className: "btn btn-link w-100", onClick: () => setAuthMode("signin"), children: "Back to Sign In" })] })), authMode === "forgot" && (_jsxs(_Fragment, { children: [renderInput("Username", "text", "username"), _jsx("button", { type: "submit", className: "btn btn-warning w-100 mb-2", children: "Send Reset Code" }), _jsx("button", { type: "button", className: "btn btn-link w-100", onClick: () => setAuthMode("signin"), children: "Back to Sign In" })] })), authMode === "reset" && (_jsxs(_Fragment, { children: [renderInput("Verification Code", "text", "confirmationCode"), renderInput("New Password", "password", "password"), renderInput("Confirm New Password", "password", "confirmPassword"), _jsx("button", { type: "submit", className: "btn btn-success w-100 mb-2", children: "Reset Password" }), _jsx("button", { type: "button", className: "btn btn-link w-100", onClick: () => setAuthMode("signin"), children: "Back to Sign In" })] })), authMode === "forceReset" && (_jsxs(_Fragment, { children: [renderInput("New Password", "password", "password"), renderInput("Confirm New Password", "password", "confirmPassword"), _jsx("button", { type: "submit", className: "btn btn-success w-100 mb-2", children: "Update Password" }), _jsx("button", { type: "button", className: "btn btn-link w-100", onClick: () => setAuthMode("signin"), children: "Back to Sign In" })] }))] }) }) }));
|
|
148
|
+
};
|
|
149
|
+
export default LoginForm;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const signInSchema: z.ZodObject<{
|
|
3
|
+
username: z.ZodString;
|
|
4
|
+
password: z.ZodString;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export declare const registerSchema: z.ZodObject<{
|
|
7
|
+
username: z.ZodString;
|
|
8
|
+
email: z.ZodString;
|
|
9
|
+
password: z.ZodString;
|
|
10
|
+
confirmPassword: z.ZodString;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export declare const resetPasswordSchema: z.ZodObject<{
|
|
13
|
+
confirmationCode: z.ZodString;
|
|
14
|
+
password: z.ZodString;
|
|
15
|
+
confirmPassword: z.ZodString;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export declare const forgotPasswordSchema: z.ZodObject<{
|
|
18
|
+
username: z.ZodString;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export declare const confirmSignUpSchema: z.ZodObject<{
|
|
21
|
+
username: z.ZodString;
|
|
22
|
+
confirmationCode: z.ZodString;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export declare const forceResetSchema: z.ZodObject<{
|
|
25
|
+
password: z.ZodString;
|
|
26
|
+
confirmPassword: z.ZodString;
|
|
27
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// Schema for Sign In
|
|
3
|
+
export const signInSchema = z.object({
|
|
4
|
+
username: z.string().min(1, "Username is required"),
|
|
5
|
+
password: z.string().min(1, "Password is required"),
|
|
6
|
+
});
|
|
7
|
+
// Schema for Register
|
|
8
|
+
export const registerSchema = z.object({
|
|
9
|
+
username: z.string().min(1, "Username is required"),
|
|
10
|
+
email: z.string().email("Invalid email"),
|
|
11
|
+
password: z.string().min(6, "Password must be at least 6 characters"),
|
|
12
|
+
confirmPassword: z.string().min(1, "Confirm Password is required"),
|
|
13
|
+
}).refine((data) => data.password === data.confirmPassword, {
|
|
14
|
+
message: "Passwords do not match",
|
|
15
|
+
path: ["confirmPassword"],
|
|
16
|
+
});
|
|
17
|
+
// Schema for Forgot/Reset Password
|
|
18
|
+
export const resetPasswordSchema = z.object({
|
|
19
|
+
confirmationCode: z.string().min(6, "Code is required"),
|
|
20
|
+
password: z.string().min(8, "Password must be at least 8 chars"),
|
|
21
|
+
confirmPassword: z.string().min(8, "Confirm your password"),
|
|
22
|
+
}).refine((data) => data.password === data.confirmPassword, {
|
|
23
|
+
message: "Passwords do not match",
|
|
24
|
+
path: ["confirmPassword"],
|
|
25
|
+
});
|
|
26
|
+
export const forgotPasswordSchema = z.object({
|
|
27
|
+
username: z.string().min(1, "Username is required"),
|
|
28
|
+
});
|
|
29
|
+
// Schema for Confirm Sign Up
|
|
30
|
+
export const confirmSignUpSchema = z.object({
|
|
31
|
+
username: z.string().min(1, "Username is required"),
|
|
32
|
+
confirmationCode: z.string().min(1, "Verification code is required"),
|
|
33
|
+
});
|
|
34
|
+
// Schema for Force Reset
|
|
35
|
+
export const forceResetSchema = z.object({
|
|
36
|
+
password: z.string().min(8, "Password must be at least 8 characters"),
|
|
37
|
+
confirmPassword: z.string().min(8, "Confirm Password is required"),
|
|
38
|
+
}).refine((data) => data.password === data.confirmPassword, {
|
|
39
|
+
message: "Passwords do not match",
|
|
40
|
+
path: ["confirmPassword"],
|
|
41
|
+
});
|