@antscorp/antsomi-ui 1.3.7-beta.57 → 1.3.7-beta.59
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/es/components/molecules/AddDynamicContent/AddDynamicContent.js +114 -123
- package/es/components/molecules/SelectAccount/hook/useGetAbstractUsers.d.ts +2 -2
- package/es/components/molecules/TemplateSaveAs/hooks/useTemplateSave.d.ts +2 -2
- package/es/components/molecules/UploadImage/index.js +2 -3
- package/es/components/organism/ContentSources/Settings.js +41 -40
- package/es/components/organism/DataTable/hooks/useDataTableListing/useDataTableListing.js +5 -7
- package/es/components/organism/Help/queries/useGetListUser.js +1 -4
- package/es/components/organism/LeftMenu/components/HomeMenu/useHomeMenu.js +1 -1
- package/es/components/organism/LeftMenu/hooks/usePermission.d.ts +1 -1
- package/es/components/organism/TicketEditorV2/queries/useFetchAccountPermission.js +1 -4
- package/es/components/organism/TicketEditorV2/queries/useGetDetailTicket.d.ts +1 -1
- package/es/components/organism/TicketEditorV2/queries/useGetListComments.d.ts +1 -1
- package/es/components/organism/TicketEditorV2/queries/useGetListUser.js +1 -4
- package/es/components/template/TemplateListing/hooks/useTemplateListing.d.ts +3 -2
- package/es/queries/AI/index.d.ts +3 -3
- package/es/queries/AI/useSqlGeneration.d.ts +3 -3
- package/es/queries/AI/useSqlGeneration.js +2 -2
- package/es/queries/Account/useGetAccountList.d.ts +3 -3
- package/es/queries/Account/useGetAccountList.js +1 -2
- package/es/queries/BusinessObject/useGetBODetail.d.ts +1 -1
- package/es/queries/BusinessObject/useGetListAllEvents.d.ts +1 -1
- package/es/queries/BusinessObject/useGetListBO.d.ts +1 -1
- package/es/queries/BusinessObject/useGetListEventAttr.d.ts +1 -1
- package/es/queries/BusinessObject/useGetListPromotionCodeAttr.d.ts +1 -1
- package/es/queries/BusinessObject/useGetListSourceByEvent.d.ts +1 -1
- package/es/queries/CustomFunction/useCustomFunction.d.ts +3 -3
- package/es/queries/CustomFunction/useCustomFunction.js +4 -8
- package/es/queries/DataTable/index.d.ts +25 -25
- package/es/queries/DataTable/index.js +19 -26
- package/es/queries/DynamicContentAttribute/useGetDynamicContentAttr.d.ts +1 -1
- package/es/queries/LeftMenu/index.d.ts +9 -9
- package/es/queries/LeftMenu/index.js +6 -4
- package/es/queries/Permission/index.d.ts +2 -2
- package/es/queries/PromotionPool/useGetListPromotionPool.d.ts +1 -1
- package/es/queries/TemplateListing/index.d.ts +5 -5
- package/es/queries/TemplateListing/index.js +14 -28
- package/es/queries/ThirdParty/useGetEventTrackingAttributes.d.ts +1 -1
- package/es/queries/ThirdParty/useGetListFallbackBO.d.ts +1 -1
- package/es/queries/ThirdParty/useStoreSavedMedia.d.ts +1 -1
- package/es/queries/ThirdParty/useStoreSavedMedia.js +0 -1
- package/es/queries/Unsubscribe/useGetUnsubscribeList.d.ts +1 -1
- package/es/queries/Unsubscribe/useGetUnsubscribeList.js +2 -2
- package/es/queries/Unsubscribe/useGetUnsubscribeListByIdentifier.d.ts +1 -1
- package/es/queries/Unsubscribe/useGetUnsubscribeListPermission.d.ts +1 -1
- package/es/queries/Unsubscribe/useGetUnsubscribeListPermission.js +2 -2
- package/es/queries/Unsubscribe/useGetUnsubscribePreferences.d.ts +1 -1
- package/es/queries/User/index.d.ts +1 -1
- package/es/queries/User/index.js +7 -11
- package/es/queries/User/userGetUserInfo.js +3 -6
- package/package.json +3 -3
|
@@ -14,6 +14,7 @@ export const useGetTemplateCategoryList = (params) => {
|
|
|
14
14
|
queryFn: () => args?.params?.publicLevel === PUBLIC_LEVEL.PUBLIC
|
|
15
15
|
? category.getPublicList(params.args)
|
|
16
16
|
: category.getList(params.args),
|
|
17
|
+
onSuccess() { },
|
|
17
18
|
...options,
|
|
18
19
|
});
|
|
19
20
|
};
|
|
@@ -22,6 +23,7 @@ export const useGetSaveAsGalleryPermissionEmails = (params) => {
|
|
|
22
23
|
return useQuery({
|
|
23
24
|
queryKey: [QUERY_KEYS.GET_SAVE_AS_GALLERY_PERMISSION_EMAILS],
|
|
24
25
|
queryFn: () => objectTemplate.getSaveAsGalleryPermission(params.args),
|
|
26
|
+
onSuccess() { },
|
|
25
27
|
...options,
|
|
26
28
|
});
|
|
27
29
|
};
|
|
@@ -29,17 +31,15 @@ export const useGetObjectTemplateList = (params) => {
|
|
|
29
31
|
const { options, args } = params;
|
|
30
32
|
return useInfiniteQuery({
|
|
31
33
|
queryKey: [QUERY_KEYS.GET_OBJECT_TEMPLATE_LIST, args.params],
|
|
32
|
-
|
|
33
|
-
queryFn: async ({ pageParam }) => {
|
|
34
|
-
const page = pageParam || 1;
|
|
34
|
+
queryFn: async ({ pageParam = 1 }) => {
|
|
35
35
|
const res = args?.params?.public_level === PUBLIC_LEVEL.PUBLIC
|
|
36
36
|
? await objectTemplate.getPublicList({
|
|
37
37
|
...args,
|
|
38
|
-
params: { ...args.params, page },
|
|
38
|
+
params: { ...args.params, page: pageParam },
|
|
39
39
|
})
|
|
40
40
|
: await objectTemplate.getList({
|
|
41
41
|
...args,
|
|
42
|
-
params: { ...args.params, page },
|
|
42
|
+
params: { ...args.params, page: pageParam },
|
|
43
43
|
});
|
|
44
44
|
return res;
|
|
45
45
|
},
|
|
@@ -73,12 +73,10 @@ export const useBulkUpdateTemplate = (params) => {
|
|
|
73
73
|
return useMutation({
|
|
74
74
|
mutationFn: objectTemplate.bulkUpdate,
|
|
75
75
|
onSettled() {
|
|
76
|
-
queryClient.invalidateQueries({
|
|
77
|
-
queryKey: [QUERY_KEYS.GET_OBJECT_TEMPLATE_LIST],
|
|
76
|
+
queryClient.invalidateQueries([QUERY_KEYS.GET_OBJECT_TEMPLATE_LIST], {
|
|
78
77
|
exact: false,
|
|
79
78
|
});
|
|
80
|
-
queryClient.invalidateQueries({
|
|
81
|
-
queryKey: [QUERY_KEYS.GET_TEMPLATE_CATEGORY_LIST],
|
|
79
|
+
queryClient.invalidateQueries([QUERY_KEYS.GET_TEMPLATE_CATEGORY_LIST], {
|
|
82
80
|
exact: false,
|
|
83
81
|
});
|
|
84
82
|
},
|
|
@@ -91,12 +89,10 @@ export const useCreateTemplate = (params) => {
|
|
|
91
89
|
return useMutation({
|
|
92
90
|
mutationFn: objectTemplate.create,
|
|
93
91
|
onSettled() {
|
|
94
|
-
queryClient.invalidateQueries({
|
|
95
|
-
queryKey: [QUERY_KEYS.GET_OBJECT_TEMPLATE_LIST],
|
|
92
|
+
queryClient.invalidateQueries([QUERY_KEYS.GET_OBJECT_TEMPLATE_LIST], {
|
|
96
93
|
exact: false,
|
|
97
94
|
});
|
|
98
|
-
queryClient.invalidateQueries({
|
|
99
|
-
queryKey: [QUERY_KEYS.GET_TEMPLATE_CATEGORY_LIST],
|
|
95
|
+
queryClient.invalidateQueries([QUERY_KEYS.GET_TEMPLATE_CATEGORY_LIST], {
|
|
100
96
|
exact: false,
|
|
101
97
|
});
|
|
102
98
|
},
|
|
@@ -109,12 +105,10 @@ export const useUpdateTemplate = (params) => {
|
|
|
109
105
|
return useMutation({
|
|
110
106
|
mutationFn: objectTemplate.update,
|
|
111
107
|
onSettled() {
|
|
112
|
-
queryClient.invalidateQueries({
|
|
113
|
-
queryKey: [QUERY_KEYS.GET_OBJECT_TEMPLATE_LIST],
|
|
108
|
+
queryClient.invalidateQueries([QUERY_KEYS.GET_OBJECT_TEMPLATE_LIST], {
|
|
114
109
|
exact: false,
|
|
115
110
|
});
|
|
116
|
-
queryClient.invalidateQueries({
|
|
117
|
-
queryKey: [QUERY_KEYS.GET_TEMPLATE_CATEGORY_LIST],
|
|
111
|
+
queryClient.invalidateQueries([QUERY_KEYS.GET_TEMPLATE_CATEGORY_LIST], {
|
|
118
112
|
exact: false,
|
|
119
113
|
});
|
|
120
114
|
},
|
|
@@ -136,19 +130,11 @@ export const usePersistTemplate = (params) => {
|
|
|
136
130
|
}
|
|
137
131
|
},
|
|
138
132
|
onSettled(data, error, variables) {
|
|
139
|
-
queryClient.invalidateQueries({
|
|
140
|
-
|
|
141
|
-
QUERY_KEYS.GET_OBJECT_TEMPLATE_DETAIL,
|
|
142
|
-
+get(variables, 'params.data.template_id', -1),
|
|
143
|
-
],
|
|
144
|
-
exact: true,
|
|
145
|
-
});
|
|
146
|
-
queryClient.invalidateQueries({
|
|
147
|
-
queryKey: [QUERY_KEYS.GET_OBJECT_TEMPLATE_LIST],
|
|
133
|
+
queryClient.invalidateQueries([QUERY_KEYS.GET_OBJECT_TEMPLATE_DETAIL, +get(variables, 'params.data.template_id', -1)], { exact: true });
|
|
134
|
+
queryClient.invalidateQueries([QUERY_KEYS.GET_OBJECT_TEMPLATE_LIST], {
|
|
148
135
|
exact: false,
|
|
149
136
|
});
|
|
150
|
-
queryClient.invalidateQueries({
|
|
151
|
-
queryKey: [QUERY_KEYS.GET_TEMPLATE_CATEGORY_LIST],
|
|
137
|
+
queryClient.invalidateQueries([QUERY_KEYS.GET_TEMPLATE_CATEGORY_LIST], {
|
|
152
138
|
exact: false,
|
|
153
139
|
});
|
|
154
140
|
},
|
|
@@ -10,5 +10,5 @@ type GetDataTableBOProps<T> = {
|
|
|
10
10
|
eventActionId: number;
|
|
11
11
|
options?: Omit<UseQueryOptions<any, any, T, any[]>, OptionHasDefault>;
|
|
12
12
|
};
|
|
13
|
-
export declare const useGetEventTrackingAttributes: <T = EventTrackingAttribute>(props: GetDataTableBOProps<T>) => import("@tanstack/react-query").UseQueryResult<
|
|
13
|
+
export declare const useGetEventTrackingAttributes: <T = EventTrackingAttribute>(props: GetDataTableBOProps<T>) => import("@tanstack/react-query").UseQueryResult<T, any>;
|
|
14
14
|
export {};
|
|
@@ -6,5 +6,5 @@ type GetDataTableBOProps<T> = {
|
|
|
6
6
|
serviceAuth: TServiceAuth;
|
|
7
7
|
options?: Omit<UseQueryOptions<any, any, T, any[]>, OptionHasDefault>;
|
|
8
8
|
};
|
|
9
|
-
export declare const useGetListFallbackBO: <T = FallbackBO[]>(props: GetDataTableBOProps<T>) => import("@tanstack/react-query").UseQueryResult<
|
|
9
|
+
export declare const useGetListFallbackBO: <T = FallbackBO[]>(props: GetDataTableBOProps<T>) => import("@tanstack/react-query").UseQueryResult<T, any>;
|
|
10
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStoreSavedMedia: (domain: string, slug: string, infos: any) => import("@tanstack/react-query").UseInfiniteQueryResult<import("
|
|
1
|
+
export declare const useStoreSavedMedia: (domain: string, slug: string, infos: any) => import("@tanstack/react-query").UseInfiniteQueryResult<import("../../models/SavedMedia").SavedMedia[], unknown>;
|
|
@@ -7,7 +7,6 @@ import { QUERY_KEYS } from '../../constants';
|
|
|
7
7
|
// Hook to fetch data with infinite scrolling
|
|
8
8
|
export const useStoreSavedMedia = (domain, slug, infos) => useInfiniteQuery({
|
|
9
9
|
queryKey: [QUERY_KEYS.GET_LIST_SAVED_MEDIA, domain, slug, infos],
|
|
10
|
-
initialPageParam: 1,
|
|
11
10
|
queryFn: ({ pageParam }) => getListingSavedMedia(domain, slug, infos, pageParam),
|
|
12
11
|
getNextPageParam: (lastPage, pages) => (lastPage.length >= 10 ? pages.length + 1 : undefined),
|
|
13
12
|
});
|
|
@@ -2,7 +2,7 @@ import { UseQueryOptions } from '@tanstack/react-query';
|
|
|
2
2
|
import { TGetUnsubscribeListArgs, TUnsubscribePayloadInfo } from '../../services/Unsubscribe';
|
|
3
3
|
interface UseGetUnsubscribeListProps {
|
|
4
4
|
args: TGetUnsubscribeListArgs;
|
|
5
|
-
options?:
|
|
5
|
+
options?: UseQueryOptions<any, Error, any>;
|
|
6
6
|
}
|
|
7
7
|
export declare const useGetUnsubscribeList: ({ args, options }: UseGetUnsubscribeListProps, infos: TUnsubscribePayloadInfo) => import("@tanstack/react-query").UseQueryResult<any, Error>;
|
|
8
8
|
export {};
|
|
@@ -7,8 +7,8 @@ import { unsubscribeServices, } from '../../services/Unsubscribe';
|
|
|
7
7
|
import { QUERY_KEYS } from '../../constants';
|
|
8
8
|
export const useGetUnsubscribeList = ({ args, options }, infos) => useQuery({
|
|
9
9
|
queryKey: [QUERY_KEYS.GET_UNSUBSCRIBE_LIST, args, options, infos],
|
|
10
|
-
queryFn: async () =>
|
|
11
|
-
|
|
10
|
+
queryFn: async () => unsubscribeServices.getUnsubscribeList(args, infos),
|
|
11
|
+
onSuccess: data => {
|
|
12
12
|
if (!data)
|
|
13
13
|
return [];
|
|
14
14
|
const unsubscribedList = data?.entries[0] || [];
|
|
@@ -2,7 +2,7 @@ import { UseQueryOptions } from '@tanstack/react-query';
|
|
|
2
2
|
import { TGetUnsubscribeListByIdentifierArgs, TUnsubscribePayloadInfo } from '../../services/Unsubscribe';
|
|
3
3
|
interface UseGetUnsubscribeListByIdentifierProps {
|
|
4
4
|
args: TGetUnsubscribeListByIdentifierArgs;
|
|
5
|
-
options?:
|
|
5
|
+
options?: UseQueryOptions<any, Error, any>;
|
|
6
6
|
}
|
|
7
7
|
export declare const useGetUnsubscribeListByIdentifier: ({ args, options }: UseGetUnsubscribeListByIdentifierProps, infos: TUnsubscribePayloadInfo) => import("@tanstack/react-query").UseQueryResult<any, Error>;
|
|
8
8
|
export {};
|
|
@@ -2,7 +2,7 @@ import { UseQueryOptions } from '@tanstack/react-query';
|
|
|
2
2
|
import { TGetUnsubscribeListPermissionArgs, TUnsubscribePayloadInfo } from '../../services/Unsubscribe';
|
|
3
3
|
interface UseGetUnsubscribeListPermissionProps {
|
|
4
4
|
args: TGetUnsubscribeListPermissionArgs;
|
|
5
|
-
options?:
|
|
5
|
+
options?: UseQueryOptions<any, Error, any>;
|
|
6
6
|
}
|
|
7
7
|
export declare const useGetUnsubscribeListPermission: ({ args, options }: UseGetUnsubscribeListPermissionProps, infos: TUnsubscribePayloadInfo) => import("@tanstack/react-query").UseQueryResult<any, Error>;
|
|
8
8
|
export {};
|
|
@@ -6,8 +6,8 @@ import { unsubscribeServices, } from '../../services/Unsubscribe';
|
|
|
6
6
|
import { QUERY_KEYS } from '../../constants';
|
|
7
7
|
export const useGetUnsubscribeListPermission = ({ args, options }, infos) => useQuery({
|
|
8
8
|
queryKey: [QUERY_KEYS.GET_UNSUBSCRIBE_LIST_PERMISSION, args, options, infos],
|
|
9
|
-
queryFn: async () =>
|
|
10
|
-
|
|
9
|
+
queryFn: async () => unsubscribeServices.getUnsubscribeListPermission(args, infos),
|
|
10
|
+
onSuccess: data => {
|
|
11
11
|
if (!data)
|
|
12
12
|
return [];
|
|
13
13
|
const unsubscribedList = data?.entries[0] || [];
|
|
@@ -2,7 +2,7 @@ import { UseQueryOptions } from '@tanstack/react-query';
|
|
|
2
2
|
import { GetUnsubscribePreferencesArgs, TUnsubscribePayloadInfo } from '../../services/Unsubscribe';
|
|
3
3
|
interface UseGetUnsubscribePreferencesProps {
|
|
4
4
|
args: GetUnsubscribePreferencesArgs;
|
|
5
|
-
options?:
|
|
5
|
+
options?: UseQueryOptions<any, Error, any>;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* React Query hook to get unsubscribe preferences by given identifier
|
|
@@ -5,4 +5,4 @@ export type TUseGetLoggedUser = {
|
|
|
5
5
|
args: TGetLoggedUserArgs;
|
|
6
6
|
options?: UseQueryOptions<LoggedUser, any, LoggedUser, any[]>;
|
|
7
7
|
};
|
|
8
|
-
export declare const useGetLoggedUser: (params: TUseGetLoggedUser) => import("@tanstack/react-query").UseQueryResult<
|
|
8
|
+
export declare const useGetLoggedUser: (params: TUseGetLoggedUser) => import("@tanstack/react-query").UseQueryResult<LoggedUser, any>;
|
package/es/queries/User/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
1
|
import { useQuery } from '@tanstack/react-query';
|
|
3
2
|
import i18next from '@antscorp/antsomi-ui/es/locales/i18n';
|
|
4
3
|
// Services
|
|
@@ -7,18 +6,15 @@ import { PORTAL_KEYS, QUERY_KEYS } from '../../constants';
|
|
|
7
6
|
import { UserAndPortalDefaultConfig } from '../../utils/portal';
|
|
8
7
|
export const useGetLoggedUser = (params) => {
|
|
9
8
|
const { args, options } = params;
|
|
10
|
-
|
|
9
|
+
return useQuery({
|
|
11
10
|
queryKey: [QUERY_KEYS.GET_LOGGED_USER, args],
|
|
12
11
|
queryFn: () => userServices.getLoggedUser(args),
|
|
13
|
-
|
|
14
|
-
});
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
if (query.data) {
|
|
12
|
+
onSuccess(data) {
|
|
17
13
|
UserAndPortalDefaultConfig.setPartial({
|
|
18
|
-
[PORTAL_KEYS.USER_LANGUAGE]:
|
|
14
|
+
[PORTAL_KEYS.USER_LANGUAGE]: data.language,
|
|
19
15
|
});
|
|
20
|
-
i18next.changeLanguage(`${
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
i18next.changeLanguage(`${data.language || 'en'}`.toLowerCase());
|
|
17
|
+
},
|
|
18
|
+
...options,
|
|
19
|
+
});
|
|
24
20
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
1
|
import { useQuery } from '@tanstack/react-query';
|
|
3
2
|
import { getUserInfo } from '../../services/User';
|
|
4
3
|
import { UserAndPortalDefaultConfig } from '../../utils/portal';
|
|
@@ -20,12 +19,10 @@ export const useGetUserInfo = (appConfig) => {
|
|
|
20
19
|
enabled,
|
|
21
20
|
queryKey,
|
|
22
21
|
queryFn: () => getUserInfo(getUserInfoParams),
|
|
22
|
+
onSuccess: data => {
|
|
23
|
+
UserAndPortalDefaultConfig.set(data.portal, data.user);
|
|
24
|
+
},
|
|
23
25
|
});
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
if (query.data) {
|
|
26
|
-
UserAndPortalDefaultConfig.set(query.data.portal, query.data.user);
|
|
27
|
-
}
|
|
28
|
-
}, [query.data]);
|
|
29
26
|
return {
|
|
30
27
|
data: query.data,
|
|
31
28
|
isLoading: query.isFetching,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antscorp/antsomi-ui",
|
|
3
|
-
"version": "1.3.7-beta.
|
|
3
|
+
"version": "1.3.7-beta.59",
|
|
4
4
|
"description": "An enterprise-class UI design language and React UI library.",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"dist/*",
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
"@fortawesome/free-solid-svg-icons": "6.1.1",
|
|
78
78
|
"@fortawesome/react-fontawesome": "0.2.0",
|
|
79
79
|
"@swiper/core": "^0.0.21",
|
|
80
|
-
"@tanstack/react-query": "
|
|
81
|
-
"@tanstack/react-query-devtools": "
|
|
80
|
+
"@tanstack/react-query": "4.20.4",
|
|
81
|
+
"@tanstack/react-query-devtools": "4.20.4",
|
|
82
82
|
"@tanstack/react-table": "^8.20.5",
|
|
83
83
|
"@tinymce/tinymce-react": "^3.7.0",
|
|
84
84
|
"@tiptap/core": "3.10.2",
|