@antscorp/antsomi-ui 1.3.6-beta.49 → 1.3.6-beta.50

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,4 +1,4 @@
1
- declare const Content: ({ apiKey, domain, portalId, token, action, ticketId, listUsers, domainTicket, config, ticketDetails, listComment, userId, refetchComments, isLoadingComment, isLoadingDetails, isLoadingDataSouce, accountManage, timeZone, isLoadingSelectedAccount, accountEdit, initOwnerId, isAllAccount, dataSelectInput, setDataSelectInput, }: {
1
+ declare const Content: ({ apiKey, domain, portalId, token, action, ticketId, listUsers, domainTicket, config, ticketDetails, listComment, userId, refetchComments, isLoadingComment, isLoadingDetails, isLoadingDataSouce, accountManage, timeZone, initOwnerId, isAllAccount, dataSelectInput, setDataSelectInput, }: {
2
2
  apiKey: any;
3
3
  domain: any;
4
4
  portalId: any;
@@ -17,8 +17,6 @@ declare const Content: ({ apiKey, domain, portalId, token, action, ticketId, lis
17
17
  isLoadingDataSouce: any;
18
18
  accountManage: any;
19
19
  timeZone: any;
20
- isLoadingSelectedAccount: any;
21
- accountEdit: any;
22
20
  initOwnerId: any;
23
21
  isAllAccount: any;
24
22
  dataSelectInput: any;
@@ -25,7 +25,7 @@ const initValueInput = {
25
25
  isChanged: false,
26
26
  referenceUrl: window.location.href,
27
27
  };
28
- const Content = ({ apiKey, domain, portalId, token, action, ticketId, listUsers, domainTicket, config, ticketDetails, listComment, userId, refetchComments, isLoadingComment, isLoadingDetails, isLoadingDataSouce, accountManage, timeZone, isLoadingSelectedAccount, accountEdit, initOwnerId, isAllAccount, dataSelectInput, setDataSelectInput, }) => {
28
+ const Content = ({ apiKey, domain, portalId, token, action, ticketId, listUsers, domainTicket, config, ticketDetails, listComment, userId, refetchComments, isLoadingComment, isLoadingDetails, isLoadingDataSouce, accountManage, timeZone, initOwnerId, isAllAccount, dataSelectInput, setDataSelectInput, }) => {
29
29
  const [isOpenToast, setIsOpenToast] = useState({
30
30
  isOpen: false,
31
31
  status: 'error',
@@ -71,14 +71,12 @@ const Content = ({ apiKey, domain, portalId, token, action, ticketId, listUsers,
71
71
  });
72
72
  });
73
73
  }
74
- if ((!isAllAccount || accountEdit !== 4) &&
75
- listUsers?.length > 0 &&
76
- (initOwnerId || userId)) {
74
+ if (!isAllAccount && listUsers?.length > 0 && (initOwnerId || userId)) {
77
75
  newOwnerIds = listUsers?.filter(user => user.userId === Number(initOwnerId || userId));
78
76
  }
79
77
  updateValueInput({ ownerId: newOwnerIds, followers: newFollowers });
80
78
  }
81
- }, [isUpdate, accountManage, listUsers, accountEdit]);
79
+ }, [isUpdate, accountManage, listUsers]);
82
80
  const browserTitle = useMemo(() => {
83
81
  if (valueInput.title && valueInput.title.trim()) {
84
82
  return valueInput.title;
@@ -102,7 +100,7 @@ const Content = ({ apiKey, domain, portalId, token, action, ticketId, listUsers,
102
100
  };
103
101
  const fetchUpdateComment = params => {
104
102
  Service.tickets.callApi
105
- .updateComment(params, domainTicket, token, config, userId, 'create-ticket-comment', ticketId)
103
+ .updateComment(params, domainTicket, token, config, userId, 'create-ticket-comment', ticketId, portalId)
106
104
  .then(res => {
107
105
  if (res.code === 200) {
108
106
  refetchComments();
@@ -118,7 +116,7 @@ const Content = ({ apiKey, domain, portalId, token, action, ticketId, listUsers,
118
116
  const fetchUpdateFollwers = params => {
119
117
  setIsLoadingFollower(true);
120
118
  Service.tickets.callApi
121
- .updateFollowers(params, domainTicket, token, config, userId, ticketId)
119
+ .updateFollowers(params, domainTicket, token, config, userId, ticketId, portalId)
122
120
  .then(res => {
123
121
  setIsLoadingFollower(false);
124
122
  })
@@ -247,11 +245,7 @@ const Content = ({ apiKey, domain, portalId, token, action, ticketId, listUsers,
247
245
  newListFile = newListFile.filter((list) => list?.token !== token);
248
246
  updateValueInput({ files: newListFile });
249
247
  };
250
- return (_jsxs("div", { style: { height: '100%' }, children: [_jsxs(Helmet, { children: [_jsx("meta", { charSet: "utf-8" }), _jsx("title", { children: browserTitle })] }), _jsx(Spin, { style: { height: '100vh' }, spinning: isLoading ||
251
- isLoadingDetails ||
252
- isLoadingDataSouce ||
253
- isLoadingFollower ||
254
- isLoadingSelectedAccount, children: _jsxs(WrapperContent, { style: { height: '100%' }, children: [_jsxs(WrapperLeftContent, { children: [_jsxs(WrapperContentInput, { style: { alignItems: 'flex-start' }, children: [_jsxs(WrapperLable, { children: ["Owner", _jsx("span", { style: { color: '#ff0000' }, children: "*" })] }), _jsxs("div", { children: [_jsx(SelectAccount, { type: "default", initData: (valueInput?.ownerId || []).map((item) => item.userId), nameKey: "userName", userIdKey: "userId", users: listUsers, isViewMode: isUpdate || !isAllAccount || accountEdit !== 4, onChange: (_, users) => updateValueInput({ ownerId: users }), onlyOne: true }), isEmptyField && !valueInput?.ownerId?.length && (_jsx("div", { className: "error-message", children: "*This field can't be empty" }))] })] }), _jsxs(WrapperContentInput, { style: { marginTop: '15px', alignItems: 'flex-start' }, children: [_jsx(WrapperLable, { children: "Follower(s)" }), _jsx(SelectAccount, { type: "default", initData: [
248
+ return (_jsxs("div", { style: { height: '100%' }, children: [_jsxs(Helmet, { children: [_jsx("meta", { charSet: "utf-8" }), _jsx("title", { children: browserTitle })] }), _jsx(Spin, { style: { height: '100vh' }, spinning: isLoading || isLoadingDetails || isLoadingDataSouce || isLoadingFollower, children: _jsxs(WrapperContent, { style: { height: '100%' }, children: [_jsxs(WrapperLeftContent, { children: [_jsxs(WrapperContentInput, { style: { alignItems: 'flex-start' }, children: [_jsxs(WrapperLable, { children: ["Owner", _jsx("span", { style: { color: '#ff0000' }, children: "*" })] }), _jsxs("div", { children: [_jsx(SelectAccount, { type: "default", initData: (valueInput?.ownerId || []).map((item) => item.userId), nameKey: "userName", userIdKey: "userId", users: listUsers, isViewMode: isUpdate || !isAllAccount, onChange: (_, users) => updateValueInput({ ownerId: users }), onlyOne: true }), isEmptyField && !valueInput?.ownerId?.length && (_jsx("div", { className: "error-message", children: "*This field can't be empty" }))] })] }), _jsxs(WrapperContentInput, { style: { marginTop: '15px', alignItems: 'flex-start' }, children: [_jsx(WrapperLable, { children: "Follower(s)" }), _jsx(SelectAccount, { type: "default", initData: [
255
249
  ...accountManage,
256
250
  ...(valueInput?.followers || []).map((item) => item.userId),
257
251
  ], nameKey: "userName", userIdKey: "userId", users: listUsers, disabledAccount: accountManage, onChange: (_, followers) => onChangeFollowers(followers) })] }), dataSelects?.map((data) => (_jsxs(WrapperContentInput, { style: { marginTop: '15px' }, children: [_jsx(WrapperLable, { children: data.title }), _jsx("div", { style: { flex: 1 }, children: isUpdate ? (_jsx(WrapperTextEdit, { children: !valueInput[data?.value]?.name?.length
@@ -28,10 +28,10 @@ declare const API: {
28
28
  messageAPI?: undefined;
29
29
  }>;
30
30
  getCustomFields: (params: any, domain: any, token: any, config: any, userId: any, type: any) => Promise<any>;
31
- getDetailsTicket: (params: any, domain: any, token: any, config: any, userId: any, ticketId: any, type?: string) => Promise<any>;
32
- getListComment: (params: any, domain: any, token: any, config: any, userId: any, type: any, ticketId: any) => Promise<any>;
33
- updateComment: (params: any, domain: any, token: any, config: any, userId: any, type: any, ticketId: any) => Promise<any>;
34
- updateFollowers: (params: any, domain: any, token: any, config: any, userId: any, ticketId: any) => Promise<any>;
31
+ getDetailsTicket: (params: any, domain: any, token: any, config: any, userId: any, ticketId: any, type: string | undefined, networkId: any) => Promise<any>;
32
+ getListComment: (params: any, domain: any, token: any, config: any, userId: any, type: any, ticketId: any, networkId: any) => Promise<any>;
33
+ updateComment: (params: any, domain: any, token: any, config: any, userId: any, type: any, ticketId: any, networkId: any) => Promise<any>;
34
+ updateFollowers: (params: any, domain: any, token: any, config: any, userId: any, ticketId: any, networkId: any) => Promise<any>;
35
35
  upload: (params: any, domain: any, token: any, config: any, userId: any, type: any) => Promise<any>;
36
36
  };
37
37
  };
@@ -11,28 +11,28 @@ const API = {
11
11
  },
12
12
  tickets: {
13
13
  callApi: {
14
- createTicket: (params, domain, token, config, userId) => callApiWithAuth(`api/ticket/index`, 'POST', { ...params }, domain, config, token, userId, true).then(res => {
14
+ createTicket: (params, domain, token, config, userId) => callApiWithAuth(`api/base/ticket/index`, 'POST', { ...params }, domain, config, token, userId, true).then(res => {
15
15
  const data = getEntriesV2(res, 0);
16
16
  // dataBackup[params.objectName] = data;
17
17
  return data;
18
18
  }),
19
- getCustomFields: (params, domain, token, config, userId, type) => callApiWithAuth(`api/ticket/index`, 'get', { ...params }, domain, config, token, userId, true, type).then(res =>
19
+ getCustomFields: (params, domain, token, config, userId, type) => callApiWithAuth(`api/base/ticket/index`, 'get', { ...params }, domain, config, token, userId, true, type).then(res =>
20
20
  // const data = getEntriesV2(res, 0);
21
21
  // dataBackup[params.objectName] = data;
22
22
  res.data),
23
- getDetailsTicket: (params, domain, token, config, userId, ticketId, type = '') => callApiWithAuth(`api/ticket/index/${ticketId}`, 'get', { ...params }, domain, config, token, userId, true, type).then(res =>
23
+ getDetailsTicket: (params, domain, token, config, userId, ticketId, type = '', networkId) => callApiWithAuth(`api/base/ticket/index/${ticketId}`, 'get', { ...params }, domain, config, token, userId, true, type, networkId).then(res =>
24
24
  // const data = getEntriesV2(res, 0);
25
25
  // dataBackup[params.objectName] = data;
26
26
  res.data),
27
- getListComment: (params, domain, token, config, userId, type, ticketId) => callApiWithAuth(`api/ticket/index/${ticketId}`, 'get', { ...params }, domain, config, token, userId, true, type).then(res =>
27
+ getListComment: (params, domain, token, config, userId, type, ticketId, networkId) => callApiWithAuth(`api/base/ticket/index/${ticketId}`, 'get', { ...params }, domain, config, token, userId, true, type, networkId).then(res =>
28
28
  // const data = getEntriesV2(res, 0);
29
29
  // dataBackup[params.objectName] = data;
30
30
  res.data),
31
- updateComment: (params, domain, token, config, userId, type, ticketId) => callApiWithAuth(`api/ticket/index/${ticketId}`, 'put', { ...params }, domain, config, token, userId, true, type).then(res =>
31
+ updateComment: (params, domain, token, config, userId, type, ticketId, networkId) => callApiWithAuth(`api/base/ticket/index/${ticketId}`, 'put', { ...params }, domain, config, token, userId, true, type, networkId).then(res =>
32
32
  // const data = getEntriesV2(res, 0);
33
33
  // dataBackup[params.objectName] = data;
34
34
  res.data),
35
- updateFollowers: (params, domain, token, config, userId, ticketId) => callApiWithAuth(`api/ticket/index/${ticketId}`, 'put', { ...params }, domain, config, token, userId, true).then(res =>
35
+ updateFollowers: (params, domain, token, config, userId, ticketId, networkId) => callApiWithAuth(`api/base/ticket/index/${ticketId}`, 'put', { ...params }, domain, config, token, userId, true, '', networkId).then(res =>
36
36
  // const data = getEntriesV2(res, 0);
37
37
  // dataBackup[params.objectName] = data;
38
38
  res.data),
@@ -44,14 +44,14 @@ const API = {
44
44
  },
45
45
  accounts: {
46
46
  callApi: {
47
- getAccountManage: (params, domain, token, config, userId, type) => callApiWithAuth(`api/network/index/${config.api_pid}`, 'GET', { ...params }, domain, config, token, userId, false, type, true).then(res => res.data),
47
+ getAccountManage: (params, domain, token, config, userId, type) => callApiWithAuth(`api/3rd/info?type=network-info&networkId=${config.api_pid}`, 'GET', { ...params }, domain, config, token, userId, false, type, undefined, true).then(res => res.data),
48
48
  },
49
49
  },
50
50
  permission: {
51
51
  callApi: {
52
52
  getList: (params, domain, token, config, userId, type, ownerId) =>
53
53
  // console.log({params, domain, token, config,userId, type})
54
- callApiWithAuth(`api/privilege/index`, 'GET', { ...params, ownerId }, domain, config, token, userId, false, type, false, true).then(res => res.data),
54
+ callApiWithAuth(`api/privilege/index`, 'GET', { ...params, ownerId }, domain, config, token, userId, false, type, undefined, false, true).then(res => res.data),
55
55
  },
56
56
  },
57
57
  };
@@ -12,9 +12,5 @@ export declare const TicketEditorV2: {
12
12
  domainTicket: string;
13
13
  ticketId: string;
14
14
  domainAccount: string;
15
- domainPermission: string;
16
- appCode: string;
17
- menuCode: string;
18
- fullParent: boolean;
19
15
  };
20
16
  };
@@ -3,7 +3,7 @@ import { useState } from 'react';
3
3
  import Content from './Content';
4
4
  import { Button, Modal } from '@antscorp/antsomi-ui/es/components/';
5
5
  import { WrapperModalHeader, TicketEditorWrapper } from './styled';
6
- import { useFetchAccountManage, useFetchAccountPermission, useGetDetailTicket, useGetListComments, useGetListUser, } from './queries';
6
+ import { useFetchAccountManage, useGetDetailTicket, useGetListComments, useGetListUser, } from './queries';
7
7
  const defaultProps = {
8
8
  apiKey: '',
9
9
  portalId: '',
@@ -16,26 +16,22 @@ const defaultProps = {
16
16
  domainTicket: '',
17
17
  ticketId: '',
18
18
  domainAccount: '',
19
- domainPermission: '',
20
- appCode: 'TICKET_MANAGEMENT',
21
- menuCode: 'TICKET',
22
- fullParent: false,
23
19
  };
24
20
  export const TicketEditorV2 = props => {
25
- const { apiKey, portalId, token, domain, action, config: propsConfig, userId, ownerId, domainTicket, ticketId, domainAccount, domainPermission, appCode, menuCode, fullParent, } = props;
21
+ const { apiKey, portalId, token, domain, action, config: propsConfig, userId, ownerId, domainTicket, ticketId, domainAccount, } = props;
26
22
  const { ticketDetails, isFetching: isFetchingDetails } = useGetDetailTicket({
27
23
  ticketId,
28
24
  domainTicket,
29
- token,
30
25
  config: propsConfig,
31
26
  userId,
27
+ networkId: portalId,
32
28
  });
33
29
  const { listComments, isFetchingComments, refetchComments } = useGetListComments({
34
30
  domainTicket,
35
- token,
36
31
  config: propsConfig,
37
32
  userId,
38
33
  ticketId,
34
+ networkId: portalId,
39
35
  enabled: !!ticketId || action !== 'create',
40
36
  });
41
37
  const { listUsers, isFetchingUsers } = useGetListUser({
@@ -44,21 +40,8 @@ export const TicketEditorV2 = props => {
44
40
  config: propsConfig,
45
41
  userId,
46
42
  });
47
- const { accountEdit, isLoadingSelectedAccount } = useFetchAccountPermission({
48
- params: {
49
- appCode,
50
- menuCode,
51
- fullParent,
52
- },
53
- domainPermission,
54
- token,
55
- config: propsConfig,
56
- userId,
57
- ownerId,
58
- });
59
43
  const { accountManage, timeZone, isLoadingAccountManage } = useFetchAccountManage({
60
44
  domainAccount,
61
- token,
62
45
  config: propsConfig,
63
46
  userId,
64
47
  });
@@ -69,7 +52,7 @@ export const TicketEditorV2 = props => {
69
52
  const handleConfirmModal = () => {
70
53
  setIsOpenModal(false);
71
54
  };
72
- return (_jsxs(TicketEditorWrapper, { children: [_jsx(Content, { apiKey: apiKey, portalId: portalId, token: token, domain: domain, action: action, listUsers: listUsers, domainTicket: domainTicket, config: config, ticketDetails: ticketDetails, listComment: listComments, ticketId: ticketId, userId: userId, refetchComments: refetchComments, isLoadingComment: isFetchingComments, isLoadingDetails: isFetchingDetails, isLoadingDataSouce: isFetchingUsers, accountManage: accountManage, timeZone: timeZone, isLoadingSelectedAccount: isLoadingSelectedAccount, accountEdit: accountEdit, initOwnerId: ownerId, isAllAccount: isAllAccount, dataSelectInput: dataSelectInput, setDataSelectInput: setDataSelectInput }), _jsx(Modal, { open: isOpenModal, onCancel: () => setIsOpenModal(false), className: "modal", children: _jsxs("div", { className: "wrapperBody", children: [_jsx(WrapperModalHeader, { children: "Confirm deletion of this ticket" }), _jsx("div", { className: "modalBody", children: _jsx("span", { style: { fontSize: '12px', color: '#000' }, children: "Once you confirm cancel, this ticket will NOT be saved." }) }), _jsxs("div", { className: "modalFooter", children: [_jsx(Button, { style: {
55
+ return (_jsxs(TicketEditorWrapper, { children: [_jsx(Content, { apiKey: apiKey, portalId: portalId, token: token, domain: domain, action: action, listUsers: listUsers, domainTicket: domainTicket, config: config, ticketDetails: ticketDetails, listComment: listComments, ticketId: ticketId, userId: userId, refetchComments: refetchComments, isLoadingComment: isFetchingComments, isLoadingDetails: isFetchingDetails, isLoadingDataSouce: isFetchingUsers, accountManage: accountManage, timeZone: timeZone, initOwnerId: ownerId, isAllAccount: isAllAccount, dataSelectInput: dataSelectInput, setDataSelectInput: setDataSelectInput }), _jsx(Modal, { open: isOpenModal, onCancel: () => setIsOpenModal(false), className: "modal", children: _jsxs("div", { className: "wrapperBody", children: [_jsx(WrapperModalHeader, { children: "Confirm deletion of this ticket" }), _jsx("div", { className: "modalBody", children: _jsx("span", { style: { fontSize: '12px', color: '#000' }, children: "Once you confirm cancel, this ticket will NOT be saved." }) }), _jsxs("div", { className: "modalFooter", children: [_jsx(Button, { style: {
73
56
  height: '28px',
74
57
  background: '#1f5fac',
75
58
  color: '#fff',
@@ -1,10 +1,9 @@
1
1
  type Props = {
2
2
  domainAccount: string;
3
- token: string;
4
3
  config: string;
5
4
  userId: string;
6
5
  };
7
- export declare const useFetchAccountManage: ({ domainAccount, token, config, userId }: Props) => {
6
+ export declare const useFetchAccountManage: ({ domainAccount, config, userId }: Props) => {
8
7
  accountManage: any;
9
8
  timeZone: any;
10
9
  isLoadingAccountManage: boolean;
@@ -1,8 +1,8 @@
1
1
  import { useQuery } from '@tanstack/react-query';
2
2
  import { QUERY_KEYS } from '../constants';
3
3
  import Service from '../Service';
4
- const generateQueryFn = async (domainAccount, token, config, userId) => {
5
- const response = await Service.accounts.callApi.getAccountManage({}, domainAccount, token, config, userId, 'account');
4
+ const generateQueryFn = async (domainAccount, config, userId) => {
5
+ const response = await Service.accounts.callApi.getAccountManage({}, domainAccount, '', config, userId, 'account');
6
6
  if (response?.code === 200) {
7
7
  const listIds = response?.data?.infoNetwork?.accountManager?.map(item => item.user_id);
8
8
  return {
@@ -15,10 +15,10 @@ const generateQueryFn = async (domainAccount, token, config, userId) => {
15
15
  timeZone: '',
16
16
  };
17
17
  };
18
- export const useFetchAccountManage = ({ domainAccount, token, config, userId }) => {
18
+ export const useFetchAccountManage = ({ domainAccount, config, userId }) => {
19
19
  const { data, isFetching } = useQuery({
20
- queryKey: [QUERY_KEYS.GET_ACCOUNT_MANAGE, domainAccount, token, config, userId],
21
- queryFn: () => generateQueryFn(domainAccount, token, config, userId),
20
+ queryKey: [QUERY_KEYS.GET_ACCOUNT_MANAGE, domainAccount, config, userId],
21
+ queryFn: () => generateQueryFn(domainAccount, config, userId),
22
22
  });
23
23
  return {
24
24
  accountManage: data?.listIds || [],
@@ -1,11 +1,11 @@
1
1
  type Props = {
2
2
  domainTicket: string;
3
- token: string;
4
3
  config: any;
5
4
  userId: string;
6
5
  ticketId: string;
6
+ networkId: string;
7
7
  };
8
- export declare const useGetDetailTicket: ({ domainTicket, token, config, userId, ticketId }: Props) => {
8
+ export declare const useGetDetailTicket: ({ domainTicket, config, userId, ticketId, networkId, }: Props) => {
9
9
  ticketDetails: any;
10
10
  isFetching: boolean;
11
11
  };
@@ -1,11 +1,11 @@
1
1
  import { useQuery } from '@tanstack/react-query';
2
2
  import { QUERY_KEYS } from '../constants/queryKeys';
3
3
  import Service from '../Service';
4
- export const useGetDetailTicket = ({ domainTicket, token, config, userId, ticketId }) => {
4
+ export const useGetDetailTicket = ({ domainTicket, config, userId, ticketId, networkId, }) => {
5
5
  const { data, isFetching } = useQuery({
6
- queryKey: [QUERY_KEYS.GET_TICKET_DETAIL, domainTicket, token, config, userId, ticketId],
6
+ queryKey: [QUERY_KEYS.GET_TICKET_DETAIL, domainTicket, config, userId, ticketId, networkId],
7
7
  enabled: !!ticketId,
8
- queryFn: () => Service.tickets.callApi.getDetailsTicket({}, domainTicket, token, config, userId, ticketId),
8
+ queryFn: () => Service.tickets.callApi.getDetailsTicket({}, domainTicket, undefined, config, userId, ticketId, '', networkId),
9
9
  });
10
10
  return {
11
11
  ticketDetails: data?.data?.ticket || [],
@@ -1,12 +1,12 @@
1
1
  type Props = {
2
2
  domainTicket: string;
3
- token: string;
4
3
  config: any;
5
4
  userId: string;
6
5
  ticketId: string;
6
+ networkId: string;
7
7
  enabled?: boolean;
8
8
  };
9
- export declare const useGetListComments: ({ domainTicket, token, config, userId, ticketId, enabled, }: Props) => {
9
+ export declare const useGetListComments: ({ domainTicket, config, userId, ticketId, enabled, networkId, }: Props) => {
10
10
  listComments: any;
11
11
  isFetchingComments: boolean;
12
12
  refetchComments: <TPageData>(options?: (import("@tanstack/react-query").RefetchOptions & import("@tanstack/react-query").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/react-query").QueryObserverResult<any, unknown>>;
@@ -1,15 +1,15 @@
1
1
  import { useQuery } from '@tanstack/react-query';
2
2
  import { QUERY_KEYS } from '../constants/queryKeys';
3
3
  import Service from '../Service';
4
- const getListCommentServices = async (params, domain, token, config, userId, type, ticketId) => {
5
- const res = await Service.tickets.callApi.getListComment(params, domain, token, config, userId, type, ticketId);
4
+ const getListCommentServices = async (params, domain, config, userId, type, ticketId, networkId) => {
5
+ const res = await Service.tickets.callApi.getListComment(params, domain, undefined, config, userId, type, ticketId, networkId);
6
6
  return res.data;
7
7
  };
8
- export const useGetListComments = ({ domainTicket, token, config, userId, ticketId, enabled, }) => {
8
+ export const useGetListComments = ({ domainTicket, config, userId, ticketId, enabled, networkId, }) => {
9
9
  const { data, isFetching, refetch } = useQuery({
10
- queryKey: [QUERY_KEYS.GET_TICKET_COMMENT, domainTicket, token, config, userId, ticketId],
10
+ queryKey: [QUERY_KEYS.GET_TICKET_COMMENT, domainTicket, config, userId, ticketId, networkId],
11
11
  enabled: !!ticketId || enabled,
12
- queryFn: () => getListCommentServices({}, domainTicket, token, config, userId, 'get-ticket-comments', ticketId),
12
+ queryFn: () => getListCommentServices({}, domainTicket, config, userId, 'get-ticket-comments', ticketId, networkId),
13
13
  });
14
14
  return {
15
15
  listComments: data || [],
@@ -33,6 +33,7 @@ export const WrapperLeftContent = styled.div `
33
33
  `;
34
34
  export const WrapperRightContent = styled.div `
35
35
  flex: 2;
36
+ width: 100%;
36
37
  ::-webkit-scrollbar {
37
38
  width: 8px;
38
39
  height: 8px;
@@ -566,6 +567,10 @@ export const WrapperContentAvatar = styled.div `
566
567
  .comment-content {
567
568
  font-size: 12px;
568
569
  color: #333;
570
+
571
+ img {
572
+ width: 100%;
573
+ }
569
574
  }
570
575
  `;
571
576
  export const WrapperMessageContent = styled.div `
@@ -1,7 +1,7 @@
1
1
  export declare function getObjectPropSafely(fn: any, defaultValue?: string): any;
2
2
  export declare function isNumeric(num: any): boolean;
3
3
  export declare function getUserLocaleLanguage(config: any): any;
4
- export declare function callApiWithAuth(endpoint: any, method: string | undefined, body: any, domain?: string, config?: {}, token?: string, userId?: string, isTicket?: boolean, type?: string, isAccount?: boolean, isPermission?: boolean, others?: {}): Promise<import("axios").AxiosResponse<any, any>>;
4
+ export declare function callApiWithAuth(endpoint: any, method: string | undefined, body: any, domain?: string, config?: {}, token?: string, userId?: string, isTicket?: boolean, type?: string, networkId?: undefined, isAccount?: boolean, isPermission?: boolean, others?: {}): Promise<import("axios").AxiosResponse<any, any>>;
5
5
  export declare function isUrlEmbedded(): boolean;
6
6
  export declare const safeParse: (val: any, defaultVal: any) => any;
7
7
  export declare const safeParseInt: (val: any, defaultVal: any) => any;
@@ -19,7 +19,7 @@ export function isNumeric(num) {
19
19
  export function getUserLocaleLanguage(config) {
20
20
  return safeParse(getWindowParam(PORTAL_KEYS.USER_LANGUAGE, config), 'en');
21
21
  }
22
- export function callApiWithAuth(endpoint, method = 'GET', body, domain = '', config = {}, token = '', userId = '', isTicket = false, type = '', isAccount = false, isPermission = false, others = {}) {
22
+ export function callApiWithAuth(endpoint, method = 'GET', body, domain = '', config = {}, token = '', userId = '', isTicket = false, type = '', networkId = undefined, isAccount = false, isPermission = false, others = {}) {
23
23
  const apiPid = getPortalId(config);
24
24
  const apiToken = token;
25
25
  // const _user_id = userId;
@@ -36,6 +36,9 @@ export function callApiWithAuth(endpoint, method = 'GET', body, domain = '', con
36
36
  params.type = type;
37
37
  // endpoint += `&type=${type}`
38
38
  }
39
+ if (networkId) {
40
+ params.networkId = networkId;
41
+ }
39
42
  return axios({
40
43
  method,
41
44
  url: `${domain}/${endpoint}`,
@@ -404,5 +407,7 @@ export const postCustomEvent = (type, data) => {
404
407
  // data,
405
408
  }));
406
409
  }
407
- catch (error) { }
410
+ catch (error) {
411
+ console.log(error);
412
+ }
408
413
  };
@@ -103,6 +103,8 @@ THEME.components = {
103
103
  colorTextDisabled: THEME.token?.bw0,
104
104
  textHoverBg: '#F2F9FF',
105
105
  marginXS: 0,
106
+ primaryShadow: 'none',
107
+ dangerShadow: 'none',
106
108
  /* Text type */
107
109
  colorBgTextHover: THEME.token?.blue,
108
110
  colorBgTextActive: THEME.token?.blue1_1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.6-beta.49",
3
+ "version": "1.3.6-beta.50",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",