@webiny/app-aco 6.4.5 → 6.6.0-alpha.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/components/Actions/DeleteFolder/DeleteFolder.js +1 -1
- package/components/Actions/DeleteFolder/DeleteFolder.js.map +1 -1
- package/components/AdvancedSearch/domain/Filter.d.ts +1 -1
- package/components/AdvancedSearch/domain/FilterRepositoryFactory.d.ts +2 -2
- package/components/AdvancedSearch/domain/FilterRepositoryFactory.js.map +1 -1
- package/components/AdvancedSearch/gateways/FiltersGraphQLGateway.d.ts +2 -2
- package/components/AdvancedSearch/gateways/FiltersGraphQLGateway.js +9 -10
- package/components/AdvancedSearch/gateways/FiltersGraphQLGateway.js.map +1 -1
- package/components/AdvancedSearch/gateways/filters.gql.d.ts +5 -5
- package/components/AdvancedSearch/gateways/filters.gql.js +5 -6
- package/components/AdvancedSearch/gateways/filters.gql.js.map +1 -1
- package/components/AdvancedSearch/useFilterRepository.js +7 -2
- package/components/AdvancedSearch/useFilterRepository.js.map +1 -1
- package/components/Table/cells/CellAuthor.d.ts +2 -0
- package/components/Table/cells/CellAuthor.js +10 -0
- package/components/Table/cells/CellAuthor.js.map +1 -0
- package/components/Table/cells/CellCreated.d.ts +2 -0
- package/components/Table/cells/CellCreated.js +13 -0
- package/components/Table/cells/CellCreated.js.map +1 -0
- package/components/Table/cells/CellModified.d.ts +2 -0
- package/components/Table/cells/CellModified.js +13 -0
- package/components/Table/cells/CellModified.js.map +1 -0
- package/components/Table/cells/index.d.ts +3 -0
- package/components/Table/cells/index.js +3 -0
- package/components/Table/createTableData.d.ts +7 -5
- package/components/Table/createTableData.js +22 -7
- package/components/Table/createTableData.js.map +1 -1
- package/components/Table/index.d.ts +2 -2
- package/components/Table/index.js +2 -2
- package/components/index.d.ts +0 -1
- package/components/index.js +0 -1
- package/config/AcoConfig.d.ts +8 -12
- package/config/advanced-search/FieldRenderer.d.ts +3 -1
- package/config/folder/Action.d.ts +1 -1
- package/config/folder/index.d.ts +3 -2
- package/config/index.d.ts +0 -1
- package/config/index.js +0 -1
- package/config/record/Action.d.ts +1 -1
- package/config/record/index.d.ts +1 -1
- package/config/table/Column.d.ts +8 -39
- package/config/table/Column.js +4 -67
- package/config/table/Column.js.map +1 -1
- package/config/table/Sorting.d.ts +2 -11
- package/config/table/Sorting.js +1 -28
- package/config/table/index.d.ts +5 -9
- package/contexts/index.d.ts +0 -3
- package/contexts/index.js +0 -3
- package/dialogs/DialogSetPermissions/graphql.d.ts +1 -1
- package/dialogs/DialogSetPermissions/graphql.js +1 -2
- package/dialogs/DialogSetPermissions/graphql.js.map +1 -1
- package/dialogs/useCreateDialog.js +2 -2
- package/dialogs/useCreateDialog.js.map +1 -1
- package/dialogs/useEditDialog.js +2 -2
- package/dialogs/useEditDialog.js.map +1 -1
- package/dialogs/useSetPermissionsDialog.js +16 -4
- package/dialogs/useSetPermissionsDialog.js.map +1 -1
- package/domain/folder/Folder.d.ts +2 -1
- package/domain/folder/Folder.js.map +1 -1
- package/features/folders/createFolder/CreateFolderGqlGateway.d.ts +3 -3
- package/features/folders/createFolder/CreateFolderGqlGateway.js +15 -16
- package/features/folders/createFolder/CreateFolderGqlGateway.js.map +1 -1
- package/features/folders/deleteFolder/DeleteFolderGqlGateway.d.ts +3 -3
- package/features/folders/deleteFolder/DeleteFolderGqlGateway.js +5 -6
- package/features/folders/deleteFolder/DeleteFolderGqlGateway.js.map +1 -1
- package/features/folders/folderModelProvider/FolderModelProvider.js +29 -31
- package/features/folders/folderModelProvider/FolderModelProvider.js.map +1 -1
- package/features/folders/folderModelProvider/GetFolderModelGqlGateway.d.ts +3 -3
- package/features/folders/folderModelProvider/GetFolderModelGqlGateway.js +5 -7
- package/features/folders/folderModelProvider/GetFolderModelGqlGateway.js.map +1 -1
- package/features/folders/getFolder/GetFolderGqlGateway.d.ts +3 -3
- package/features/folders/getFolder/GetFolderGqlGateway.js +5 -7
- package/features/folders/getFolder/GetFolderGqlGateway.js.map +1 -1
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsUseCase.d.ts +3 -3
- package/features/folders/getFolderExtensionsFields/useFolderExtensionsFields.d.ts +3 -3
- package/features/folders/listFolders/ListFoldersGqlGateway.d.ts +1 -1
- package/features/folders/listFolders/ListFoldersGqlGateway.js +1 -2
- package/features/folders/listFolders/ListFoldersGqlGateway.js.map +1 -1
- package/features/folders/listFolders/useListFolders.d.ts +1 -1
- package/features/folders/listFoldersByParentIds/ListFoldersByParentIdsGqlGateway.d.ts +3 -3
- package/features/folders/listFoldersByParentIds/ListFoldersByParentIdsGqlGateway.js +5 -7
- package/features/folders/listFoldersByParentIds/ListFoldersByParentIdsGqlGateway.js.map +1 -1
- package/features/folders/listFoldersByParentIds/useListFoldersByParentIds.d.ts +2 -2
- package/features/folders/loadFolderHierarchy/useLoadFolderHierarchy.d.ts +2 -2
- package/features/folders/updateFolder/UpdateFolderGqlGateway.d.ts +3 -3
- package/features/folders/updateFolder/UpdateFolderGqlGateway.js +5 -6
- package/features/folders/updateFolder/UpdateFolderGqlGateway.js.map +1 -1
- package/hooks/index.d.ts +0 -6
- package/hooks/index.js +0 -6
- package/index.d.ts +3 -2
- package/index.js +2 -2
- package/package.json +16 -23
- package/presentation/folderTree/FolderTreePresenter.js +8 -8
- package/presentation/folderTree/FolderTreePresenter.js.map +1 -1
- package/presentation/folderTree/FolderTreePresenter.test.js +4 -2
- package/presentation/folderTree/FolderTreePresenter.test.js.map +1 -1
- package/table.types.d.ts +2 -9
- package/types.d.ts +5 -26
- package/types.js.map +1 -1
- package/components/Extensions/Extensions.d.ts +0 -2
- package/components/Extensions/Extensions.js +0 -30
- package/components/Extensions/Extensions.js.map +0 -1
- package/components/Extensions/index.d.ts +0 -1
- package/components/Extensions/index.js +0 -1
- package/config/folder/createFolderFieldDecoratorFactory.d.ts +0 -13
- package/config/folder/createFolderFieldDecoratorFactory.js +0 -17
- package/config/folder/createFolderFieldDecoratorFactory.js.map +0 -1
- package/config/table/Sorting.js.map +0 -1
- package/contexts/acoList.d.ts +0 -49
- package/contexts/acoList.js +0 -303
- package/contexts/acoList.js.map +0 -1
- package/contexts/app.d.ts +0 -33
- package/contexts/app.js +0 -47
- package/contexts/app.js.map +0 -1
- package/contexts/folders.d.ts +0 -12
- package/contexts/folders.js +0 -32
- package/contexts/folders.js.map +0 -1
- package/contexts/navigateFolder.d.ts +0 -17
- package/contexts/navigateFolder.js +0 -54
- package/contexts/navigateFolder.js.map +0 -1
- package/contexts/records.d.ts +0 -31
- package/contexts/records.js +0 -316
- package/contexts/records.js.map +0 -1
- package/exports/admin/aco.d.ts +0 -2
- package/exports/admin/aco.js +0 -2
- package/graphql/app.gql.d.ts +0 -17
- package/graphql/app.gql.js +0 -22
- package/graphql/app.gql.js.map +0 -1
- package/graphql/records/common.d.ts +0 -4
- package/graphql/records/common.js +0 -57
- package/graphql/records/common.js.map +0 -1
- package/graphql/records/getRecord.d.ts +0 -2
- package/graphql/records/getRecord.js +0 -5
- package/graphql/records/getRecord.js.map +0 -1
- package/graphql/records/listRecords.d.ts +0 -2
- package/graphql/records/listRecords.js +0 -26
- package/graphql/records/listRecords.js.map +0 -1
- package/graphql/records/moveRecord.d.ts +0 -2
- package/graphql/records/moveRecord.js +0 -16
- package/graphql/records/moveRecord.js.map +0 -1
- package/graphql/records/types.d.ts +0 -108
- package/graphql/records/types.js +0 -0
- package/graphql/records.gql.d.ts +0 -3
- package/graphql/records.gql.js +0 -3
- package/handlers.d.ts +0 -23
- package/handlers.js +0 -22
- package/handlers.js.map +0 -1
- package/hooks/useAcoApp.d.ts +0 -2
- package/hooks/useAcoApp.js +0 -16
- package/hooks/useAcoApp.js.map +0 -1
- package/hooks/useAcoList.d.ts +0 -3
- package/hooks/useAcoList.js +0 -10
- package/hooks/useAcoList.js.map +0 -1
- package/hooks/useFolderModel.d.ts +0 -2
- package/hooks/useFolderModel.js +0 -16
- package/hooks/useFolderModel.js.map +0 -1
- package/hooks/useFoldersType.d.ts +0 -1
- package/hooks/useFoldersType.js +0 -12
- package/hooks/useFoldersType.js.map +0 -1
- package/hooks/useNavigateFolder.d.ts +0 -2
- package/hooks/useNavigateFolder.js +0 -10
- package/hooks/useNavigateFolder.js.map +0 -1
- package/hooks/useRecords.d.ts +0 -62
- package/hooks/useRecords.js +0 -64
- package/hooks/useRecords.js.map +0 -1
- package/hooks/useTags.d.ts +0 -14
- package/hooks/useTags.js +0 -27
- package/hooks/useTags.js.map +0 -1
- package/sorting.d.ts +0 -9
- package/sorting.js +0 -31
- package/sorting.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/Actions/DeleteFolder/DeleteFolder.js","sources":["../../../../src/components/Actions/DeleteFolder/DeleteFolder.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete.svg\";\n\nimport { AcoConfig } from \"~/config/index.js\";\nimport { useDeleteDialog } from \"~/dialogs/index.js\";\nimport { useFolder } from \"~/hooks/index.js\";\n\nexport const DeleteFolder = () => {\n const { folder } = useFolder();\n const { showDialog } = useDeleteDialog();\n const { OptionsMenuItem } = AcoConfig.Folder.Action;\n\n const onAction = useCallback(() => {\n showDialog({\n folder\n });\n }, [folder]);\n\n if (!folder) {\n return null;\n }\n\n return (\n <OptionsMenuItem\n icon={<DeleteIcon />}\n label={\"Delete\"}\n onAction={onAction}\n data-testid={\"aco.actions.folder.delete\"}\n
|
|
1
|
+
{"version":3,"file":"components/Actions/DeleteFolder/DeleteFolder.js","sources":["../../../../src/components/Actions/DeleteFolder/DeleteFolder.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete.svg\";\n\nimport { AcoConfig } from \"~/config/index.js\";\nimport { useDeleteDialog } from \"~/dialogs/index.js\";\nimport { useFolder } from \"~/hooks/index.js\";\n\nexport const DeleteFolder = () => {\n const { folder } = useFolder();\n const { showDialog } = useDeleteDialog();\n const { OptionsMenuItem } = AcoConfig.Folder.Action;\n\n const onAction = useCallback(() => {\n showDialog({\n folder\n });\n }, [folder]);\n\n if (!folder) {\n return null;\n }\n\n return (\n <OptionsMenuItem\n icon={<DeleteIcon />}\n label={\"Delete\"}\n onAction={onAction}\n data-testid={\"aco.actions.folder.delete\"}\n variant={\"destructive\"}\n />\n );\n};\n"],"names":["DeleteFolder","folder","useFolder","showDialog","useDeleteDialog","OptionsMenuItem","AcoConfig","onAction","useCallback","DeleteIcon"],"mappings":";;;;;AAOO,MAAMA,eAAe;IACxB,MAAM,EAAEC,MAAM,EAAE,GAAGC;IACnB,MAAM,EAAEC,UAAU,EAAE,GAAGC;IACvB,MAAM,EAAEC,eAAe,EAAE,GAAGC,UAAU,MAAM,CAAC,MAAM;IAEnD,MAAMC,WAAWC,YAAY;QACzBL,WAAW;YACPF;QACJ;IACJ,GAAG;QAACA;KAAO;IAEX,IAAI,CAACA,QACD,OAAO;IAGX,OAAO,WAAP,GACI,oBAACI,iBAAAA;QACG,oBAAM,oBAACI,gBAAUA;QACjB,OAAO;QACP,UAAUF;QACV,eAAa;QACb,SAAS;;AAGrB"}
|
|
@@ -49,6 +49,7 @@ export declare class Filter {
|
|
|
49
49
|
static createEmpty(): Filter;
|
|
50
50
|
static create(data: FilterDTO): Filter;
|
|
51
51
|
static validate(data: FilterDTO): zod.ZodSafeParseResult<{
|
|
52
|
+
id?: string | null | undefined;
|
|
52
53
|
name: string;
|
|
53
54
|
description: string;
|
|
54
55
|
operation: Operation;
|
|
@@ -60,7 +61,6 @@ export declare class Filter {
|
|
|
60
61
|
value: string | number | boolean | (string | number | boolean)[];
|
|
61
62
|
}[];
|
|
62
63
|
}[];
|
|
63
|
-
id?: string | null | undefined;
|
|
64
64
|
}>;
|
|
65
65
|
protected constructor(data: {
|
|
66
66
|
operation: Operation;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/index.js";
|
|
2
2
|
import { FilterRepository } from "./FilterRepository.js";
|
|
3
3
|
declare class FilterRepositoryFactory {
|
|
4
4
|
private gateway;
|
|
5
5
|
private cache;
|
|
6
|
-
getRepository(client:
|
|
6
|
+
getRepository(client: MainGraphQLClient.Interface, namespace: string): FilterRepository;
|
|
7
7
|
}
|
|
8
8
|
export declare const filterRepositoryFactory: FilterRepositoryFactory;
|
|
9
9
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/AdvancedSearch/domain/FilterRepositoryFactory.js","sources":["../../../../src/components/AdvancedSearch/domain/FilterRepositoryFactory.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"components/AdvancedSearch/domain/FilterRepositoryFactory.js","sources":["../../../../src/components/AdvancedSearch/domain/FilterRepositoryFactory.ts"],"sourcesContent":["import type { MainGraphQLClient } from \"@webiny/app/features/mainGraphQLClient/index.js\";\nimport type { FiltersGatewayInterface } from \"~/components/AdvancedSearch/gateways/index.js\";\nimport { FiltersGraphQLGateway } from \"~/components/AdvancedSearch/gateways/index.js\";\nimport { FilterRepository } from \"./FilterRepository.js\";\n\nclass FilterRepositoryFactory {\n private gateway: FiltersGatewayInterface | undefined;\n private cache: Map<string, FilterRepository> = new Map();\n\n getRepository(client: MainGraphQLClient.Interface, namespace: string) {\n if (!this.gateway) {\n this.gateway = new FiltersGraphQLGateway(client);\n }\n\n if (!this.cache.has(namespace)) {\n this.cache.set(namespace, new FilterRepository(this.gateway, namespace));\n }\n\n return this.cache.get(namespace) as FilterRepository;\n }\n}\n\nexport const filterRepositoryFactory = new FilterRepositoryFactory();\n"],"names":["FilterRepositoryFactory","client","namespace","FiltersGraphQLGateway","FilterRepository","Map","filterRepositoryFactory"],"mappings":";;AAKA,MAAMA;IAIF,cAAcC,MAAmC,EAAEC,SAAiB,EAAE;QAClE,IAAI,CAAC,IAAI,CAAC,OAAO,EACb,IAAI,CAAC,OAAO,GAAG,IAAIC,sBAAsBF;QAG7C,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAACC,YAChB,IAAI,CAAC,KAAK,CAAC,GAAG,CAACA,WAAW,IAAIE,iBAAiB,IAAI,CAAC,OAAO,EAAEF;QAGjE,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAACA;IAC1B;;aAZQ,KAAK,GAAkC,IAAIG;;AAavD;AAEO,MAAMC,0BAA0B,IAAIN"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/index.js";
|
|
2
2
|
import type { CreateFilterPayload, UpdateFilterPayload } from "./filters.types.js";
|
|
3
3
|
import type { FiltersGatewayInterface } from "./FiltersGatewayInterface.js";
|
|
4
4
|
export declare class FiltersGraphQLGateway implements FiltersGatewayInterface {
|
|
5
5
|
private client;
|
|
6
|
-
constructor(client:
|
|
6
|
+
constructor(client: MainGraphQLClient.Interface);
|
|
7
7
|
list(namespace: string): Promise<import("../domain/Filter.js").FilterDTO[]>;
|
|
8
8
|
get(id: string): Promise<import("../domain/Filter.js").FilterDTO>;
|
|
9
9
|
create(filter: CreateFilterPayload): Promise<import("../domain/Filter.js").FilterDTO>;
|
|
@@ -4,13 +4,12 @@ class FiltersGraphQLGateway {
|
|
|
4
4
|
this.client = client;
|
|
5
5
|
}
|
|
6
6
|
async list(namespace) {
|
|
7
|
-
const
|
|
7
|
+
const response = await this.client.execute({
|
|
8
8
|
query: LIST_FILTERS,
|
|
9
9
|
variables: {
|
|
10
10
|
namespace,
|
|
11
11
|
limit: 10000
|
|
12
|
-
}
|
|
13
|
-
fetchPolicy: "network-only"
|
|
12
|
+
}
|
|
14
13
|
});
|
|
15
14
|
if (!response) throw new Error("Network error while listing filters.");
|
|
16
15
|
const { data, error } = response.aco.listFilters;
|
|
@@ -18,7 +17,7 @@ class FiltersGraphQLGateway {
|
|
|
18
17
|
return data;
|
|
19
18
|
}
|
|
20
19
|
async get(id) {
|
|
21
|
-
const
|
|
20
|
+
const response = await this.client.execute({
|
|
22
21
|
query: GET_FILTER,
|
|
23
22
|
variables: {
|
|
24
23
|
id
|
|
@@ -30,8 +29,8 @@ class FiltersGraphQLGateway {
|
|
|
30
29
|
return data;
|
|
31
30
|
}
|
|
32
31
|
async create(filter) {
|
|
33
|
-
const
|
|
34
|
-
|
|
32
|
+
const response = await this.client.execute({
|
|
33
|
+
query: CREATE_FILTER,
|
|
35
34
|
variables: {
|
|
36
35
|
data: filter
|
|
37
36
|
}
|
|
@@ -44,8 +43,8 @@ class FiltersGraphQLGateway {
|
|
|
44
43
|
async update(filter) {
|
|
45
44
|
const { id, name, description, operation, groups } = filter;
|
|
46
45
|
if (!id) throw new Error("Error while updating filter, missing id.");
|
|
47
|
-
const
|
|
48
|
-
|
|
46
|
+
const response = await this.client.execute({
|
|
47
|
+
query: UPDATE_FILTER,
|
|
49
48
|
variables: {
|
|
50
49
|
id,
|
|
51
50
|
data: {
|
|
@@ -62,8 +61,8 @@ class FiltersGraphQLGateway {
|
|
|
62
61
|
return data;
|
|
63
62
|
}
|
|
64
63
|
async delete(id) {
|
|
65
|
-
const
|
|
66
|
-
|
|
64
|
+
const response = await this.client.execute({
|
|
65
|
+
query: DELETE_FILTER,
|
|
67
66
|
variables: {
|
|
68
67
|
id
|
|
69
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/AdvancedSearch/gateways/FiltersGraphQLGateway.js","sources":["../../../../src/components/AdvancedSearch/gateways/FiltersGraphQLGateway.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"components/AdvancedSearch/gateways/FiltersGraphQLGateway.js","sources":["../../../../src/components/AdvancedSearch/gateways/FiltersGraphQLGateway.ts"],"sourcesContent":["import type { MainGraphQLClient } from \"@webiny/app/features/mainGraphQLClient/index.js\";\n\nimport type {\n CreateFilterPayload,\n CreateFilterResponse,\n DeleteFilterResponse,\n GetFilterResponse,\n GetFilterQueryVariables,\n CreateFilterVariables,\n UpdateFilterVariables,\n DeleteFilterVariables,\n ListFiltersResponse,\n ListFiltersQueryVariables,\n UpdateFilterPayload,\n UpdateFilterResponse\n} from \"./filters.types.js\";\nimport type { FiltersGatewayInterface } from \"./FiltersGatewayInterface.js\";\nimport {\n CREATE_FILTER,\n DELETE_FILTER,\n GET_FILTER,\n LIST_FILTERS,\n UPDATE_FILTER\n} from \"./filters.gql.js\";\n\nexport class FiltersGraphQLGateway implements FiltersGatewayInterface {\n private client: MainGraphQLClient.Interface;\n\n constructor(client: MainGraphQLClient.Interface) {\n this.client = client;\n }\n\n async list(namespace: string) {\n const response = await this.client.execute<ListFiltersResponse, ListFiltersQueryVariables>({\n query: LIST_FILTERS,\n variables: {\n namespace,\n limit: 10000\n }\n });\n\n if (!response) {\n throw new Error(\"Network error while listing filters.\");\n }\n\n const { data, error } = response.aco.listFilters;\n\n if (!data) {\n throw new Error(error?.message || \"Could not fetch filters.\");\n }\n\n return data;\n }\n\n async get(id: string) {\n const response = await this.client.execute<GetFilterResponse, GetFilterQueryVariables>({\n query: GET_FILTER,\n variables: { id }\n });\n\n if (!response) {\n throw new Error(\"Network error while fetch filter.\");\n }\n\n const { data, error } = response.aco.getFilter;\n\n if (!data) {\n throw new Error(error?.message || `Could not fetch filter with id: ${id}`);\n }\n\n return data;\n }\n\n async create(filter: CreateFilterPayload) {\n const response = await this.client.execute<CreateFilterResponse, CreateFilterVariables>({\n query: CREATE_FILTER,\n variables: {\n data: filter\n }\n });\n\n if (!response) {\n throw new Error(\"Network error while creating filter.\");\n }\n\n const { data, error } = response.aco.createFilter;\n\n if (!data) {\n throw new Error(error?.message || \"Could not create filter.\");\n }\n\n return data;\n }\n\n async update(filter: UpdateFilterPayload) {\n const { id, name, description, operation, groups } = filter;\n\n if (!id) {\n throw new Error(\"Error while updating filter, missing id.\");\n }\n\n const response = await this.client.execute<UpdateFilterResponse, UpdateFilterVariables>({\n query: UPDATE_FILTER,\n variables: {\n id,\n data: {\n name,\n description,\n operation,\n groups\n }\n }\n });\n\n if (!response) {\n throw new Error(\"Network error while updating filter.\");\n }\n\n const { data, error } = response.aco.updateFilter;\n\n if (!data) {\n throw new Error(error?.message || \"Could not update filter.\");\n }\n\n return data;\n }\n\n async delete(id: string) {\n const response = await this.client.execute<DeleteFilterResponse, DeleteFilterVariables>({\n query: DELETE_FILTER,\n variables: {\n id\n }\n });\n\n if (!response) {\n throw new Error(\"Network error while deleting filter.\");\n }\n\n const { data, error } = response.aco.deleteFilter;\n\n if (!data) {\n throw new Error(error?.message || \"Could not delete filter.\");\n }\n\n return true;\n }\n}\n"],"names":["FiltersGraphQLGateway","client","namespace","response","LIST_FILTERS","Error","data","error","id","GET_FILTER","filter","CREATE_FILTER","name","description","operation","groups","UPDATE_FILTER","DELETE_FILTER"],"mappings":";AAyBO,MAAMA;IAGT,YAAYC,MAAmC,CAAE;QAC7C,IAAI,CAAC,MAAM,GAAGA;IAClB;IAEA,MAAM,KAAKC,SAAiB,EAAE;QAC1B,MAAMC,WAAW,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAiD;YACvF,OAAOC;YACP,WAAW;gBACPF;gBACA,OAAO;YACX;QACJ;QAEA,IAAI,CAACC,UACD,MAAM,IAAIE,MAAM;QAGpB,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGJ,SAAS,GAAG,CAAC,WAAW;QAEhD,IAAI,CAACG,MACD,MAAM,IAAID,MAAME,OAAO,WAAW;QAGtC,OAAOD;IACX;IAEA,MAAM,IAAIE,EAAU,EAAE;QAClB,MAAML,WAAW,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAA6C;YACnF,OAAOM;YACP,WAAW;gBAAED;YAAG;QACpB;QAEA,IAAI,CAACL,UACD,MAAM,IAAIE,MAAM;QAGpB,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGJ,SAAS,GAAG,CAAC,SAAS;QAE9C,IAAI,CAACG,MACD,MAAM,IAAID,MAAME,OAAO,WAAW,CAAC,gCAAgC,EAAEC,IAAI;QAG7E,OAAOF;IACX;IAEA,MAAM,OAAOI,MAA2B,EAAE;QACtC,MAAMP,WAAW,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAA8C;YACpF,OAAOQ;YACP,WAAW;gBACP,MAAMD;YACV;QACJ;QAEA,IAAI,CAACP,UACD,MAAM,IAAIE,MAAM;QAGpB,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGJ,SAAS,GAAG,CAAC,YAAY;QAEjD,IAAI,CAACG,MACD,MAAM,IAAID,MAAME,OAAO,WAAW;QAGtC,OAAOD;IACX;IAEA,MAAM,OAAOI,MAA2B,EAAE;QACtC,MAAM,EAAEF,EAAE,EAAEI,IAAI,EAAEC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAE,GAAGL;QAErD,IAAI,CAACF,IACD,MAAM,IAAIH,MAAM;QAGpB,MAAMF,WAAW,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAA8C;YACpF,OAAOa;YACP,WAAW;gBACPR;gBACA,MAAM;oBACFI;oBACAC;oBACAC;oBACAC;gBACJ;YACJ;QACJ;QAEA,IAAI,CAACZ,UACD,MAAM,IAAIE,MAAM;QAGpB,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGJ,SAAS,GAAG,CAAC,YAAY;QAEjD,IAAI,CAACG,MACD,MAAM,IAAID,MAAME,OAAO,WAAW;QAGtC,OAAOD;IACX;IAEA,MAAM,OAAOE,EAAU,EAAE;QACrB,MAAML,WAAW,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAA8C;YACpF,OAAOc;YACP,WAAW;gBACPT;YACJ;QACJ;QAEA,IAAI,CAACL,UACD,MAAM,IAAIE,MAAM;QAGpB,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGJ,SAAS,GAAG,CAAC,YAAY;QAEjD,IAAI,CAACG,MACD,MAAM,IAAID,MAAME,OAAO,WAAW;QAGtC,OAAO;IACX;AACJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const CREATE_FILTER:
|
|
2
|
-
export declare const LIST_FILTERS:
|
|
3
|
-
export declare const GET_FILTER:
|
|
4
|
-
export declare const UPDATE_FILTER:
|
|
5
|
-
export declare const DELETE_FILTER:
|
|
1
|
+
export declare const CREATE_FILTER = "\n mutation CreateFilter($data: FilterCreateInput!) {\n aco {\n createFilter(data: $data) {\n data \n {\n id\n name\n description\n operation\n groups {\n operation\n filters {\n field\n condition\n value\n }\n }\n createdOn\n }\n\n error \n {\n code\n data\n message\n }\n\n }\n }\n }\n";
|
|
2
|
+
export declare const LIST_FILTERS = "\n query ListFilters($namespace: String!, $limit: Int!) {\n aco {\n listFilters(where: { namespace: $namespace }, limit: $limit) {\n data \n {\n id\n name\n description\n operation\n groups {\n operation\n filters {\n field\n condition\n value\n }\n }\n createdOn\n }\n\n error \n {\n code\n data\n message\n }\n\n }\n }\n }\n";
|
|
3
|
+
export declare const GET_FILTER = "\n query GetFilters($id: ID!) {\n aco {\n getFilter(id: $id) {\n data \n {\n id\n name\n description\n operation\n groups {\n operation\n filters {\n field\n condition\n value\n }\n }\n createdOn\n }\n\n error \n {\n code\n data\n message\n }\n\n }\n }\n }\n";
|
|
4
|
+
export declare const UPDATE_FILTER = "\n mutation UpdateFilter($id: ID!, $data: FilterUpdateInput!) {\n aco {\n updateFilter(id: $id, data: $data) {\n data \n {\n id\n name\n description\n operation\n groups {\n operation\n filters {\n field\n condition\n value\n }\n }\n createdOn\n }\n\n error \n {\n code\n data\n message\n }\n\n }\n }\n }\n";
|
|
5
|
+
export declare const DELETE_FILTER = "\n mutation DeleteFilter($id: ID!) {\n aco {\n deleteFilter(id: $id) {\n data\n error \n {\n code\n data\n message\n }\n\n }\n }\n }\n";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import graphql_tag from "graphql-tag";
|
|
2
1
|
const ERROR_FIELD = `
|
|
3
2
|
{
|
|
4
3
|
code
|
|
@@ -23,7 +22,7 @@ const DATA_FIELD = `
|
|
|
23
22
|
createdOn
|
|
24
23
|
}
|
|
25
24
|
`;
|
|
26
|
-
const CREATE_FILTER =
|
|
25
|
+
const CREATE_FILTER = `
|
|
27
26
|
mutation CreateFilter($data: FilterCreateInput!) {
|
|
28
27
|
aco {
|
|
29
28
|
createFilter(data: $data) {
|
|
@@ -33,7 +32,7 @@ const CREATE_FILTER = graphql_tag`
|
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
34
|
`;
|
|
36
|
-
const LIST_FILTERS =
|
|
35
|
+
const LIST_FILTERS = `
|
|
37
36
|
query ListFilters($namespace: String!, $limit: Int!) {
|
|
38
37
|
aco {
|
|
39
38
|
listFilters(where: { namespace: $namespace }, limit: $limit) {
|
|
@@ -43,7 +42,7 @@ const LIST_FILTERS = graphql_tag`
|
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
44
|
`;
|
|
46
|
-
const GET_FILTER =
|
|
45
|
+
const GET_FILTER = `
|
|
47
46
|
query GetFilters($id: ID!) {
|
|
48
47
|
aco {
|
|
49
48
|
getFilter(id: $id) {
|
|
@@ -53,7 +52,7 @@ const GET_FILTER = graphql_tag`
|
|
|
53
52
|
}
|
|
54
53
|
}
|
|
55
54
|
`;
|
|
56
|
-
const UPDATE_FILTER =
|
|
55
|
+
const UPDATE_FILTER = `
|
|
57
56
|
mutation UpdateFilter($id: ID!, $data: FilterUpdateInput!) {
|
|
58
57
|
aco {
|
|
59
58
|
updateFilter(id: $id, data: $data) {
|
|
@@ -63,7 +62,7 @@ const UPDATE_FILTER = graphql_tag`
|
|
|
63
62
|
}
|
|
64
63
|
}
|
|
65
64
|
`;
|
|
66
|
-
const DELETE_FILTER =
|
|
65
|
+
const DELETE_FILTER = `
|
|
67
66
|
mutation DeleteFilter($id: ID!) {
|
|
68
67
|
aco {
|
|
69
68
|
deleteFilter(id: $id) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/AdvancedSearch/gateways/filters.gql.js","sources":["../../../../src/components/AdvancedSearch/gateways/filters.gql.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"components/AdvancedSearch/gateways/filters.gql.js","sources":["../../../../src/components/AdvancedSearch/gateways/filters.gql.ts"],"sourcesContent":["const ERROR_FIELD = /* GraphQL */ `\n {\n code\n data\n message\n }\n`;\n\nconst DATA_FIELD = /* GraphQL */ `\n {\n id\n name\n description\n operation\n groups {\n operation\n filters {\n field\n condition\n value\n }\n }\n createdOn\n }\n`;\n\nexport const CREATE_FILTER = /* GraphQL */ `\n mutation CreateFilter($data: FilterCreateInput!) {\n aco {\n createFilter(data: $data) {\n data ${DATA_FIELD}\n error ${ERROR_FIELD}\n }\n }\n }\n`;\n\nexport const LIST_FILTERS = /* GraphQL */ `\n query ListFilters($namespace: String!, $limit: Int!) {\n aco {\n listFilters(where: { namespace: $namespace }, limit: $limit) {\n data ${DATA_FIELD}\n error ${ERROR_FIELD}\n }\n }\n }\n`;\n\nexport const GET_FILTER = /* GraphQL */ `\n query GetFilters($id: ID!) {\n aco {\n getFilter(id: $id) {\n data ${DATA_FIELD}\n error ${ERROR_FIELD}\n }\n }\n }\n`;\n\nexport const UPDATE_FILTER = /* GraphQL */ `\n mutation UpdateFilter($id: ID!, $data: FilterUpdateInput!) {\n aco {\n updateFilter(id: $id, data: $data) {\n data ${DATA_FIELD}\n error ${ERROR_FIELD}\n }\n }\n }\n`;\n\nexport const DELETE_FILTER = /* GraphQL */ `\n mutation DeleteFilter($id: ID!) {\n aco {\n deleteFilter(id: $id) {\n data\n error ${ERROR_FIELD}\n }\n }\n }\n`;\n"],"names":["ERROR_FIELD","DATA_FIELD","CREATE_FILTER","LIST_FILTERS","GET_FILTER","UPDATE_FILTER","DELETE_FILTER"],"mappings":"AAAA,MAAMA,cAA4B,CAAC;;;;;;AAMnC,CAAC;AAED,MAAMC,aAA2B,CAAC;;;;;;;;;;;;;;;;AAgBlC,CAAC;AAEM,MAAMC,gBAA8B,CAAC;;;;qBAIvB,EAAED,WAAW;sBACZ,EAAED,YAAY;;;;AAIpC,CAAC;AAEM,MAAMG,eAA6B,CAAC;;;;qBAItB,EAAEF,WAAW;sBACZ,EAAED,YAAY;;;;AAIpC,CAAC;AAEM,MAAMI,aAA2B,CAAC;;;;qBAIpB,EAAEH,WAAW;sBACZ,EAAED,YAAY;;;;AAIpC,CAAC;AAEM,MAAMK,gBAA8B,CAAC;;;;qBAIvB,EAAEJ,WAAW;sBACZ,EAAED,YAAY;;;;AAIpC,CAAC;AAEM,MAAMM,gBAA8B,CAAC;;;;;sBAKtB,EAAEN,YAAY;;;;AAIpC,CAAC"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { useContainer } from "@webiny/app";
|
|
3
|
+
import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/index.js";
|
|
2
4
|
import { filterRepositoryFactory } from "./domain/index.js";
|
|
3
5
|
const useFilterRepository = (namespace)=>{
|
|
4
|
-
const
|
|
6
|
+
const container = useContainer();
|
|
7
|
+
const client = useMemo(()=>container.resolve(MainGraphQLClient), [
|
|
8
|
+
container
|
|
9
|
+
]);
|
|
5
10
|
return filterRepositoryFactory.getRepository(client, namespace);
|
|
6
11
|
};
|
|
7
12
|
export { useFilterRepository };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/AdvancedSearch/useFilterRepository.js","sources":["../../../src/components/AdvancedSearch/useFilterRepository.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"components/AdvancedSearch/useFilterRepository.js","sources":["../../../src/components/AdvancedSearch/useFilterRepository.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useContainer } from \"@webiny/app\";\nimport { MainGraphQLClient } from \"@webiny/app/features/mainGraphQLClient/index.js\";\nimport { filterRepositoryFactory } from \"~/components/AdvancedSearch/domain/index.js\";\n\nexport const useFilterRepository = (namespace: string) => {\n const container = useContainer();\n const client = useMemo(() => container.resolve(MainGraphQLClient), [container]);\n\n return filterRepositoryFactory.getRepository(client, namespace);\n};\n"],"names":["useFilterRepository","namespace","container","useContainer","client","useMemo","MainGraphQLClient","filterRepositoryFactory"],"mappings":";;;;AAKO,MAAMA,sBAAsB,CAACC;IAChC,MAAMC,YAAYC;IAClB,MAAMC,SAASC,QAAQ,IAAMH,UAAU,OAAO,CAACI,oBAAoB;QAACJ;KAAU;IAE9E,OAAOK,wBAAwB,aAAa,CAACH,QAAQH;AACzD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import react, { useContext } from "react";
|
|
2
|
+
import { TableRowContext } from "../useTableRow.js";
|
|
3
|
+
const CellAuthor = ()=>{
|
|
4
|
+
const context = useContext(TableRowContext);
|
|
5
|
+
if (!context) return null;
|
|
6
|
+
return /*#__PURE__*/ react.createElement(react.Fragment, null, context.row.data.createdBy.displayName);
|
|
7
|
+
};
|
|
8
|
+
export { CellAuthor };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=CellAuthor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/Table/cells/CellAuthor.js","sources":["../../../../src/components/Table/cells/CellAuthor.tsx"],"sourcesContent":["import React, { useContext } from \"react\";\nimport { TableRowContext } from \"../useTableRow.js\";\n\nexport const CellAuthor = () => {\n const context = useContext(TableRowContext);\n if (!context) {\n return null;\n }\n return <>{context.row.data.createdBy.displayName}</>;\n};\n"],"names":["CellAuthor","context","useContext","TableRowContext"],"mappings":";;AAGO,MAAMA,aAAa;IACtB,MAAMC,UAAUC,WAAWC;IAC3B,IAAI,CAACF,SACD,OAAO;IAEX,OAAO,WAAP,GAAO,0CAAGA,QAAQ,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW;AACpD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import react, { useContext } from "react";
|
|
2
|
+
import { TimeAgo } from "@webiny/admin-ui";
|
|
3
|
+
import { TableRowContext } from "../useTableRow.js";
|
|
4
|
+
const CellCreated = ()=>{
|
|
5
|
+
const context = useContext(TableRowContext);
|
|
6
|
+
if (!context) return null;
|
|
7
|
+
return /*#__PURE__*/ react.createElement(TimeAgo, {
|
|
8
|
+
datetime: context.row.data.createdOn
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
export { CellCreated };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=CellCreated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/Table/cells/CellCreated.js","sources":["../../../../src/components/Table/cells/CellCreated.tsx"],"sourcesContent":["import React, { useContext } from \"react\";\nimport { TimeAgo } from \"@webiny/admin-ui\";\nimport { TableRowContext } from \"../useTableRow.js\";\n\nexport const CellCreated = () => {\n const context = useContext(TableRowContext);\n if (!context) {\n return null;\n }\n return <TimeAgo datetime={context.row.data.createdOn} />;\n};\n"],"names":["CellCreated","context","useContext","TableRowContext","TimeAgo"],"mappings":";;;AAIO,MAAMA,cAAc;IACvB,MAAMC,UAAUC,WAAWC;IAC3B,IAAI,CAACF,SACD,OAAO;IAEX,OAAO,WAAP,GAAO,oBAACG,SAAOA;QAAC,UAAUH,QAAQ,GAAG,CAAC,IAAI,CAAC,SAAS;;AACxD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import react, { useContext } from "react";
|
|
2
|
+
import { TimeAgo } from "@webiny/admin-ui";
|
|
3
|
+
import { TableRowContext } from "../useTableRow.js";
|
|
4
|
+
const CellModified = ()=>{
|
|
5
|
+
const context = useContext(TableRowContext);
|
|
6
|
+
if (!context) return null;
|
|
7
|
+
return /*#__PURE__*/ react.createElement(TimeAgo, {
|
|
8
|
+
datetime: context.row.data.savedOn
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
export { CellModified };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=CellModified.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/Table/cells/CellModified.js","sources":["../../../../src/components/Table/cells/CellModified.tsx"],"sourcesContent":["import React, { useContext } from \"react\";\nimport { TimeAgo } from \"@webiny/admin-ui\";\nimport { TableRowContext } from \"../useTableRow.js\";\n\nexport const CellModified = () => {\n const context = useContext(TableRowContext);\n if (!context) {\n return null;\n }\n return <TimeAgo datetime={context.row.data.savedOn} />;\n};\n"],"names":["CellModified","context","useContext","TableRowContext","TimeAgo"],"mappings":";;;AAIO,MAAMA,eAAe;IACxB,MAAMC,UAAUC,WAAWC;IAC3B,IAAI,CAACF,SACD,OAAO;IAEX,OAAO,WAAP,GAAO,oBAACG,SAAOA;QAAC,UAAUH,QAAQ,GAAG,CAAC,IAAI,CAAC,OAAO;;AACtD"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
export { createRecordsData } from "@webiny/app-admin/components/Table/createTableData.js";
|
|
1
2
|
import type { FolderDto } from "../../domain/folder/FolderDto.js";
|
|
2
|
-
import type { FolderTableRow
|
|
3
|
-
export declare const createRecordsData: <T extends {
|
|
4
|
-
id: string;
|
|
5
|
-
$selectable?: boolean;
|
|
6
|
-
}>(items: T[]) => RecordTableRow<T>[];
|
|
3
|
+
import type { FolderTableRow } from "../../table.types.js";
|
|
7
4
|
export declare const createFoldersData: (items: FolderDto[]) => FolderTableRow[];
|
|
5
|
+
export interface FolderSortConfig {
|
|
6
|
+
field: string;
|
|
7
|
+
direction: "ASC" | "DESC";
|
|
8
|
+
}
|
|
9
|
+
export declare function sortFolders(folders: FolderDto[], sort: FolderSortConfig | undefined): FolderDto[];
|
|
@@ -1,15 +1,30 @@
|
|
|
1
|
-
const createRecordsData = (items)=>items.map((item)=>({
|
|
2
|
-
id: item.id,
|
|
3
|
-
$type: "RECORD",
|
|
4
|
-
$selectable: void 0 !== item.$selectable ? item.$selectable : true,
|
|
5
|
-
data: item
|
|
6
|
-
}));
|
|
7
1
|
const createFoldersData = (items)=>items.map((item)=>({
|
|
8
2
|
id: item.id,
|
|
9
3
|
$type: "FOLDER",
|
|
10
4
|
$selectable: false,
|
|
11
5
|
data: item
|
|
12
6
|
}));
|
|
13
|
-
|
|
7
|
+
const FOLDER_SORT_FIELDS = {
|
|
8
|
+
name: (f)=>f.title,
|
|
9
|
+
title: (f)=>f.title,
|
|
10
|
+
createdOn: (f)=>f.createdOn,
|
|
11
|
+
savedOn: (f)=>f.savedOn,
|
|
12
|
+
modifiedOn: (f)=>f.modifiedOn ?? f.savedOn,
|
|
13
|
+
createdBy: (f)=>f.createdBy.displayName,
|
|
14
|
+
savedBy: (f)=>f.savedBy.displayName,
|
|
15
|
+
modifiedBy: (f)=>f.modifiedBy ? f.modifiedBy.displayName : f.savedBy.displayName
|
|
16
|
+
};
|
|
17
|
+
function sortFolders(folders, sort) {
|
|
18
|
+
if (!sort || 0 === folders.length) return folders;
|
|
19
|
+
const accessor = FOLDER_SORT_FIELDS[sort.field];
|
|
20
|
+
if (!accessor) return folders;
|
|
21
|
+
const desc = "DESC" === sort.direction;
|
|
22
|
+
return folders.slice().sort((a, b)=>{
|
|
23
|
+
const cmp = accessor(a).localeCompare(accessor(b));
|
|
24
|
+
return desc ? -cmp : cmp;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export { createRecordsData } from "@webiny/app-admin/components/Table/createTableData.js";
|
|
28
|
+
export { createFoldersData, sortFolders };
|
|
14
29
|
|
|
15
30
|
//# sourceMappingURL=createTableData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/Table/createTableData.js","sources":["../../../src/components/Table/createTableData.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"components/Table/createTableData.js","sources":["../../../src/components/Table/createTableData.ts"],"sourcesContent":["export { createRecordsData } from \"@webiny/app-admin/components/Table/createTableData.js\";\n\nimport type { FolderDto } from \"~/domain/folder/FolderDto.js\";\nimport type { FolderTableRow } from \"~/table.types.js\";\n\nexport const createFoldersData = (items: FolderDto[]): FolderTableRow[] => {\n return items.map(item => ({\n id: item.id,\n $type: \"FOLDER\",\n $selectable: false,\n data: item\n }));\n};\n\nexport interface FolderSortConfig {\n field: string;\n direction: \"ASC\" | \"DESC\";\n}\n\nconst FOLDER_SORT_FIELDS: Record<string, (folder: FolderDto) => string> = {\n name: f => f.title,\n title: f => f.title,\n createdOn: f => f.createdOn,\n savedOn: f => f.savedOn,\n modifiedOn: f => f.modifiedOn ?? f.savedOn,\n createdBy: f => f.createdBy.displayName,\n savedBy: f => f.savedBy.displayName,\n modifiedBy: f => (f.modifiedBy ? f.modifiedBy.displayName : f.savedBy.displayName)\n};\n\nexport function sortFolders(folders: FolderDto[], sort: FolderSortConfig | undefined): FolderDto[] {\n if (!sort || folders.length === 0) {\n return folders;\n }\n\n const accessor = FOLDER_SORT_FIELDS[sort.field];\n if (!accessor) {\n return folders;\n }\n\n const desc = sort.direction === \"DESC\";\n\n return folders.slice().sort((a, b) => {\n const cmp = accessor(a).localeCompare(accessor(b));\n return desc ? -cmp : cmp;\n });\n}\n"],"names":["createFoldersData","items","item","FOLDER_SORT_FIELDS","f","sortFolders","folders","sort","accessor","desc","a","b","cmp"],"mappings":"AAKO,MAAMA,oBAAoB,CAACC,QACvBA,MAAM,GAAG,CAACC,CAAAA,OAAS;YACtB,IAAIA,KAAK,EAAE;YACX,OAAO;YACP,aAAa;YACb,MAAMA;QACV;AAQJ,MAAMC,qBAAoE;IACtE,MAAMC,CAAAA,IAAKA,EAAE,KAAK;IAClB,OAAOA,CAAAA,IAAKA,EAAE,KAAK;IACnB,WAAWA,CAAAA,IAAKA,EAAE,SAAS;IAC3B,SAASA,CAAAA,IAAKA,EAAE,OAAO;IACvB,YAAYA,CAAAA,IAAKA,EAAE,UAAU,IAAIA,EAAE,OAAO;IAC1C,WAAWA,CAAAA,IAAKA,EAAE,SAAS,CAAC,WAAW;IACvC,SAASA,CAAAA,IAAKA,EAAE,OAAO,CAAC,WAAW;IACnC,YAAYA,CAAAA,IAAMA,EAAE,UAAU,GAAGA,EAAE,UAAU,CAAC,WAAW,GAAGA,EAAE,OAAO,CAAC,WAAW;AACrF;AAEO,SAASC,YAAYC,OAAoB,EAAEC,IAAkC;IAChF,IAAI,CAACA,QAAQD,AAAmB,MAAnBA,QAAQ,MAAM,EACvB,OAAOA;IAGX,MAAME,WAAWL,kBAAkB,CAACI,KAAK,KAAK,CAAC;IAC/C,IAAI,CAACC,UACD,OAAOF;IAGX,MAAMG,OAAOF,AAAmB,WAAnBA,KAAK,SAAS;IAE3B,OAAOD,QAAQ,KAAK,GAAG,IAAI,CAAC,CAACI,GAAGC;QAC5B,MAAMC,MAAMJ,SAASE,GAAG,aAAa,CAACF,SAASG;QAC/C,OAAOF,OAAO,CAACG,MAAMA;IACzB;AACJ"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { Table, createUseTableRow, TableRowProvider, TableRowContext } from "@webiny/app-admin/components/Table/index.js";
|
|
2
|
+
export { CellAuthor, CellCreated, CellModified } from "@webiny/app-admin/components/Table/cells/index.js";
|
|
2
3
|
export * from "./createTableData.js";
|
|
3
|
-
export * from "./useTableRow.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./components/index.js";
|
|
2
1
|
export * from "./createTableData.js";
|
|
3
|
-
export
|
|
2
|
+
export { Table, TableRowContext, TableRowProvider, createUseTableRow } from "@webiny/app-admin/components/Table/index.js";
|
|
3
|
+
export { CellAuthor, CellCreated, CellModified } from "@webiny/app-admin/components/Table/cells/index.js";
|
package/components/index.d.ts
CHANGED
package/components/index.js
CHANGED
package/config/AcoConfig.d.ts
CHANGED
|
@@ -15,28 +15,24 @@ export declare const AcoConfig: (({ priority, children }: import("@webiny/react-
|
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
17
|
Folder: {
|
|
18
|
-
Action:
|
|
18
|
+
Action: typeof import("./folder/Action.js").BaseAction & {
|
|
19
19
|
OptionsMenuItem: (props: import("@webiny/app-admin/index.js").OptionsMenuItemProps) => React.JSX.Element;
|
|
20
20
|
};
|
|
21
|
-
DropConfirmation:
|
|
21
|
+
DropConfirmation: typeof import("./folder/DropConfirmation.js").DropConfirmation;
|
|
22
22
|
};
|
|
23
23
|
Record: {
|
|
24
|
-
Action:
|
|
24
|
+
Action: typeof import("./record/Action.js").BaseAction & {
|
|
25
25
|
OptionsMenuItem: (props: import("@webiny/app-admin/index.js").OptionsMenuItemProps) => React.JSX.Element;
|
|
26
26
|
OptionsMenuLink: (props: import("@webiny/app-admin/index.js").OptionsMenuLinkProps) => React.JSX.Element;
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
Table: {
|
|
30
|
-
Column: import("react").FC<import("
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<TUserRow>(): import("../index.js").TableRowContextData<TBaseRow & {
|
|
35
|
-
data: TUserRow;
|
|
36
|
-
}>;
|
|
37
|
-
};
|
|
30
|
+
Column: import("react").FC<import("@webiny/app-admin/config/table/Column.js").ColumnProps> & {
|
|
31
|
+
createUseTableRow: typeof import("@webiny/app-admin/index.js").createUseTableRow;
|
|
32
|
+
} & {
|
|
33
|
+
isFolderRow: (row: import("@webiny/app-admin/index.js").TableRow) => row is import("../table.types.js").FolderTableRow;
|
|
38
34
|
};
|
|
39
|
-
Sorting: ({ name, field, order }: import("
|
|
35
|
+
Sorting: ({ name, field, order }: import("@webiny/app-admin/config/table/Sorting.js").SortingProps) => React.JSX.Element;
|
|
40
36
|
};
|
|
41
37
|
};
|
|
42
38
|
export interface AcoConfig {
|
|
@@ -10,7 +10,9 @@ export interface FieldRendererProps {
|
|
|
10
10
|
element: React.ReactElement;
|
|
11
11
|
type: FieldType;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
declare const BaseFieldRenderer: ({ name, type, element }: FieldRendererProps) => React.JSX.Element;
|
|
14
|
+
export declare const FieldRenderer: typeof BaseFieldRenderer & {
|
|
14
15
|
useInputField: () => import("~/components/AdvancedSearch/useInputField.js").InputFieldContext;
|
|
15
16
|
FieldType: typeof FieldType;
|
|
16
17
|
};
|
|
18
|
+
export {};
|
|
@@ -11,6 +11,6 @@ export interface ActionProps {
|
|
|
11
11
|
after?: string;
|
|
12
12
|
}
|
|
13
13
|
export declare const BaseAction: ({ name, after, before, remove, element }: ActionProps) => React.JSX.Element;
|
|
14
|
-
export declare const Action:
|
|
14
|
+
export declare const Action: typeof BaseAction & {
|
|
15
15
|
OptionsMenuItem: (props: import("@webiny/app-admin").OptionsMenuItemProps) => React.JSX.Element;
|
|
16
16
|
};
|
package/config/folder/index.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { ActionConfig } from "./Action.js";
|
|
2
|
+
import { DropConfirmation } from "./DropConfirmation.js";
|
|
2
3
|
export interface FolderConfig {
|
|
3
4
|
actions: ActionConfig[];
|
|
4
5
|
dropConfirmation: boolean;
|
|
5
6
|
}
|
|
6
7
|
export declare const Folder: {
|
|
7
|
-
Action:
|
|
8
|
+
Action: typeof import("./Action.js").BaseAction & {
|
|
8
9
|
OptionsMenuItem: (props: import("@webiny/app-admin/index.js").OptionsMenuItemProps) => React.JSX.Element;
|
|
9
10
|
};
|
|
10
|
-
DropConfirmation:
|
|
11
|
+
DropConfirmation: typeof DropConfirmation;
|
|
11
12
|
};
|
package/config/index.d.ts
CHANGED
package/config/index.js
CHANGED
|
@@ -11,7 +11,7 @@ export interface ActionProps {
|
|
|
11
11
|
after?: string;
|
|
12
12
|
}
|
|
13
13
|
export declare const BaseAction: ({ name, after, before, remove, element }: ActionProps) => React.JSX.Element;
|
|
14
|
-
export declare const Action:
|
|
14
|
+
export declare const Action: typeof BaseAction & {
|
|
15
15
|
OptionsMenuItem: (props: import("@webiny/app-admin").OptionsMenuItemProps) => React.JSX.Element;
|
|
16
16
|
OptionsMenuLink: (props: import("@webiny/app-admin").OptionsMenuLinkProps) => React.JSX.Element;
|
|
17
17
|
};
|
package/config/record/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export interface RecordConfig {
|
|
|
3
3
|
actions: ActionConfig[];
|
|
4
4
|
}
|
|
5
5
|
export declare const Record: {
|
|
6
|
-
Action:
|
|
6
|
+
Action: typeof import("./Action.js").BaseAction & {
|
|
7
7
|
OptionsMenuItem: (props: import("@webiny/app-admin/index.js").OptionsMenuItemProps) => React.JSX.Element;
|
|
8
8
|
OptionsMenuLink: (props: import("@webiny/app-admin/index.js").OptionsMenuLinkProps) => React.JSX.Element;
|
|
9
9
|
};
|
package/config/table/Column.d.ts
CHANGED
|
@@ -1,40 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
name: string;
|
|
10
|
-
resizable: boolean;
|
|
11
|
-
size: number;
|
|
12
|
-
sortable: boolean;
|
|
13
|
-
truncate: boolean;
|
|
14
|
-
visible: boolean;
|
|
15
|
-
}
|
|
16
|
-
export interface ColumnProps {
|
|
17
|
-
after?: string;
|
|
18
|
-
before?: string;
|
|
19
|
-
cell?: string | ReactElement;
|
|
20
|
-
className?: string;
|
|
21
|
-
truncate?: boolean;
|
|
22
|
-
header?: string | ReactElement;
|
|
23
|
-
hideable?: boolean;
|
|
24
|
-
name: string;
|
|
25
|
-
path?: string;
|
|
26
|
-
remove?: boolean;
|
|
27
|
-
resizable?: boolean;
|
|
28
|
-
size?: number;
|
|
29
|
-
sortable?: boolean;
|
|
30
|
-
visible?: boolean;
|
|
31
|
-
}
|
|
32
|
-
export declare const Column: React.FC<ColumnProps> & {
|
|
33
|
-
isFolderRow: (row: TableRow) => row is FolderTableRow;
|
|
34
|
-
createUseTableRow: <TBaseRow = Record<string, any>>() => {
|
|
35
|
-
(): import("~/components/Table/useTableRow.js").TableRowContextData<TBaseRow>;
|
|
36
|
-
<TUserRow>(): import("~/components/Table/useTableRow.js").TableRowContextData<TBaseRow & {
|
|
37
|
-
data: TUserRow;
|
|
38
|
-
}>;
|
|
39
|
-
};
|
|
1
|
+
import type { TableRow } from "../../table.types.js";
|
|
2
|
+
import type { FolderTableRow } from "../../table.types.js";
|
|
3
|
+
export type { ColumnConfig, ColumnProps } from "@webiny/app-admin/config/table/Column.js";
|
|
4
|
+
declare const isFolderRow: (row: TableRow) => row is FolderTableRow;
|
|
5
|
+
export declare const Column: import("react").FC<import("@webiny/app-admin/config/table/Column.js").ColumnProps> & {
|
|
6
|
+
createUseTableRow: typeof import("@webiny/app-admin/components").createUseTableRow;
|
|
7
|
+
} & {
|
|
8
|
+
isFolderRow: typeof isFolderRow;
|
|
40
9
|
};
|