@axelor/aos-mobile-dms 8.3.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 +44 -0
- package/lib/api/document-api.d.ts +39 -0
- package/lib/api/document-api.js +254 -0
- package/lib/api/document-api.js.map +1 -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/components/atoms/AuthorFilter/AuthorFilter.d.ts +7 -0
- package/lib/components/atoms/AuthorFilter/AuthorFilter.js +51 -0
- package/lib/components/atoms/AuthorFilter/AuthorFilter.js.map +1 -0
- package/lib/components/atoms/DirectoryCard/DirectoryCard.d.ts +6 -0
- package/lib/components/atoms/DirectoryCard/DirectoryCard.js +55 -0
- package/lib/components/atoms/DirectoryCard/DirectoryCard.js.map +1 -0
- package/lib/components/atoms/DocumentCard/DocumentCard.d.ts +7 -0
- package/lib/components/atoms/DocumentCard/DocumentCard.js +63 -0
- package/lib/components/atoms/DocumentCard/DocumentCard.js.map +1 -0
- package/lib/components/atoms/SwitchDocumentType/SwitchDocumentType.d.ts +7 -0
- package/lib/components/atoms/SwitchDocumentType/SwitchDocumentType.js +44 -0
- package/lib/components/atoms/SwitchDocumentType/SwitchDocumentType.js.map +1 -0
- package/lib/components/atoms/index.d.ts +4 -0
- package/lib/components/atoms/index.js +22 -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/DocumentActionCard/DocumentActionCard.d.ts +7 -0
- package/lib/components/molecules/DocumentActionCard/DocumentActionCard.js +79 -0
- package/lib/components/molecules/DocumentActionCard/DocumentActionCard.js.map +1 -0
- package/lib/components/molecules/index.d.ts +1 -0
- package/lib/components/molecules/index.js +19 -0
- package/lib/components/molecules/index.js.map +1 -0
- package/lib/components/organisms/ParentDirectorySearchBar/ParentDirectorySearchBar.d.ts +12 -0
- package/lib/components/organisms/ParentDirectorySearchBar/ParentDirectorySearchBar.js +42 -0
- package/lib/components/organisms/ParentDirectorySearchBar/ParentDirectorySearchBar.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/DocumentList/DocumentList.d.ts +7 -0
- package/lib/components/templates/DocumentList/DocumentList.js +100 -0
- package/lib/components/templates/DocumentList/DocumentList.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/documentSlice.d.ts +132 -0
- package/lib/features/documentSlice.js +135 -0
- package/lib/features/documentSlice.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/hooks/use-dms-header-actions.d.ts +1 -0
- package/lib/hooks/use-dms-header-actions.js +44 -0
- package/lib/hooks/use-dms-header-actions.js.map +1 -0
- package/lib/i18n/en.json +30 -0
- package/lib/i18n/fr.json +30 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.js +76 -0
- package/lib/index.js.map +1 -0
- package/lib/models/forms.d.ts +2 -0
- package/lib/models/forms.js +67 -0
- package/lib/models/forms.js.map +1 -0
- package/lib/models/index.d.ts +4 -0
- package/lib/models/index.js +22 -0
- package/lib/models/index.js.map +1 -0
- package/lib/models/objectFields.d.ts +2 -0
- package/lib/models/objectFields.js +36 -0
- package/lib/models/objectFields.js.map +1 -0
- package/lib/models/searchFields.d.ts +2 -0
- package/lib/models/searchFields.js +21 -0
- package/lib/models/searchFields.js.map +1 -0
- package/lib/models/sortFields.d.ts +2 -0
- package/lib/models/sortFields.js +21 -0
- package/lib/models/sortFields.js.map +1 -0
- package/lib/screens/AllDocumentsScreen.d.ts +5 -0
- package/lib/screens/AllDocumentsScreen.js +28 -0
- package/lib/screens/AllDocumentsScreen.js.map +1 -0
- package/lib/screens/AttachedFilesScreen.d.ts +6 -0
- package/lib/screens/AttachedFilesScreen.js +77 -0
- package/lib/screens/AttachedFilesScreen.js.map +1 -0
- package/lib/screens/DocumentFormScreen.d.ts +6 -0
- package/lib/screens/DocumentFormScreen.js +64 -0
- package/lib/screens/DocumentFormScreen.js.map +1 -0
- package/lib/screens/MyFavoriteDocumentsScreen.d.ts +3 -0
- package/lib/screens/MyFavoriteDocumentsScreen.js +43 -0
- package/lib/screens/MyFavoriteDocumentsScreen.js.map +1 -0
- package/lib/screens/index.d.ts +49 -0
- package/lib/screens/index.js +57 -0
- package/lib/screens/index.js.map +1 -0
- package/lib/types/file.d.ts +13 -0
- package/lib/types/file.js +127 -0
- package/lib/types/file.js.map +1 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +19 -0
- package/lib/types/index.js.map +1 -0
- package/lib/utils/attachedFilesGenericAction.d.ts +17 -0
- package/lib/utils/attachedFilesGenericAction.js +59 -0
- package/lib/utils/attachedFilesGenericAction.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/moduleHelper.d.ts +19 -0
- package/lib/utils/moduleHelper.js +56 -0
- package/lib/utils/moduleHelper.js.map +1 -0
- package/package.json +45 -0
|
@@ -0,0 +1,77 @@
|
|
|
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, useState } from 'react';
|
|
19
|
+
import { handlerApiCall, headerActionsProvider, useIsFocused, useTranslator, } from '@axelor/aos-mobile-core';
|
|
20
|
+
import { Alert, Text } from '@axelor/aos-mobile-ui';
|
|
21
|
+
import { fetchDirectory } from '../api/document-api';
|
|
22
|
+
import { DocumentList } from '../components';
|
|
23
|
+
const AttachedFilesScreen = ({ navigation, route }) => {
|
|
24
|
+
const { parent: _parent, model, modelId, options } = route?.params ?? {};
|
|
25
|
+
const I18n = useTranslator();
|
|
26
|
+
const isFocused = useIsFocused();
|
|
27
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
28
|
+
const [parent, setParent] = useState(_parent);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
!parent && setIsVisible(true);
|
|
31
|
+
}, [parent]);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (isFocused && parent == null) {
|
|
34
|
+
handlerApiCall({
|
|
35
|
+
fetchFunction: fetchDirectory,
|
|
36
|
+
data: { model, modelId },
|
|
37
|
+
action: 'Dms_SliceAction_FetchDirectory',
|
|
38
|
+
getState: () => { },
|
|
39
|
+
responseOptions: { isArrayResponse: false },
|
|
40
|
+
errorOptions: {
|
|
41
|
+
errorTracing: false,
|
|
42
|
+
showErrorToast: false,
|
|
43
|
+
},
|
|
44
|
+
}).then(setParent);
|
|
45
|
+
}
|
|
46
|
+
}, [isFocused, model, modelId, parent]);
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (options?.screenTitle != null) {
|
|
49
|
+
headerActionsProvider.registerModel('dms_attachedFiles_tree', {
|
|
50
|
+
headerTitle: options?.screenTitle,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}, [options]);
|
|
54
|
+
return (<>
|
|
55
|
+
{!isVisible && (<DocumentList defaultParent={parent} isAttachedFilesList/>)}
|
|
56
|
+
<Alert visible={isVisible} title={I18n.t('Dms_NoAttachedFiles')} cancelButtonConfig={{
|
|
57
|
+
title: I18n.t('Base_No'),
|
|
58
|
+
onPress: () => {
|
|
59
|
+
setIsVisible(false);
|
|
60
|
+
navigation.goBack();
|
|
61
|
+
},
|
|
62
|
+
}} confirmButtonConfig={{
|
|
63
|
+
title: I18n.t('Base_Yes'),
|
|
64
|
+
onPress: () => {
|
|
65
|
+
setIsVisible(false);
|
|
66
|
+
navigation.navigate('DocumentFormScreen', {
|
|
67
|
+
model,
|
|
68
|
+
modelId,
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
}} translator={I18n.t}>
|
|
72
|
+
<Text>{I18n.t('Dms_DoYouWantToAddFile')}</Text>
|
|
73
|
+
</Alert>
|
|
74
|
+
</>);
|
|
75
|
+
};
|
|
76
|
+
export default AttachedFilesScreen;
|
|
77
|
+
//# sourceMappingURL=AttachedFilesScreen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttachedFilesScreen.js","sourceRoot":"","sources":["../../src/screens/AttachedFilesScreen.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACjD,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,YAAY,EACZ,aAAa,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,KAAK,EAAE,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAE3C,MAAM,mBAAmB,GAAG,CAAC,EAAC,UAAU,EAAE,KAAK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OAAO,CAAC,CAAC,CAAC;IAEd,OAAO,CACL,EACE;MAAA,CAAC,CAAC,SAAS,IAAI,CACb,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,mBAAmB,EAAG,CAC5D,CACD;MAAA,CAAC,KAAK,CACJ,OAAO,CAAC,CAAC,SAAS,CAAC,CACnB,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CACrC,kBAAkB,CAAC,CAAC;YAClB,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;YACxB,OAAO,EAAE,GAAG,EAAE;gBACZ,YAAY,CAAC,KAAK,CAAC,CAAC;gBACpB,UAAU,CAAC,MAAM,EAAE,CAAC;YACtB,CAAC;SACF,CAAC,CACF,mBAAmB,CAAC,CAAC;YACnB,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC;YACzB,OAAO,EAAE,GAAG,EAAE;gBACZ,YAAY,CAAC,KAAK,CAAC,CAAC;gBACpB,UAAU,CAAC,QAAQ,CAAC,oBAAoB,EAAE;oBACxC,KAAK;oBACL,OAAO;iBACR,CAAC,CAAC;YACL,CAAC;SACF,CAAC,CACF,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACnB;QAAA,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,EAAE,IAAI,CAChD;MAAA,EAAE,KAAK,CACT;IAAA,GAAG,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
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, useMemo } from 'react';
|
|
19
|
+
import { StyleSheet } from 'react-native';
|
|
20
|
+
import { FormView, useSelector } from '@axelor/aos-mobile-core';
|
|
21
|
+
import { createDocument, updateDocument } from '../features/documentSlice';
|
|
22
|
+
const DocumentFormScreen = ({ navigation, route }) => {
|
|
23
|
+
const { parent, document, model, modelId } = route?.params ?? {};
|
|
24
|
+
const { user } = useSelector(state => state.user);
|
|
25
|
+
const { mobileSettings } = useSelector(state => state.appConfig);
|
|
26
|
+
const creationDefaultValue = useMemo(() => ({
|
|
27
|
+
isAttachedFileCreation: model && modelId,
|
|
28
|
+
parent: parent,
|
|
29
|
+
}), [model, modelId, parent]);
|
|
30
|
+
const defaultValue = useMemo(() => document, [document]);
|
|
31
|
+
const documentAPI = useCallback((_document, isCreation, dispatch) => {
|
|
32
|
+
if (!_document.isAttachedFileCreation && _document.parent?.id == null) {
|
|
33
|
+
_document.parent = user.dmsRoot ?? mobileSettings?.defaultDmsRoot;
|
|
34
|
+
}
|
|
35
|
+
const sliceFunction = isCreation ? createDocument : updateDocument;
|
|
36
|
+
dispatch(sliceFunction({ document: _document, model, modelId }));
|
|
37
|
+
navigation.pop();
|
|
38
|
+
}, [mobileSettings?.defaultDmsRoot, model, modelId, navigation, user.dmsRoot]);
|
|
39
|
+
return (<FormView style={styles.form} formKey="dms_document" creationDefaultValue={creationDefaultValue} defaultValue={defaultValue} defaultEditMode actions={[
|
|
40
|
+
{
|
|
41
|
+
key: 'create-document',
|
|
42
|
+
type: 'create',
|
|
43
|
+
needValidation: true,
|
|
44
|
+
needRequiredFields: true,
|
|
45
|
+
hideIf: () => document != null,
|
|
46
|
+
customAction: ({ objectState, dispatch }) => documentAPI(objectState, true, dispatch),
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
key: 'update-document',
|
|
50
|
+
type: 'update',
|
|
51
|
+
needValidation: true,
|
|
52
|
+
needRequiredFields: true,
|
|
53
|
+
hideIf: () => document == null,
|
|
54
|
+
customAction: ({ objectState, dispatch }) => documentAPI(objectState, false, dispatch),
|
|
55
|
+
},
|
|
56
|
+
]}/>);
|
|
57
|
+
};
|
|
58
|
+
const styles = StyleSheet.create({
|
|
59
|
+
form: {
|
|
60
|
+
paddingBottom: 150,
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
export default DocumentFormScreen;
|
|
64
|
+
//# sourceMappingURL=DocumentFormScreen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentFormScreen.js","sourceRoot":"","sources":["../../src/screens/DocumentFormScreen.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AAClD,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,QAAQ,EAAE,WAAW,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAEzE,MAAM,kBAAkB,GAAG,CAAC,EAAC,UAAU,EAAE,KAAK,EAAC,EAAE,EAAE;IACjD,MAAM,EAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAC,GAAG,KAAK,EAAE,MAAM,IAAI,EAAE,CAAC;IAE/D,MAAM,EAAC,IAAI,EAAC,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK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O,CAAC,CAAC;YACP;gBACE,GAAG,EAAE,iBAAiB;gBACtB,IAAI,EAAE,QAAQ;gBACd,cAAc,EAAE,IAAI;gBACpB,kBAAkB,EAAE,IAAI;gBACxB,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ,IAAI,IAAI;gBAC9B,YAAY,EAAE,CAAC,EAAC,WAAW,EAAE,QAAQ,EAAC,EAAE,EAAE,CACxC,WAAW,CAAC,WAAW,EAAE,IAAI,EAAE,QAAQ,CAAC;aAC3C;YACD;gBACE,GAAG,EAAE,iBAAiB;gBACtB,IAAI,EAAE,QAAQ;gBACd,cAAc,EAAE,IAAI;gBACpB,kBAAkB,EAAE,IAAI;gBACxB,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ,IAAI,IAAI;gBAC9B,YAAY,EAAE,CAAC,EAAC,WAAW,EAAE,QAAQ,EAAC,EAAE,EAAE,CACxC,WAAW,CAAC,WAAW,EAAE,KAAK,EAAE,QAAQ,CAAC;aAC5C;SACF,CAAC,EACF,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,aAAa,EAAE,GAAG;KACnB;CACF,CAAC,CAAC;AAEH,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
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, { 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 { AuthorFilter, DocumentActionCard } from '../components';
|
|
22
|
+
import { searchFavoriteDocument } from '../features/documentSlice';
|
|
23
|
+
import { File } from '../types';
|
|
24
|
+
const MyFavoriteDocumentsScreen = ({}) => {
|
|
25
|
+
const I18n = useTranslator();
|
|
26
|
+
const Colors = useThemeColor();
|
|
27
|
+
const [author, setAuthor] = useState(null);
|
|
28
|
+
const [selectedExtensions, setSelectedExtensions] = useState([]);
|
|
29
|
+
const { user } = useSelector(state => state.user);
|
|
30
|
+
const { loadingFavoriteDocument, moreLoadingFavoriteDocument, isListEndFavoriteDocument, favoriteDocumentList, } = useSelector(state => state.dms_document);
|
|
31
|
+
const sliceFunctionData = useMemo(() => ({
|
|
32
|
+
authorId: author?.id,
|
|
33
|
+
extensions: selectedExtensions.map(_extension => _extension.key),
|
|
34
|
+
favoriteFileIds: user?.favouriteFileSet?.length > 0
|
|
35
|
+
? user?.favouriteFileSet?.map((file) => file.id)
|
|
36
|
+
: [-1],
|
|
37
|
+
}), [author?.id, selectedExtensions, user?.favouriteFileSet]);
|
|
38
|
+
return (<Screen removeSpaceOnTop={true}>
|
|
39
|
+
<SearchListView list={favoriteDocumentList} loading={loadingFavoriteDocument} moreLoading={moreLoadingFavoriteDocument} isListEnd={isListEndFavoriteDocument} sliceFunction={searchFavoriteDocument} sliceFunctionData={sliceFunctionData} displaySearchValue={item => item.fileName} searchPlaceholder={I18n.t('Base_Search')} headerChildren={<AuthorFilter author={author} setAuthor={setAuthor}/>} chipComponent={<ChipSelect mode="multi" selectionItems={File.getFileExtensionList(Colors)} onChangeValue={setSelectedExtensions} showClearButton/>} renderListItem={({ item }) => <DocumentActionCard document={item}/>}/>
|
|
40
|
+
</Screen>);
|
|
41
|
+
};
|
|
42
|
+
export default MyFavoriteDocumentsScreen;
|
|
43
|
+
//# sourceMappingURL=MyFavoriteDocumentsScreen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MyFavoriteDocumentsScreen.js","sourceRoot":"","sources":["../../src/screens/MyFavoriteDocumentsScreen.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,YAAY,EAAE,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAC,sBAAsB,EAAC,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAC,IAAI,EAAC,MAAM,UAAU,CAAC;AAE9B,MAAM,yBAAyB,GAAG,CAAC,EAAE,EAAE,EAAE;IACvC,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAE/B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAEjE,MAAM,EAAC,IAAI,EAAC,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAChD,MAAM,EACJ,uBAAuB,EACvB,2BAA2B,EAC3B,yBAAyB,EACzB,oBAAoB,GACrB,GAAG,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Ac,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAClD,aAAa,CAAC,CAAC,qBAAqB,CAAC,CACrC,eAAe,EACf,CACH,CACD,cAAc,CAAC,CAAC,CAAC,EAAC,IAAI,EAAC,EAAE,EAAE,CAAC,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAG,CAAC,EAEvE;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import AllDocumentsScreen from './AllDocumentsScreen';
|
|
3
|
+
import MyFavoriteDocumentsScreen from './MyFavoriteDocumentsScreen';
|
|
4
|
+
import DocumentFormScreen from './DocumentFormScreen';
|
|
5
|
+
import AttachedFilesScreen from './AttachedFilesScreen';
|
|
6
|
+
declare const _default: {
|
|
7
|
+
AllDocumentsScreen: {
|
|
8
|
+
title: string;
|
|
9
|
+
component: ({ defaultParent }: {
|
|
10
|
+
defaultParent: any;
|
|
11
|
+
}) => import("react").JSX.Element;
|
|
12
|
+
actionID: string;
|
|
13
|
+
options: {
|
|
14
|
+
shadedHeader: boolean;
|
|
15
|
+
};
|
|
16
|
+
isUsableOnShortcut: boolean;
|
|
17
|
+
};
|
|
18
|
+
FavoriteDocuments: {
|
|
19
|
+
title: string;
|
|
20
|
+
component: ({}: {}) => import("react").JSX.Element;
|
|
21
|
+
options: {
|
|
22
|
+
shadedHeader: boolean;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
DocumentFormScreen: {
|
|
26
|
+
title: string;
|
|
27
|
+
component: ({ navigation, route }: {
|
|
28
|
+
navigation: any;
|
|
29
|
+
route: any;
|
|
30
|
+
}) => import("react").JSX.Element;
|
|
31
|
+
isUsableOnShortcut: boolean;
|
|
32
|
+
};
|
|
33
|
+
AttachedFilesScreen: {
|
|
34
|
+
title: string;
|
|
35
|
+
actionID: string;
|
|
36
|
+
component: ({ navigation, route }: {
|
|
37
|
+
navigation: any;
|
|
38
|
+
route: any;
|
|
39
|
+
}) => import("react").JSX.Element;
|
|
40
|
+
options: {
|
|
41
|
+
shadedHeader: boolean;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export default _default;
|
|
46
|
+
export { AllDocumentsScreen };
|
|
47
|
+
export { MyFavoriteDocumentsScreen };
|
|
48
|
+
export { DocumentFormScreen };
|
|
49
|
+
export { AttachedFilesScreen };
|
|
@@ -0,0 +1,57 @@
|
|
|
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 AllDocumentsScreen from './AllDocumentsScreen';
|
|
19
|
+
import MyFavoriteDocumentsScreen from './MyFavoriteDocumentsScreen';
|
|
20
|
+
import DocumentFormScreen from './DocumentFormScreen';
|
|
21
|
+
import AttachedFilesScreen from './AttachedFilesScreen';
|
|
22
|
+
export default {
|
|
23
|
+
AllDocumentsScreen: {
|
|
24
|
+
title: 'Dms_AllDocuments',
|
|
25
|
+
component: AllDocumentsScreen,
|
|
26
|
+
actionID: 'dms_all_documents',
|
|
27
|
+
options: {
|
|
28
|
+
shadedHeader: false,
|
|
29
|
+
},
|
|
30
|
+
isUsableOnShortcut: true,
|
|
31
|
+
},
|
|
32
|
+
FavoriteDocuments: {
|
|
33
|
+
title: 'Dms_MyFavoriteDocuments',
|
|
34
|
+
component: MyFavoriteDocumentsScreen,
|
|
35
|
+
options: {
|
|
36
|
+
shadedHeader: false,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
DocumentFormScreen: {
|
|
40
|
+
title: 'Dms_Document',
|
|
41
|
+
component: DocumentFormScreen,
|
|
42
|
+
isUsableOnShortcut: true,
|
|
43
|
+
},
|
|
44
|
+
AttachedFilesScreen: {
|
|
45
|
+
title: 'Dms_AttachedFiles',
|
|
46
|
+
actionID: 'dms_attachedFiles_tree',
|
|
47
|
+
component: AttachedFilesScreen,
|
|
48
|
+
options: {
|
|
49
|
+
shadedHeader: false,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
export { AllDocumentsScreen };
|
|
54
|
+
export { MyFavoriteDocumentsScreen };
|
|
55
|
+
export { DocumentFormScreen };
|
|
56
|
+
export { AttachedFilesScreen };
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/screens/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AACpE,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAExD,eAAe;IACb,kBAAkB,EAAE;QAClB,KAAK,EAAE,kBAAkB;QACzB,SAAS,EAAE,kBAAkB;QAC7B,QAAQ,EAAE,mBAAmB;QAC7B,OAAO,EAAE;YACP,YAAY,EAAE,KAAK;SACpB;QACD,kBAAkB,EAAE,IAAI;KACzB;IACD,iBAAiB,EAAE;QACjB,KAAK,EAAE,yBAAyB;QAChC,SAAS,EAAE,yBAAyB;QACpC,OAAO,EAAE;YACP,YAAY,EAAE,KAAK;SACpB;KACF;IACD,kBAAkB,EAAE;QAClB,KAAK,EAAE,cAAc;QACrB,SAAS,EAAE,kBAAkB;QAC7B,kBAAkB,EAAE,IAAI;KACzB;IACD,mBAAmB,EAAE;QACnB,KAAK,EAAE,mBAAmB;QAC1B,QAAQ,EAAE,wBAAwB;QAClC,SAAS,EAAE,mBAAmB;QAC9B,OAAO,EAAE;YACP,YAAY,EAAE,KAAK;SACpB;KACF;CACF,CAAC;AAEF,OAAO,EAAC,kBAAkB,EAAC,CAAC;AAC5B,OAAO,EAAC,yBAAyB,EAAC,CAAC;AACnC,OAAO,EAAC,kBAAkB,EAAC,CAAC;AAC5B,OAAO,EAAC,mBAAmB,EAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ThemeColors } from '@axelor/aos-mobile-ui';
|
|
2
|
+
declare class File {
|
|
3
|
+
static fileExtensions: string[];
|
|
4
|
+
static getFileExtension: (fileName: string) => string;
|
|
5
|
+
static getFileIcon: (fileName: string) => "file-earmark-pdf-fill" | "file-earmark-image-fill" | "filetype-csv" | "file-earmark-zip-fill" | "file-earmark-word-fill" | "file-earmark-ppt-fill" | "file-earmark-spreadsheet-fill" | "file-earmark-music-fill" | "file-earmark-fill";
|
|
6
|
+
static getFileColor: (fileName: string, Colors: ThemeColors) => import("@axelor/aos-mobile-ui").Color;
|
|
7
|
+
static getFileExtensionList: (Colors: ThemeColors) => {
|
|
8
|
+
title: string;
|
|
9
|
+
color: import("@axelor/aos-mobile-ui").Color;
|
|
10
|
+
key: string;
|
|
11
|
+
}[];
|
|
12
|
+
}
|
|
13
|
+
export default File;
|
|
@@ -0,0 +1,127 @@
|
|
|
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
|
+
class File {
|
|
19
|
+
static fileExtensions = [
|
|
20
|
+
'pdf',
|
|
21
|
+
'jpeg',
|
|
22
|
+
'jpg',
|
|
23
|
+
'svg',
|
|
24
|
+
'png',
|
|
25
|
+
'csv',
|
|
26
|
+
'zip',
|
|
27
|
+
'docx',
|
|
28
|
+
'doc',
|
|
29
|
+
'odt',
|
|
30
|
+
'txt',
|
|
31
|
+
'potx',
|
|
32
|
+
'pptx',
|
|
33
|
+
'ppt',
|
|
34
|
+
'odp',
|
|
35
|
+
'ods',
|
|
36
|
+
'xls',
|
|
37
|
+
'xlsx',
|
|
38
|
+
'xltm',
|
|
39
|
+
'mp4',
|
|
40
|
+
'mp3',
|
|
41
|
+
];
|
|
42
|
+
static getFileExtension = (fileName) => {
|
|
43
|
+
if (fileName == null) {
|
|
44
|
+
return fileName;
|
|
45
|
+
}
|
|
46
|
+
return fileName.split('.').pop();
|
|
47
|
+
};
|
|
48
|
+
static getFileIcon = (fileName) => {
|
|
49
|
+
switch (this.getFileExtension(fileName)) {
|
|
50
|
+
case 'pdf':
|
|
51
|
+
return 'file-earmark-pdf-fill';
|
|
52
|
+
case 'jpeg':
|
|
53
|
+
case 'jpg':
|
|
54
|
+
case 'svg':
|
|
55
|
+
case 'png':
|
|
56
|
+
return 'file-earmark-image-fill';
|
|
57
|
+
case 'csv':
|
|
58
|
+
return 'filetype-csv';
|
|
59
|
+
case 'zip':
|
|
60
|
+
return 'file-earmark-zip-fill';
|
|
61
|
+
case 'docx':
|
|
62
|
+
case 'doc':
|
|
63
|
+
case 'odt':
|
|
64
|
+
case 'txt':
|
|
65
|
+
return 'file-earmark-word-fill';
|
|
66
|
+
case 'potx':
|
|
67
|
+
case 'pptx':
|
|
68
|
+
case 'ppt':
|
|
69
|
+
case 'odp':
|
|
70
|
+
return 'file-earmark-ppt-fill';
|
|
71
|
+
case 'ods':
|
|
72
|
+
case 'xls':
|
|
73
|
+
case 'xlsx':
|
|
74
|
+
case 'xltm':
|
|
75
|
+
return 'file-earmark-spreadsheet-fill';
|
|
76
|
+
case 'mp4':
|
|
77
|
+
case 'mp3':
|
|
78
|
+
return 'file-earmark-music-fill';
|
|
79
|
+
default:
|
|
80
|
+
return 'file-earmark-fill';
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
static getFileColor = (fileName, Colors) => {
|
|
84
|
+
switch (this.getFileExtension(fileName)) {
|
|
85
|
+
case 'pdf':
|
|
86
|
+
return Colors.errorColor;
|
|
87
|
+
case 'jpeg':
|
|
88
|
+
case 'jpg':
|
|
89
|
+
case 'svg':
|
|
90
|
+
case 'png':
|
|
91
|
+
return Colors.plannedColor;
|
|
92
|
+
case 'csv':
|
|
93
|
+
return Colors.successColor;
|
|
94
|
+
case 'zip':
|
|
95
|
+
return Colors.progressColor;
|
|
96
|
+
case 'docx':
|
|
97
|
+
case 'doc':
|
|
98
|
+
case 'odt':
|
|
99
|
+
case 'txt':
|
|
100
|
+
return Colors.infoColor;
|
|
101
|
+
case 'potx':
|
|
102
|
+
case 'pptx':
|
|
103
|
+
case 'ppt':
|
|
104
|
+
case 'odp':
|
|
105
|
+
return Colors.warningColor;
|
|
106
|
+
case 'ods':
|
|
107
|
+
case 'xls':
|
|
108
|
+
case 'xlsx':
|
|
109
|
+
case 'xltm':
|
|
110
|
+
return Colors.successColor;
|
|
111
|
+
case 'mp4':
|
|
112
|
+
case 'mp3':
|
|
113
|
+
return Colors.priorityColor;
|
|
114
|
+
default:
|
|
115
|
+
return Colors.primaryColor;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
static getFileExtensionList = (Colors) => {
|
|
119
|
+
return this.fileExtensions.map(extension => ({
|
|
120
|
+
title: extension.toUpperCase(),
|
|
121
|
+
color: this.getFileColor(extension, Colors),
|
|
122
|
+
key: extension,
|
|
123
|
+
}));
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
export default File;
|
|
127
|
+
//# sourceMappingURL=file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/types/file.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,MAAM,IAAI;IACR,MAAM,CAAC,cAAc,GAAG;QACtB,KAAK;QACL,MAAM;QACN,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,MAAM;QACN,KAAK;QACL,KAAK;QACL,KAAK;QACL,MAAM;QACN,MAAM;QACN,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,MAAM;QACN,MAAM;QACN,KAAK;QACL,KAAK;KACN,CAAC;IAEF,MAAM,CAAC,gBAAgB,GAAG,CAAC,QAAgB,EAAE,EAAE;QAC7C,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,OAAO,QAAQ,CAAC;SACjB;QACD,OAAO,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;IACnC,CAAC,CAAC;IAEF,MAAM,CAAC,WAAW,GAAG,CAAC,QAAgB,EAAE,EAAE;QACxC,QAAQ,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE;YACvC,KAAK,KAAK;gBACR,OAAO,uBAAuB,CAAC;YACjC,KAAK,MAAM,CAAC;YACZ,KAAK,KAAK,CAAC;YACX,KAAK,KAAK,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KAAK;gBACR,OAAO,MAAM,CAAC,YAAY,CAAC;YAC7B,KAAK,KAAK,CAAC;YACX,KAAK,KAAK,CAAC;YACX,KAAK,MAAM,CAAC;YACZ,KAAK,MAAM;gBACT,OAAO,MAAM,CAAC,YAAY,CAAC;YAC7B,KAAK,KAAK,CAAC;YACX,KAAK,KAAK;gBACR,OAAO,MAAM,CAAC,aAAa,CAAC;YAC9B;gBACE,OAAO,MAAM,CAAC,YAAY,CAAC;SAC9B;IACH,CAAC,CAAC;IAEF,MAAM,CAAC,oBAAoB,GAAG,CAAC,MAAmB,EAAE,EAAE;QACpD,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;YAC3C,KAAK,EAAE,SAAS,CAAC,WAAW,EAAE;YAC9B,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC;YAC3C,GAAG,EAAE,SAAS;SACf,CAAC,CAAC,CAAC;IACN,CAAC,CAAC;;AAGJ,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as File } from './file';
|
|
@@ -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 { default as File } from './file';
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,IAAI,IAAI,EAAC,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const getAction: ({ model, modelId, options, canCreateObject, navigation, translator, }: {
|
|
2
|
+
model: string;
|
|
3
|
+
modelId: number;
|
|
4
|
+
options: any;
|
|
5
|
+
canCreateObject?: boolean;
|
|
6
|
+
navigation: any;
|
|
7
|
+
translator: (key: string) => string;
|
|
8
|
+
}) => Promise<{
|
|
9
|
+
key: string;
|
|
10
|
+
order: number;
|
|
11
|
+
iconName: string;
|
|
12
|
+
indicator: any;
|
|
13
|
+
title: string;
|
|
14
|
+
onPress: () => any;
|
|
15
|
+
showInHeader: boolean;
|
|
16
|
+
hideIf: boolean;
|
|
17
|
+
}>;
|
|
@@ -0,0 +1,59 @@
|
|
|
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 { handlerApiCall } from '@axelor/aos-mobile-core';
|
|
19
|
+
import { countAttachedFiles, fetchDirectory } from '../api/document-api';
|
|
20
|
+
export const getAction = async ({ model, modelId, options, canCreateObject = true, navigation, translator, }) => {
|
|
21
|
+
const directory = await handlerApiCall({
|
|
22
|
+
fetchFunction: fetchDirectory,
|
|
23
|
+
data: { model, modelId },
|
|
24
|
+
action: 'Dms_SliceAction_FetchDirectory',
|
|
25
|
+
getState: () => { },
|
|
26
|
+
responseOptions: { isArrayResponse: false },
|
|
27
|
+
errorOptions: {
|
|
28
|
+
errorTracing: false,
|
|
29
|
+
showErrorToast: false,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
const numberAttachedFiles = await handlerApiCall({
|
|
33
|
+
fetchFunction: countAttachedFiles,
|
|
34
|
+
data: { model, modelId },
|
|
35
|
+
action: 'Dms_SliceAction_CountAttachedFiles',
|
|
36
|
+
getState: () => { },
|
|
37
|
+
responseOptions: { returnTotal: true },
|
|
38
|
+
errorOptions: {
|
|
39
|
+
errorTracing: false,
|
|
40
|
+
showErrorToast: false,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
return {
|
|
44
|
+
key: 'dmsAttachedFiles',
|
|
45
|
+
order: 10,
|
|
46
|
+
iconName: 'paperclip',
|
|
47
|
+
indicator: numberAttachedFiles,
|
|
48
|
+
title: translator('Dms_AttachedFiles'),
|
|
49
|
+
onPress: () => navigation.navigate('AttachedFilesScreen', {
|
|
50
|
+
parent: directory,
|
|
51
|
+
model,
|
|
52
|
+
modelId,
|
|
53
|
+
options,
|
|
54
|
+
}),
|
|
55
|
+
showInHeader: true,
|
|
56
|
+
hideIf: !directory && !canCreateObject,
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=attachedFilesGenericAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachedFilesGenericAction.js","sourceRoot":"","sources":["../../src/utils/attachedFilesG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KAAK;YACL,OAAO;YACP,OAAO;SACR,CAAC;QACJ,YAAY,EAAE,IAAI;QAClB,MAAM,EAAE,CAAC,SAAS,IAAI,CAAC,eAAe;KACvC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 * from './attachedFilesGenericAction';
|
|
19
|
+
export * from './moduleHelper';
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Menu, Screen } from '@axelor/aos-mobile-core';
|
|
2
|
+
type DMSFile = {
|
|
3
|
+
id: number;
|
|
4
|
+
fileName: string;
|
|
5
|
+
};
|
|
6
|
+
type Menus = {
|
|
7
|
+
[menuKey: string]: Menu;
|
|
8
|
+
};
|
|
9
|
+
type Screens = {
|
|
10
|
+
[screenKey: string]: Screen;
|
|
11
|
+
};
|
|
12
|
+
export declare const createMenusScreen: ({ favouriteFolderSet, favouriteFileSet, }: {
|
|
13
|
+
favouriteFolderSet: DMSFile[];
|
|
14
|
+
favouriteFileSet: DMSFile[];
|
|
15
|
+
}) => {
|
|
16
|
+
menus: Menus;
|
|
17
|
+
screens: Screens;
|
|
18
|
+
};
|
|
19
|
+
export {};
|