@axelor/aos-mobile-message 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 +42 -0
- package/lib/api/index.d.ts +1 -0
- package/lib/api/index.js +19 -0
- package/lib/api/index.js.map +1 -0
- package/lib/api/mail-message-api.d.ts +53 -0
- package/lib/api/mail-message-api.js +133 -0
- package/lib/api/mail-message-api.js.map +1 -0
- package/lib/components/atoms/AuthorText/AuthorText.d.ts +8 -0
- package/lib/components/atoms/AuthorText/AuthorText.js +41 -0
- package/lib/components/atoms/AuthorText/AuthorText.js.map +1 -0
- package/lib/components/atoms/Avatar/Avatar.d.ts +9 -0
- package/lib/components/atoms/Avatar/Avatar.js +49 -0
- package/lib/components/atoms/Avatar/Avatar.js.map +1 -0
- package/lib/components/atoms/ExpandableText/ExpandableText.d.ts +7 -0
- package/lib/components/atoms/ExpandableText/ExpandableText.js +68 -0
- package/lib/components/atoms/ExpandableText/ExpandableText.js.map +1 -0
- package/lib/components/atoms/MessageBox/MessageBox.d.ts +12 -0
- package/lib/components/atoms/MessageBox/MessageBox.js +63 -0
- package/lib/components/atoms/MessageBox/MessageBox.js.map +1 -0
- package/lib/components/atoms/MessageFlags/MessageFlags.d.ts +9 -0
- package/lib/components/atoms/MessageFlags/MessageFlags.js +74 -0
- package/lib/components/atoms/MessageFlags/MessageFlags.js.map +1 -0
- package/lib/components/atoms/TrackItem/TrackItem.d.ts +10 -0
- package/lib/components/atoms/TrackItem/TrackItem.js +59 -0
- package/lib/components/atoms/TrackItem/TrackItem.js.map +1 -0
- package/lib/components/atoms/index.d.ts +6 -0
- package/lib/components/atoms/index.js +24 -0
- package/lib/components/atoms/index.js.map +1 -0
- package/lib/components/index.d.ts +4 -0
- package/lib/components/index.js +22 -0
- package/lib/components/index.js.map +1 -0
- package/lib/components/molecules/CommentCard/CommentCard.d.ts +14 -0
- package/lib/components/molecules/CommentCard/CommentCard.js +60 -0
- package/lib/components/molecules/CommentCard/CommentCard.js.map +1 -0
- package/lib/components/molecules/NotificationCard/NotificationCard.d.ts +19 -0
- package/lib/components/molecules/NotificationCard/NotificationCard.js +59 -0
- package/lib/components/molecules/NotificationCard/NotificationCard.js.map +1 -0
- package/lib/components/molecules/SendMessageBox/SendMessageBox.d.ts +13 -0
- package/lib/components/molecules/SendMessageBox/SendMessageBox.js +62 -0
- package/lib/components/molecules/SendMessageBox/SendMessageBox.js.map +1 -0
- package/lib/components/molecules/UnsubscribeIcon/UnsubscribeIcon.d.ts +3 -0
- package/lib/components/molecules/UnsubscribeIcon/UnsubscribeIcon.js +47 -0
- package/lib/components/molecules/UnsubscribeIcon/UnsubscribeIcon.js.map +1 -0
- package/lib/components/molecules/index.d.ts +4 -0
- package/lib/components/molecules/index.js +22 -0
- package/lib/components/molecules/index.js.map +1 -0
- package/lib/components/organisms/MailMessageCard/MailMessageCard.d.ts +22 -0
- package/lib/components/organisms/MailMessageCard/MailMessageCard.js +148 -0
- package/lib/components/organisms/MailMessageCard/MailMessageCard.js.map +1 -0
- package/lib/components/organisms/index.d.ts +1 -0
- package/lib/components/organisms/index.js +19 -0
- package/lib/components/organisms/index.js.map +1 -0
- package/lib/components/templates/MailMessageView/MailMessageView.d.ts +9 -0
- package/lib/components/templates/MailMessageView/MailMessageView.js +69 -0
- package/lib/components/templates/MailMessageView/MailMessageView.js.map +1 -0
- package/lib/components/templates/index.d.ts +1 -0
- package/lib/components/templates/index.js +19 -0
- package/lib/components/templates/index.js.map +1 -0
- package/lib/features/asyncFunctions-index.d.ts +1 -0
- package/lib/features/asyncFunctions-index.js +19 -0
- package/lib/features/asyncFunctions-index.js.map +1 -0
- package/lib/features/index.d.ts +1 -0
- package/lib/features/index.js +19 -0
- package/lib/features/index.js.map +1 -0
- package/lib/features/mailMessageSlice.d.ts +110 -0
- package/lib/features/mailMessageSlice.js +180 -0
- package/lib/features/mailMessageSlice.js.map +1 -0
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.js +19 -0
- package/lib/hooks/index.js.map +1 -0
- package/lib/hooks/use-is-subscribed.d.ts +1 -0
- package/lib/hooks/use-is-subscribed.js +25 -0
- package/lib/hooks/use-is-subscribed.js.map +1 -0
- package/lib/hooks/use-message-header-actions.d.ts +1 -0
- package/lib/hooks/use-message-header-actions.js +162 -0
- package/lib/hooks/use-message-header-actions.js.map +1 -0
- package/lib/i18n/en.json +32 -0
- package/lib/i18n/fr.json +32 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.js +48 -0
- package/lib/index.js.map +1 -0
- package/lib/screens/InboxScreen.d.ts +3 -0
- package/lib/screens/InboxScreen.js +35 -0
- package/lib/screens/InboxScreen.js.map +1 -0
- package/lib/screens/MailMessageAttachedFilesScreen.d.ts +5 -0
- package/lib/screens/MailMessageAttachedFilesScreen.js +37 -0
- package/lib/screens/MailMessageAttachedFilesScreen.js.map +1 -0
- package/lib/screens/MailMessageLinkFilesScreen.d.ts +5 -0
- package/lib/screens/MailMessageLinkFilesScreen.js +88 -0
- package/lib/screens/MailMessageLinkFilesScreen.js.map +1 -0
- package/lib/screens/MailMessageScreen.d.ts +5 -0
- package/lib/screens/MailMessageScreen.js +32 -0
- package/lib/screens/MailMessageScreen.js.map +1 -0
- package/lib/screens/index.d.ts +43 -0
- package/lib/screens/index.js +53 -0
- package/lib/screens/index.js.map +1 -0
- package/lib/types/inbox-type.d.ts +5 -0
- package/lib/types/inbox-type.js +24 -0
- package/lib/types/inbox-type.js.map +1 -0
- package/lib/types/index.d.ts +3 -0
- package/lib/types/index.js +21 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/mail-message-notification-type.d.ts +13 -0
- package/lib/types/mail-message-notification-type.js +48 -0
- package/lib/types/mail-message-notification-type.js.map +1 -0
- package/lib/types/mail-message-type.d.ts +17 -0
- package/lib/types/mail-message-type.js +55 -0
- package/lib/types/mail-message-type.js.map +1 -0
- package/lib/utils/date.d.ts +2 -0
- package/lib/utils/date.js +24 -0
- package/lib/utils/date.js.map +1 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +20 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/mailMessagesGenericAction.d.ts +24 -0
- package/lib/utils/mailMessagesGenericAction.js +53 -0
- package/lib/utils/mailMessagesGenericAction.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mailMessageSlice.js","sourceRoot":"","sources":["../../src/features/mailMessageSlice.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,4BAA4B,EAC5B,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,mBAAmB,EACnB,kBAAkB,IAAI,mBAAmB,EACzC,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,IAAI,wBAAwB,EACnD,sBAAsB,EACtB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC;AAErC,MAAM,CAAC,MAAM,eAAe,GAAG,gBAAgB,CAC7C,8BAA8B,EAC9B,KAAK,WAAW,IAAI,EAAE,EAAC,QAAQ,EAAC;IAC9B,OAAO,cAAc,CAAC;QACpB,aAAa,EAAE,iBAAiB;QAChC,IAAI,EAAE,IAAI;QACV,MAAM,EAAE,uCAAuC;QAC/C,QAAQ,EAAE,QAAQ;QAClB,eAAe,EAAE,EAAC,eAAe,EAAE,IAAI,EAAC;KACzC,CAAC,CAAC;AACL,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,gBAAgB,CACpD,qCAAqC,EACrC,KAAK,WAAW,IAAI,EAAE,EAAC,QAAQ,EAAE,QAAQ,EAAC;IACxC,MAAM,oBAAoB,GAAG,EAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OA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C,CAAC;QACH,4BAA4B,CAAC,OAAO,EAAE,kBAAkB,EAAE;YACxD,OAAO,EAAE,cAAc;YACvB,WAAW,EAAE,kBAAkB;YAC/B,SAAS,EAAE,gBAAgB;YAC3B,IAAI,EAAE,WAAW;SAClB,CAAC,CAAC;QACH,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YAC/D,KAAK,CAAC,kBAAkB,GAAG,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;QAClD,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,OAAO,CAAC,uBAAuB,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACnE,KAAK,CAAC,cAAc,GAAG,MAAM,CAAC,OAAO,CAAC;QACxC,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,EAAC,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAAC,GAC3E,iBAAiB,CAAC,OAAO,CAAC;AAE5B,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useIsSubscribed } from './use-is-subscribed';
|
|
@@ -0,0 +1,19 @@
|
|
|
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 { useIsSubscribed } from './use-is-subscribed';
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useIsSubscribed: () => boolean;
|
|
@@ -0,0 +1,25 @@
|
|
|
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 { useMemo } from 'react';
|
|
19
|
+
import { useSelector } from '@axelor/aos-mobile-core';
|
|
20
|
+
export const useIsSubscribed = () => {
|
|
21
|
+
const { userId } = useSelector(state => state.auth);
|
|
22
|
+
const { modelFollowersList } = useSelector(state => state.mailMessages);
|
|
23
|
+
return useMemo(() => modelFollowersList.find((_f) => _f.$author.id === userId) != null, [modelFollowersList, userId]);
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=use-is-subscribed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-is-subscribed.js","sourceRoot":"","sources":["../../src/hooks/use-is-subscribed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AAEpD,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,MAAM,EAAC,MAAM,EAAC,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAClD,MAAM,EAAC,kBAAkB,EAAC,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAEtE,OAAO,OAAO,CACZ,GAAG,EAAE,CACH,kBAAkB,CAAC,IAAI,CAAC,CAAC,EAAO,EAAE,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,KAAK,MAAM,CAAC,IAAI,IAAI,EACxE,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAC7B,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useMessageHeaders: () => void;
|
|
@@ -0,0 +1,162 @@
|
|
|
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 React, { useCallback, useEffect, useState } from 'react';
|
|
19
|
+
import { headerActionsProvider, useDispatch, useNavigation, useSelector, useTranslator, useWebSocket, } from '@axelor/aos-mobile-core';
|
|
20
|
+
import { DoubleIcon, useThemeColor } from '@axelor/aos-mobile-ui';
|
|
21
|
+
import { getAction } from '../utils';
|
|
22
|
+
import { countUnreadMailMessages, getModelSubscribers, markAllMailMessageAsRead, saveInboxFolder, } from '../features/mailMessageSlice';
|
|
23
|
+
import { UnsubscribeIcon } from '../components';
|
|
24
|
+
import { useIsSubscribed } from './use-is-subscribed';
|
|
25
|
+
import { InboxFolder } from '../types';
|
|
26
|
+
export const useMessageHeaders = () => {
|
|
27
|
+
useMailMessagesGenericAction();
|
|
28
|
+
useMailMessagesDetailsAction();
|
|
29
|
+
useUserProfileActions();
|
|
30
|
+
useInboxActions();
|
|
31
|
+
};
|
|
32
|
+
const useMailMessagesGenericAction = () => {
|
|
33
|
+
const I18n = useTranslator();
|
|
34
|
+
const navigation = useNavigation();
|
|
35
|
+
const { mobileSettings } = useSelector((state) => state.appConfig);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
headerActionsProvider.registerGenericAction('message_mailMessages', async ({ model, modelId }) => await getAction({
|
|
38
|
+
model,
|
|
39
|
+
modelId,
|
|
40
|
+
navigation,
|
|
41
|
+
hideIf: !mobileSettings?.isTrackerMessageEnabled,
|
|
42
|
+
translator: I18n.t,
|
|
43
|
+
}));
|
|
44
|
+
}, [I18n.t, mobileSettings, navigation, I18n]);
|
|
45
|
+
};
|
|
46
|
+
const useMailMessagesDetailsAction = () => {
|
|
47
|
+
const I18n = useTranslator();
|
|
48
|
+
const Colors = useThemeColor();
|
|
49
|
+
const isSubscribed = useIsSubscribed();
|
|
50
|
+
const dispatch = useDispatch();
|
|
51
|
+
const { unreadMessages, model, modelId } = useSelector(state => state.mailMessages);
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
dispatch(getModelSubscribers({ model, modelId }));
|
|
54
|
+
dispatch(countUnreadMailMessages({ model, modelId }));
|
|
55
|
+
}, [dispatch, model, modelId]);
|
|
56
|
+
const handleMarkAllAsRead = useCallback(() => {
|
|
57
|
+
dispatch(markAllMailMessageAsRead({ modelId, model }));
|
|
58
|
+
}, [dispatch, model, modelId]);
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
headerActionsProvider.registerModel('message_mailMessage_details', {
|
|
61
|
+
actions: [
|
|
62
|
+
{
|
|
63
|
+
key: 'readMessages',
|
|
64
|
+
order: 10,
|
|
65
|
+
showInHeader: true,
|
|
66
|
+
iconName: 'check-all',
|
|
67
|
+
iconColor: unreadMessages === 0
|
|
68
|
+
? Colors.primaryColor.background
|
|
69
|
+
: Colors.secondaryColor.background,
|
|
70
|
+
title: I18n.t('Message_MarkAllAsRead'),
|
|
71
|
+
onPress: handleMarkAllAsRead,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
key: 'subscribe',
|
|
75
|
+
order: 20,
|
|
76
|
+
showInHeader: true,
|
|
77
|
+
iconName: 'star-fill',
|
|
78
|
+
title: I18n.t(isSubscribed ? 'Message_Unsubscribe' : 'Message_Subscribe'),
|
|
79
|
+
onPress: () => { },
|
|
80
|
+
customComponent: <UnsubscribeIcon />,
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
});
|
|
84
|
+
}, [Colors, I18n, handleMarkAllAsRead, isSubscribed, unreadMessages]);
|
|
85
|
+
};
|
|
86
|
+
const useUserProfileActions = () => {
|
|
87
|
+
const I18n = useTranslator();
|
|
88
|
+
const navigation = useNavigation();
|
|
89
|
+
const { mobileSettings } = useSelector(state => state.appConfig);
|
|
90
|
+
const [numberUnreadMessages, setNumberUnreadMessages] = useState(0);
|
|
91
|
+
useWebSocket(websocket => setNumberUnreadMessages(websocket?.data?.values?.mail?.unread));
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
headerActionsProvider.registerModel('auth_user_profile', {
|
|
94
|
+
actions: [
|
|
95
|
+
{
|
|
96
|
+
key: 'inbox',
|
|
97
|
+
order: 15,
|
|
98
|
+
iconName: 'chat-dots',
|
|
99
|
+
indicator: numberUnreadMessages,
|
|
100
|
+
title: I18n.t('Message_Inbox'),
|
|
101
|
+
hideIf: !mobileSettings?.isInboxAccessEnabled,
|
|
102
|
+
onPress: () => navigation.navigate('InboxScreen'),
|
|
103
|
+
showInHeader: true,
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
});
|
|
107
|
+
}, [
|
|
108
|
+
I18n,
|
|
109
|
+
mobileSettings?.isInboxAccessEnabled,
|
|
110
|
+
navigation,
|
|
111
|
+
numberUnreadMessages,
|
|
112
|
+
]);
|
|
113
|
+
};
|
|
114
|
+
const useInboxActions = () => {
|
|
115
|
+
const I18n = useTranslator();
|
|
116
|
+
const Colors = useThemeColor();
|
|
117
|
+
const dispatch = useDispatch();
|
|
118
|
+
const { inboxFolder } = useSelector(state => state.mailMessages);
|
|
119
|
+
useEffect(() => {
|
|
120
|
+
headerActionsProvider.registerModel('message_mailMessage_inbox', {
|
|
121
|
+
actions: [
|
|
122
|
+
{
|
|
123
|
+
key: 'inboxImportant',
|
|
124
|
+
order: 10,
|
|
125
|
+
iconName: null,
|
|
126
|
+
customComponent: (<DoubleIcon topIconConfig={{
|
|
127
|
+
name: inboxFolder === InboxFolder.Important ? 'star-fill' : 'star',
|
|
128
|
+
size: 15,
|
|
129
|
+
color: Colors.primaryColor.background,
|
|
130
|
+
}} topIconPosition={{ bottom: -7, right: -7 }} bottomIconConfig={{ name: 'eye' }}/>),
|
|
131
|
+
title: I18n.t('Message_ImportantMessages'),
|
|
132
|
+
onPress: () => {
|
|
133
|
+
dispatch(saveInboxFolder(inboxFolder === InboxFolder.Important
|
|
134
|
+
? InboxFolder.Inbox
|
|
135
|
+
: InboxFolder.Important));
|
|
136
|
+
},
|
|
137
|
+
showInHeader: true,
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
key: 'inboxArchive',
|
|
141
|
+
order: 20,
|
|
142
|
+
iconName: null,
|
|
143
|
+
customComponent: (<DoubleIcon topIconConfig={{
|
|
144
|
+
name: inboxFolder === InboxFolder.Archive
|
|
145
|
+
? 'archive-fill'
|
|
146
|
+
: 'archive',
|
|
147
|
+
size: 15,
|
|
148
|
+
color: Colors.primaryColor.background,
|
|
149
|
+
}} topIconPosition={{ bottom: -7, right: -7 }} bottomIconConfig={{ name: 'eye' }}/>),
|
|
150
|
+
title: I18n.t('Message_ArchivedMessages'),
|
|
151
|
+
onPress: () => {
|
|
152
|
+
dispatch(saveInboxFolder(inboxFolder === InboxFolder.Archive
|
|
153
|
+
? InboxFolder.Inbox
|
|
154
|
+
: InboxFolder.Archive));
|
|
155
|
+
},
|
|
156
|
+
showInHeader: true,
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
});
|
|
160
|
+
}, [Colors.primaryColor.background, I18n, dispatch, inboxFolder]);
|
|
161
|
+
};
|
|
162
|
+
//# sourceMappingURL=use-message-header-actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-message-header-actions.js","sourceRoot":"","sources":["../../src/hooks/use-message-header-actions.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC9D,OAAO,EACL,qBAAqB,EACrB,WAAW,EACX,aAAa,EACb,WAAW,EACX,aAAa,EACb,YAAY,GACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,UAAU,EAAE,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,CAAC;AACnC,OAAO,EACL,uB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BACT,QAAQ,EAAE,IAAI;oBACd,eAAe,EAAE,CACf,CAAC,UAAU,CACT,aAAa,CAAC,CAAC;4BACb,IAAI,EACF,WAAW,KAAK,WAAW,CAAC,OAAO;gCACjC,CAAC,CAAC,cAAc;gCAChB,CAAC,CAAC,SAAS;4BACf,IAAI,EAAE,EAAE;4BACR,KAAK,EAAE,MAAM,CAAC,YAAY,CAAC,UAAU;yBACtC,CAAC,CACF,eAAe,CAAC,CAAC,EAAC,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,EAAC,CAAC,CACzC,gBAAgB,CAAC,CAAC,EAAC,IAAI,EAAE,KAAK,EAAC,CAAC,EAChC,CACH;oBACD,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,0BAA0B,CAAC;oBACzC,OAAO,EAAE,GAAG,EAAE;wBACZ,QAAQ,CACL,eAAuB,CACtB,WAAW,KAAK,WAAW,CAAC,OAAO;4BACjC,CAAC,CAAC,WAAW,CAAC,KAAK;4BACnB,CAAC,CAAC,WAAW,CAAC,OAAO,CACxB,CACF,CAAC;oBACJ,CAAC;oBACD,YAAY,EAAE,IAAI;iBACnB;aACF;SACF,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;AACpE,CAAC,CAAC"}
|
package/lib/i18n/en.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Message_Message": "Message",
|
|
3
|
+
"Message_MailMessages": "Mail messages",
|
|
4
|
+
"Message_CommentInput_Placeholder": "Enter a comment",
|
|
5
|
+
"Message_MarkAllAsRead": "Mark all messages as read",
|
|
6
|
+
"Message_Subscribe": "Subscribe",
|
|
7
|
+
"Message_Unsubscribe": "Unsubscribe",
|
|
8
|
+
"Message_Question": "Question",
|
|
9
|
+
"Message_Unfollow_Confirmation": "Are you sure to unfollow this document?",
|
|
10
|
+
"Message_Notifications": "Notifications",
|
|
11
|
+
"Message_Inbox": "Inbox",
|
|
12
|
+
"Message_Respond": "Respond",
|
|
13
|
+
"Message_MarkAsRead": "Mark as read",
|
|
14
|
+
"Message_MarkAsUnread": "Mark as unread",
|
|
15
|
+
"Message_MarkAsImportant": "Mark as important",
|
|
16
|
+
"Message_MarkAsNotImportant": "Mark as not important",
|
|
17
|
+
"Message_MarkAsArchived": "Mark as archived",
|
|
18
|
+
"Message_MarkAsNotArchived": "Mark as not archived",
|
|
19
|
+
"Message_ImportantMessages": "Important messages",
|
|
20
|
+
"Message_ArchivedMessages": "Archived messages",
|
|
21
|
+
"Message_LinkFiles": "Link files",
|
|
22
|
+
"Message_InvalidFile": "This file is not valid as it does not contain any document.",
|
|
23
|
+
"Message_SliceAction_FetchMailMessages": "fetch mail messages",
|
|
24
|
+
"Message_SliceAction_PostMailMessageComment": "post mail message comment",
|
|
25
|
+
"Message_SliceAction_FetchModelSubscribers": "fetch model subscribers",
|
|
26
|
+
"Message_SliceAction_SubscribeToModel": "subscribe to model",
|
|
27
|
+
"Message_SliceAction_UnsubscribeFromModel": "unsubscribe from model",
|
|
28
|
+
"Message_SliceAction_CountUnreadMailMessages": "count unread mail messages",
|
|
29
|
+
"Message_SliceAction_MarkAllMailMessageAsRead": "mark all mail messages as read",
|
|
30
|
+
"Message_SliceAction_FetchInboxMessages": "fetch inbox messages",
|
|
31
|
+
"Message_SliceAction_ModifyMailMessagesFlags": "modify mail message flags"
|
|
32
|
+
}
|
package/lib/i18n/fr.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Message_Message": "Message",
|
|
3
|
+
"Message_MailMessages": "Suivi des notifications",
|
|
4
|
+
"Message_CommentInput_Placeholder": "Entrez votre commentaire",
|
|
5
|
+
"Message_MarkAllAsRead": "Marquer tous les messages comme lus",
|
|
6
|
+
"Message_Subscribe": "S'abonner",
|
|
7
|
+
"Message_Unsubscribe": "Se désabonner",
|
|
8
|
+
"Message_Question": "Question",
|
|
9
|
+
"Message_Unfollow_Confirmation": "Êtes-vous sûr de vouloir vous désabonner de ce document?",
|
|
10
|
+
"Message_Notifications": "Notifications",
|
|
11
|
+
"Message_Inbox": "Boîte de reception",
|
|
12
|
+
"Message_Respond": "Répondre",
|
|
13
|
+
"Message_MarkAsRead": "Marquer comme lu",
|
|
14
|
+
"Message_MarkAsUnread": "Marquer comme non lu",
|
|
15
|
+
"Message_MarkAsImportant": "Marquer comme important",
|
|
16
|
+
"Message_MarkAsNotImportant": "Marquer comme non important",
|
|
17
|
+
"Message_MarkAsArchived": "Marquer comme archivé",
|
|
18
|
+
"Message_MarkAsNotArchived": "Marquer comme non archivé",
|
|
19
|
+
"Message_ImportantMessages": "Messages importants",
|
|
20
|
+
"Message_ArchivedMessages": "Messages archivés",
|
|
21
|
+
"Message_LinkFiles": "Lier des fichiers",
|
|
22
|
+
"Message_InvalidFile": "Cet enregistrement est invalide car il ne contient aucun fichier.",
|
|
23
|
+
"Message_SliceAction_FetchMailMessages": "récupération des mail messages",
|
|
24
|
+
"Message_SliceAction_PostMailMessageComment": "ajout d'un mail message",
|
|
25
|
+
"Message_SliceAction_FetchModelSubscribers": "récupération des abonnés du modèle",
|
|
26
|
+
"Message_SliceAction_SubscribeToModel": "abonnement au modèle",
|
|
27
|
+
"Message_SliceAction_UnsubscribeFromModel": "désabonnement au modèle",
|
|
28
|
+
"Message_SliceAction_CountUnreadMailMessages": "comptage des mail messages non lus",
|
|
29
|
+
"Message_SliceAction_MarkAllMailMessageAsRead": "marquer tous les messages comme lus",
|
|
30
|
+
"Message_SliceAction_FetchInboxMessages": "récupération des messages de la boîte de reception",
|
|
31
|
+
"Message_SliceAction_ModifyMailMessagesFlags": "modification des indicateurs du message"
|
|
32
|
+
}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Module } from '@axelor/aos-mobile-core';
|
|
2
|
+
export declare const MessageModule: Module;
|
|
3
|
+
export * from './api';
|
|
4
|
+
export * from './components';
|
|
5
|
+
export * from './features/asyncFunctions-index';
|
|
6
|
+
export * from './screens';
|
|
7
|
+
export * from './types';
|
|
8
|
+
export * from './utils';
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
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 enTranslations from './i18n/en.json';
|
|
19
|
+
import frTranslations from './i18n/fr.json';
|
|
20
|
+
import MessageScreens from './screens';
|
|
21
|
+
import * as messageReducers from './features';
|
|
22
|
+
import { useMessageHeaders } from './hooks/use-message-header-actions';
|
|
23
|
+
export const MessageModule = {
|
|
24
|
+
name: 'app-message',
|
|
25
|
+
title: 'Message_Message',
|
|
26
|
+
subtitle: 'Message_Message',
|
|
27
|
+
icon: 'bell-fill',
|
|
28
|
+
translations: {
|
|
29
|
+
en: enTranslations,
|
|
30
|
+
fr: frTranslations,
|
|
31
|
+
},
|
|
32
|
+
screens: {
|
|
33
|
+
...MessageScreens,
|
|
34
|
+
},
|
|
35
|
+
reducers: {
|
|
36
|
+
...messageReducers,
|
|
37
|
+
},
|
|
38
|
+
models: {
|
|
39
|
+
headerRegisters: useMessageHeaders,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
export * from './api';
|
|
43
|
+
export * from './components';
|
|
44
|
+
export * from './features/asyncFunctions-index';
|
|
45
|
+
export * from './screens';
|
|
46
|
+
export * from './types';
|
|
47
|
+
export * from './utils';
|
|
48
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,cAAc,MAAM,gBAAgB,CAAC;AAC5C,OAAO,cAAc,MAAM,gBAAgB,CAAC;AAC5C,OAAO,cAAc,MAAM,WAAW,CAAC;AACvC,OAAO,KAAK,eAAe,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAC,iBAAiB,EAAC,MAAM,oCAAoC,CAAC;AAErE,MAAM,CAAC,MAAM,aAAa,GAAW;IACnC,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,iBAAiB;IACxB,QAAQ,EAAE,iBAAiB;IAC3B,IAAI,EAAE,WAAW;IACjB,YAAY,EAAE;QACZ,EAAE,EAAE,cAAc;QAClB,EAAE,EAAE,cAAc;KACnB;IACD,OAAO,EAAE;QACP,GAAG,cAAc;KAClB;IACD,QAAQ,EAAE;QACR,GAAG,eAAe;KACnB;IACD,MAAM,EAAE;QACN,eAAe,EAAE,iBAAiB;KACnC;CACF,CAAC;AAEF,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,iCAAiC,CAAC;AAChD,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
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 React, { useCallback } from 'react';
|
|
19
|
+
import { useDispatch, useSelector, useTranslator } from '@axelor/aos-mobile-core';
|
|
20
|
+
import { Screen, ScrollList } from '@axelor/aos-mobile-ui';
|
|
21
|
+
import { MailMessageCard } from '../components';
|
|
22
|
+
import { fetchInboxMessages } from '../features/mailMessageSlice';
|
|
23
|
+
const InboxScreen = ({}) => {
|
|
24
|
+
const I18n = useTranslator();
|
|
25
|
+
const dispatch = useDispatch();
|
|
26
|
+
const { loadingInbox, moreLoadingInbox, isInboxListEnd, inboxList, inboxFolder, } = useSelector(state => state.mailMessages);
|
|
27
|
+
const fetchInboxMessagesAPI = useCallback((page) => {
|
|
28
|
+
dispatch(fetchInboxMessages({ folder: inboxFolder, page }));
|
|
29
|
+
}, [dispatch, inboxFolder]);
|
|
30
|
+
return (<Screen removeSpaceOnTop>
|
|
31
|
+
<ScrollList loadingList={loadingInbox} data={inboxList} renderItem={({ item }) => (<MailMessageCard key={item.id} messageId={item.id} author={item.$author?.fullName} avatar={item.$avatar} body={item.body} eventText={item.$eventText} eventTime={item.$eventTime} files={item.$files} relatedName={item.relatedName} subject={item.subject} type={item.type} flags={item.$flags} relatedId={item.relatedId} relatedModel={item.relatedModel} isInbox numReplies={item.$numReplies}/>)} fetchData={fetchInboxMessagesAPI} filter={false} moreLoading={moreLoadingInbox} isListEnd={isInboxListEnd} translator={I18n.t}/>
|
|
32
|
+
</Screen>);
|
|
33
|
+
};
|
|
34
|
+
export default InboxScreen;
|
|
35
|
+
//# sourceMappingURL=InboxScreen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InboxScreen.js","sourceRoot":"","sources":["../../src/screens/InboxScreen.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAC,MAAM,OAAO,CAAC;AACzC,OAAO,EAAC,WAAW,EAAE,WAAW,EAAE,aAAa,EAAC,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAC,kBAAkB,EAAC,MAAM,8BAA8B,CAAC;AAEhE,MAAM,WAAW,GAAG,CAAC,EAAE,EAAE,EAAE;IACzB,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,MAAM,EACJ,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,WAAW,GACZ,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAE7C,MAAM,qBAAqB,GAAG,WAAW,CACvC,CAAC,IAAY,EAAE,EAAE;QACf,QAAQ,CAAE,kBAA0B,CAAC,EAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAC,CAAC,CAAC,CAAC;IACrE,CAAC,EACD,CAAC,QAAQ,EAAE,WAAW,CAAC,CACxB,CAAC;IAEF,OAAO,CACL,CAAC,MAAM,CAAC,gBAAgB,CACtB;MAAA,CAAC,UAAU,CACT,WAAW,CAAC,CAAC,YAAY,CAAC,CAC1B,IAAI,CAAC,CAAC,SAAS,CAAC,CAChB,UAAU,CAAC,CAAC,CAAC,EAAC,IAAI,EAAC,E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|
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, { useMemo, useState } from 'react';
|
|
19
|
+
import { useSelector, SearchListView, useTranslator, } from '@axelor/aos-mobile-core';
|
|
20
|
+
import { ChipSelect, Screen, useThemeColor } from '@axelor/aos-mobile-ui';
|
|
21
|
+
import { DocumentActionCard, File, searchDocument } from '@axelor/aos-mobile-dms';
|
|
22
|
+
const MailMessageAttachedFilesScreen = ({ route }) => {
|
|
23
|
+
const { files } = route?.params;
|
|
24
|
+
const I18n = useTranslator();
|
|
25
|
+
const Colors = useThemeColor();
|
|
26
|
+
const [selectedExtensions, setSelectedExtensions] = useState([]);
|
|
27
|
+
const { loadingDocuments, moreLoadingDocument, isListEndDocument, documentList, } = useSelector(state => state.dms_document);
|
|
28
|
+
const sliceFunctionData = useMemo(() => ({
|
|
29
|
+
extensions: selectedExtensions.map(_extension => _extension.key),
|
|
30
|
+
metaFileIds: files.map((_file) => _file.id),
|
|
31
|
+
}), [files, selectedExtensions]);
|
|
32
|
+
return (<Screen removeSpaceOnTop={true}>
|
|
33
|
+
<SearchListView list={documentList} loading={loadingDocuments} moreLoading={moreLoadingDocument} isListEnd={isListEndDocument} sliceFunction={searchDocument} sliceFunctionData={sliceFunctionData} displaySearchValue={item => item.fileName} searchPlaceholder={I18n.t('Base_Search')} chipComponent={<ChipSelect mode="multi" selectionItems={File.getFileExtensionList(Colors)} onChangeValue={setSelectedExtensions} showClearButton/>} renderListItem={({ item }) => (<DocumentActionCard document={item} disableEdit disabledDelete/>)} expandableFilter={false}/>
|
|
34
|
+
</Screen>);
|
|
35
|
+
};
|
|
36
|
+
export default MailMessageAttachedFilesScreen;
|
|
37
|
+
//# sourceMappingURL=MailMessageAttachedFilesScreen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MailMessageAttachedFilesScreen.js","sourceRoot":"","sources":["../../src/screens/MailMessageAttachedFilesScreen.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/C,OAAO,EACL,WAAW,EACX,cAAc,EACd,aAAa,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAC,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAC,kBAAkB,EAAE,IAAI,EAAE,cAAc,EAAC,MAAM,wBAAwB,CAAC;AAEhF,MAAM,8BAA8B,GAAG,CAAC,EAAC,KAAK,EAAC,EAAE,EAAE;IACjD,MAAM,EAAC,KAAK,EAAC,GAAG,KAAK,EAAE,MAAM,CAAC;IAC9B,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAE/B,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAEjE,MAAM,EACJ,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,GACb,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAE7C,MAAM,iBAAiB,GAAG,OAAO,CAC/B,GAAG,EAAE,CAAC,CAAC;QACL,UAAU,EAAE,kBAAkB,CAAC,GAAG,CAAC,UAAU,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
|
|
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 React, { useCallback, useMemo, useState } from 'react';
|
|
19
|
+
import { StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
20
|
+
import { showToastMessage, useDispatch, useSelector, useTranslator, } from '@axelor/aos-mobile-core';
|
|
21
|
+
import { Button, Icon, Screen, Text } from '@axelor/aos-mobile-ui';
|
|
22
|
+
import { DocumentList } from '@axelor/aos-mobile-dms';
|
|
23
|
+
import { saveLinkFiles } from '../features/mailMessageSlice';
|
|
24
|
+
const MailMessageLinkFilesScreen = ({ navigation }) => {
|
|
25
|
+
const I18n = useTranslator();
|
|
26
|
+
const dispatch = useDispatch();
|
|
27
|
+
const { linkFiles: _linkFiles } = useSelector(state => state.mailMessages);
|
|
28
|
+
const [linkFiles, setLinkFiles] = useState(_linkFiles);
|
|
29
|
+
const displayLinkFiles = useMemo(() => linkFiles.length > 0 || linkFiles.length !== _linkFiles.length, [_linkFiles.length, linkFiles.length]);
|
|
30
|
+
const handleLinkFiles = useCallback((file) => {
|
|
31
|
+
if (!file?.metaFile) {
|
|
32
|
+
showToastMessage({
|
|
33
|
+
position: 'bottom',
|
|
34
|
+
type: 'error',
|
|
35
|
+
text1: I18n.t('Base_Error'),
|
|
36
|
+
text2: I18n.t('Message_InvalidFile'),
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
setLinkFiles(prevFiles => {
|
|
41
|
+
if (prevFiles.some(({ id }) => id === file.id)) {
|
|
42
|
+
return prevFiles.filter(({ id }) => id !== file.id);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
return [...prevFiles, file];
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}, [I18n]);
|
|
50
|
+
const renderFile = useCallback((file, idx) => {
|
|
51
|
+
return (<TouchableOpacity style={styles.linkFile} onPress={() => handleLinkFiles(file)} key={idx}>
|
|
52
|
+
<Icon name="x-lg"/>
|
|
53
|
+
<Text style={styles.text} numberOfLines={1}>
|
|
54
|
+
{file.fileName}
|
|
55
|
+
</Text>
|
|
56
|
+
</TouchableOpacity>);
|
|
57
|
+
}, [handleLinkFiles]);
|
|
58
|
+
return (<Screen removeSpaceOnTop fixedItems={displayLinkFiles && (<View style={styles.linkFilesContainer}>
|
|
59
|
+
{linkFiles.map(renderFile)}
|
|
60
|
+
<Button width="100%" title={I18n.t('Base_Validate')} onPress={() => {
|
|
61
|
+
dispatch(saveLinkFiles(linkFiles));
|
|
62
|
+
navigation.goBack();
|
|
63
|
+
}}/>
|
|
64
|
+
</View>)}>
|
|
65
|
+
<DocumentList hideActions customOnPress={handleLinkFiles}/>
|
|
66
|
+
</Screen>);
|
|
67
|
+
};
|
|
68
|
+
const styles = StyleSheet.create({
|
|
69
|
+
linkFilesContainer: {
|
|
70
|
+
flexDirection: 'row',
|
|
71
|
+
flexWrap: 'wrap',
|
|
72
|
+
paddingVertical: 2,
|
|
73
|
+
paddingHorizontal: 15,
|
|
74
|
+
gap: 5,
|
|
75
|
+
},
|
|
76
|
+
linkFile: {
|
|
77
|
+
flexShrink: 1,
|
|
78
|
+
flexDirection: 'row',
|
|
79
|
+
alignItems: 'center',
|
|
80
|
+
gap: 3,
|
|
81
|
+
},
|
|
82
|
+
text: {
|
|
83
|
+
flexShrink: 1,
|
|
84
|
+
textDecorationLine: 'underline',
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
export default MailMessageLinkFilesScreen;
|
|
88
|
+
//# sourceMappingURL=MailMessageLinkFilesScreen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MailMessageLinkFilesScreen.js","sourceRoot":"","sources":["../../src/screens/MailMessageLinkFilesScreen.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAC,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAChE,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,aAAa,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAC,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAC,YAAY,EAAC,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAC,aAAa,EAAC,MAAM,8BAA8B,CAAC;AAE3D,MAAM,0BAA0B,GAAG,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE;IAClD,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,MAAM,EAAC,SAAS,EAAE,UAAU,EAAC,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAEzE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAQ,UAAU,CAAC,CAAC;IAE9D,MAAM,gBAAgB,GAAG,OAAO,CAC9B,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,SAAS,CAAC,MAAM,KAAK,UAAU,CAAC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}
|
|
@@ -0,0 +1,32 @@
|
|
|
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 React, { useEffect } from 'react';
|
|
19
|
+
import { useDispatch } from '@axelor/aos-mobile-core';
|
|
20
|
+
import { MailMessageView } from '../components';
|
|
21
|
+
import { registerModel, registerModelId } from '../features/mailMessageSlice';
|
|
22
|
+
const MailMessageScreen = ({ route }) => {
|
|
23
|
+
const { model, modelId } = route.params;
|
|
24
|
+
const dispatch = useDispatch();
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
dispatch(registerModel(model));
|
|
27
|
+
dispatch(registerModelId(modelId));
|
|
28
|
+
}, [dispatch, model, modelId]);
|
|
29
|
+
return <MailMessageView model={model} modelId={modelId}/>;
|
|
30
|
+
};
|
|
31
|
+
export default MailMessageScreen;
|
|
32
|
+
//# sourceMappingURL=MailMessageScreen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MailMessageScreen.js","sourceRoot":"","sources":["../../src/screens/MailMessageScreen.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACvC,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAC,aAAa,EAAE,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAE5E,MAAM,iBAAiB,GAAG,CAAC,EAAC,KAAK,EAAC,EAAE,EAAE;IACpC,MAAM,EAAC,KAAK,EAAE,OAAO,EAAC,GAAG,KAAK,CAAC,MAAM,CAAC;IACtC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,SAAS,CAAC,GAAG,EAAE;QACb,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;QAC/B,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;IACrC,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;IAE/B,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,EAAG,CAAC;AAC7D,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|