@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
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Dms
|
|
3
|
+
tags: Readme
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<h1 align="center">@axelor/aos-mobile-dms</h1>
|
|
7
|
+
|
|
8
|
+
<div align="center">
|
|
9
|
+
<img src="https://i.imgur.com/KJAAFlT.png" width="30%"/>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
## Presentation
|
|
13
|
+
|
|
14
|
+
This package was developed for the [Axelor Open Mobile](https://github.com/axelor/axelor-mobile) application.
|
|
15
|
+
|
|
16
|
+
The purpose of this package is to link with the DMS mangement of the [Axelor Open Suite (AOS)](https://github.com/axelor/axelor-open-suite) ERP. It provides a simplified version of a number of processes available on the webapp. This package is compatible with AOS from version 8.3.0.
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
Install the library :
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
yarn add @axelor/aos-mobile-dms
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Compatibility with React v18.2.x and React Native v0.73.x.
|
|
27
|
+
|
|
28
|
+
To add this package in your application, you need to add it in the _modules_ props of the component `Application` from @axelor/aos-mobile-core package.
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
import React from 'react';
|
|
32
|
+
import {Application} from '@axelor/aos-mobile-core';
|
|
33
|
+
import {DmsModule} from '@axelor/aos-mobile-dms';
|
|
34
|
+
|
|
35
|
+
const App = () => {
|
|
36
|
+
return <Application modules={[DmsModule]} mainMenu="auth_menu_user" />;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default App;
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Developpment
|
|
43
|
+
|
|
44
|
+
This package is developed as part of the Axelor Open Mobile application. To contribute, please go to the [Github project](https://github.com/axelor/axelor-mobile) and follow the guidelines. You will also find an installation guide to help you configure your environment.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export function searchDocument({ searchValue, authorId, extensions, parentDirectoryId, noParent, favoriteFileIds, page, }: {
|
|
2
|
+
searchValue?: any;
|
|
3
|
+
authorId: any;
|
|
4
|
+
extensions: any;
|
|
5
|
+
parentDirectoryId: any;
|
|
6
|
+
noParent?: boolean;
|
|
7
|
+
favoriteFileIds?: any[];
|
|
8
|
+
page?: number;
|
|
9
|
+
}): Promise<any>;
|
|
10
|
+
export function searchDirectory({ searchValue, authorId, page }: {
|
|
11
|
+
searchValue: any;
|
|
12
|
+
authorId: any;
|
|
13
|
+
page?: number;
|
|
14
|
+
}): Promise<any>;
|
|
15
|
+
export function createDocument({ document, model, modelId }: {
|
|
16
|
+
document: any;
|
|
17
|
+
model: any;
|
|
18
|
+
modelId: any;
|
|
19
|
+
}): Promise<void>;
|
|
20
|
+
export function updateDocument({ document }: {
|
|
21
|
+
document: any;
|
|
22
|
+
}): Promise<void>;
|
|
23
|
+
export function fetchDirectory({ model, modelId }: {
|
|
24
|
+
model: any;
|
|
25
|
+
modelId: any;
|
|
26
|
+
}): Promise<any>;
|
|
27
|
+
export function countAttachedFiles({ model, modelId }: {
|
|
28
|
+
model: any;
|
|
29
|
+
modelId: any;
|
|
30
|
+
}): Promise<any>;
|
|
31
|
+
export function addToFavorites({ documentId }: {
|
|
32
|
+
documentId: any;
|
|
33
|
+
}): Promise<void>;
|
|
34
|
+
export function removeFromFavorites({ documentId }: {
|
|
35
|
+
documentId: any;
|
|
36
|
+
}): Promise<void>;
|
|
37
|
+
export function deleteDocument({ documentId }: {
|
|
38
|
+
documentId: any;
|
|
39
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { createStandardSearch, formatRequestBody, getActionApi, getSearchCriterias, } from '@axelor/aos-mobile-core';
|
|
19
|
+
const createDocumentCriteria = ({ searchValue, authorId, extensions, parentDirectoryId, noParent, isDirectory = null, favoriteFileIds, }) => {
|
|
20
|
+
const criteria = [getSearchCriterias('dms_document', searchValue)];
|
|
21
|
+
if (authorId != null) {
|
|
22
|
+
criteria.push({
|
|
23
|
+
fieldName: 'createdBy.id',
|
|
24
|
+
operator: '=',
|
|
25
|
+
value: authorId,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
if (Array.isArray(extensions) && extensions.length > 0) {
|
|
29
|
+
criteria.push({
|
|
30
|
+
operator: 'or',
|
|
31
|
+
criteria: [
|
|
32
|
+
{
|
|
33
|
+
operator: 'and',
|
|
34
|
+
criteria: [
|
|
35
|
+
{
|
|
36
|
+
fieldName: 'isDirectory',
|
|
37
|
+
operator: '=',
|
|
38
|
+
value: false,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
operator: 'or',
|
|
42
|
+
criteria: extensions.map(_extension => ({
|
|
43
|
+
fieldName: 'fileName',
|
|
44
|
+
operator: 'like',
|
|
45
|
+
value: '%.' + _extension,
|
|
46
|
+
})),
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
fieldName: 'isDirectory',
|
|
52
|
+
operator: '=',
|
|
53
|
+
value: true,
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (parentDirectoryId != null) {
|
|
59
|
+
criteria.push({
|
|
60
|
+
fieldName: 'parent.id',
|
|
61
|
+
operator: '=',
|
|
62
|
+
value: parentDirectoryId,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
if (noParent) {
|
|
66
|
+
criteria.push({
|
|
67
|
+
fieldName: 'parent',
|
|
68
|
+
operator: 'isNull',
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
if (isDirectory != null) {
|
|
72
|
+
criteria.push({
|
|
73
|
+
fieldName: 'isDirectory',
|
|
74
|
+
operator: '=',
|
|
75
|
+
value: isDirectory,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
if (Array.isArray(favoriteFileIds) && favoriteFileIds.length > 0) {
|
|
79
|
+
criteria.push({
|
|
80
|
+
fieldName: 'id',
|
|
81
|
+
operator: 'in',
|
|
82
|
+
value: favoriteFileIds,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return criteria;
|
|
86
|
+
};
|
|
87
|
+
const createFetchDirectoryCriteria = ({ model, modelId }) => {
|
|
88
|
+
return [
|
|
89
|
+
{
|
|
90
|
+
fieldName: 'isDirectory',
|
|
91
|
+
operator: '=',
|
|
92
|
+
value: true,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
fieldName: 'relatedId',
|
|
96
|
+
operator: '=',
|
|
97
|
+
value: modelId,
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
fieldName: 'relatedModel',
|
|
101
|
+
operator: '=',
|
|
102
|
+
value: model,
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
fieldName: 'parent.relatedModel',
|
|
106
|
+
operator: '=',
|
|
107
|
+
value: model,
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
operator: 'or',
|
|
111
|
+
criteria: [
|
|
112
|
+
{
|
|
113
|
+
fieldName: 'parent.relatedId',
|
|
114
|
+
operator: 'isNull',
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
fieldName: 'parent.relatedId',
|
|
118
|
+
operator: '=',
|
|
119
|
+
value: 0,
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
];
|
|
124
|
+
};
|
|
125
|
+
const createCountAttachedFilesCriteria = ({ model, modelId }) => {
|
|
126
|
+
return [
|
|
127
|
+
{
|
|
128
|
+
fieldName: 'relatedModel',
|
|
129
|
+
operator: '=',
|
|
130
|
+
value: model,
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
fieldName: 'relatedId',
|
|
134
|
+
operator: '=',
|
|
135
|
+
value: modelId,
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
fieldName: 'isDirectory',
|
|
139
|
+
operator: '!=',
|
|
140
|
+
value: true,
|
|
141
|
+
},
|
|
142
|
+
];
|
|
143
|
+
};
|
|
144
|
+
export async function searchDocument({ searchValue = null, authorId, extensions, parentDirectoryId, noParent = false, favoriteFileIds = [], page = 0, }) {
|
|
145
|
+
return createStandardSearch({
|
|
146
|
+
model: 'com.axelor.dms.db.DMSFile',
|
|
147
|
+
criteria: createDocumentCriteria({
|
|
148
|
+
searchValue,
|
|
149
|
+
authorId,
|
|
150
|
+
extensions,
|
|
151
|
+
parentDirectoryId,
|
|
152
|
+
noParent,
|
|
153
|
+
favoriteFileIds,
|
|
154
|
+
}),
|
|
155
|
+
fieldKey: 'dms_document',
|
|
156
|
+
sortKey: 'dms_document',
|
|
157
|
+
page,
|
|
158
|
+
provider: 'model',
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
export async function searchDirectory({ searchValue, authorId, page = 0 }) {
|
|
162
|
+
return createStandardSearch({
|
|
163
|
+
model: 'com.axelor.dms.db.DMSFile',
|
|
164
|
+
criteria: createDocumentCriteria({
|
|
165
|
+
searchValue,
|
|
166
|
+
authorId,
|
|
167
|
+
isDirectory: true,
|
|
168
|
+
}),
|
|
169
|
+
fieldKey: 'dms_document',
|
|
170
|
+
sortKey: 'dms_document',
|
|
171
|
+
page,
|
|
172
|
+
provider: 'model',
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
export async function createDocument({ document, model, modelId }) {
|
|
176
|
+
const body = { relatedModel: model, relatedId: modelId, ...document };
|
|
177
|
+
const { matchers } = formatRequestBody(body, 'data');
|
|
178
|
+
return getActionApi().send({
|
|
179
|
+
url: '/ws/rest/com.axelor.dms.db.DMSFile',
|
|
180
|
+
method: 'put',
|
|
181
|
+
body: {
|
|
182
|
+
data: body,
|
|
183
|
+
},
|
|
184
|
+
description: 'create document',
|
|
185
|
+
matchers: {
|
|
186
|
+
modelName: 'com.axelor.dms.db.DMSFile',
|
|
187
|
+
id: Date.now(),
|
|
188
|
+
fields: matchers,
|
|
189
|
+
},
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
export async function updateDocument({ document }) {
|
|
193
|
+
const { matchers } = formatRequestBody(document, 'data');
|
|
194
|
+
return getActionApi().send({
|
|
195
|
+
url: '/ws/rest/com.axelor.dms.db.DMSFile',
|
|
196
|
+
method: 'post',
|
|
197
|
+
body: {
|
|
198
|
+
data: document,
|
|
199
|
+
},
|
|
200
|
+
description: 'update document',
|
|
201
|
+
matchers: {
|
|
202
|
+
modelName: 'com.axelor.dms.db.DMSFile',
|
|
203
|
+
id: document.id,
|
|
204
|
+
fields: matchers,
|
|
205
|
+
},
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
export async function fetchDirectory({ model, modelId }) {
|
|
209
|
+
return createStandardSearch({
|
|
210
|
+
model: 'com.axelor.dms.db.DMSFile',
|
|
211
|
+
criteria: createFetchDirectoryCriteria({ model, modelId }),
|
|
212
|
+
fieldKey: 'dms_document',
|
|
213
|
+
sortKey: 'dms_document',
|
|
214
|
+
page: 0,
|
|
215
|
+
numberElementsByPage: 1,
|
|
216
|
+
provider: 'model',
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
export async function countAttachedFiles({ model, modelId }) {
|
|
220
|
+
return createStandardSearch({
|
|
221
|
+
model: 'com.axelor.dms.db.DMSFile',
|
|
222
|
+
criteria: createCountAttachedFilesCriteria({ model, modelId }),
|
|
223
|
+
fieldKey: 'dms_document',
|
|
224
|
+
page: 0,
|
|
225
|
+
numberElementsByPage: null,
|
|
226
|
+
provider: 'model',
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
export async function addToFavorites({ documentId }) {
|
|
230
|
+
return getActionApi().send({
|
|
231
|
+
url: `ws/aos/dms/favorites/${documentId}`,
|
|
232
|
+
method: 'post',
|
|
233
|
+
description: 'add to favorites',
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
export async function removeFromFavorites({ documentId }) {
|
|
237
|
+
return getActionApi().send({
|
|
238
|
+
url: `ws/aos/dms/favorites/${documentId}`,
|
|
239
|
+
method: 'delete',
|
|
240
|
+
description: 'remove from favorites',
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
export async function deleteDocument({ documentId }) {
|
|
244
|
+
return getActionApi().send({
|
|
245
|
+
url: `ws/rest/com.axelor.dms.db.DMSFile/${documentId}`,
|
|
246
|
+
method: 'delete',
|
|
247
|
+
description: 'delete document',
|
|
248
|
+
matchers: {
|
|
249
|
+
modelName: 'com.axelor.dms.db.DMSFile',
|
|
250
|
+
id: documentId,
|
|
251
|
+
},
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
//# sourceMappingURL=document-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-api.js","sourceRoot":"","sources":["../../src/api/document-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,sBAAsB,GAAG,CAAC,EAC9B,WAAW,EACX,QAAQ,EACR,UAAU,EACV,iBAAiB,EACjB,QAAQ,EACR,WAAW,GAAG,IAAI,EAClB,eAAe,GAChB,EAAE,EAAE;IACH,MAAM,QAAQ,GAAG,CAAC,kBAAkB,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC;IAEnE,IAAI,QAAQ,IAAI,IAAI,EAAE;QACpB,QAAQ,CAAC,IAAI,CAAC;YACZ,SAAS,EAAE,cAAc;YACzB,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,QAAQ;SAChB,CAAC,CAAC;KACJ;IAED,IAAI,KAAK,CAAC,OAAO,CA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,EAAC,UAAU,EAAC;IAC/C,OAAO,YAAY,EAAE,CAAC,IAAI,CAAC;QACzB,GAAG,EAAE,wBAAwB,UAAU,EAAE;QACzC,MAAM,EAAE,MAAM;QACd,WAAW,EAAE,kBAAkB;KAChC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,EAAC,UAAU,EAAC;IACpD,OAAO,YAAY,EAAE,CAAC,IAAI,CAAC;QACzB,GAAG,EAAE,wBAAwB,UAAU,EAAE;QACzC,MAAM,EAAE,QAAQ;QAChB,WAAW,EAAE,uBAAuB;KACrC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,EAAC,UAAU,EAAC;IAC/C,OAAO,YAAY,EAAE,CAAC,IAAI,CAAC;QACzB,GAAG,EAAE,qCAAqC,UAAU,EAAE;QACtD,MAAM,EAAE,QAAQ;QAChB,WAAW,EAAE,iBAAiB;QAC9B,QAAQ,EAAE;YACR,SAAS,EAAE,2BAA2B;YACtC,EAAE,EAAE,UAAU;SACf;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { addToFavorites as addToFavoritesApi, countAttachedFiles as countAttachedDocumentsApi, createDocument as createDocumentApi, deleteDocument as deleteDocumentApi, fetchDirectory as fetchDirectoryApi, removeFromFavorites as removeFromFavoritesApi, searchDirectory as searchDirectoryApi, searchDocument as searchDocumentApi, updateDocument as updateDocumentApi, } from './document-api';
|
package/lib/api/index.js
ADDED
|
@@ -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 { addToFavorites as addToFavoritesApi, countAttachedFiles as countAttachedDocumentsApi, createDocument as createDocumentApi, deleteDocument as deleteDocumentApi, fetchDirectory as fetchDirectoryApi, removeFromFavorites as removeFromFavoritesApi, searchDirectory as searchDirectoryApi, searchDocument as searchDocumentApi, updateDocument as updateDocumentApi, } from './document-api';
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,cAAc,IAAI,iBAAiB,EACnC,kBAAkB,IAAI,yBAAyB,EAC/C,cAAc,IAAI,iBAAiB,EACnC,cAAc,IAAI,iBAAiB,EACnC,cAAc,IAAI,iBAAiB,EACnC,mBAAmB,IAAI,sBAAsB,EAC7C,eAAe,IAAI,kBAAkB,EACrC,cAAc,IAAI,iBAAiB,EACnC,cAAc,IAAI,iBAAiB,GACpC,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
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 from 'react';
|
|
19
|
+
import { StyleSheet, View } from 'react-native';
|
|
20
|
+
import { UserSearchBar, useSelector } from '@axelor/aos-mobile-core';
|
|
21
|
+
import { ToggleButton } from '@axelor/aos-mobile-ui';
|
|
22
|
+
const AuthorFilter = ({ author, setAuthor }) => {
|
|
23
|
+
const { user } = useSelector(state => state.user);
|
|
24
|
+
return (<View style={styles.container}>
|
|
25
|
+
<ToggleButton isActive={author?.id === user?.id} onPress={() => setAuthor(current => (current?.id === user?.id ? null : user))} buttonConfig={{
|
|
26
|
+
iconName: 'person-fill',
|
|
27
|
+
style: styles.toggleButton,
|
|
28
|
+
}}/>
|
|
29
|
+
<UserSearchBar style={styles.userSearchBar} defaultValue={author} onChange={setAuthor} showTitle={false}/>
|
|
30
|
+
</View>);
|
|
31
|
+
};
|
|
32
|
+
const styles = StyleSheet.create({
|
|
33
|
+
container: {
|
|
34
|
+
zIndex: 1,
|
|
35
|
+
flexDirection: 'row',
|
|
36
|
+
justifyContent: 'space-between',
|
|
37
|
+
alignSelf: 'center',
|
|
38
|
+
alignItems: 'center',
|
|
39
|
+
width: '90%',
|
|
40
|
+
},
|
|
41
|
+
toggleButton: {
|
|
42
|
+
width: '10%',
|
|
43
|
+
height: 40,
|
|
44
|
+
marginVertical: 0,
|
|
45
|
+
},
|
|
46
|
+
userSearchBar: {
|
|
47
|
+
width: '88%',
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
export default AuthorFilter;
|
|
51
|
+
//# sourceMappingURL=AuthorFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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AM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,MAAM,EAAE,CAAC;QACT,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,eAAe;QAC/B,SAAS,EAAE,QAAQ;QACnB,UAAU,EAAE,QAAQ;QACpB,KAAK,EAAE,KAAK;KACb;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,KAAK;QACZ,MAAM,EAAE,EAAE;QACV,cAAc,EAAE,CAAC;KAClB;IACD,aAAa,EAAE;QACb,KAAK,EAAE,KAAK;KACb;CACF,CAAC,CAAC;AAEH,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
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 from 'react';
|
|
19
|
+
import { StyleSheet, View } from 'react-native';
|
|
20
|
+
import { useNavigation, usePermitted, useSelector, } from '@axelor/aos-mobile-core';
|
|
21
|
+
import { Icon, LabelText, Text } from '@axelor/aos-mobile-ui';
|
|
22
|
+
const DirectoryCard = ({ directory }) => {
|
|
23
|
+
const navigation = useNavigation();
|
|
24
|
+
const { canCreate } = usePermitted({
|
|
25
|
+
modelName: 'com.axelor.dms.db.DMSFile',
|
|
26
|
+
});
|
|
27
|
+
const { mobileSettings } = useSelector((state) => state.appConfig);
|
|
28
|
+
return (<View style={styles.container}>
|
|
29
|
+
<View style={styles.contentContainer}>
|
|
30
|
+
<Text style={styles.title} writingType="important" numberOfLines={2}>
|
|
31
|
+
{directory.fileName}
|
|
32
|
+
</Text>
|
|
33
|
+
<LabelText title={directory.createdBy?.fullName} iconName="person-fill"/>
|
|
34
|
+
</View>
|
|
35
|
+
{canCreate &&
|
|
36
|
+
(mobileSettings?.isFolderCreationAllowed ||
|
|
37
|
+
mobileSettings?.isFileCreationAllowed) && (<Icon style={styles.icon} name="plus" size={32} touchable onPress={() => navigation.navigate('DocumentFormScreen', { parent: directory })}/>)}
|
|
38
|
+
</View>);
|
|
39
|
+
};
|
|
40
|
+
const styles = StyleSheet.create({
|
|
41
|
+
container: {
|
|
42
|
+
flexDirection: 'row',
|
|
43
|
+
},
|
|
44
|
+
contentContainer: {
|
|
45
|
+
flex: 1,
|
|
46
|
+
},
|
|
47
|
+
title: {
|
|
48
|
+
marginBottom: 4,
|
|
49
|
+
},
|
|
50
|
+
icon: {
|
|
51
|
+
marginRight: 4,
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
export default DirectoryCard;
|
|
55
|
+
//# sourceMappingURL=DirectoryCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DirectoryCard.js","sourceRoot":"","sources":["../../../../src/components/atoms/DirectoryCard/DirectoryCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EACL,aAAa,EACb,YAAY,EACZ,WAAW,GACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAM5D,MAAM,aAAa,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CAAC;IAC/B,SAAS,EAAE;QACT,aAAa,EAAE,KAAK;KACrB;IACD,gBAAgB,EAAE;QAChB,IAAI,EAAE,CAAC;KACR;IACD,KAAK,EAAE;QACL,YAAY,EAAE,CAAC;KAChB;IACD,IAAI,EAAE;QACJ,WAAW,EAAE,CAAC;KACf;CACF,CAAC,CAAC;AAEH,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import React, { useMemo } from 'react';
|
|
19
|
+
import { StyleSheet } from 'react-native';
|
|
20
|
+
import { formatDateTime, openFileInExternalApp, useSelector, useTranslator, } from '@axelor/aos-mobile-core';
|
|
21
|
+
import { LabelText, ObjectCard, useThemeColor } from '@axelor/aos-mobile-ui';
|
|
22
|
+
import { File } from '../../../types';
|
|
23
|
+
const DocumentCard = ({ style, document }) => {
|
|
24
|
+
const I18n = useTranslator();
|
|
25
|
+
const Colors = useThemeColor();
|
|
26
|
+
const { baseUrl, token, jsessionId } = useSelector((state) => state.auth);
|
|
27
|
+
const fileColor = useMemo(() => File.getFileColor(document.fileName, Colors).background, [Colors, document.fileName]);
|
|
28
|
+
const styles = useMemo(() => getStyles(fileColor), [fileColor]);
|
|
29
|
+
const addedOn = useMemo(() => `${I18n.t('Base_AddedOn')} ${formatDateTime(document.createdOn, I18n.t('Base_DateTimeFormat'))}`, [I18n, document.createdOn]);
|
|
30
|
+
const handleOpenFile = async () => {
|
|
31
|
+
await openFileInExternalApp({
|
|
32
|
+
fileName: document.metaFile?.fileName,
|
|
33
|
+
id: document.metaFile?.id,
|
|
34
|
+
isMetaFile: true,
|
|
35
|
+
}, { baseUrl: baseUrl, token: token, jsessionId: jsessionId }, I18n);
|
|
36
|
+
};
|
|
37
|
+
return (<ObjectCard style={[styles.card, style]} showArrow={false} onPress={handleOpenFile} upperTexts={{
|
|
38
|
+
items: [
|
|
39
|
+
{
|
|
40
|
+
customComponent: (<LabelText iconName={File.getFileIcon(document.fileName)} color={fileColor} value={document.fileName} size={16} textSize={16} onlyOneLine/>),
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
iconName: 'person-fill',
|
|
44
|
+
indicatorText: document.createdBy?.fullName,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
iconName: 'calendar-event',
|
|
48
|
+
indicatorText: addedOn,
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
}}/>);
|
|
52
|
+
};
|
|
53
|
+
const getStyles = (borderColor) => StyleSheet.create({
|
|
54
|
+
card: {
|
|
55
|
+
marginVertical: 2,
|
|
56
|
+
marginHorizontal: 0,
|
|
57
|
+
marginRight: 2,
|
|
58
|
+
borderLeftWidth: 7,
|
|
59
|
+
borderLeftColor: borderColor,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
export default DocumentCard;
|
|
63
|
+
//# sourceMappingURL=DocumentCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentCard.js","sourceRoot":"","sources":["../../../../src/components/atoms/DocumentCard/DocumentCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,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AAY,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface SwitchDocumentTypeProps {
|
|
3
|
+
defaultValue: boolean;
|
|
4
|
+
onChange: (value: boolean) => void;
|
|
5
|
+
}
|
|
6
|
+
declare const SwitchDocumentType: ({ defaultValue, onChange, }: SwitchDocumentTypeProps) => React.JSX.Element;
|
|
7
|
+
export default SwitchDocumentType;
|
|
@@ -0,0 +1,44 @@
|
|
|
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 from 'react';
|
|
19
|
+
import { StyleSheet } from 'react-native';
|
|
20
|
+
import { useTranslator } from '@axelor/aos-mobile-core';
|
|
21
|
+
import { RadioSelect } from '@axelor/aos-mobile-ui';
|
|
22
|
+
const DOCUMENT_TYPE = {
|
|
23
|
+
file: 'file',
|
|
24
|
+
folder: 'folder',
|
|
25
|
+
};
|
|
26
|
+
const SwitchDocumentTypeAux = ({ defaultValue, onChange, }) => {
|
|
27
|
+
const I18n = useTranslator();
|
|
28
|
+
return (<RadioSelect style={styles.radioSelect} defaultValue={defaultValue ? DOCUMENT_TYPE.folder : DOCUMENT_TYPE.file} items={[
|
|
29
|
+
{ id: DOCUMENT_TYPE.file, title: I18n.t('Dms_File') },
|
|
30
|
+
{ id: DOCUMENT_TYPE.folder, title: I18n.t('Dms_Folder') },
|
|
31
|
+
]} onChange={type => onChange(type === DOCUMENT_TYPE.folder)}/>);
|
|
32
|
+
};
|
|
33
|
+
const SwitchDocumentType = ({ defaultValue, onChange, }) => {
|
|
34
|
+
return (<SwitchDocumentTypeAux defaultValue={defaultValue} onChange={onChange}/>);
|
|
35
|
+
};
|
|
36
|
+
const styles = StyleSheet.create({
|
|
37
|
+
radioSelect: {
|
|
38
|
+
alignSelf: 'center',
|
|
39
|
+
width: '90%',
|
|
40
|
+
marginTop: 10,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
export default SwitchDocumentType;
|
|
44
|
+
//# sourceMappingURL=SwitchDocumentType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwitchDocumentType.js","sourceRoot":"","sources":["../../../../src/components/atoms/SwitchDocumentType/SwitchDocumentType.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAElD,MAAM,aAAa,GAAG;IACpB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;CACjB,CAAC;AAOF,MAAM,qBAAqB,GAAG,CAAC,EAC7B,YAAY,EACZ,QAAQ,GACgB,EAAE,EAAE;IAC5B,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAE7B,OAAO,CACL,CAAC,WAAW,CACV,KAAK,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAC1B,YAAY,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CACvE,KAAK,CAAC,CAAC;YACL,EAAC,EAAE,EAAE,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,EAAC;YACnD,EAAC,EAAE,EAAE,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,EAAC;SACxD,CAAC,CACF,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,KAAK,aAAa,CAAC,MAAM,CAAC,CAAC,EAC1D,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,EAC1B,YAAY,EACZ,QAAQ,GACgB,EAAE,EAAE;IAC5B,OAAO,CACL,CAAC,qBAAqB,CAAC,YAAY,CAAC,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAAG,CAC1E,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,WAAW,EAAE;QACX,SAAS,EAAE,QAAQ;QACnB,KAAK,EAAE,KAAK;QACZ,SAAS,EAAE,EAAE;KACd;CACF,CAAC,CAAC;AAEH,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as AuthorFilter } from './AuthorFilter/AuthorFilter';
|
|
2
|
+
export { default as DirectoryCard } from './DirectoryCard/DirectoryCard';
|
|
3
|
+
export { default as DocumentCard } from './DocumentCard/DocumentCard';
|
|
4
|
+
export { default as SwitchDocumentType } from './SwitchDocumentType/SwitchDocumentType';
|