awing-library 2.1.2-dev.50 → 2.1.2-dev.52
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.
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { type DirectoryAddOrEditServices } from 'AWING/DirectoryForm';
|
|
2
2
|
import { type DirectoryPermissionServices } from 'AWING/DirectoryPermission';
|
|
3
|
-
import type {
|
|
3
|
+
import type { CustomPagingRequestInput } from 'Features/types';
|
|
4
4
|
import type { Directory } from './types';
|
|
5
5
|
export type DirectoryServices = DirectoryAddOrEditServices & DirectoryPermissionServices & {
|
|
6
6
|
/** Get Directories
|
|
7
7
|
* @params PagingQueryInput<Directory> - Không truyền param sẽ lấy tất cả
|
|
8
8
|
*/
|
|
9
|
-
getDirectories: (params?:
|
|
9
|
+
getDirectories: (params?: {
|
|
10
|
+
input?: CustomPagingRequestInput;
|
|
10
11
|
parentDirectoryId?: number;
|
|
11
12
|
workspaceId?: number;
|
|
12
13
|
depthFromRoot?: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CustomPagingRequestInput
|
|
1
|
+
import { CustomPagingRequestInput } from 'Features/types';
|
|
2
2
|
import { Schema, SchemaObjectDefinition } from '../Schema';
|
|
3
3
|
import { Workspace } from '../types';
|
|
4
4
|
import { Atom } from 'jotai';
|
|
@@ -170,7 +170,8 @@ export interface SharingProps {
|
|
|
170
170
|
id: number;
|
|
171
171
|
}) => Promise<void>;
|
|
172
172
|
getObjectFilters: () => Promise<ObjectFilter[]>;
|
|
173
|
-
getDirectories: (params?:
|
|
173
|
+
getDirectories: (params?: {
|
|
174
|
+
input?: CustomPagingRequestInput;
|
|
174
175
|
parentDirectoryId?: number;
|
|
175
176
|
workspaceId?: number;
|
|
176
177
|
depthFromRoot?: number;
|
package/dist/esm/index.js
CHANGED
|
@@ -187648,10 +187648,12 @@ function Container$3() {
|
|
|
187648
187648
|
depthFromRoot
|
|
187649
187649
|
};
|
|
187650
187650
|
await (services === null || services === void 0 ? void 0 : services.getDirectories(Object.assign({
|
|
187651
|
-
|
|
187652
|
-
|
|
187653
|
-
|
|
187654
|
-
|
|
187651
|
+
input: {
|
|
187652
|
+
where: Object.assign({}, convertArrayFiltersToCondition([{
|
|
187653
|
+
key: 'isFile',
|
|
187654
|
+
type: FilterOperationType.EQ,
|
|
187655
|
+
value: false
|
|
187656
|
+
}]))
|
|
187655
187657
|
},
|
|
187656
187658
|
workspaceId: currentWorkspace === null || currentWorkspace === void 0 ? void 0 : currentWorkspace.id,
|
|
187657
187659
|
parentDirectoryId: directoryId
|
|
@@ -187668,28 +187670,29 @@ function Container$3() {
|
|
|
187668
187670
|
let searchKey = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : '';
|
|
187669
187671
|
let objectTypeCode = arguments.length > 5 ? arguments[5] : undefined;
|
|
187670
187672
|
setLoadingChildDirectories(true);
|
|
187671
|
-
const queryObjectTypeCode = objectTypeCode ? {
|
|
187672
|
-
objectTypeCode: {
|
|
187673
|
-
eq: objectTypeCode
|
|
187674
|
-
}
|
|
187675
|
-
} : {};
|
|
187676
187673
|
const queryDepthFromRoot = depthFromRoot === -1 ? {} : {
|
|
187677
187674
|
depthFromRoot
|
|
187678
187675
|
};
|
|
187679
|
-
await (services === null || services === void 0 ? void 0 : services.getDirectories(Object.assign(
|
|
187680
|
-
|
|
187681
|
-
|
|
187682
|
-
|
|
187683
|
-
|
|
187684
|
-
|
|
187685
|
-
|
|
187686
|
-
|
|
187687
|
-
|
|
187688
|
-
|
|
187689
|
-
|
|
187690
|
-
|
|
187691
|
-
|
|
187692
|
-
|
|
187676
|
+
await (services === null || services === void 0 ? void 0 : services.getDirectories(Object.assign({
|
|
187677
|
+
input: {
|
|
187678
|
+
where: Object.assign({}, convertArrayFiltersToCondition([{
|
|
187679
|
+
key: 'name',
|
|
187680
|
+
type: FilterOperationType.CONTAINS,
|
|
187681
|
+
value: searchKey
|
|
187682
|
+
}, {
|
|
187683
|
+
key: 'id',
|
|
187684
|
+
type: FilterOperationType.NE,
|
|
187685
|
+
value: newFocusDirectoryId
|
|
187686
|
+
}, {
|
|
187687
|
+
key: 'objectTypeCode',
|
|
187688
|
+
type: FilterOperationType.EQ,
|
|
187689
|
+
value: objectTypeCode
|
|
187690
|
+
}])),
|
|
187691
|
+
skip: newPageIndex * newPageSize,
|
|
187692
|
+
take: newPageSize
|
|
187693
|
+
},
|
|
187694
|
+
parentDirectoryId: newFocusDirectoryId
|
|
187695
|
+
}, queryDepthFromRoot)).then(data => {
|
|
187693
187696
|
setLoadingChildDirectories(false);
|
|
187694
187697
|
setChildDirectories(data.items);
|
|
187695
187698
|
setChildDirectoriesTotal(data.total);
|
|
@@ -189331,12 +189334,15 @@ function Create() {
|
|
|
189331
189334
|
setObjectFilters(objectFilters || []);
|
|
189332
189335
|
});
|
|
189333
189336
|
getDirectories({
|
|
189334
|
-
|
|
189335
|
-
|
|
189336
|
-
|
|
189337
|
-
|
|
189337
|
+
input: {
|
|
189338
|
+
where: Object.assign({}, convertArrayFiltersToCondition([{
|
|
189339
|
+
key: 'isFile',
|
|
189340
|
+
type: FilterOperationType.EQ,
|
|
189341
|
+
value: false
|
|
189342
|
+
}]))
|
|
189338
189343
|
},
|
|
189339
|
-
workspaceId:
|
|
189344
|
+
// workspaceId: 1 do ADMIN nó tách ra khỏi storage
|
|
189345
|
+
workspaceId: 1
|
|
189340
189346
|
}).then(directories => {
|
|
189341
189347
|
const directoriesSorted = sortByDirectoryPath(directories.items || []);
|
|
189342
189348
|
const directoriesOptions = directoriesSorted.map(item => {
|
package/dist/index.d.ts
CHANGED
|
@@ -2856,7 +2856,8 @@ interface SharingProps {
|
|
|
2856
2856
|
id: number;
|
|
2857
2857
|
}) => Promise<void>;
|
|
2858
2858
|
getObjectFilters: () => Promise<ObjectFilter[]>;
|
|
2859
|
-
getDirectories: (params?:
|
|
2859
|
+
getDirectories: (params?: {
|
|
2860
|
+
input?: CustomPagingRequestInput;
|
|
2860
2861
|
parentDirectoryId?: number;
|
|
2861
2862
|
workspaceId?: number;
|
|
2862
2863
|
depthFromRoot?: number;
|
|
@@ -3115,7 +3116,8 @@ type DirectoryServices = DirectoryAddOrEditServices$1 & DirectoryPermissionServi
|
|
|
3115
3116
|
/** Get Directories
|
|
3116
3117
|
* @params PagingQueryInput<Directory> - Không truyền param sẽ lấy tất cả
|
|
3117
3118
|
*/
|
|
3118
|
-
getDirectories: (params?:
|
|
3119
|
+
getDirectories: (params?: {
|
|
3120
|
+
input?: CustomPagingRequestInput;
|
|
3119
3121
|
parentDirectoryId?: number;
|
|
3120
3122
|
workspaceId?: number;
|
|
3121
3123
|
depthFromRoot?: number;
|