@axelor/aos-mobile-core 7.2.7 → 8.0.1
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/lib/api/app-config-api.d.ts +3 -0
- package/lib/api/app-config-api.js +29 -0
- package/lib/api/app-config-api.js.map +1 -0
- package/lib/api/net-info-utils.js +22 -3
- package/lib/api/net-info-utils.js.map +1 -1
- package/lib/apiProviders/utils.js +3 -3
- package/lib/apiProviders/utils.js.map +1 -1
- package/lib/app/Application.d.ts +2 -0
- package/lib/app/Application.js +1 -0
- package/lib/app/Application.js.map +1 -1
- package/lib/app/ContextedApplication.js +4 -37
- package/lib/app/ContextedApplication.js.map +1 -1
- package/lib/app/Module.d.ts +19 -10
- package/lib/auth/api/index.d.ts +1 -2
- package/lib/auth/api/index.js +1 -2
- package/lib/auth/api/index.js.map +1 -1
- package/lib/auth/api/localization-api.d.ts +1 -0
- package/lib/auth/api/localization-api.js +27 -0
- package/lib/auth/api/localization-api.js.map +1 -0
- package/lib/auth/features/asyncFunctionsIndex.d.ts +2 -2
- package/lib/auth/features/asyncFunctionsIndex.js +2 -2
- package/lib/auth/features/asyncFunctionsIndex.js.map +1 -1
- package/lib/auth/features/configSlice.d.ts +0 -22
- package/lib/auth/features/configSlice.js +0 -36
- package/lib/auth/features/configSlice.js.map +1 -1
- package/lib/auth/features/index.d.ts +1 -1
- package/lib/auth/features/index.js +1 -1
- package/lib/auth/features/index.js.map +1 -1
- package/lib/auth/features/{languageSlice.d.ts → localizationSlice.d.ts} +3 -3
- package/lib/auth/features/{languageSlice.js → localizationSlice.js} +12 -12
- package/lib/auth/features/localizationSlice.js.map +1 -0
- package/lib/auth/hooks/use-auth-headers.js +2 -2
- package/lib/auth/hooks/use-auth-headers.js.map +1 -1
- package/lib/auth/i18n/en.json +1 -3
- package/lib/auth/i18n/fr.json +1 -3
- package/lib/auth/index.js +3 -2
- package/lib/auth/index.js.map +1 -1
- package/lib/auth/models/objectFields.js +10 -0
- package/lib/auth/models/objectFields.js.map +1 -1
- package/lib/auth/screens/UserScreen.js +12 -11
- package/lib/auth/screens/UserScreen.js.map +1 -1
- package/lib/components/external/Camera/Camera.js +4 -4
- package/lib/components/external/Camera/Camera.js.map +1 -1
- package/lib/components/external/CameraScanner/CameraScanner.js +1 -1
- package/lib/components/external/CameraScanner/CameraScanner.js.map +1 -1
- package/lib/components/external/PlanningView/PlanningView.d.ts +2 -1
- package/lib/components/external/PlanningView/PlanningView.js +38 -12
- package/lib/components/external/PlanningView/PlanningView.js.map +1 -1
- package/lib/components/external/Stopwatch/Stopwatch.js +5 -5
- package/lib/components/external/Stopwatch/Stopwatch.js.map +1 -1
- package/lib/components/external/Toast/Toast.d.ts +2 -0
- package/lib/components/external/Toast/Toast.js +100 -0
- package/lib/components/external/Toast/Toast.js.map +1 -0
- package/lib/components/external/Toast/ToastProvider.d.ts +13 -0
- package/lib/{navigator/roles.helper.js → components/external/Toast/ToastProvider.js} +12 -13
- package/lib/components/external/Toast/ToastProvider.js.map +1 -0
- package/lib/components/external/Toast/index.d.ts +2 -0
- package/lib/{auth/api/language-api.js → components/external/Toast/index.js} +3 -7
- package/lib/components/external/Toast/index.js.map +1 -0
- package/lib/components/external/index.d.ts +1 -0
- package/lib/components/external/index.js +1 -0
- package/lib/components/external/index.js.map +1 -1
- package/lib/components/molecules/CameraButton/CameraButton.js +1 -1
- package/lib/components/molecules/CameraButton/CameraButton.js.map +1 -1
- package/lib/components/molecules/DateDisplay/DateDisplay.d.ts +6 -0
- package/lib/components/molecules/DateDisplay/DateDisplay.js +47 -0
- package/lib/components/molecules/DateDisplay/DateDisplay.js.map +1 -0
- package/lib/components/molecules/FocusScreen/FocusScreen.d.ts +11 -0
- package/lib/components/molecules/FocusScreen/FocusScreen.js +36 -0
- package/lib/components/molecules/FocusScreen/FocusScreen.js.map +1 -0
- package/lib/components/molecules/HeaderOptionsMenuItem/HeaderOptionMenuItem.d.ts +1 -2
- package/lib/components/molecules/HeaderOptionsMenuItem/HeaderOptionMenuItem.js +2 -2
- package/lib/components/molecules/HeaderOptionsMenuItem/HeaderOptionMenuItem.js.map +1 -1
- package/lib/components/molecules/InputBarCodeCard/InputBarCodeCard.js +2 -2
- package/lib/components/molecules/InputBarCodeCard/InputBarCodeCard.js.map +1 -1
- package/lib/components/molecules/MailMessageReadIcon/MailMessageReadIcon.js +2 -2
- package/lib/components/molecules/MailMessageReadIcon/MailMessageReadIcon.js.map +1 -1
- package/lib/components/molecules/PeriodDisplay/PeriodDisplay.d.ts +7 -0
- package/lib/components/molecules/PeriodDisplay/PeriodDisplay.js +63 -0
- package/lib/components/molecules/PeriodDisplay/PeriodDisplay.js.map +1 -0
- package/lib/components/molecules/TrackItem/TrackItem.js +1 -1
- package/lib/components/molecules/TrackItem/TrackItem.js.map +1 -1
- package/lib/components/molecules/UploadFileInput/UploadFileInput.js +4 -4
- package/lib/components/molecules/UploadFileInput/UploadFileInput.js.map +1 -1
- package/lib/components/molecules/index.d.ts +3 -0
- package/lib/components/molecules/index.js +3 -0
- package/lib/components/molecules/index.js.map +1 -1
- package/lib/components/organisms/AnomalyBubble/AnomalyBubble.js +2 -1
- package/lib/components/organisms/AnomalyBubble/AnomalyBubble.js.map +1 -1
- package/lib/components/organisms/AnomalyList/AnomalyList.js +1 -1
- package/lib/components/organisms/AnomalyList/AnomalyList.js.map +1 -1
- package/lib/components/organisms/DateInput/DateInput.d.ts +2 -1
- package/lib/components/organisms/DateInput/DateInput.js +62 -43
- package/lib/components/organisms/DateInput/DateInput.js.map +1 -1
- package/lib/components/organisms/DateInput/date-input.helper.js +1 -1
- package/lib/components/organisms/DateInput/date-input.helper.js.map +1 -1
- package/lib/components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.js +3 -3
- package/lib/components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.js.map +1 -1
- package/lib/components/organisms/MailMessageCard/MailMessageCard.js +3 -6
- package/lib/components/organisms/MailMessageCard/MailMessageCard.js.map +1 -1
- package/lib/components/organisms/MailMessageCommentCard/MailMessageCommentCard.js +1 -1
- package/lib/components/organisms/MailMessageCommentCard/MailMessageCommentCard.js.map +1 -1
- package/lib/components/organisms/MailMessageNotificationCard/MailMessageNotificationCard.js +1 -1
- package/lib/components/organisms/MailMessageNotificationCard/MailMessageNotificationCard.js.map +1 -1
- package/lib/components/pages/CustomFieldForm/CustomFieldForm.d.ts +16 -0
- package/lib/components/pages/CustomFieldForm/CustomFieldForm.js +66 -0
- package/lib/components/pages/CustomFieldForm/CustomFieldForm.js.map +1 -0
- package/lib/components/pages/FormView/Components/Field.js +2 -1
- package/lib/components/pages/FormView/Components/Field.js.map +1 -1
- package/lib/components/pages/FormView/FormView.d.ts +2 -1
- package/lib/components/pages/FormView/FormView.js +55 -9
- package/lib/components/pages/FormView/FormView.js.map +1 -1
- package/lib/components/pages/index.d.ts +1 -0
- package/lib/components/pages/index.js +1 -0
- package/lib/components/pages/index.js.map +1 -1
- package/lib/components/templates/AttachedFilesView/AttachedFilesView.js +1 -2
- package/lib/components/templates/AttachedFilesView/AttachedFilesView.js.map +1 -1
- package/lib/components/templates/MailMessageView/MailMessageView.js +47 -27
- package/lib/components/templates/MailMessageView/MailMessageView.js.map +1 -1
- package/lib/components/templates/PopupApplicationInformation/PopupApplicationInformation.js +2 -2
- package/lib/components/templates/PopupApplicationInformation/PopupApplicationInformation.js.map +1 -1
- package/lib/components/templates/PopupMinimalRequiredVersion/PopupMinimalRequiredVersion.js +3 -3
- package/lib/components/templates/PopupMinimalRequiredVersion/PopupMinimalRequiredVersion.js.map +1 -1
- package/lib/components/templates/SocialNetworkLinks/SocialNetworkLinks.js +2 -2
- package/lib/components/templates/SocialNetworkLinks/SocialNetworkLinks.js.map +1 -1
- package/lib/config/RouterProvider.d.ts +10 -0
- package/lib/config/RouterProvider.js +21 -8
- package/lib/config/RouterProvider.js.map +1 -1
- package/lib/config/routes.d.ts +6 -3
- package/lib/config/routes.js +5 -3
- package/lib/config/routes.js.map +1 -1
- package/lib/dashboards/api.helpers.d.ts +4 -0
- package/lib/dashboards/api.helpers.js +32 -0
- package/lib/dashboards/api.helpers.js.map +1 -0
- package/lib/dashboards/display.helpers.d.ts +1 -0
- package/lib/dashboards/display.helpers.js +21 -0
- package/lib/dashboards/display.helpers.js.map +1 -0
- package/lib/dashboards/menu.helpers.d.ts +52 -0
- package/lib/dashboards/menu.helpers.js +89 -0
- package/lib/dashboards/menu.helpers.js.map +1 -0
- package/lib/dashboards/view/DashboardScreen.d.ts +4 -0
- package/lib/dashboards/view/DashboardScreen.js +81 -0
- package/lib/dashboards/view/DashboardScreen.js.map +1 -0
- package/lib/dashboards/view/index.d.ts +1 -0
- package/lib/dashboards/view/index.js +19 -0
- package/lib/dashboards/view/index.js.map +1 -0
- package/lib/features/{menuConfigSlice.d.ts → appConfigSlice.d.ts} +2 -3
- package/lib/features/appConfigSlice.js +63 -0
- package/lib/features/appConfigSlice.js.map +1 -0
- package/lib/features/index.d.ts +2 -2
- package/lib/features/index.js +2 -2
- package/lib/features/index.js.map +1 -1
- package/lib/features/metaJsonFieldSlice.js +1 -1
- package/lib/features/metaJsonFieldSlice.js.map +1 -1
- package/lib/features/{mobileConfigSlice.d.ts → mobileDashboardSlice.d.ts} +3 -4
- package/lib/features/{menuConfigSlice.js → mobileDashboardSlice.js} +14 -19
- package/lib/features/mobileDashboardSlice.js.map +1 -0
- package/lib/forms/studio/api.helpers.d.ts +2 -1
- package/lib/forms/studio/api.helpers.js +24 -13
- package/lib/forms/studio/api.helpers.js.map +1 -1
- package/lib/forms/studio/formula.helpers.d.ts +1 -0
- package/lib/forms/studio/formula.helpers.js +13 -1
- package/lib/forms/studio/formula.helpers.js.map +1 -1
- package/lib/forms/types.d.ts +3 -0
- package/lib/header/hooks.d.ts +0 -1
- package/lib/header/hooks.js +3 -4
- package/lib/header/hooks.js.map +1 -1
- package/lib/header/types.d.ts +0 -1
- package/lib/i18n/component/Translator.js +1 -1
- package/lib/i18n/component/Translator.js.map +1 -1
- package/lib/i18n/translations/en.json +14 -6
- package/lib/i18n/translations/fr.json +14 -6
- package/lib/navigator/Navigator.js +30 -9
- package/lib/navigator/Navigator.js.map +1 -1
- package/lib/navigator/drawer/BackIcon.js +1 -1
- package/lib/navigator/drawer/BackIcon.js.map +1 -1
- package/lib/navigator/drawer/DrawerContent.js +1 -1
- package/lib/navigator/drawer/DrawerContent.js.map +1 -1
- package/lib/navigator/drawer/DrawerToggleButton.js +1 -1
- package/lib/navigator/drawer/DrawerToggleButton.js.map +1 -1
- package/lib/navigator/drawer/Menu.js +2 -2
- package/lib/navigator/drawer/Menu.js.map +1 -1
- package/lib/navigator/drawer/MenuIconButton.js +3 -3
- package/lib/navigator/drawer/MenuIconButton.js.map +1 -1
- package/lib/navigator/drawer/MenuItem.js +5 -1
- package/lib/navigator/drawer/MenuItem.js.map +1 -1
- package/lib/navigator/drawer/MenuItemEntry.d.ts +2 -1
- package/lib/navigator/drawer/MenuItemEntry.js +31 -11
- package/lib/navigator/drawer/MenuItemEntry.js.map +1 -1
- package/lib/navigator/drawer/MenuSeparator.d.ts +5 -0
- package/lib/navigator/drawer/MenuSeparator.js +58 -0
- package/lib/navigator/drawer/MenuSeparator.js.map +1 -0
- package/lib/navigator/drawer/MenuTitle.js +2 -2
- package/lib/navigator/drawer/MenuTitle.js.map +1 -1
- package/lib/navigator/drawer/SubMenuItem.js +2 -1
- package/lib/navigator/drawer/SubMenuItem.js.map +1 -1
- package/lib/navigator/drawer/SubMenuItemList.js +1 -1
- package/lib/navigator/drawer/SubMenuItemList.js.map +1 -1
- package/lib/navigator/menu.helper.d.ts +0 -5
- package/lib/navigator/menu.helper.js +1 -26
- package/lib/navigator/menu.helper.js.map +1 -1
- package/lib/navigator/module.helper.d.ts +5 -3
- package/lib/navigator/module.helper.js +90 -27
- package/lib/navigator/module.helper.js.map +1 -1
- package/lib/screens/ErrorScreen.js +1 -1
- package/lib/screens/ErrorScreen.js.map +1 -1
- package/lib/screens/JsonFieldScreen.js +9 -43
- package/lib/screens/JsonFieldScreen.js.map +1 -1
- package/lib/sessions/components/alerts/PopupSession.js +1 -1
- package/lib/sessions/components/alerts/PopupSession.js.map +1 -1
- package/lib/sessions/components/display/SessionCard.js +4 -11
- package/lib/sessions/components/display/SessionCard.js.map +1 -1
- package/lib/sessions/components/display/SessionListCard.js +1 -1
- package/lib/sessions/components/display/SessionListCard.js.map +1 -1
- package/lib/sessions/components/error/ErrorText.js +1 -1
- package/lib/sessions/components/error/ErrorText.js.map +1 -1
- package/lib/sessions/components/inputs/DefaultCheckbox.js +1 -1
- package/lib/sessions/components/inputs/PasswordInput.js +2 -2
- package/lib/sessions/components/inputs/PasswordInput.js.map +1 -1
- package/lib/sessions/components/inputs/SessionNameInput.js +1 -1
- package/lib/sessions/components/inputs/SessionNameInput.js.map +1 -1
- package/lib/sessions/components/inputs/UrlInput.js +4 -4
- package/lib/sessions/components/inputs/UrlInput.js.map +1 -1
- package/lib/sessions/components/inputs/UsernameInput.js +6 -4
- package/lib/sessions/components/inputs/UsernameInput.js.map +1 -1
- package/lib/tools/ClipboardProvider.js +4 -4
- package/lib/tools/ClipboardProvider.js.map +1 -1
- package/lib/tools/ContactProvider.js +2 -2
- package/lib/tools/ContactProvider.js.map +1 -1
- package/lib/tools/LinkingProvider.js +3 -3
- package/lib/tools/LinkingProvider.js.map +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +1 -0
- package/lib/types/index.js.map +1 -1
- package/lib/types/mail-message-type.d.ts +18 -0
- package/lib/types/mail-message-type.js +55 -0
- package/lib/types/mail-message-type.js.map +1 -0
- package/lib/types/stopwatch-type.js +1 -1
- package/lib/utils/date.d.ts +3 -0
- package/lib/utils/date.js +13 -0
- package/lib/utils/date.js.map +1 -1
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/object.js +1 -1
- package/lib/utils/object.js.map +1 -1
- package/lib/utils/show-toast-message.js +7 -1
- package/lib/utils/show-toast-message.js.map +1 -1
- package/package.json +3 -3
- package/lib/api/menu-config-api.d.ts +0 -5
- package/lib/api/menu-config-api.js +0 -63
- package/lib/api/menu-config-api.js.map +0 -1
- package/lib/api/mobile-config-api.d.ts +0 -1
- package/lib/api/mobile-config-api.js +0 -52
- package/lib/api/mobile-config-api.js.map +0 -1
- package/lib/auth/api/config-api.d.ts +0 -2
- package/lib/auth/api/config-api.js +0 -45
- package/lib/auth/api/config-api.js.map +0 -1
- package/lib/auth/api/language-api.d.ts +0 -1
- package/lib/auth/api/language-api.js.map +0 -1
- package/lib/auth/features/languageSlice.js.map +0 -1
- package/lib/features/menuConfigSlice.js.map +0 -1
- package/lib/features/mobileConfigSlice.js +0 -52
- package/lib/features/mobileConfigSlice.js.map +0 -1
- package/lib/navigator/roles.helper.d.ts +0 -4
- package/lib/navigator/roles.helper.js.map +0 -1
package/lib/config/routes.js
CHANGED
|
@@ -21,9 +21,10 @@ const routes = {
|
|
|
21
21
|
AppBase: '/ws/rest/com.axelor.apps.base.db.AppBase',
|
|
22
22
|
AppCrm: '/ws/rest/com.axelor.apps.base.db.AppCrm',
|
|
23
23
|
AppExpense: '/ws/rest/com.axelor.apps.base.db.AppExpense',
|
|
24
|
-
|
|
24
|
+
AppHelpdesk: '/ws/rest/com.axelor.apps.base.db.AppHelpdesk',
|
|
25
25
|
AppStock: '/ws/rest/com.axelor.apps.base.db.AppStock',
|
|
26
26
|
AppSupplychain: '/ws/rest/com.axelor.apps.base.db.AppSupplychain',
|
|
27
|
+
AppTimesheet: '/ws/rest/com.axelor.apps.base.db.AppTimesheet',
|
|
27
28
|
AppMobileSettings: '/ws/rest/com.axelor.apps.base.db.AppMobileSettings',
|
|
28
29
|
AppProduction: '/ws/rest/com.axelor.apps.base.db.AppProduction',
|
|
29
30
|
TraceBack: '/ws/rest/com.axelor.exception.db.TraceBack',
|
|
@@ -35,10 +36,11 @@ const routes = {
|
|
|
35
36
|
AppBase: '/ws/rest/com.axelor.studio.db.AppBase',
|
|
36
37
|
AppCrm: '/ws/rest/com.axelor.studio.db.AppCrm',
|
|
37
38
|
AppExpense: '/ws/rest/com.axelor.studio.db.AppExpense',
|
|
38
|
-
|
|
39
|
+
AppHelpdesk: '/ws/rest/com.axelor.studio.db.AppHelpdesk',
|
|
39
40
|
AppStock: '/ws/rest/com.axelor.studio.db.AppStock',
|
|
40
41
|
AppSupplychain: '/ws/rest/com.axelor.studio.db.AppSupplychain',
|
|
41
|
-
|
|
42
|
+
AppTimesheet: '/ws/rest/com.axelor.studio.db.AppTimesheet',
|
|
43
|
+
AppMobileSettings: '/ws/aos/mobilesettings',
|
|
42
44
|
AppProduction: 'ws/rest/com.axelor.studio.db.AppProduction',
|
|
43
45
|
TraceBack: '/ws/rest/com.axelor.apps.base.db.TraceBack',
|
|
44
46
|
EmailAddress: '/ws/rest/com.axelor.message.db.EmailAddress',
|
package/lib/config/routes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../src/config/routes.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,MAAM,GAAG;IACb,IAAI,EAAE;QACJ,GAAG,EAAE,sCAAsC;QAC3C,OAAO,EAAE,0CAA0C;QACnD,MAAM,EAAE,yCAAyC;QACjD,UAAU,EAAE,6CAA6C;QACzD,
|
|
1
|
+
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../src/config/routes.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,MAAM,GAAG;IACb,IAAI,EAAE;QACJ,GAAG,EAAE,sCAAsC;QAC3C,OAAO,EAAE,0CAA0C;QACnD,MAAM,EAAE,yCAAyC;QACjD,UAAU,EAAE,6CAA6C;QACzD,WAAW,EAAE,8CAA8C;QAC3D,QAAQ,EAAE,2CAA2C;QACrD,cAAc,EAAE,iDAAiD;QACjE,YAAY,EAAE,+CAA+C;QAC7D,iBAAiB,EAAE,oDAAoD;QACvE,aAAa,EAAE,gDAAgD;QAC/D,SAAS,EAAE,4CAA4C;QACvD,YAAY,EAAE,kDAAkD;QAChE,YAAY,EAAE,kDAAkD;KACjE;IACD,IAAI,EAAE;QACJ,GAAG,EAAE,mCAAmC;QACxC,OAAO,EAAE,uCAAuC;QAChD,MAAM,EAAE,sCAAsC;QAC9C,UAAU,EAAE,0CAA0C;QACtD,WAAW,EAAE,2CAA2C;QACxD,QAAQ,EAAE,wCAAwC;QAClD,cAAc,EAAE,8CAA8C;QAC9D,YAAY,EAAE,4CAA4C;QAC1D,iBAAiB,EAAE,wBAAwB;QAC3C,aAAa,EAAE,4CAA4C;QAC3D,SAAS,EAAE,4CAA4C;QACvD,YAAY,EAAE,6CAA6C;QAC3D,YAAY,EAAE,cAAc;KAC7B;CACF,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2024 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 } from '../apiProviders';
|
|
19
|
+
export async function fetchDashboard({ id }) {
|
|
20
|
+
if (id == null) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
return axiosApiProvider.get({
|
|
24
|
+
url: `/ws/aos/mobiledashboard/${id}`,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export async function fetchDashboardConfigs() {
|
|
28
|
+
return axiosApiProvider.get({
|
|
29
|
+
url: 'ws/rest/com.axelor.apps.mobilesettings.db.MobileDashboard',
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=api.helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.helpers.js","sourceRoot":"","sources":["../../src/dashboards/api.helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AAEjD,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,EAAC,EAAE,EAAe;IACrD,IAAI,EAAE,IAAI,IAAI,EAAE;QACd,OAAO,IAAI,CAAC;KACb;IAED,OAAO,gBAAgB,CAAC,GAAG,CAAC;QAC1B,GAAG,EAAE,2BAA2B,EAAE,EAAE;KACrC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB;IACzC,OAAO,gBAAgB,CAAC,GAAG,CAAC;QAC1B,GAAG,EAAE,2DAA2D;KACjE,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const createDashboardActionID: (id: number) => string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2024 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 const createDashboardActionID = (id) => {
|
|
19
|
+
return `core_dashboard${id}_details`;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=display.helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display.helpers.js","sourceRoot":"","sources":["../../src/dashboards/display.helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,EAAU,EAAE,EAAE;IACpD,OAAO,iBAAiB,EAAE,UAAU,CAAC;AACvC,CAAC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Menu, Module, Screen } from '../app';
|
|
2
|
+
type DashboardMenuConfig = {
|
|
3
|
+
[menuKey: string]: {
|
|
4
|
+
menu: Menu;
|
|
5
|
+
configRoles: any[];
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
type Menus = {
|
|
9
|
+
[menuKey: string]: Menu;
|
|
10
|
+
};
|
|
11
|
+
type Screens = {
|
|
12
|
+
[screenKey: string]: Screen;
|
|
13
|
+
};
|
|
14
|
+
export declare const createDashboardScreens: (dashboardConfigs: {
|
|
15
|
+
id: number;
|
|
16
|
+
appName: string;
|
|
17
|
+
isCustom: boolean;
|
|
18
|
+
menuTitle?: string;
|
|
19
|
+
iconName?: string;
|
|
20
|
+
menuOrder?: number;
|
|
21
|
+
authorizedRoleSet: any[];
|
|
22
|
+
}[]) => {
|
|
23
|
+
menus: DashboardMenuConfig;
|
|
24
|
+
screens: Screens;
|
|
25
|
+
};
|
|
26
|
+
export declare const filterAuthorizedDashboardMenus: (dashboardConfigs: DashboardMenuConfig, { roles: userRoles }: {
|
|
27
|
+
roles: any[];
|
|
28
|
+
}) => Menus;
|
|
29
|
+
export declare const addDashboardMenus: (modules: Module[], dashboardMenus: Menus) => {
|
|
30
|
+
menus: {
|
|
31
|
+
[x: string]: Menu;
|
|
32
|
+
};
|
|
33
|
+
name: string;
|
|
34
|
+
title?: string;
|
|
35
|
+
subtitle?: string;
|
|
36
|
+
icon?: string;
|
|
37
|
+
compatibilityAOS?: import("../app/Module").Compatibility;
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
screens?: {
|
|
40
|
+
[screenKey: string]: Screen;
|
|
41
|
+
};
|
|
42
|
+
translations?: {
|
|
43
|
+
[languageKey: string]: any;
|
|
44
|
+
};
|
|
45
|
+
reducers?: {
|
|
46
|
+
[key: string]: import("redux").Reducer;
|
|
47
|
+
};
|
|
48
|
+
backgroundFunctions?: Function[];
|
|
49
|
+
models?: import("../app").Models;
|
|
50
|
+
requiredConfig?: string[];
|
|
51
|
+
}[];
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2024 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 { createDashboardActionID } from './display.helpers';
|
|
19
|
+
import { DashboardScreen } from './view';
|
|
20
|
+
const createScreenComponent = id => {
|
|
21
|
+
return props => DashboardScreen({ ...props, dashboardId: id });
|
|
22
|
+
};
|
|
23
|
+
export const createDashboardScreens = (dashboardConfigs) => {
|
|
24
|
+
const screens = {};
|
|
25
|
+
const menus = {};
|
|
26
|
+
if (Array.isArray(dashboardConfigs) && dashboardConfigs.length > 0) {
|
|
27
|
+
dashboardConfigs.forEach(({ id, appName, isCustom = false, menuTitle, iconName, menuOrder, authorizedRoleSet = [], }) => {
|
|
28
|
+
const config = isCustom
|
|
29
|
+
? {
|
|
30
|
+
title: menuTitle ?? 'Base_Dashboard',
|
|
31
|
+
icon: iconName ?? 'graph-up',
|
|
32
|
+
order: menuOrder,
|
|
33
|
+
}
|
|
34
|
+
: { title: 'Base_Dashboard', icon: 'graph-up', order: -10 };
|
|
35
|
+
const screenKey = `Dashboard_${appName}_${id}`;
|
|
36
|
+
screens[screenKey] = {
|
|
37
|
+
title: config.title,
|
|
38
|
+
component: createScreenComponent(id),
|
|
39
|
+
actionID: createDashboardActionID(id),
|
|
40
|
+
};
|
|
41
|
+
const _menu = {
|
|
42
|
+
title: config.title,
|
|
43
|
+
icon: config.icon,
|
|
44
|
+
parent: appName,
|
|
45
|
+
order: config.order,
|
|
46
|
+
compatibilityAOS: {
|
|
47
|
+
moduleName: 'axelor-mobile-settings',
|
|
48
|
+
downToVersion: '8.0.0',
|
|
49
|
+
},
|
|
50
|
+
screen: screenKey,
|
|
51
|
+
isDefault: true,
|
|
52
|
+
};
|
|
53
|
+
menus[`${appName}_menu_dashboard${id}`] = {
|
|
54
|
+
menu: _menu,
|
|
55
|
+
configRoles: authorizedRoleSet,
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return { menus, screens };
|
|
60
|
+
};
|
|
61
|
+
export const filterAuthorizedDashboardMenus = (dashboardConfigs, { roles: userRoles }) => {
|
|
62
|
+
const menus = {};
|
|
63
|
+
Object.entries(dashboardConfigs)
|
|
64
|
+
.filter(([_, { configRoles: authorizedRoleSet }]) => {
|
|
65
|
+
if (!Array.isArray(authorizedRoleSet) || authorizedRoleSet.length === 0) {
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
else if (!Array.isArray(userRoles) || userRoles.length === 0) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
return authorizedRoleSet.some(_neededRole => userRoles.find(_userRole => _userRole.id === _neededRole.id));
|
|
73
|
+
}
|
|
74
|
+
})
|
|
75
|
+
.forEach(([key, { menu }]) => {
|
|
76
|
+
menus[key] = menu;
|
|
77
|
+
});
|
|
78
|
+
return menus;
|
|
79
|
+
};
|
|
80
|
+
export const addDashboardMenus = (modules, dashboardMenus) => {
|
|
81
|
+
return modules.map(_module => {
|
|
82
|
+
const associatedMenus = Object.fromEntries(Object.entries(dashboardMenus).filter(([, { parent }]) => parent === _module.name));
|
|
83
|
+
return {
|
|
84
|
+
..._module,
|
|
85
|
+
menus: { ...(_module.menus ?? {}), ...(associatedMenus ?? {}) },
|
|
86
|
+
};
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=menu.helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.helpers.js","sourceRoot":"","sources":["../../src/dashboards/menu.helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAC,uBAAuB,EAAC,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAC,eAAe,EAAC,MAAM,QAAQ,CAAC;AAcvC,MAAM,qBAAqB,GAAG,EAAE,CAAC,EAAE;IACjC,OAAO,KAAK,CAAC,EAAE,CAAC,eAAe,CAAC,EAAC,GAAG,KAAK,EAAE,WAAW,EAAE,EAAE,EAAC,CAAC,CAAC;AAC/D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,gBAQG,EAC6C,EAAE;IAClD,MAAM,OAAO,GAAY,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,OAAO,CAAC,cAAc,CAAC,CAAC,MAAM,CACnC,CAAC,CAAC,EAAE,EAAC,MAAM,EAAC,CAAC,EAAE,EAAE,CAAC,MAAM,KAAK,OAAO,CAAC,IAAI,CAC1C,CACF,CAAC;QAEF,OAAO;YACL,GAAG,OAAO;YACV,KAAK,EAAE,EAAC,GAAG,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,eAAe,IAAI,EAAE,CAAC,EAAC;SAC9D,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2024 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 React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
19
|
+
import { Dashboard, WarningCard } from '@axelor/aos-mobile-ui';
|
|
20
|
+
import { headerActionsProvider } from '../../header';
|
|
21
|
+
import { useTranslator } from '../../i18n';
|
|
22
|
+
import { createDashboardActionID } from '../display.helpers';
|
|
23
|
+
import { ActivityIndicator } from 'react-native';
|
|
24
|
+
import { fetchDashboard } from '../api.helpers';
|
|
25
|
+
export const DashboardScreen = ({ dashboardId, hideCardBackground = false }) => {
|
|
26
|
+
const I18n = useTranslator();
|
|
27
|
+
const [dashboard, setDashboard] = useState({});
|
|
28
|
+
const [loading, setLoading] = useState(false);
|
|
29
|
+
const refresh = useCallback(() => {
|
|
30
|
+
setLoading(true);
|
|
31
|
+
fetchDashboard({ id: dashboardId })
|
|
32
|
+
.then(response => {
|
|
33
|
+
setDashboard({ ...(response?.data?.object ?? {}), id: dashboardId });
|
|
34
|
+
})
|
|
35
|
+
.catch(() => setDashboard({}))
|
|
36
|
+
.finally(() => setLoading(false));
|
|
37
|
+
}, [dashboardId]);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
let isMounted = true;
|
|
40
|
+
if (isMounted) {
|
|
41
|
+
refresh();
|
|
42
|
+
}
|
|
43
|
+
return () => {
|
|
44
|
+
isMounted = false;
|
|
45
|
+
};
|
|
46
|
+
}, [refresh]);
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
headerActionsProvider.registerModel(createDashboardActionID(dashboardId), {
|
|
49
|
+
actions: [
|
|
50
|
+
{
|
|
51
|
+
key: 'refreshConfig',
|
|
52
|
+
order: 10,
|
|
53
|
+
showInHeader: false,
|
|
54
|
+
iconName: 'arrow-repeat',
|
|
55
|
+
title: I18n.t('Base_Dashboard_RefreshConfig'),
|
|
56
|
+
onPress: refresh,
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
});
|
|
60
|
+
}, [I18n, dashboardId, refresh]);
|
|
61
|
+
const dashboardData = useMemo(() => {
|
|
62
|
+
if (!Array.isArray(dashboard?.dashboardLineList)) {
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
return dashboard?.dashboardLineList.map(elt => ({
|
|
66
|
+
graphList: elt.chartList.map(ch => ({
|
|
67
|
+
type: ch.chartType,
|
|
68
|
+
dataList: [ch.valueList],
|
|
69
|
+
title: ch?.chartName,
|
|
70
|
+
})),
|
|
71
|
+
}));
|
|
72
|
+
}, [dashboard]);
|
|
73
|
+
if (loading) {
|
|
74
|
+
return <ActivityIndicator size="large"/>;
|
|
75
|
+
}
|
|
76
|
+
if (!Array.isArray(dashboardData) || dashboardData.length === 0) {
|
|
77
|
+
return (<WarningCard errorMessage={I18n.t('Base_Dashboard_Misconfigured')}/>);
|
|
78
|
+
}
|
|
79
|
+
return (<Dashboard lineList={dashboardData} hideCardBackground={hideCardBackground}/>);
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=DashboardScreen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardScreen.js","sourceRoot":"","sources":["../../../src/dashboards/view/DashboardScreen.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACvE,OAAO,EAAC,SAAS,EAAE,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAC,qBAAqB,EAAC,MAAM,cAAc,CAAC;AACnD,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AACzC,OAAO,EAAC,uBAAuB,EAAC,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAE9C,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAC,WAAW,EAAE,kBAAkB,GAAG,KAAK,EAAC,EAAE,EAAE;IAC3E,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAE7B,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAM,EAAE,CAAC,CAAC;IACpD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IAEvD,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE;QAC/B,UAAU,CAAC,IAAI,CAAC,CAAC;QACjB,cAAc,CAAC,EA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AG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAC9C,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;gBAClC,IAAI,EAAE,EAAE,CAAC,SAAS;gBAClB,QAAQ,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC;gBACxB,KAAK,EAAE,EAAE,EAAE,SAAS;aACrB,CAAC,CAAC;SACJ,CAAC,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,IAAI,OAAO,EAAE;QACX,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,EAAG,CAAC;KAC3C;IAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE;QAC/D,OAAO,CACL,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC,EAAG,CACtE,CAAC;KACH;IAED,OAAO,CACL,CAAC,SAAS,CACR,QAAQ,CAAC,CAAC,aAAa,CAAC,CACxB,kBAAkB,CAAC,CAAC,kBAAkB,CAAC,EACvC,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DashboardScreen } from './DashboardScreen';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2024 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 { DashboardScreen } from './DashboardScreen';
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dashboards/view/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const fetchRequiredConfig: import("@reduxjs/toolkit").AsyncThunk<any[], void, {
|
|
2
2
|
state?: unknown;
|
|
3
3
|
dispatch?: import("redux").Dispatch<import("redux").AnyAction>;
|
|
4
4
|
extra?: unknown;
|
|
@@ -8,7 +8,6 @@ export const fetchMenuConfig: import("@reduxjs/toolkit").AsyncThunk<any, void, {
|
|
|
8
8
|
fulfilledMeta?: unknown;
|
|
9
9
|
rejectedMeta?: unknown;
|
|
10
10
|
}>;
|
|
11
|
-
export const
|
|
11
|
+
export const appConfigReducer: import("redux").Reducer<{
|
|
12
12
|
loadingConfig: boolean;
|
|
13
|
-
restrictedMenus: any[];
|
|
14
13
|
}>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2024 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 { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
19
|
+
import { handlerApiCall } from '../apiProviders/utils';
|
|
20
|
+
import { getAppConfig } from '../api/app-config-api';
|
|
21
|
+
const fetchConfig = async (data, { getState }) => {
|
|
22
|
+
return await handlerApiCall({
|
|
23
|
+
fetchFunction: getAppConfig,
|
|
24
|
+
data,
|
|
25
|
+
action: 'Base_SliceAction_FetchMobileConfig',
|
|
26
|
+
getState,
|
|
27
|
+
responseOptions: { isArrayResponse: false },
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
export const fetchRequiredConfig = createAsyncThunk('appConfig/fetchRequiredConfig', async function (data, { getState }) {
|
|
31
|
+
let promises = [];
|
|
32
|
+
data.forEach(configName => {
|
|
33
|
+
promises.push(fetchConfig({ configName }, { getState }));
|
|
34
|
+
});
|
|
35
|
+
return Promise.all(promises);
|
|
36
|
+
});
|
|
37
|
+
const initialState = {
|
|
38
|
+
loadingConfig: false,
|
|
39
|
+
};
|
|
40
|
+
const appConfigSlice = createSlice({
|
|
41
|
+
name: 'appConfig',
|
|
42
|
+
initialState,
|
|
43
|
+
extraReducers: builder => {
|
|
44
|
+
builder.addCase(fetchRequiredConfig.pending, state => {
|
|
45
|
+
state.loadingConfig = true;
|
|
46
|
+
});
|
|
47
|
+
builder.addCase(fetchRequiredConfig.rejected, state => {
|
|
48
|
+
state.loadingConfig = false;
|
|
49
|
+
});
|
|
50
|
+
builder.addCase(fetchRequiredConfig.fulfilled, (state, action) => {
|
|
51
|
+
state.loadingConfig = false;
|
|
52
|
+
action.meta.arg.forEach((_configName, index) => {
|
|
53
|
+
state[formatAppName(_configName)] = action.payload[index];
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
const formatAppName = appName => {
|
|
59
|
+
const configName = appName.replace('App', '');
|
|
60
|
+
return configName.charAt(0).toLowerCase() + configName.substr(1);
|
|
61
|
+
};
|
|
62
|
+
export const appConfigReducer = appConfigSlice.reducer;
|
|
63
|
+
//# sourceMappingURL=appConfigSlice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appConfigSlice.js","sourceRoot":"","sources":["../../src/features/appConfigSlice.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAEnD,MAAM,WAAW,GAAG,KAAK,EAAE,IAAI,EAAE,EAAC,QAAQ,EAAC,EAAE,EAAE;IAC7C,OAAO,MAAM,cAAc,CAAC;QAC1B,aAAa,EAAE,YAAY;QAC3B,IAAI;QACJ,MAAM,EAAE,oCAAoC;QAC5C,QAAQ;QACR,eAAe,EAAE,EAAC,eAAe,EAAE,KAAK,EAAC;KAC1C,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAgB,CACjD,+BAA+B,EAC/B,KAAK,WAAW,IAAI,EAAE,EAAC,QAAQ,EAAC;IAC9B,IAAI,QAAQ,GAAG,EAAE,CAAC;IAElB,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QACxB,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,EAAC,UAAU,EAAC,EAAE,EAAC,QAAQ,EAAC,CAAC,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAA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|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
export { appConfigReducer as appConfig } from "./appConfigSlice";
|
|
1
2
|
export { attachedFilesReducer as attachedFiles } from "./attachedFilesSlice";
|
|
2
3
|
export { authReducer as auth } from "./authSlice";
|
|
3
4
|
export { default as cameraScanner } from "./cameraScannerSlice";
|
|
4
5
|
export { default as camera } from "./cameraSlice";
|
|
5
6
|
export { formReducer as form } from "./formSlice";
|
|
6
7
|
export { mailMessagesReducer as mailMessages } from "./mailMessageSlice";
|
|
7
|
-
export { menuConfigReducer as menuConfig } from "./menuConfigSlice";
|
|
8
8
|
export { metafileReducer as metafile } from "./metafileSlice";
|
|
9
9
|
export { metaJsonFieldReducer as metaJsonField } from "./metaJsonFieldSlice";
|
|
10
10
|
export { metaModuleReducer as metaModule } from "./metaModuleSlice";
|
|
11
|
-
export {
|
|
11
|
+
export { mobileDashboardReducer as mobileDashboard } from "./mobileDashboardSlice";
|
|
12
12
|
export { onlineReducer as online } from "./onlineSlice";
|
|
13
13
|
export { default as scanner } from "./scannerSlice";
|
|
14
14
|
export { userListReducer as userList } from "./userSlice";
|
package/lib/features/index.js
CHANGED
|
@@ -15,17 +15,17 @@
|
|
|
15
15
|
* You should have received a copy of the GNU Affero General Public License
|
|
16
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
+
export { appConfigReducer as appConfig } from './appConfigSlice';
|
|
18
19
|
export { attachedFilesReducer as attachedFiles } from './attachedFilesSlice';
|
|
19
20
|
export { authReducer as auth } from './authSlice';
|
|
20
21
|
export { default as cameraScanner } from './cameraScannerSlice';
|
|
21
22
|
export { default as camera } from './cameraSlice';
|
|
22
23
|
export { formReducer as form } from './formSlice';
|
|
23
24
|
export { mailMessagesReducer as mailMessages } from './mailMessageSlice';
|
|
24
|
-
export { menuConfigReducer as menuConfig } from './menuConfigSlice';
|
|
25
25
|
export { metafileReducer as metafile } from './metafileSlice';
|
|
26
26
|
export { metaJsonFieldReducer as metaJsonField } from './metaJsonFieldSlice';
|
|
27
27
|
export { metaModuleReducer as metaModule } from './metaModuleSlice';
|
|
28
|
-
export {
|
|
28
|
+
export { mobileDashboardReducer as mobileDashboard } from './mobileDashboardSlice';
|
|
29
29
|
export { onlineReducer as online } from './onlineSlice';
|
|
30
30
|
export { default as scanner } from './scannerSlice';
|
|
31
31
|
export { userListReducer as userList } from './userSlice';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/features/index.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,oBAAoB,IAAI,aAAa,EAAC,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAC,WAAW,IAAI,IAAI,EAAC,MAAM,aAAa,CAAC;AAChD,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,eAAe,CAAC;AAChD,OAAO,EAAC,WAAW,IAAI,IAAI,EAAC,MAAM,aAAa,CAAC;AAChD,OAAO,EAAC,mBAAmB,IAAI,YAAY,EAAC,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/features/index.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,IAAI,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAC,oBAAoB,IAAI,aAAa,EAAC,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAC,WAAW,IAAI,IAAI,EAAC,MAAM,aAAa,CAAC;AAChD,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,eAAe,CAAC;AAChD,OAAO,EAAC,WAAW,IAAI,IAAI,EAAC,MAAM,aAAa,CAAC;AAChD,OAAO,EAAC,mBAAmB,IAAI,YAAY,EAAC,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAC,eAAe,IAAI,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAC,oBAAoB,IAAI,aAAa,EAAC,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAC,iBAAiB,IAAI,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAC,sBAAsB,IAAI,eAAe,EAAC,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAC,aAAa,IAAI,MAAM,EAAC,MAAM,eAAe,CAAC;AACtD,OAAO,EAAC,OAAO,IAAI,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAC,eAAe,IAAI,QAAQ,EAAC,MAAM,aAAa,CAAC"}
|
|
@@ -42,7 +42,7 @@ export const updateJsonFieldsObject = createAsyncThunk('metaJsonField/updateJson
|
|
|
42
42
|
data: data,
|
|
43
43
|
action: 'Base_SliceAction_UpdateJsonFieldsObject',
|
|
44
44
|
getState: getState,
|
|
45
|
-
responseOptions: { isArrayResponse: false, showToast:
|
|
45
|
+
responseOptions: { isArrayResponse: false, showToast: data.showToast },
|
|
46
46
|
});
|
|
47
47
|
});
|
|
48
48
|
const initialState = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metaJsonFieldSlice.js","sourceRoot":"","sources":["../../src/features/metaJsonFieldSlice.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AACrD,OAAO,EACL,sBAAsB,IAAI,uBAAuB,EACjD,WAAW,IAAI,YAAY,EAC3B,sBAAsB,IAAI,uBAAuB,GAClD,MAAM,6BAA6B,CAAC;AAErC,MAAM,CAAC,MAAM,sBAAsB,GAAG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AE,EAAE;CACX,CAAC;AAEF,MAAM,kBAAkB,GAAG,WAAW,CAAC;IACrC,IAAI,EAAE,eAAe;IACrB,YAAY;IACZ,aAAa,EAAE,OAAO,CAAC,EAAE;QACvB,OAAO,CAAC,OAAO,CAAC,sBAAsB,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YAClE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC;QAChC,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACvD,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC;QAChC,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,OAAO,CAAC,sBAAsB,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YAClE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC;QAChC,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC,OAAO,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const fetchDashboardConfigs: import("@reduxjs/toolkit").AsyncThunk<any, void, {
|
|
2
2
|
state?: unknown;
|
|
3
3
|
dispatch?: import("redux").Dispatch<import("redux").AnyAction>;
|
|
4
4
|
extra?: unknown;
|
|
@@ -8,7 +8,6 @@ export const fetchMobileConfig: import("@reduxjs/toolkit").AsyncThunk<any, void,
|
|
|
8
8
|
fulfilledMeta?: unknown;
|
|
9
9
|
rejectedMeta?: unknown;
|
|
10
10
|
}>;
|
|
11
|
-
export const
|
|
12
|
-
|
|
13
|
-
mobileConfigs: any[];
|
|
11
|
+
export const mobileDashboardReducer: import("redux").Reducer<{
|
|
12
|
+
dashboardConfigs: any[];
|
|
14
13
|
}>;
|
|
@@ -16,33 +16,28 @@
|
|
|
16
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
19
|
-
import { getModulesConfig } from '../api/menu-config-api';
|
|
20
19
|
import { handlerApiCall } from '../apiProviders/utils';
|
|
21
|
-
|
|
20
|
+
import { fetchDashboardConfigs as _fetchDashboardConfigs } from '../dashboards/api.helpers';
|
|
21
|
+
export const fetchDashboardConfigs = createAsyncThunk('mobileDashboard/fetchDashboardConfigs', async function (data, { getState }) {
|
|
22
22
|
return handlerApiCall({
|
|
23
|
-
fetchFunction:
|
|
24
|
-
data,
|
|
25
|
-
action: '
|
|
26
|
-
getState,
|
|
27
|
-
responseOptions: { isArrayResponse: true },
|
|
23
|
+
fetchFunction: _fetchDashboardConfigs,
|
|
24
|
+
data: data,
|
|
25
|
+
action: 'Base_SliceAction_FetchDashboardConfigs',
|
|
26
|
+
getState: getState,
|
|
27
|
+
responseOptions: { isArrayResponse: true, showToast: false },
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
30
|
const initialState = {
|
|
31
|
-
|
|
32
|
-
restrictedMenus: [],
|
|
31
|
+
dashboardConfigs: [],
|
|
33
32
|
};
|
|
34
|
-
const
|
|
35
|
-
name: '
|
|
33
|
+
const mobileDashboardSlice = createSlice({
|
|
34
|
+
name: 'mobileDashboard',
|
|
36
35
|
initialState,
|
|
37
36
|
extraReducers: builder => {
|
|
38
|
-
builder.addCase(
|
|
39
|
-
state.
|
|
40
|
-
});
|
|
41
|
-
builder.addCase(fetchMenuConfig.fulfilled, (state, action) => {
|
|
42
|
-
state.loadingConfig = false;
|
|
43
|
-
state.restrictedMenus = [...action.payload];
|
|
37
|
+
builder.addCase(fetchDashboardConfigs.fulfilled, (state, action) => {
|
|
38
|
+
state.dashboardConfigs = action.payload;
|
|
44
39
|
});
|
|
45
40
|
},
|
|
46
41
|
});
|
|
47
|
-
export const
|
|
48
|
-
//# sourceMappingURL=
|
|
42
|
+
export const mobileDashboardReducer = mobileDashboardSlice.reducer;
|
|
43
|
+
//# sourceMappingURL=mobileDashboardSlice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobileDashboardSlice.js","sourceRoot":"","sources":["../../src/features/mobileDashboardSlice.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAC,qBAAqB,IAAI,sBAAsB,EAAC,MAAM,2BAA2B,CAAC;AAE1F,MAAM,CAAC,MAAM,qBAAqB,GAAG,gBAAgB,CACnD,uCAAuC,EACvC,KAAK,WAAW,IAAI,EAAE,EAAC,QAAQ,EAAC;IAC9B,OAAO,cAAc,CAAC;QACpB,aAAa,EAAE,sBAAsB;QACrC,IAAI,EAAE,IAAI;QACV,MAAM,EAAE,wCAAwC;QAChD,QAAQ,EAAE,QAAQ;QAClB,eAAe,EAAE,EAAC,eAAe,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAC;KAC3D,CAAC,CAAC;AACL,CAAC,CACF,CAAC;AAEF,MAAM,YAAY,GAAG;IACnB,gBAAgB,EAAE,EAAE;CACrB,CAAC;AAEF,MAAM,oBAAoB,GAAG,WAAW,CAAC;IACvC,IAAI,EAAE,iBAAiB;IACvB,YAAY;IACZ,aAAa,EAAE,OAAO,CAAC,EAAE;QACvB,OAAO,CAAC,OAAO,CAAC,qBAAqB,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACjE,KAAK,CAAC,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC;QAC1C,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,oBAAoB,CAAC,OAAO,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export declare function fetchJsonFieldsOfModel({ modelName }: {
|
|
1
|
+
export declare function fetchJsonFieldsOfModel({ modelName, type, }: {
|
|
2
2
|
modelName: string;
|
|
3
|
+
type: string;
|
|
3
4
|
}): Promise<any>;
|
|
4
5
|
export declare function fetchObject({ modelName, id, }: {
|
|
5
6
|
modelName: string;
|