@axelor/aos-mobile-core 8.3.7 → 8.4.0
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 +2 -312
- package/lib/api/aop-filter-api.d.ts +9 -0
- package/lib/api/aop-filter-api.js +63 -0
- package/lib/api/aop-filter-api.js.map +1 -0
- package/lib/api/currency-api.d.ts +1 -0
- package/lib/api/currency-api.js +28 -0
- package/lib/api/currency-api.js.map +1 -0
- package/lib/api/index.d.ts +12 -0
- package/lib/api/index.js +30 -0
- package/lib/api/index.js.map +1 -0
- package/lib/api/login-api.js +2 -2
- package/lib/api/login-api.js.map +1 -1
- package/lib/api/metafile-api.d.ts +1 -1
- package/lib/api/print-template-api.d.ts +1 -1
- package/lib/api/print-template-api.js +2 -1
- package/lib/api/print-template-api.js.map +1 -1
- package/lib/apiProviders/Standard/requests.helper.d.ts +13 -1
- package/lib/apiProviders/Standard/requests.helper.js +37 -2
- package/lib/apiProviders/Standard/requests.helper.js.map +1 -1
- package/lib/apiProviders/middlewares/index.d.ts +2 -1
- package/lib/apiProviders/middlewares/index.js +2 -1
- package/lib/apiProviders/middlewares/index.js.map +1 -1
- package/lib/apiProviders/middlewares/maintenance.d.ts +5 -0
- package/lib/apiProviders/middlewares/maintenance.js +63 -0
- package/lib/apiProviders/middlewares/maintenance.js.map +1 -0
- package/lib/app/Application.d.ts +1 -0
- package/lib/app/Application.js +1 -1
- package/lib/app/Application.js.map +1 -1
- package/lib/app/ContextedApplication.js +4 -2
- package/lib/app/ContextedApplication.js.map +1 -1
- package/lib/app/ContextsProvider.d.ts +2 -1
- package/lib/app/ContextsProvider.js +5 -1
- package/lib/app/ContextsProvider.js.map +1 -1
- package/lib/app/modules/types.d.ts +2 -2
- package/lib/auth/api/config-api.js +1 -1
- package/lib/auth/api/config-api.js.map +1 -1
- package/lib/components/external/Camera/Camera.js +10 -0
- package/lib/components/external/Camera/Camera.js.map +1 -1
- package/lib/components/external/Toast/Toast.js +10 -35
- package/lib/components/external/Toast/Toast.js.map +1 -1
- package/lib/components/external/Toast/ToastDisplay.d.ts +4 -0
- package/lib/components/external/Toast/ToastDisplay.js +59 -0
- package/lib/components/external/Toast/ToastDisplay.js.map +1 -0
- package/lib/components/molecules/UploadFileInput/UploadFileInput.js +35 -52
- package/lib/components/molecules/UploadFileInput/UploadFileInput.js.map +1 -1
- package/lib/components/molecules/index.d.ts +0 -3
- package/lib/components/molecules/index.js +0 -3
- package/lib/components/molecules/index.js.map +1 -1
- package/lib/components/organisms/DateInput/DateInput.js +1 -4
- package/lib/components/organisms/DateInput/DateInput.js.map +1 -1
- package/lib/components/organisms/FilterContainer/FilterContainer.d.ts +12 -0
- package/lib/components/organisms/FilterContainer/FilterContainer.js +54 -0
- package/lib/components/organisms/FilterContainer/FilterContainer.js.map +1 -0
- package/lib/components/organisms/PopupFilters/PopupFilters.d.ts +10 -0
- package/lib/components/organisms/PopupFilters/PopupFilters.js +73 -0
- package/lib/components/organisms/PopupFilters/PopupFilters.js.map +1 -0
- package/lib/components/organisms/PopupPrintTemplate/PopupPrintTemplate.d.ts +3 -1
- package/lib/components/organisms/PopupPrintTemplate/PopupPrintTemplate.js +20 -34
- package/lib/components/organisms/PopupPrintTemplate/PopupPrintTemplate.js.map +1 -1
- package/lib/components/organisms/index.d.ts +2 -4
- package/lib/components/organisms/index.js +2 -4
- package/lib/components/organisms/index.js.map +1 -1
- package/lib/components/pages/FormView/FormView.js +2 -0
- package/lib/components/pages/FormView/FormView.js.map +1 -1
- package/lib/components/templates/SearchListView/SearchListView.js +8 -5
- package/lib/components/templates/SearchListView/SearchListView.js.map +1 -1
- package/lib/components/templates/index.d.ts +0 -1
- package/lib/components/templates/index.js +0 -1
- package/lib/components/templates/index.js.map +1 -1
- package/lib/features/asyncFunctions-index.d.ts +12 -0
- package/lib/features/asyncFunctions-index.js +30 -0
- package/lib/features/asyncFunctions-index.js.map +1 -0
- package/lib/features/authSlice.js +8 -0
- package/lib/features/authSlice.js.map +1 -1
- package/lib/features/cameraScannerSlice.d.ts +3 -1
- package/lib/features/cameraScannerSlice.js +14 -2
- package/lib/features/cameraScannerSlice.js.map +1 -1
- package/lib/features/{attachedFilesSlice.d.ts → currencySlice.d.ts} +3 -3
- package/lib/features/{attachedFilesSlice.js → currencySlice.js} +20 -15
- package/lib/features/currencySlice.js.map +1 -0
- package/lib/features/index.d.ts +1 -2
- package/lib/features/index.js +1 -2
- package/lib/features/index.js.map +1 -1
- package/lib/forms/studio/api.helpers.d.ts +1 -1
- package/lib/forms/studio/api.helpers.js.map +1 -1
- package/lib/header/FilterProvider.d.ts +22 -0
- package/lib/header/FilterProvider.js +48 -0
- package/lib/header/FilterProvider.js.map +1 -0
- package/lib/header/HeaderActionsProvider.d.ts +1 -0
- package/lib/header/HeaderActionsProvider.js.map +1 -1
- package/lib/header/hooks.d.ts +1 -67
- package/lib/header/hooks.js +153 -158
- package/lib/header/hooks.js.map +1 -1
- package/lib/header/index.d.ts +2 -1
- package/lib/header/index.js +1 -0
- package/lib/header/index.js.map +1 -1
- package/lib/header/types.d.ts +0 -4
- package/lib/hooks/index.d.ts +3 -0
- package/lib/hooks/index.js +3 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/use-currency-formatter.d.ts +1 -0
- package/lib/hooks/use-currency-formatter.js +37 -0
- package/lib/hooks/use-currency-formatter.js.map +1 -0
- package/lib/hooks/use-header-registers.js +2 -0
- package/lib/hooks/use-header-registers.js.map +1 -1
- package/lib/hooks/use-mass-scanner.d.ts +15 -0
- package/lib/hooks/use-mass-scanner.js +70 -0
- package/lib/hooks/use-mass-scanner.js.map +1 -0
- package/lib/hooks/use-outdated-version.d.ts +3 -0
- package/lib/hooks/use-outdated-version.js +30 -0
- package/lib/hooks/use-outdated-version.js.map +1 -0
- package/lib/hooks/use-scan-activator.d.ts +8 -3
- package/lib/hooks/use-scan-activator.js +42 -22
- package/lib/hooks/use-scan-activator.js.map +1 -1
- package/lib/i18n/translations/en.json +9 -18
- package/lib/i18n/translations/fr.json +9 -18
- package/lib/index.d.ts +16 -22
- package/lib/index.js +16 -22
- package/lib/index.js.map +1 -1
- package/lib/models/objectFields.js +9 -0
- package/lib/models/objectFields.js.map +1 -1
- package/lib/navigator/Navigator.d.ts +3 -6
- package/lib/navigator/Navigator.js +17 -19
- package/lib/navigator/Navigator.js.map +1 -1
- package/lib/navigator/components/DrawerContent.d.ts +13 -0
- package/lib/navigator/{drawer → components}/DrawerContent.js +34 -73
- package/lib/navigator/components/DrawerContent.js.map +1 -0
- package/lib/navigator/components/header/Header.d.ts +9 -0
- package/lib/navigator/{drawer → components/header}/Header.js +13 -21
- package/lib/navigator/components/header/Header.js.map +1 -0
- package/lib/navigator/components/header/HeaderButton.d.ts +6 -0
- package/lib/navigator/{drawer/DrawerToggleButton.js → components/header/HeaderButton.js} +10 -10
- package/lib/navigator/components/header/HeaderButton.js.map +1 -0
- package/lib/navigator/components/header/HeaderOptionMenu.d.ts +13 -0
- package/lib/{components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.js → navigator/components/header/HeaderOptionMenu.js} +10 -43
- package/lib/navigator/components/header/HeaderOptionMenu.js.map +1 -0
- package/lib/navigator/components/header/HeaderOptionMenuItem.js.map +1 -0
- package/lib/navigator/components/header/index.d.ts +1 -0
- package/lib/navigator/components/header/index.js +19 -0
- package/lib/navigator/components/header/index.js.map +1 -0
- package/lib/navigator/components/index.d.ts +2 -0
- package/lib/navigator/components/index.js +20 -0
- package/lib/navigator/components/index.js.map +1 -0
- package/lib/navigator/components/menu/AuthMenu.d.ts +8 -0
- package/lib/navigator/{drawer/AuthMenuIconButton.js → components/menu/AuthMenu.js} +10 -9
- package/lib/navigator/components/menu/AuthMenu.js.map +1 -0
- package/lib/navigator/components/menu/Menu.d.ts +13 -0
- package/lib/navigator/components/menu/Menu.js +63 -0
- package/lib/navigator/components/menu/Menu.js.map +1 -0
- package/lib/navigator/components/menu/MenuIconButton.d.ts +14 -0
- package/lib/navigator/{drawer → components/menu}/MenuIconButton.js +17 -20
- package/lib/navigator/components/menu/MenuIconButton.js.map +1 -0
- package/lib/navigator/components/menu/MenuItem.d.ts +14 -0
- package/lib/navigator/{drawer → components/menu}/MenuItem.js +6 -6
- package/lib/navigator/components/menu/MenuItem.js.map +1 -0
- package/lib/navigator/components/menu/MenuItemEntry.d.ts +16 -0
- package/lib/navigator/{drawer → components/menu}/MenuItemEntry.js +11 -19
- package/lib/navigator/components/menu/MenuItemEntry.js.map +1 -0
- package/lib/navigator/components/menu/MenuItemList.d.ts +12 -0
- package/lib/navigator/{drawer/Menu.js → components/menu/MenuItemList.js} +5 -46
- package/lib/navigator/components/menu/MenuItemList.js.map +1 -0
- package/lib/navigator/components/menu/MenuSeparator.d.ts +7 -0
- package/lib/navigator/{drawer → components/menu}/MenuSeparator.js +4 -8
- package/lib/navigator/components/menu/MenuSeparator.js.map +1 -0
- package/lib/navigator/components/menu/MenuTitle.d.ts +8 -0
- package/lib/navigator/{drawer → components/menu}/MenuTitle.js +3 -3
- package/lib/navigator/components/menu/MenuTitle.js.map +1 -0
- package/lib/navigator/components/menu/SubMenuItem.d.ts +9 -0
- package/lib/navigator/{drawer → components/menu}/SubMenuItem.js +4 -4
- package/lib/navigator/components/menu/SubMenuItem.js.map +1 -0
- package/lib/navigator/components/menu/SubMenuItemList.d.ts +12 -0
- package/lib/navigator/{drawer → components/menu}/SubMenuItemList.js +5 -5
- package/lib/navigator/components/menu/SubMenuItemList.js.map +1 -0
- package/lib/navigator/components/menu/index.d.ts +4 -0
- package/lib/navigator/components/menu/index.js +22 -0
- package/lib/navigator/components/menu/index.js.map +1 -0
- package/lib/navigator/helpers/access.helper.d.ts +4 -0
- package/lib/navigator/helpers/access.helper.js +121 -0
- package/lib/navigator/helpers/access.helper.js.map +1 -0
- package/lib/navigator/helpers/compatibility.helper.d.ts +3 -0
- package/lib/navigator/helpers/compatibility.helper.js +123 -0
- package/lib/navigator/helpers/compatibility.helper.js.map +1 -0
- package/lib/navigator/helpers/index.d.ts +6 -0
- package/lib/navigator/helpers/index.js +24 -0
- package/lib/navigator/helpers/index.js.map +1 -0
- package/lib/navigator/helpers/menu.helper.d.ts +56 -0
- package/lib/navigator/{menu.helper.js → helpers/menu.helper.js} +17 -22
- package/lib/navigator/helpers/menu.helper.js.map +1 -0
- package/lib/navigator/helpers/module.helper.d.ts +8 -0
- package/lib/navigator/helpers/module.helper.js +58 -0
- package/lib/navigator/helpers/module.helper.js.map +1 -0
- package/lib/navigator/helpers/navigation-type.d.ts +4 -0
- package/lib/navigator/helpers/navigation-type.js +19 -0
- package/lib/navigator/helpers/navigation-type.js.map +1 -0
- package/lib/navigator/helpers/tool.helper.d.ts +3 -0
- package/lib/navigator/helpers/tool.helper.js +44 -0
- package/lib/navigator/helpers/tool.helper.js.map +1 -0
- package/lib/navigator/index.d.ts +3 -1
- package/lib/navigator/index.js +3 -1
- package/lib/navigator/index.js.map +1 -1
- package/lib/navigator/{ActiveScreenProvider.d.ts → providers/active-screen.d.ts} +1 -1
- package/lib/navigator/{ActiveScreenProvider.js → providers/active-screen.js} +3 -3
- package/lib/navigator/providers/active-screen.js.map +1 -0
- package/lib/navigator/providers/index.d.ts +3 -0
- package/lib/navigator/providers/index.js +21 -0
- package/lib/navigator/providers/index.js.map +1 -0
- package/lib/navigator/providers/module-navigator.d.ts +8 -0
- package/lib/{screens/MailMessageScreen.js → navigator/providers/module-navigator.js} +7 -7
- package/lib/navigator/providers/module-navigator.js.map +1 -0
- package/lib/navigator/{NavigationInformationsProvider.d.ts → providers/navigation-informations.d.ts} +6 -2
- package/lib/navigator/{NavigationInformationsProvider.js → providers/navigation-informations.js} +11 -10
- package/lib/navigator/providers/navigation-informations.js.map +1 -0
- package/lib/screens/ErrorScreen.d.ts +7 -5
- package/lib/screens/ErrorScreen.js +26 -4
- package/lib/screens/ErrorScreen.js.map +1 -1
- package/lib/screens/index.d.ts +10 -33
- package/lib/screens/index.js +1 -17
- package/lib/screens/index.js.map +1 -1
- package/lib/tools/FileDownloader.js +7 -2
- package/lib/tools/FileDownloader.js.map +1 -1
- package/lib/tools/FilePicker.js +4 -3
- package/lib/tools/FilePicker.js.map +1 -1
- package/lib/types/index.d.ts +0 -2
- package/lib/types/index.js +0 -2
- package/lib/types/index.js.map +1 -1
- package/lib/utils/date.d.ts +1 -0
- package/lib/utils/date.js +4 -1
- package/lib/utils/date.js.map +1 -1
- package/lib/utils/index.d.ts +2 -2
- package/lib/utils/index.js +2 -2
- package/lib/utils/index.js.map +1 -1
- package/lib/websocket/WebSocketProvider.d.ts +20 -0
- package/lib/websocket/WebSocketProvider.js +89 -0
- package/lib/websocket/WebSocketProvider.js.map +1 -0
- package/lib/websocket/hooks.d.ts +2 -0
- package/lib/{navigator/drawer/BackIcon.js → websocket/hooks.js} +8 -17
- package/lib/websocket/hooks.js.map +1 -0
- package/lib/websocket/index.d.ts +2 -0
- package/lib/websocket/index.js +20 -0
- package/lib/websocket/index.js.map +1 -0
- package/lib/websocket/types.d.ts +13 -0
- package/lib/websocket/types.js +26 -0
- package/lib/websocket/types.js.map +1 -0
- package/package.json +35 -29
- package/lib/api/mail-message-api.d.ts +0 -44
- package/lib/api/mail-message-api.js +0 -129
- package/lib/api/mail-message-api.js.map +0 -1
- package/lib/components/molecules/HeaderOptionsMenuItem/HeaderOptionMenuItem.js.map +0 -1
- package/lib/components/molecules/MailMessageReadIcon/MailMessageReadIcon.d.ts +0 -12
- package/lib/components/molecules/MailMessageReadIcon/MailMessageReadIcon.js +0 -59
- package/lib/components/molecules/MailMessageReadIcon/MailMessageReadIcon.js.map +0 -1
- package/lib/components/molecules/TrackItem/TrackItem.d.ts +0 -10
- package/lib/components/molecules/TrackItem/TrackItem.js +0 -65
- package/lib/components/molecules/TrackItem/TrackItem.js.map +0 -1
- package/lib/components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.d.ts +0 -13
- package/lib/components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.js.map +0 -1
- package/lib/components/organisms/MailMessageCard/MailMessageCard.d.ts +0 -17
- package/lib/components/organisms/MailMessageCard/MailMessageCard.js +0 -76
- package/lib/components/organisms/MailMessageCard/MailMessageCard.js.map +0 -1
- package/lib/components/organisms/MailMessageCommentCard/MailMessageCommentCard.d.ts +0 -13
- package/lib/components/organisms/MailMessageCommentCard/MailMessageCommentCard.js +0 -138
- package/lib/components/organisms/MailMessageCommentCard/MailMessageCommentCard.js.map +0 -1
- package/lib/components/organisms/MailMessageNotificationCard/MailMessageNotificationCard.d.ts +0 -17
- package/lib/components/organisms/MailMessageNotificationCard/MailMessageNotificationCard.js +0 -81
- package/lib/components/organisms/MailMessageNotificationCard/MailMessageNotificationCard.js.map +0 -1
- package/lib/components/templates/MailMessageView/MailMessageView.d.ts +0 -10
- package/lib/components/templates/MailMessageView/MailMessageView.js +0 -184
- package/lib/components/templates/MailMessageView/MailMessageView.js.map +0 -1
- package/lib/features/attachedFilesSlice.js.map +0 -1
- package/lib/features/mailMessageSlice.d.ts +0 -97
- package/lib/features/mailMessageSlice.js +0 -196
- package/lib/features/mailMessageSlice.js.map +0 -1
- package/lib/navigator/ActiveScreenProvider.js.map +0 -1
- package/lib/navigator/NavigationInformationsProvider.js.map +0 -1
- package/lib/navigator/drawer/AuthMenuIconButton.d.ts +0 -7
- package/lib/navigator/drawer/AuthMenuIconButton.js.map +0 -1
- package/lib/navigator/drawer/BackIcon.d.ts +0 -5
- package/lib/navigator/drawer/BackIcon.js.map +0 -1
- package/lib/navigator/drawer/DrawerContent.d.ts +0 -10
- package/lib/navigator/drawer/DrawerContent.js.map +0 -1
- package/lib/navigator/drawer/DrawerToggleButton.d.ts +0 -5
- package/lib/navigator/drawer/DrawerToggleButton.js.map +0 -1
- package/lib/navigator/drawer/Header.d.ts +0 -8
- package/lib/navigator/drawer/Header.js.map +0 -1
- package/lib/navigator/drawer/Menu.d.ts +0 -10
- package/lib/navigator/drawer/Menu.js.map +0 -1
- package/lib/navigator/drawer/MenuIconButton.d.ts +0 -12
- package/lib/navigator/drawer/MenuIconButton.js.map +0 -1
- package/lib/navigator/drawer/MenuItem.d.ts +0 -12
- package/lib/navigator/drawer/MenuItem.js.map +0 -1
- package/lib/navigator/drawer/MenuItemEntry.d.ts +0 -14
- package/lib/navigator/drawer/MenuItemEntry.js.map +0 -1
- package/lib/navigator/drawer/MenuSeparator.d.ts +0 -6
- package/lib/navigator/drawer/MenuSeparator.js.map +0 -1
- package/lib/navigator/drawer/MenuTitle.d.ts +0 -6
- package/lib/navigator/drawer/MenuTitle.js.map +0 -1
- package/lib/navigator/drawer/SubMenuItem.d.ts +0 -8
- package/lib/navigator/drawer/SubMenuItem.js.map +0 -1
- package/lib/navigator/drawer/SubMenuItemList.d.ts +0 -11
- package/lib/navigator/drawer/SubMenuItemList.js.map +0 -1
- package/lib/navigator/menu.helper.d.ts +0 -17
- package/lib/navigator/menu.helper.js.map +0 -1
- package/lib/navigator/module.helper.d.ts +0 -25
- package/lib/navigator/module.helper.js +0 -299
- package/lib/navigator/module.helper.js.map +0 -1
- package/lib/screens/MailMessageAttachedFilesScreen.d.ts +0 -5
- package/lib/screens/MailMessageAttachedFilesScreen.js +0 -68
- package/lib/screens/MailMessageAttachedFilesScreen.js.map +0 -1
- package/lib/screens/MailMessageScreen.d.ts +0 -5
- package/lib/screens/MailMessageScreen.js.map +0 -1
- package/lib/types/mail-message-notification-type.d.ts +0 -12
- package/lib/types/mail-message-notification-type.js +0 -48
- package/lib/types/mail-message-notification-type.js.map +0 -1
- package/lib/types/mail-message-type.d.ts +0 -18
- package/lib/types/mail-message-type.js +0 -55
- package/lib/types/mail-message-type.js.map +0 -1
- /package/lib/{components/molecules/HeaderOptionsMenuItem → navigator/components/header}/HeaderOptionMenuItem.d.ts +0 -0
- /package/lib/{components/molecules/HeaderOptionsMenuItem → navigator/components/header}/HeaderOptionMenuItem.js +0 -0
package/README.md
CHANGED
|
@@ -19,10 +19,10 @@ It contains:
|
|
|
19
19
|
- Auth module with login and user screens
|
|
20
20
|
- Translations management system
|
|
21
21
|
- Various helper tools : clipboard, file viewer, external app management
|
|
22
|
-
- Management of MailMessages
|
|
23
22
|
- AOS linked components or using external libraries : Camera, Scanner, PlanningView, Stopwatch, ...
|
|
24
23
|
- Menu management
|
|
25
24
|
- Storage management
|
|
25
|
+
- and many more...
|
|
26
26
|
|
|
27
27
|
## Usage
|
|
28
28
|
|
|
@@ -32,319 +32,9 @@ Install the library :
|
|
|
32
32
|
yarn add @axelor/aos-mobile-core
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
Compatibility with React v18.2.x and React Native v0.70.x.
|
|
36
|
-
|
|
37
35
|
This package has a few required libraries as peer dependencies, please check package.json for more informations.
|
|
38
36
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
The component Application enables you to create an application really simply :
|
|
42
|
-
|
|
43
|
-
```typescript
|
|
44
|
-
interface Application {
|
|
45
|
-
modules: Module[]; // Functionnal packages
|
|
46
|
-
mainMenu?: string; // Main menu when openning app
|
|
47
|
-
additionalsReducers?: any;
|
|
48
|
-
version: string; // App version to be display on login screen
|
|
49
|
-
themes?: Theme[]; // Additionnals themes
|
|
50
|
-
defaultTheme?: Theme; // Default theme for all users
|
|
51
|
-
writingThemes?: Writing[]; // Additionnals writing themes
|
|
52
|
-
defaultWritingTheme?: Writing; // Default writing theme for all users
|
|
53
|
-
showModulesSubtitle: boolean; // Option to show subtitles of modules in the drawer menu
|
|
54
|
-
configuration?: appConfig; // Configuration to customize application
|
|
55
|
-
}
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Each module is based on the same interface and has the following attributes :
|
|
59
|
-
|
|
60
|
-
```typescript
|
|
61
|
-
interface Module {
|
|
62
|
-
name: string; // Module name
|
|
63
|
-
title?: string; // Module title in the drawer
|
|
64
|
-
subtitle?: string; // Module subtitle in the drawer
|
|
65
|
-
icon?: string; // Module icon in the drawer
|
|
66
|
-
disabled?: boolean;
|
|
67
|
-
menus: {
|
|
68
|
-
// List of menus of the module
|
|
69
|
-
[screenKey: string]: {
|
|
70
|
-
title: string;
|
|
71
|
-
icon: string;
|
|
72
|
-
screen: string; // Name of the main screen of this menu
|
|
73
|
-
disabled?: boolean;
|
|
74
|
-
parent?: string; // Option to add menu in another module
|
|
75
|
-
order?: number; // Option to change order of menu (default: index * 10)
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
screens: {
|
|
79
|
-
// List of screens of the module
|
|
80
|
-
[screenKey: string]: {
|
|
81
|
-
component: React.FC<any>;
|
|
82
|
-
title: string;
|
|
83
|
-
options?: ScreenOptions; // screen options to activate or not shadedHeader
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
translations?: {
|
|
87
|
-
// All translations of the module
|
|
88
|
-
[languageKey: string]: any;
|
|
89
|
-
};
|
|
90
|
-
reducers?: any; // Reducers of the module
|
|
91
|
-
backgroundFunctions?: Function[]; // List of function that should be executed in the background, interval is 5 minutes
|
|
92
|
-
models?: {
|
|
93
|
-
objectFields?: ObjectFields; // Fields of object for API calls structured on YUP schemas
|
|
94
|
-
sortFields?: SortFields; // Sort rules for API calls
|
|
95
|
-
searchFields?: SearchFields; // List of fields of object for searchs
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
### Perform request
|
|
101
|
-
|
|
102
|
-
This package provides a tool for making HTTP requests. This tool is based on axios. To use it, simply import the provider and use the appropriate method:
|
|
103
|
-
|
|
104
|
-
```typescript
|
|
105
|
-
import {axiosApiProvider} from '@axelor/aos-mobile-core';
|
|
106
|
-
|
|
107
|
-
...
|
|
108
|
-
|
|
109
|
-
axiosApiProvider.post({url: '...', data: {...}});
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
You can also create standard requests with the functions createStandardSearch and createStandardFetch.
|
|
113
|
-
|
|
114
|
-
```typescript
|
|
115
|
-
createStandardSearch = ({
|
|
116
|
-
model: string; // Full name of the model
|
|
117
|
-
criteria?: Criteria[]; // List of criterias
|
|
118
|
-
domain?: string;
|
|
119
|
-
domainContext?: any;
|
|
120
|
-
fieldKey: string; // Key of the API fields configuration given in models props of module
|
|
121
|
-
sortKey?: string; // Key of the sort rules configuration given in models props of module
|
|
122
|
-
page: number; // Current page in search
|
|
123
|
-
numberElementsByPage?: number; // Number of elements that should be fetched, default is 10 and can be adjusted in app configuration file
|
|
124
|
-
}): Promise<any>;
|
|
125
|
-
|
|
126
|
-
createStandardFetch = ({
|
|
127
|
-
model: string; // Full name of the model
|
|
128
|
-
fieldKey: string; // Key of the API fields configuration given in models props of module
|
|
129
|
-
id: number; // Id of the object that should be fetched
|
|
130
|
-
relatedFields?: any; // Additional fields of the relational objects
|
|
131
|
-
}): Promise<any>;
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
### Translations system
|
|
135
|
-
|
|
136
|
-
This package is also responsible for managing translations. To add translations in the database, you just have to indicate them as an JSON format in the export of the module:
|
|
137
|
-
|
|
138
|
-
```typescript
|
|
139
|
-
const myModule : Module {
|
|
140
|
-
name: "my-module-key";
|
|
141
|
-
title: "MyModule_Name";
|
|
142
|
-
subtitle: "MyModule_SubName";
|
|
143
|
-
icon: ...;
|
|
144
|
-
menus: {...};
|
|
145
|
-
screens: {...};
|
|
146
|
-
translations: {
|
|
147
|
-
en: {
|
|
148
|
-
MyModule_Name: "My module name",
|
|
149
|
-
MyModule_SubName: "My module",
|
|
150
|
-
HelloWorld: "Hello world"
|
|
151
|
-
},
|
|
152
|
-
fr: {
|
|
153
|
-
MyModule_Name: "Le nom de mon module",
|
|
154
|
-
MyModule_SubName: "Mon module",
|
|
155
|
-
HelloWorld: "Bonjour"
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
Then, to translate an element and thus retrieve its translation, the translation function must be retrieved from the `useTranslator` hook:
|
|
162
|
-
|
|
163
|
-
```typescript
|
|
164
|
-
import {useTranslator} from '@axelor/aos-mobile-core';
|
|
165
|
-
import {Text} from '@axelor/aos-mobile-ui';
|
|
166
|
-
|
|
167
|
-
...
|
|
168
|
-
|
|
169
|
-
const I18n = useTranslator();
|
|
170
|
-
|
|
171
|
-
...
|
|
172
|
-
|
|
173
|
-
<Text>{I18n.t('HelloWorld')}</Text>
|
|
174
|
-
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
The auth module, present in this package, allows the user's language to be modified directly from his profile. However, the package also provides the reducer to perform this action in the case of an overload or the addition on another screen. To change the language, simply update the user on the server:
|
|
178
|
-
|
|
179
|
-
```typescript
|
|
180
|
-
import {updateActiveUser, useDispatch, useSelector} from '@axelor/aos-mobile-core';
|
|
181
|
-
|
|
182
|
-
...
|
|
183
|
-
|
|
184
|
-
const {user} = useSelector(state => state.user);
|
|
185
|
-
const dispatch = useDispatch();
|
|
186
|
-
|
|
187
|
-
...
|
|
188
|
-
|
|
189
|
-
const updateLanguage = useCallback(
|
|
190
|
-
language => {
|
|
191
|
-
dispatch(
|
|
192
|
-
updateActiveUser({id: user.id, language, version: user.version}),
|
|
193
|
-
);
|
|
194
|
-
},
|
|
195
|
-
[dispatch, user],
|
|
196
|
-
);
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
Default language of the application is 'en' but this can be modified in the application configuration file under defaultLanguage props.
|
|
200
|
-
|
|
201
|
-
### Helper tools
|
|
202
|
-
|
|
203
|
-
This package provides several helpers such as:
|
|
204
|
-
|
|
205
|
-
- Clipboard provider
|
|
206
|
-
|
|
207
|
-
To copy something to the user's clipboard, just call the clipboardProvider.copyToClipboard with the string value of what you want to copy:
|
|
208
|
-
|
|
209
|
-
```typescript
|
|
210
|
-
import {clipboardProvider} from '@axelor/aos-mobile-core';
|
|
211
|
-
import {Icon, useThemeColor} from '@axelor/aos-mobile-ui';
|
|
212
|
-
|
|
213
|
-
...
|
|
214
|
-
|
|
215
|
-
const Colors = useThemeColor();
|
|
216
|
-
|
|
217
|
-
...
|
|
218
|
-
|
|
219
|
-
{address?.fullName && (
|
|
220
|
-
<Icon
|
|
221
|
-
name="copy"
|
|
222
|
-
color={Colors.secondaryColor.foreground}
|
|
223
|
-
size={20}
|
|
224
|
-
touchable={true}
|
|
225
|
-
onPress={() =>
|
|
226
|
-
clipboardProvider.copyToClipboard(address?.fullName)
|
|
227
|
-
}
|
|
228
|
-
/>
|
|
229
|
-
)}
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
- Open a file in an external app
|
|
233
|
-
|
|
234
|
-
This package provides a tool to open files from the server, either MetaFile or DMSFile, in the application dedicated to the latter type on the phone.
|
|
235
|
-
|
|
236
|
-
To do this, simply use the openFileInExternalApp function of the package with the necessary information:
|
|
237
|
-
|
|
238
|
-
```typescript
|
|
239
|
-
import {openFileInExternalApp, useSelector, useTranslator} from '@axelor/aos-mobile-core';
|
|
240
|
-
|
|
241
|
-
...
|
|
242
|
-
|
|
243
|
-
const {baseUrl, token, jsessionId} = useSelector(state => state.auth);
|
|
244
|
-
const I18n = useTranslator();
|
|
245
|
-
|
|
246
|
-
...
|
|
247
|
-
|
|
248
|
-
const handleShowFile = async item => {
|
|
249
|
-
await openFileInExternalApp(
|
|
250
|
-
{fileName: item.fileName, id: item.id, isMetaFile: isMetaFile},
|
|
251
|
-
{baseUrl: baseUrl, token: token, jsessionId: jsessionId},
|
|
252
|
-
I18n,
|
|
253
|
-
);
|
|
254
|
-
};
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
- Pick a file for phone data
|
|
258
|
-
|
|
259
|
-
This package provides a tool to pick an image from phone storage.
|
|
260
|
-
|
|
261
|
-
To do this, simply use the handleDocumentSelection function of the package with the necessary information:
|
|
262
|
-
|
|
263
|
-
```typescript
|
|
264
|
-
import {handleDocumentSelection} from '@axelor/aos-mobile-core';
|
|
265
|
-
|
|
266
|
-
...
|
|
267
|
-
|
|
268
|
-
const handlePickFile = async () => {
|
|
269
|
-
await handleDocumentSelection(console.log);
|
|
270
|
-
};
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
- Open an external app with contact informations
|
|
274
|
-
|
|
275
|
-
To have the contact applications (call, email, maps, ...), just use the linkingProvider with the dedicated method:
|
|
276
|
-
|
|
277
|
-
1. URL management: `openURL(url: string, error: {title: string; message: string})`
|
|
278
|
-
2. Browser management: `openBrowser(url: string)`
|
|
279
|
-
3. Call management: `openCallApp(tel: string)`
|
|
280
|
-
4. Message management: `openSMSApp(tel: string)`
|
|
281
|
-
5. Email management: `openMailApp(email: string, subject?: string, body?: string, to?: string, cc?: string, bcc?: string)`
|
|
282
|
-
6. Maps management: `openMapApp(address?: string, destination?: string, latitude?: number, longitude?: number, transportType: string)`
|
|
283
|
-
|
|
284
|
-
An example with maps app:
|
|
285
|
-
|
|
286
|
-
```typescript
|
|
287
|
-
import {linkingProvider} from '@axelor/aos-mobile-core';
|
|
288
|
-
import {Icon, useThemeColor} from '@axelor/aos-mobile-ui';
|
|
289
|
-
|
|
290
|
-
...
|
|
291
|
-
|
|
292
|
-
const Colors = useThemeColor();
|
|
293
|
-
|
|
294
|
-
...
|
|
295
|
-
|
|
296
|
-
{address?.fullName && (
|
|
297
|
-
<Icon
|
|
298
|
-
name="map-marked-alt"
|
|
299
|
-
color={Colors.secondaryColor.foreground}
|
|
300
|
-
size={20}
|
|
301
|
-
touchable={true}
|
|
302
|
-
onPress={() =>
|
|
303
|
-
linkingProvider.openMapApp(address?.fullName)
|
|
304
|
-
}
|
|
305
|
-
/>
|
|
306
|
-
)}
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
### Add MailMessages
|
|
310
|
-
|
|
311
|
-
- Management of MailMessages on objects
|
|
312
|
-
|
|
313
|
-
This package provides a component to add MailMessages functionality to the header. This component also allows to display its children if there are any as a dropdown menu.
|
|
314
|
-
|
|
315
|
-
For the first functionality of this component, it is necessary to provide in props the name of the object model ("com.axelor.apps.stock.db.StockCorrection" for the stock corrections for example), the id of the current object, and the navigation attribute to go on the dedicated screens:
|
|
316
|
-
|
|
317
|
-
```typescript
|
|
318
|
-
import {HeaderOptionsMenu} from '@axelor/aos-mobile-core';
|
|
319
|
-
import {DropdownMenuItem} from '@axelor/aos-mobile-ui';
|
|
320
|
-
|
|
321
|
-
...
|
|
322
|
-
|
|
323
|
-
React.useLayoutEffect(() => {
|
|
324
|
-
navigation.setOptions({
|
|
325
|
-
headerRight: () => (
|
|
326
|
-
<HeaderOptionsMenu
|
|
327
|
-
model={...}
|
|
328
|
-
modelId={...}
|
|
329
|
-
navigation={navigation}>
|
|
330
|
-
<DropdownMenuItem
|
|
331
|
-
icon="..."
|
|
332
|
-
placeholder={...}
|
|
333
|
-
onPress={...}
|
|
334
|
-
/>
|
|
335
|
-
</HeaderOptionsMenu>
|
|
336
|
-
),
|
|
337
|
-
});
|
|
338
|
-
}, [navigation, ...]);
|
|
339
|
-
```
|
|
340
|
-
|
|
341
|
-
An example of rendering:
|
|
342
|
-
|
|
343
|
-

|
|
344
|
-
|
|
345
|
-
### Components
|
|
346
|
-
|
|
347
|
-
This package also provides a number of components linked to Axelor Open Suite (AOS) or requiring external libraries such as the camera, the calendar view or the stopwatch.
|
|
37
|
+
For more information about how to use the tools, please check the [documentation](https://docs.axelor.com/aos-mobile/).
|
|
348
38
|
|
|
349
39
|
## Developpment
|
|
350
40
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function fetchDefaultFilters({ modelName, options, }: {
|
|
2
|
+
modelName: string;
|
|
3
|
+
options?: any;
|
|
4
|
+
}): Promise<any>;
|
|
5
|
+
export declare function fetchMetaFilters({ page, filterName, userId }: {
|
|
6
|
+
page?: number;
|
|
7
|
+
filterName: any;
|
|
8
|
+
userId: any;
|
|
9
|
+
}): Promise<any>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { axiosApiProvider, createStandardSearch, } from '../apiProviders';
|
|
19
|
+
const createMetaFiltersCriteria = ({ filterName, userId }) => {
|
|
20
|
+
return [
|
|
21
|
+
{
|
|
22
|
+
fieldName: 'filterView',
|
|
23
|
+
operator: '=',
|
|
24
|
+
value: filterName,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
operator: 'or',
|
|
28
|
+
criteria: [
|
|
29
|
+
{
|
|
30
|
+
fieldName: 'shared',
|
|
31
|
+
operator: '=',
|
|
32
|
+
value: true,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
fieldName: 'user.id',
|
|
36
|
+
operator: '=',
|
|
37
|
+
value: userId,
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
};
|
|
43
|
+
export async function fetchDefaultFilters({ modelName, options, }) {
|
|
44
|
+
return axiosApiProvider.post({
|
|
45
|
+
url: `/ws/meta/view`,
|
|
46
|
+
data: {
|
|
47
|
+
data: {
|
|
48
|
+
type: 'search-filters',
|
|
49
|
+
...(options != null && options),
|
|
50
|
+
},
|
|
51
|
+
model: modelName,
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
export async function fetchMetaFilters({ page = 0, filterName, userId }) {
|
|
56
|
+
return createStandardSearch({
|
|
57
|
+
model: 'com.axelor.meta.db.MetaFilter',
|
|
58
|
+
criteria: createMetaFiltersCriteria({ filterName, userId }),
|
|
59
|
+
fieldKey: 'core_metaFilter',
|
|
60
|
+
page,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=aop-filter-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aop-filter-api.js","sourceRoot":"","sources":["../../src/api/aop-filter-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,gBAAgB,EAChB,oBAAoB,GAErB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,yBAAyB,GAAG,CAAC,EAAC,UAAU,EAAE,MAAM,EAAC,EAAc,EAAE;IACrE,OAAO;QACL;YACE,SAAS,EAAE,YAAY;YACvB,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,UAAU;SAClB;QACD;YACE,QAAQ,EAAE,IAAI;YACd,QAAQ,EAAE;gBACR;oBACE,SAAS,EAAE,QAAQ;oBACnB,QAAQ,EAAE,GAAG;oBACb,KAAK,EAAE,IAAI;iBACZ;gBACD;oBACE,SAAS,EAAE,SAAS;oBACpB,QAAQ,EAAE,GAAG;oBACb,KAAK,EAAE,MAAM;iBACd;aACF;SACF;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,EACxC,SAAS,EACT,OAAO,GAIR;IACC,OAAO,gBAAgB,CAAC,IAAI,CAAC;QAC3B,GAAG,EAAE,eAAe;QACpB,IAAI,EAAE;YACJ,IAAI,EAAE;gBACJ,IAAI,EAAE,gBAAgB;gBACtB,GAAG,CAAC,OAAO,IAAI,IAAI,IAAI,OAAO,CAAC;aAChC;YACD,KAAK,EAAE,SAAS;SACjB;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,EAAC,IAAI,GAAG,CAAC,EAAE,UAAU,EAAE,MAAM,EAAC;IACnE,OAAO,oBAAoB,CAAC;QAC1B,KAAK,EAAE,+BAA+B;QACtC,QAAQ,EAAE,yBAAyB,CAAC,EAAC,UAAU,EAAE,MAAM,EAAC,CAAC;QACzD,QAAQ,EAAE,iBAAiB;QAC3B,IAAI;KACL,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getAllCurrencies({}: {}): Promise<any>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { createStandardSearch } from '../apiProviders';
|
|
19
|
+
export async function getAllCurrencies({}) {
|
|
20
|
+
return createStandardSearch({
|
|
21
|
+
model: 'com.axelor.apps.base.db.Currency',
|
|
22
|
+
fieldKey: 'core_currency',
|
|
23
|
+
numberElementsByPage: null,
|
|
24
|
+
page: 0,
|
|
25
|
+
provider: 'model',
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=currency-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"currency-api.js","sourceRoot":"","sources":["../../src/api/currency-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AAErD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,EAAE;IACvC,OAAO,oBAAoB,CAAC;QAC1B,KAAK,EAAE,kCAAkC;QACzC,QAAQ,EAAE,eAAe;QACzB,oBAAoB,EAAE,IAAI;QAC1B,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,OAAO;KAClB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { fetchAnomalies } from './anomaly-api';
|
|
2
|
+
export { fetchDefaultFilters, fetchMetaFilters } from './aop-filter-api';
|
|
3
|
+
export { getAppConfig } from './app-config-api';
|
|
4
|
+
export { getAllCurrencies } from './currency-api';
|
|
5
|
+
export { ejectAxios, getActiveUserInfo, initAxiosWithHeaders, loginApi, logoutApi, } from './login-api';
|
|
6
|
+
export { getAllMetaModules } from './meta-module-api';
|
|
7
|
+
export { deleteMetaFile, fetchFileDetails, uploadBase64, uploadFile, } from './metafile-api';
|
|
8
|
+
export { fetchModel } from './model-api';
|
|
9
|
+
export { getNetInfo, getTokenInfo } from './net-info-utils';
|
|
10
|
+
export { fetchActionPrint, fetchFileToPrint, searchPrintingTemplate as searchPrintingTemplateApi, } from './print-template-api';
|
|
11
|
+
export { traceError } from './traceback-api';
|
|
12
|
+
export { searchUser as searchUserApi } from './user-api';
|
package/lib/api/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
export { fetchAnomalies } from './anomaly-api';
|
|
19
|
+
export { fetchDefaultFilters, fetchMetaFilters } from './aop-filter-api';
|
|
20
|
+
export { getAppConfig } from './app-config-api';
|
|
21
|
+
export { getAllCurrencies } from './currency-api';
|
|
22
|
+
export { ejectAxios, getActiveUserInfo, initAxiosWithHeaders, loginApi, logoutApi, } from './login-api';
|
|
23
|
+
export { getAllMetaModules } from './meta-module-api';
|
|
24
|
+
export { deleteMetaFile, fetchFileDetails, uploadBase64, uploadFile, } from './metafile-api';
|
|
25
|
+
export { fetchModel } from './model-api';
|
|
26
|
+
export { getNetInfo, getTokenInfo } from './net-info-utils';
|
|
27
|
+
export { fetchActionPrint, fetchFileToPrint, searchPrintingTemplate as searchPrintingTemplateApi, } from './print-template-api';
|
|
28
|
+
export { traceError } from './traceback-api';
|
|
29
|
+
export { searchUser as searchUserApi } from './user-api';
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAE,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAC,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,oBAAoB,EACpB,QAAQ,EACR,SAAS,GACV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AACpD,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AACvC,OAAO,EAAC,UAAU,EAAE,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,IAAI,yBAAyB,GACpD,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAC,UAAU,IAAI,aAAa,EAAC,MAAM,YAAY,CAAC"}
|
package/lib/api/login-api.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
import axios from 'axios';
|
|
19
|
-
import { fieldsParserMiddleware, provider, translationMiddleware, } from '../apiProviders';
|
|
19
|
+
import { fieldsParserMiddleware, provider, translationMiddleware, maintenanceMiddleware, } from '../apiProviders';
|
|
20
20
|
const LOGIN_PATH = 'callback';
|
|
21
21
|
const SESSION_REGEX = /JSESSIONID=\w+/g;
|
|
22
22
|
const getJsessionId = (cookie) => {
|
|
@@ -37,7 +37,7 @@ export function initAxiosWithHeaders(res, url) {
|
|
|
37
37
|
config.headers['x-csrf-token'] = token;
|
|
38
38
|
return config;
|
|
39
39
|
});
|
|
40
|
-
const responseInterceptorId = axios.interceptors.response.use(_response => fieldsParserMiddleware(translationMiddleware(_response)));
|
|
40
|
+
const responseInterceptorId = axios.interceptors.response.use(_response => fieldsParserMiddleware(translationMiddleware(_response)), _error => maintenanceMiddleware(_error));
|
|
41
41
|
provider.getModelApi()?.init();
|
|
42
42
|
return { token, jsessionId, requestInterceptorId, responseInterceptorId };
|
|
43
43
|
}
|
package/lib/api/login-api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-api.js","sourceRoot":"","sources":["../../src/api/login-api.ts"],"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AC;IAChB,CAAC,CAAC,CAAC;IAEH,MAAM,qBAAqB,GAAG,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAC3D,SAAS,CAAC,EAAE,CAAC,sBAAsB,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC,EACrE,MAAM,CAAC,EAAE,CAAC,qBAAqB,CAAC,MAAM,CAAC,CACxC,CAAC;IAEF,QAAQ,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC;IAE/B,OAAO,EAAC,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,qBAAqB,EAAC,CAAC;AAC1E,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,GAAW,EACX,QAAgB,EAChB,QAAgB;IAOhB,OAAO,KAAK;SACT,IAAI,CAAC,GAAG,GAAG,GAAG,UAAU,EAAE,EAAE,EAAC,QAAQ,EAAE,QAAQ,EAAC,CAAC;SACjD,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,oBAAoB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS;IAC7B,OAAO,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AAC9B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACrC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;IACxD,OAAO;QACL,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAChC,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI;KACnD,CAAC;AACJ,CAAC"}
|
|
@@ -47,7 +47,8 @@ export async function fetchActionPrint({ id, model }) {
|
|
|
47
47
|
const fileName = res.view?.views?.[0]?.name;
|
|
48
48
|
const error = res?.error?.message;
|
|
49
49
|
return { templateSet, fileName, error };
|
|
50
|
-
})
|
|
50
|
+
})
|
|
51
|
+
.catch(() => ({}));
|
|
51
52
|
}
|
|
52
53
|
export async function searchPrintingTemplate({ searchValue = null, page = 0, idList, }) {
|
|
53
54
|
if (!Array.isArray(idList) || idList.length === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"print-template-api.js","sourceRoot":"","sources":["../../src/api/print-template-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,8BAA8B,GAAG,CAAC,EAAC,WAAW,EAAE,MAAM,EAAC,EAAE,EAAE;IAC/D,OAAO;QACL,kBAAkB,CAAC,oBAAoB,EAAE,WAAW,CAAC;QACrD;YACE,SAAS,EAAE,IAAI;YACf,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,MAAM;SACd;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,EAAC,EAAE,EAAE,KAAK,EAAC;IAChD,OAAO,gBAAgB;SACpB,IAAI,CAAC;QACJ,GAAG,EAAE,WAAW;QAChB,IAAI,EAAE;YACJ,MAAM,EAAE,8BAA8B;YACtC,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE;gBACJ,OAAO,EAAE;oBACP,EAAE,EAAE,EAAE;oBACN,MAAM,EAAE,KAAK;iBACd;aACF;SACF;KACF,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;SACjC,IAAI,CAAC,GAAG,CAAC,EAAE;QACV,MAAM,WAAW,GAAG,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,uBAAuB,CAAC;QAChE,MAAM,QAAQ,GAAG,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;QAC5C,MAAM,KAA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F,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;SACjC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACZ,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO;QAC1B,QAAQ,EAAE,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI;KACrC,CAAC,CAAC,CAAC;AACR,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Criteria, Domain } from '../Model';
|
|
2
|
+
import { Filter } from '../../header/FilterProvider';
|
|
2
3
|
interface SearchProps {
|
|
3
4
|
model: string;
|
|
4
5
|
criteria?: Criteria[];
|
|
@@ -13,6 +14,7 @@ interface SearchProps {
|
|
|
13
14
|
isCompanyM2M?: boolean;
|
|
14
15
|
companyFieldName?: string;
|
|
15
16
|
companySetFieldName?: string;
|
|
17
|
+
filter?: Filter;
|
|
16
18
|
}
|
|
17
19
|
interface HierarchicalSearchProps extends SearchProps {
|
|
18
20
|
parentField: string;
|
|
@@ -30,13 +32,23 @@ declare class RequestBuilder {
|
|
|
30
32
|
constructor();
|
|
31
33
|
init(defaultRequestLimit: number): void;
|
|
32
34
|
getRequestLimit(): number;
|
|
33
|
-
createStandardSearch: ({ model, criteria, domain, domainContext, fieldKey, sortKey, page, numberElementsByPage, provider, companyId, isCompanyM2M, companyFieldName, companySetFieldName, }: SearchProps) => Promise<any>;
|
|
35
|
+
createStandardSearch: ({ model, criteria, domain, domainContext, fieldKey, sortKey, page, numberElementsByPage, provider, companyId, isCompanyM2M, companyFieldName, companySetFieldName, filter, }: SearchProps) => Promise<any>;
|
|
34
36
|
private getIdsHierarchicalSearch;
|
|
35
37
|
createHierarchicalSearch: ({ parentField, parentId, criteria, ...props }: HierarchicalSearchProps) => Promise<any>;
|
|
36
38
|
createStandardFetch: ({ model, fieldKey, id, relatedFields, provider, }: FetchProps) => Promise<any>;
|
|
37
39
|
}
|
|
38
40
|
export declare const requestBuilder: RequestBuilder;
|
|
39
41
|
export declare const getCompanyCriteria: (companyId: number, companyFieldName?: string) => Criteria;
|
|
42
|
+
export declare function getFilterDomains(model: string, filter?: Filter): {
|
|
43
|
+
domains?: {
|
|
44
|
+
type: string;
|
|
45
|
+
name: string;
|
|
46
|
+
domain: string;
|
|
47
|
+
title: string;
|
|
48
|
+
}[];
|
|
49
|
+
domainContext?: any;
|
|
50
|
+
criteria?: Criteria[];
|
|
51
|
+
};
|
|
40
52
|
export declare const getCompanyDomain: (companyId: number, companySetFieldName?: string) => Domain;
|
|
41
53
|
export declare const createStandardSearch: (searchOptions: SearchProps) => Promise<any>;
|
|
42
54
|
export declare const createHierarchicalSearch: (searchOptions: HierarchicalSearchProps) => Promise<any>;
|