@antscorp/antsomi-ui 1.3.5-beta.566 → 1.3.5-beta.568

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.
@@ -40,7 +40,7 @@ export const IconGallery = () => {
40
40
  React.createElement("h4", null, "These components below are invalid (check name and file name is correct?)"),
41
41
  invalidIcons.map(item => (React.createElement("strong", { key: item.name, style: { color: 'red' } },
42
42
  React.createElement("pre", null, item.name)))))) : null,
43
- React.createElement(Input, { placeholder: "Search Icon", value: search, onChange: e => setSearch(e.target.value), style: { fontSize: '20px' } }),
43
+ React.createElement(Input, { placeholder: "Search Icon", value: search, onChange: e => setSearch(e.target.value), style: { fontSize: '16px' } }),
44
44
  React.createElement(Flex, { className: "grid-container", gap: 16 }, validIcons
45
45
  .filter(item => searchMatchAny([item.name, ...item.dataSearch], debounceSearchValue))
46
46
  .map(item => {
@@ -7,7 +7,6 @@ export { AdjustIcon } from './AdjustIcon';
7
7
  export { AllDevicesIcon } from './AllDevicesIcon';
8
8
  export { AllJourneyChannelsIcon } from './AllJourneyChannelsIcon';
9
9
  export { ArrowGrowIcon } from './ArrowGrowIcon';
10
- export { ArrowIcon } from './ArrowIcon';
11
10
  export { ArrowLineIcon } from './ArrowLineIcon';
12
11
  export { AssignmentIndIcon } from './AssignmentIndIcon';
13
12
  export { AttachmentIcon } from './AttachmentIcon';
@@ -33,17 +32,16 @@ export { ChatBubbleOutlineIcon } from './ChatBubbleOutlineIcon';
33
32
  export { ChatConversationCommentAddCommentIcon } from './ChatConversationCommentAddCommentIcon';
34
33
  export { ChatMentionIcon } from './ChatMentionIcon';
35
34
  export { ChatUnreadIcon } from './ChatUnreadIcon';
36
- export { CheckSlimIcon } from './CheckSlimIcon';
37
35
  export { CheckboxChecked5RadiusIcon } from './CheckboxChecked5RadiusIcon';
38
36
  export { CheckboxCheckedIcon } from './CheckboxCheckedIcon';
39
37
  export { CheckboxIndeterminate5RadiusIcon } from './CheckboxIndeterminate5RadiusIcon';
40
38
  export { CheckboxIndeterminateIcon } from './CheckboxIndeterminateIcon';
41
39
  export { CheckboxUnchecked5RadiusIcon } from './CheckboxUnchecked5RadiusIcon';
42
40
  export { CheckboxUncheckedIcon } from './CheckboxUncheckedIcon';
41
+ export { CheckSlimIcon } from './CheckSlimIcon';
43
42
  export { CircleAddElementIcon } from './CircleAddElementIcon';
44
43
  export { CircleNotificationsIcon } from './CircleNotificationsIcon';
45
44
  export { CloseIcon } from './CloseIcon';
46
- export { CloseRemoveIcon } from './CloseRemoveIcon';
47
45
  export { CodeIcon } from './CodeIcon';
48
46
  export { ColorProfileStyleThemeIcon } from './ColorProfileStyleThemeIcon';
49
47
  export { ColumnIcon } from './ColumnIcon';
@@ -62,7 +60,6 @@ export { CurvedConnectorIcon } from './CurvedConnectorIcon';
62
60
  export { DashboardIcon } from './DashboardIcon';
63
61
  export { DataIcon } from './DataIcon';
64
62
  export { DataRefreshIcon } from './DataRefreshIcon';
65
- export { DataVer2Icon } from './DataVer2Icon';
66
63
  export { DeleteRemoveTrashIcon } from './DeleteRemoveTrashIcon';
67
64
  export { DeliveryLogIcon } from './DeliveryLogIcon';
68
65
  export { DesktopLaptopIcon } from './DesktopLaptopIcon';
@@ -103,9 +100,9 @@ export { ForecastIcon } from './ForecastIcon';
103
100
  export { ForwardIcon } from './ForwardIcon';
104
101
  export { FreeDrawIcon } from './FreeDrawIcon';
105
102
  export { FullReviewIcon } from './FullReviewIcon';
106
- export { GPTIcon } from './GPTIcon';
107
103
  export { GenerateAutoWizardIcon } from './GenerateAutoWizardIcon';
108
104
  export { GetInsightIcon } from './GetInsightIcon';
105
+ export { GPTIcon } from './GPTIcon';
109
106
  export { GridViewIcon } from './GridViewIcon';
110
107
  export { GroupIcon } from './GroupIcon';
111
108
  export { GroupLayerIcon } from './GroupLayerIcon';
@@ -132,7 +129,6 @@ export { LineIcon } from './LineIcon';
132
129
  export { ListIcon } from './ListIcon';
133
130
  export { LoadingIcon } from './LoadingIcon';
134
131
  export { LocalMallIcon } from './LocalMallIcon';
135
- export { LockRestrictIcon } from './LockRestrictIcon';
136
132
  export { MapIcon } from './MapIcon';
137
133
  export { MarkAsReadIcon } from './MarkAsReadIcon';
138
134
  export { MediaGalleryIcon } from './MediaGalleryIcon';
@@ -145,13 +141,12 @@ export { MobileFriendlyIcon } from './MobileFriendlyIcon';
145
141
  export { MobilePhoneIcon } from './MobilePhoneIcon';
146
142
  export { MoreIcon } from './MoreIcon';
147
143
  export { MoreInfoIcon } from './MoreInfoIcon';
148
- export { MoveTo1Icon } from './MoveTo1Icon';
149
144
  export { MoveToIcon } from './MoveToIcon';
150
145
  export { MuteIcon } from './MuteIcon';
151
146
  export { NodeViewIcon } from './NodeViewIcon';
152
147
  export { NotificationIcon } from './NotificationIcon';
153
- export { NotificationSettingIcon } from './NotificationSettingIcon';
154
148
  export { NotificationsActiveIcon } from './NotificationsActiveIcon';
149
+ export { NotificationSettingIcon } from './NotificationSettingIcon';
155
150
  export { OpenNewTabIcon } from './OpenNewTabIcon';
156
151
  export { OpenUrlIcon } from './OpenUrlIcon';
157
152
  export { PageArticleIcon } from './PageArticleIcon';
@@ -236,8 +231,7 @@ export { ViewDetailsInformationIcon } from './ViewDetailsInformationIcon';
236
231
  export { VisibilityOffEyeIcon } from './VisibilityOffEyeIcon';
237
232
  export { WarningIcon } from './WarningIcon';
238
233
  export { WebAssetIcon } from './WebAssetIcon';
239
- export { WebIcon } from './WebIcon';
240
- export { WebPagesBrowserIcon } from './WebPagesBrowserIcon';
241
234
  export { WebhookIcon } from './WebhookIcon';
235
+ export { WebIcon } from './WebIcon';
242
236
  export { WidgetIcon } from './WidgetIcon';
243
237
  export { WritingAIAssitantIcon } from './WritingAIAssitantIcon';
@@ -7,7 +7,6 @@ export { AdjustIcon } from './AdjustIcon';
7
7
  export { AllDevicesIcon } from './AllDevicesIcon';
8
8
  export { AllJourneyChannelsIcon } from './AllJourneyChannelsIcon';
9
9
  export { ArrowGrowIcon } from './ArrowGrowIcon';
10
- export { ArrowIcon } from './ArrowIcon';
11
10
  export { ArrowLineIcon } from './ArrowLineIcon';
12
11
  export { AssignmentIndIcon } from './AssignmentIndIcon';
13
12
  export { AttachmentIcon } from './AttachmentIcon';
@@ -33,17 +32,16 @@ export { ChatBubbleOutlineIcon } from './ChatBubbleOutlineIcon';
33
32
  export { ChatConversationCommentAddCommentIcon } from './ChatConversationCommentAddCommentIcon';
34
33
  export { ChatMentionIcon } from './ChatMentionIcon';
35
34
  export { ChatUnreadIcon } from './ChatUnreadIcon';
36
- export { CheckSlimIcon } from './CheckSlimIcon';
37
35
  export { CheckboxChecked5RadiusIcon } from './CheckboxChecked5RadiusIcon';
38
36
  export { CheckboxCheckedIcon } from './CheckboxCheckedIcon';
39
37
  export { CheckboxIndeterminate5RadiusIcon } from './CheckboxIndeterminate5RadiusIcon';
40
38
  export { CheckboxIndeterminateIcon } from './CheckboxIndeterminateIcon';
41
39
  export { CheckboxUnchecked5RadiusIcon } from './CheckboxUnchecked5RadiusIcon';
42
40
  export { CheckboxUncheckedIcon } from './CheckboxUncheckedIcon';
41
+ export { CheckSlimIcon } from './CheckSlimIcon';
43
42
  export { CircleAddElementIcon } from './CircleAddElementIcon';
44
43
  export { CircleNotificationsIcon } from './CircleNotificationsIcon';
45
44
  export { CloseIcon } from './CloseIcon';
46
- export { CloseRemoveIcon } from './CloseRemoveIcon';
47
45
  export { CodeIcon } from './CodeIcon';
48
46
  export { ColorProfileStyleThemeIcon } from './ColorProfileStyleThemeIcon';
49
47
  export { ColumnIcon } from './ColumnIcon';
@@ -62,7 +60,6 @@ export { CurvedConnectorIcon } from './CurvedConnectorIcon';
62
60
  export { DashboardIcon } from './DashboardIcon';
63
61
  export { DataIcon } from './DataIcon';
64
62
  export { DataRefreshIcon } from './DataRefreshIcon';
65
- export { DataVer2Icon } from './DataVer2Icon';
66
63
  export { DeleteRemoveTrashIcon } from './DeleteRemoveTrashIcon';
67
64
  export { DeliveryLogIcon } from './DeliveryLogIcon';
68
65
  export { DesktopLaptopIcon } from './DesktopLaptopIcon';
@@ -103,9 +100,9 @@ export { ForecastIcon } from './ForecastIcon';
103
100
  export { ForwardIcon } from './ForwardIcon';
104
101
  export { FreeDrawIcon } from './FreeDrawIcon';
105
102
  export { FullReviewIcon } from './FullReviewIcon';
106
- export { GPTIcon } from './GPTIcon';
107
103
  export { GenerateAutoWizardIcon } from './GenerateAutoWizardIcon';
108
104
  export { GetInsightIcon } from './GetInsightIcon';
105
+ export { GPTIcon } from './GPTIcon';
109
106
  export { GridViewIcon } from './GridViewIcon';
110
107
  export { GroupIcon } from './GroupIcon';
111
108
  export { GroupLayerIcon } from './GroupLayerIcon';
@@ -132,7 +129,6 @@ export { LineIcon } from './LineIcon';
132
129
  export { ListIcon } from './ListIcon';
133
130
  export { LoadingIcon } from './LoadingIcon';
134
131
  export { LocalMallIcon } from './LocalMallIcon';
135
- export { LockRestrictIcon } from './LockRestrictIcon';
136
132
  export { MapIcon } from './MapIcon';
137
133
  export { MarkAsReadIcon } from './MarkAsReadIcon';
138
134
  export { MediaGalleryIcon } from './MediaGalleryIcon';
@@ -145,13 +141,12 @@ export { MobileFriendlyIcon } from './MobileFriendlyIcon';
145
141
  export { MobilePhoneIcon } from './MobilePhoneIcon';
146
142
  export { MoreIcon } from './MoreIcon';
147
143
  export { MoreInfoIcon } from './MoreInfoIcon';
148
- export { MoveTo1Icon } from './MoveTo1Icon';
149
144
  export { MoveToIcon } from './MoveToIcon';
150
145
  export { MuteIcon } from './MuteIcon';
151
146
  export { NodeViewIcon } from './NodeViewIcon';
152
147
  export { NotificationIcon } from './NotificationIcon';
153
- export { NotificationSettingIcon } from './NotificationSettingIcon';
154
148
  export { NotificationsActiveIcon } from './NotificationsActiveIcon';
149
+ export { NotificationSettingIcon } from './NotificationSettingIcon';
155
150
  export { OpenNewTabIcon } from './OpenNewTabIcon';
156
151
  export { OpenUrlIcon } from './OpenUrlIcon';
157
152
  export { PageArticleIcon } from './PageArticleIcon';
@@ -236,8 +231,7 @@ export { ViewDetailsInformationIcon } from './ViewDetailsInformationIcon';
236
231
  export { VisibilityOffEyeIcon } from './VisibilityOffEyeIcon';
237
232
  export { WarningIcon } from './WarningIcon';
238
233
  export { WebAssetIcon } from './WebAssetIcon';
239
- export { WebIcon } from './WebIcon';
240
- export { WebPagesBrowserIcon } from './WebPagesBrowserIcon';
241
234
  export { WebhookIcon } from './WebhookIcon';
235
+ export { WebIcon } from './WebIcon';
242
236
  export { WidgetIcon } from './WidgetIcon';
243
237
  export { WritingAIAssitantIcon } from './WritingAIAssitantIcon';
@@ -15,9 +15,10 @@ export interface DrawerDetailProps extends Omit<DrawerProps, 'closeIcon' | 'titl
15
15
  export interface DrawerDetailCloseIconProps extends React.HtmlHTMLAttributes<HTMLDivElement> {
16
16
  show?: boolean;
17
17
  }
18
- export interface DrawerHeaderProps extends FlexProps {
18
+ export interface DrawerHeaderProps extends Omit<FlexProps, 'children'> {
19
19
  height?: React.CSSProperties['height'];
20
20
  showBorderBottom?: boolean;
21
+ children?: ReactNode;
21
22
  }
22
23
  export interface DrawerDetailMenuProps extends Omit<AntdProps, 'onClick'> {
23
24
  show?: boolean;
@@ -93,7 +93,7 @@ export const SearchUser = (props) => {
93
93
  label: (React.createElement(StyledSelectItem, { onClick: () => handleAddUser(user) },
94
94
  React.createElement(Avatar, { src: user.avatar }),
95
95
  React.createElement("div", { className: "info" },
96
- React.createElement("div", { className: "name" }, user.user_name),
96
+ React.createElement("div", { className: "name" }, user.full_name),
97
97
  React.createElement("div", { className: "email" }, user.email)))),
98
98
  })) },
99
99
  React.createElement(Input, { style: { padding: '5px' }, placeholder: placeholder, suffix: isFetching ? (React.createElement(Spin, { indicatorSize: 20, style: { paddingLeft: '5px', marginLeft: '10px', alignSelf: 'center' } })) : (
@@ -9,8 +9,9 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import React, { useEffect, useRef, useState } from 'react';
12
+ import React, { useMemo, useEffect, useRef, useState } from 'react';
13
13
  import { Editor } from '@tinymce/tinymce-react';
14
+ import { Helmet } from 'react-helmet';
14
15
  import dayjs from 'dayjs';
15
16
  import DropdownComponent from './components/DropdownComponent';
16
17
  import MessageComponent from './components/MessageComponent';
@@ -20,6 +21,7 @@ import { MESSAGE_TYPE, TICKET_CUSTOM_MESSAGE_KEY } from './constant';
20
21
  import { WrapperContent, WrapperContentInput, WrapperEditor, WrapperIconEditor, WrapperInputFile, WrapperLable, WrapperLeftContent, WrapperLinkItemFiles, WrapperMessageContent, WrapperRightContent, WrapperTextEdit, WrapperTextInput, DrawerHeader, } from './styled';
21
22
  import { formatAccountId, formatDatarender, formatParams, handleValidateContent, postCustomEvent, } from './util';
22
23
  const initValueInput = {
24
+ originTitle: 'Create new ticket',
23
25
  title: '',
24
26
  feature: {},
25
27
  ticketType: {},
@@ -121,8 +123,8 @@ const Content = ({ apiKey, domain, portalId, token, action, ticketId, listUsers,
121
123
  // handleSendData(valueInput)
122
124
  }
123
125
  };
124
- const handleOnchangeTitle = e => {
125
- const { value: title } = e.target;
126
+ const handleOnchangeTitle = title => {
127
+ // const { value: title } = e.target;
126
128
  updateValueInput({
127
129
  title,
128
130
  });
@@ -132,11 +134,26 @@ const Content = ({ apiKey, domain, portalId, token, action, ticketId, listUsers,
132
134
  setValueInput(initValueInput);
133
135
  }
134
136
  }, [openDrawer]);
135
- useEffect(() => {
136
- setDrawerHeader(React.createElement(DrawerHeader, null,
137
- !!valueInput.title && (React.createElement(EditableName, { defaultValue: valueInput.title, onBlur: handleOnchangeTitle, readonly: isUpdate })),
138
- React.createElement("div", { id: "header-journey-right", className: "right-content" }, !isUpdate && (React.createElement(Button, { type: "primary", onClick: handleSubmit }, "Save")))));
139
- }, [valueInput && valueInput.title, isUpdate]);
137
+ // useEffect(() => {
138
+ // setDrawerHeader(
139
+ // <DrawerHeader>
140
+ // {!!valueInput.title && (
141
+ // <EditableName
142
+ // defaultValue={valueInput.title}
143
+ // onBlur={handleOnchangeTitle}
144
+ // readonly={isUpdate}
145
+ // />
146
+ // )}
147
+ // <div id="header-journey-right" className="right-content">
148
+ // {!isUpdate && (
149
+ // <Button type="primary" onClick={handleSubmit}>
150
+ // Save
151
+ // </Button>
152
+ // )}
153
+ // </div>
154
+ // </DrawerHeader>,
155
+ // );
156
+ // }, [valueInput && valueInput.title, isUpdate]);
140
157
  useEffect(() => {
141
158
  if (!isUpdate) {
142
159
  const newFollowers = [];
@@ -158,6 +175,12 @@ const Content = ({ apiKey, domain, portalId, token, action, ticketId, listUsers,
158
175
  updateValueInput({ ownerId: newOwnerIds, followers: newFollowers });
159
176
  }
160
177
  }, [isUpdate, accountManage, listUsers, accountEdit]);
178
+ const browserTitle = useMemo(() => {
179
+ if (valueInput.title && valueInput.title.trim()) {
180
+ return valueInput.title;
181
+ }
182
+ return valueInput.originTitle;
183
+ }, [valueInput.title, valueInput.originTitle]);
161
184
  const getCustomFields = () => {
162
185
  if (dataSelects && dataSelects.length)
163
186
  return;
@@ -223,6 +246,7 @@ const Content = ({ apiKey, domain, portalId, token, action, ticketId, listUsers,
223
246
  ticketType,
224
247
  title,
225
248
  referenceUrl,
249
+ originTitle: title,
226
250
  });
227
251
  }
228
252
  }
@@ -334,11 +358,19 @@ const Content = ({ apiKey, domain, portalId, token, action, ticketId, listUsers,
334
358
  setIsOpenToast(Object.assign(Object.assign({}, isOpenToast), { isOpen: false }));
335
359
  };
336
360
  return (React.createElement("div", { style: { height: '100%' } },
361
+ React.createElement(Helmet, null,
362
+ React.createElement("meta", { charSet: "utf-8" }),
363
+ React.createElement("title", null, browserTitle)),
337
364
  React.createElement(Spin, { style: { height: '100vh' }, spinning: isLoading ||
338
365
  isLoadingDetails ||
339
366
  isLoadingDataSouce ||
340
367
  isLoadingFollower ||
341
368
  isLoadingSelectedAccount },
369
+ React.createElement(DrawerHeader, null,
370
+ React.createElement(EditableName, { value: valueInput.title, onChange: handleOnchangeTitle, readonly: isUpdate, error: isEmptyField && (!valueInput.title || !valueInput.title.trim())
371
+ ? "Title can't be empty"
372
+ : '' }),
373
+ React.createElement("div", { id: "header-journey-right", className: "right-content" }, !isUpdate && (React.createElement(Button, { type: "primary", onClick: handleSubmit }, "Save")))),
342
374
  React.createElement(WrapperContent, { style: { height: '100%' } },
343
375
  React.createElement(WrapperLeftContent, null,
344
376
  React.createElement(WrapperContentInput, { style: { alignItems: 'flex-start' } },
@@ -3,7 +3,7 @@ import Content from './Content';
3
3
  import Service from './Service';
4
4
  import TicketIcon from './components/icons/TicketIcon';
5
5
  import AddTicketIcon from './components/icons/AddTicketIcon';
6
- import { Button, Modal, Popover, Typography, DrawerDetail, message, } from '@antscorp/antsomi-ui/es/components/';
6
+ import { Button, Modal, Popover, Typography, DrawerDetail, message, Icon, } from '@antscorp/antsomi-ui/es/components/';
7
7
  import { WrapperModalHeader, TicketButton, TicketEditorWrapper } from './styled';
8
8
  // import Message from './components/Message';
9
9
  const defaultProps = {
@@ -236,8 +236,17 @@ export const TicketEditor = props => {
236
236
  React.createElement(Popover, { open: isOpenPopover, className: "popoverBody" },
237
237
  React.createElement(Typography, { className: "popoverItem", onClick: () => handleSelectPopover('DRAWER') }, "Create ticket"),
238
238
  React.createElement(Typography, { className: "popoverItem", onClick: () => handleSelectPopover('CHAT') }, "Chat with us")))),
239
- React.createElement(DrawerDetail, { open: openDrawer, onClose: () => handleClose(true, false), headerProps: {
240
- children: drawerHeader,
239
+ React.createElement(DrawerDetail, { open: openDrawer, onClose: () => handleClose(true, false), menuProps: {
240
+ items: [
241
+ {
242
+ icon: React.createElement(Icon, { type: "icon-ants-pencil" }),
243
+ label: 'Settings',
244
+ key: 'settings',
245
+ },
246
+ ],
247
+ selectedKeys: ['settings'],
248
+ }, headerProps: {
249
+ // children: drawerHeader,
241
250
  showBorderBottom: true,
242
251
  }, name: "ticket-editor-drawer" }, openDrawer && (React.createElement(Content, { apiKey: apiKey, portalId: portalId, token: token, domain: domain, action: action, listUsers: listUsers, domainTicket: domainTicket, config: config, ticketDetails: ticketDetails, listComment: listComment, ticketId: ticketId, userId: userId, fetchgetTicketComments: fetchgetTicketComments, isLoadingComment: isLoadingComment, isLoadingDetails: isLoadingDetails, isLoadingDataSouce: isLoadingDataSouce, handleCloseDrawer: handleCloseDrawer, setIsSuccessCreated: setIsSuccessCreated, accountManage: accountManage, timeZone: timeZone, isLoadingSelectedAccount: isLoadingSelectedAccount, accountEdit: accountEdit, initOwnerId: ownerId, isAllAccount: isAllAccount, setDrawerHeader: setDrawerHeader, openDrawer: openDrawer, dataSelectInput: dataSelectInput, setDataSelectInput: setDataSelectInput }))),
243
252
  React.createElement(Modal, { open: isOpenModal, onCancel: () => setIsOpenModal(false), className: "modal" },
@@ -781,17 +781,64 @@ export const TicketEditorWrapper = styled.div `
781
781
  }
782
782
  }
783
783
  `;
784
+ // export const DrawerHeader = styled.div`
785
+ // background: #ffffff;
786
+ // display: flex;
787
+ // align-items: center;
788
+ // justify-content: space-between;
789
+ // width: 100%;
790
+ // .left-content {
791
+ // display: flex;
792
+ // align-items: center;
793
+ // gap: 15px;
794
+ // }
795
+ // .right-content {
796
+ // display: flex;
797
+ // align-items: center;
798
+ // gap: 15px;
799
+ // .header-info-drawer {
800
+ // display: flex;
801
+ // flex-direction: column;
802
+ // gap: 5px;
803
+ // padding: 4.5px 0;
804
+ // > div {
805
+ // display: flex;
806
+ // align-items: center;
807
+ // gap: 10px;
808
+ // justify-content: end;
809
+ // }
810
+ // p {
811
+ // margin: 0;
812
+ // }
813
+ // }
814
+ // }
815
+ // `;
784
816
  export const DrawerHeader = styled.div `
785
- background: #ffffff;
817
+ position: sticky;
818
+ top: 0px;
819
+ height: 50px;
820
+ padding: 0px 15px;
821
+ box-sizing: border-box;
822
+ background-color: #FFFFFF;
823
+ flex-shrink: 0;
824
+ z-index: 20;
825
+ border-bottom: 1px solid #E5E5E5;
786
826
  display: flex;
787
827
  align-items: center;
788
828
  justify-content: space-between;
829
+ gap: 100px;
789
830
  width: 100%;
831
+ max-width: 100%;
790
832
 
791
833
  .left-content {
792
834
  display: flex;
793
835
  align-items: center;
794
836
  gap: 15px;
837
+ max-width: calc(100% - 150px);
838
+
839
+ #header-journey-name {
840
+ max-width: 100%;
841
+ }
795
842
  }
796
843
 
797
844
  .right-content {
@@ -36,7 +36,6 @@ import { ChildrenWrapper, ContentWrapper, LayoutLoading, LayoutWrapper, Notifica
36
36
  import { LeftMenu } from '../../organism';
37
37
  import { Flex } from '../../atoms';
38
38
  import { HeaderV2, AccessDenied } from '../../molecules';
39
- import { RecommendationWorkspace } from './components';
40
39
  // Contexts
41
40
  import { AppConfigContext } from '../../..';
42
41
  // Constants
@@ -49,6 +48,7 @@ import { useLayoutStore } from './stores';
49
48
  import { hasSelectAccountPermission } from './utils';
50
49
  import { useCustomRouter, useDeepCompareEffect, useDeepCompareMemo, useMutationObserver, } from '@antscorp/antsomi-ui/es/hooks';
51
50
  import { HOME_MENU_ITEMS } from '../../organism/LeftMenu/constants';
51
+ import { RecommendationWorkspace } from './components';
52
52
  import i18nInstance from '@antscorp/antsomi-ui/es/locales/i18n';
53
53
  const { DATAFLOWS, APP_ANTALYSER } = APP_CODES;
54
54
  export const Layout = memo(props => {
@@ -67,20 +67,18 @@ export const Layout = memo(props => {
67
67
  const params = useParams();
68
68
  const location = useLocation();
69
69
  const { navigate, replace } = useCustomRouter();
70
- const [state, setState] = useState({
71
- showAccountSelection: false,
72
- noSpaceTopContent: false,
73
- activeMenu: null,
74
- activePageTitle: '',
75
- isAccessDenied: false,
76
- isLoadingLayout: true,
77
- });
78
- const { showAccountSelection, noSpaceTopContent, activeMenu, activePageTitle, isAccessDenied, isLoadingLayout, } = state;
70
+ const [showAccountSelection, setShowAccountSelection] = useState(false);
71
+ const [noSpaceTopContent, setNoSpaceTopContent] = useState(false);
72
+ const [activeMenu, setActiveMenu] = useState(null);
73
+ const [activePageTitle, setActivePageTitle] = useState('');
74
+ const [isAccessDenied, setIsAccessDenied] = useState(false);
75
+ const [isLoadingLayout, setLoadingLayout] = useState(true);
79
76
  const notificationWrapperRef = useRef(null);
77
+ const timeoutLoadingLayout = useRef(null);
80
78
  useMutationObserver(() => {
81
79
  if (notificationWrapperRef.current) {
82
80
  const child = notificationWrapperRef.current.querySelector('div');
83
- setState(prev => (Object.assign(Object.assign({}, prev), { noSpaceTopContent: !!child })));
81
+ setNoSpaceTopContent(!!child);
84
82
  }
85
83
  }, notificationWrapperRef, {
86
84
  attributes: true,
@@ -148,14 +146,13 @@ export const Layout = memo(props => {
148
146
  const leftMenuAppConfig = useDeepCompareMemo(() => omit(Object.assign(Object.assign({}, appConfig), { permissionDomain }), ['setAppConfig']), [appConfig]);
149
147
  const antsProcessingNotificationConfig = useMemo(() => (Object.assign({ permissionDomain, socketDomain: SOCKET_API, token, accountId: userId, userId, lang: languageCode, networkId: portalId }, processingNotificationProps)), [permissionDomain, token, userId, languageCode, portalId, processingNotificationProps]);
150
148
  const onActiveMenuCodeChange = useCallback((activeItemPath, flattenPermissionList, menuListPermission) => {
149
+ var _a;
151
150
  const activeMenuItem = activeItemPath === null || activeItemPath === void 0 ? void 0 : activeItemPath[(activeItemPath === null || activeItemPath === void 0 ? void 0 : activeItemPath.length) - 1];
152
151
  const { menu_item_code, page_title, menu_item_name, permission_code } = activeMenuItem || {};
153
- setState(prev => {
154
- var _a;
155
- return (Object.assign(Object.assign({}, prev), { activePageTitle: page_title
156
- ? i18nInstance.t((_a = translations.leftMenu.pageTitle) === null || _a === void 0 ? void 0 : _a[`${page_title}`]).toString()
157
- : menu_item_name, activeMenu: activeMenuItem }));
158
- });
152
+ setActivePageTitle(page_title
153
+ ? i18nInstance.t((_a = translations.leftMenu.pageTitle) === null || _a === void 0 ? void 0 : _a[`${page_title}`]).toString()
154
+ : menu_item_name);
155
+ setActiveMenu(activeMenuItem);
159
156
  onActiveMenuChange === null || onActiveMenuChange === void 0 ? void 0 : onActiveMenuChange(menu_item_code);
160
157
  const hasRole = hasSelectAccountPermission({
161
158
  activeItemPath: cloneDeep(activeItemPath),
@@ -163,16 +160,25 @@ export const Layout = memo(props => {
163
160
  menuListPermission,
164
161
  appItem: activeItemPath[0],
165
162
  });
166
- setState(prev => (Object.assign(Object.assign({}, prev), { showAccountSelection: hasRole })));
163
+ setShowAccountSelection(hasRole);
167
164
  // Check if the user has permission or not (access denied)
168
165
  if (!!permission_code &&
169
166
  !!activeMenuItem &&
170
167
  Array.isArray(flattenPermissionList) &&
171
- flattenPermissionList.length) {
168
+ !!flattenPermissionList.length) {
172
169
  const isAccessDenied = !flattenPermissionList.some(item => item.menu_code === activeMenuItem.permission_code);
173
- setState(prev => (Object.assign(Object.assign({}, prev), { isAccessDenied, isLoadingLayout: false })));
170
+ setIsAccessDenied(isAccessDenied);
171
+ }
172
+ // Handle set loading layout
173
+ if (timeoutLoadingLayout) {
174
+ clearTimeout(timeoutLoadingLayout.current);
174
175
  }
175
- }, [onActiveMenuChange]);
176
+ timeoutLoadingLayout.current = setTimeout(() => {
177
+ if (isLoadingLayout) {
178
+ setLoadingLayout(false);
179
+ }
180
+ }, 500);
181
+ }, [isLoadingLayout, onActiveMenuChange]);
176
182
  // Effects
177
183
  /** Handle replace current userId in params if current userId is not match */
178
184
  useDeepCompareEffect(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.566",
3
+ "version": "1.3.5-beta.568",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { IconProps } from './types';
3
- export declare const ArrowIcon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
@@ -1,7 +0,0 @@
1
- import React, { forwardRef } from 'react';
2
- import { useIcon } from './hooks/useIcon';
3
- export const ArrowIcon = forwardRef((props, ref) => {
4
- const { width, height } = useIcon(props);
5
- return (React.createElement("svg", Object.assign({ viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg" }, props, { ref: ref, width: width, height: height }),
6
- React.createElement("path", { d: "M9 5.01562H18.9844V15H17.0156V8.39062L5.39062 20.0156L3.98438 18.6094L15.6094 6.98438H9V5.01562Z", fill: "currentColor" })));
7
- });
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { IconProps } from './types';
3
- export declare const CloseRemoveIcon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
@@ -1,7 +0,0 @@
1
- import React, { forwardRef } from 'react';
2
- import { useIcon } from './hooks/useIcon';
3
- export const CloseRemoveIcon = forwardRef((props, ref) => {
4
- const { width, height } = useIcon(props);
5
- return (React.createElement("svg", Object.assign({ viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg" }, props, { ref: ref, width: width, height: height }),
6
- React.createElement("path", { d: "M18.9844 6.42188L13.4062 12L18.9844 17.5781L17.5781 18.9844L12 13.4062L6.42188 18.9844L5.01562 17.5781L10.5938 12L5.01562 6.42188L6.42188 5.01562L12 10.5938L17.5781 5.01562L18.9844 6.42188Z", fill: "currentColor" })));
7
- });
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { IconProps } from './types';
3
- export declare const DataVer2Icon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
@@ -1,7 +0,0 @@
1
- import React, { forwardRef } from 'react';
2
- import { useIcon } from './hooks/useIcon';
3
- export const DataVer2Icon = forwardRef((props, ref) => {
4
- const { width, height } = useIcon(props);
5
- return (React.createElement("svg", Object.assign({ viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg" }, props, { ref: ref, width: width, height: height }),
6
- React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M19.002 6.5C19.002 7.88071 15.6499 9 11.515 9C7.38 9 4.02795 7.88071 4.02795 6.5C4.02795 5.11929 7.38 4 11.515 4C15.6499 4 19.002 5.11929 19.002 6.5ZM18.974 12.131C18.974 13.42 15.622 14.465 11.487 14.465C7.352 14.465 4 13.419 4 12.131V8.46204C4 9.75104 7.352 10.795 11.487 10.795C15.622 10.795 18.974 9.74904 18.974 8.46204V12.131ZM18.974 17.8423C18.974 19.1313 15.622 20.1763 11.487 20.1763C7.352 20.1763 4 19.1303 4 17.8423V14.1733C4 15.4623 7.352 16.5063 11.487 16.5063C15.622 16.5063 18.974 15.4603 18.974 14.1733V17.8423Z" })));
7
- });
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { IconProps } from './types';
3
- export declare const LockRestrictIcon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
@@ -1,7 +0,0 @@
1
- import React, { forwardRef } from 'react';
2
- import { useIcon } from './hooks/useIcon';
3
- export const LockRestrictIcon = forwardRef((props, ref) => {
4
- const { width, height } = useIcon(props);
5
- return (React.createElement("svg", Object.assign({ viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg" }, props, { ref: ref, width: width, height: height }),
6
- React.createElement("path", { d: "M15.0938 8.01562V6C15.0938 5.15625 14.7812 4.4375 14.1562 3.84375C13.5625 3.21875 12.8438 2.90625 12 2.90625C11.1562 2.90625 10.4219 3.21875 9.79688 3.84375C9.20312 4.4375 8.90625 5.15625 8.90625 6V8.01562H15.0938ZM10.5938 16.4062C11 16.8125 11.4688 17.0156 12 17.0156C12.5312 17.0156 13 16.8125 13.4062 16.4062C13.8125 16 14.0156 15.5312 14.0156 15C14.0156 14.4688 13.8125 14 13.4062 13.5938C13 13.1875 12.5312 12.9844 12 12.9844C11.4688 12.9844 11 13.1875 10.5938 13.5938C10.1875 14 9.98438 14.4688 9.98438 15C9.98438 15.5312 10.1875 16 10.5938 16.4062ZM18 8.01562C18.5312 8.01562 19 8.21875 19.4062 8.625C19.8125 9 20.0156 9.45312 20.0156 9.98438V20.0156C20.0156 20.5469 19.8125 21.0156 19.4062 21.4219C19 21.7969 18.5312 21.9844 18 21.9844H6C5.46875 21.9844 5 21.7969 4.59375 21.4219C4.1875 21.0156 3.98438 20.5469 3.98438 20.0156V9.98438C3.98438 9.45312 4.1875 9 4.59375 8.625C5 8.21875 5.46875 8.01562 6 8.01562H6.98438V6C6.98438 4.625 7.46875 3.45313 8.4375 2.48438C9.4375 1.48438 10.625 0.984375 12 0.984375C13.375 0.984375 14.5469 1.48438 15.5156 2.48438C16.5156 3.45313 17.0156 4.625 17.0156 6V8.01562H18Z" })));
7
- });
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { IconProps } from './types';
3
- export declare const MoveTo1Icon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
@@ -1,7 +0,0 @@
1
- import React, { forwardRef } from 'react';
2
- import { useIcon } from './hooks/useIcon';
3
- export const MoveTo1Icon = forwardRef((props, ref) => {
4
- const { width, height } = useIcon(props);
5
- return (React.createElement("svg", Object.assign({ viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg" }, props, { ref: ref, width: width, height: height }),
6
- React.createElement("path", { d: "M20.0156 6C21.0938 6 21.9844 6.89062 21.9844 8.01562V18C21.9844 19.0781 21.0938 20.0156 20.0156 20.0156H3.98438C2.90625 20.0156 2.01562 19.0781 2.01562 18V6C2.01562 4.92188 2.90625 3.98438 3.98438 3.98438H9.98438L12 6H20.0156ZM20.0156 18V8.01562H11.1562L10.5938 7.40625L9.1875 6H3.98438V18H20.0156ZM12.1406 12L10.5938 10.4062L12 9L15.9844 13.0312L12 17.0156L10.5469 15.6094L12.1406 14.0156H8.01562V12H12.1406Z", fill: "currentColor" })));
7
- });
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { IconProps } from './types';
3
- export declare const WebPagesBrowserIcon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
@@ -1,7 +0,0 @@
1
- import React, { forwardRef } from 'react';
2
- import { useIcon } from './hooks/useIcon';
3
- export const WebPagesBrowserIcon = forwardRef((props, ref) => {
4
- const { width, height } = useIcon(props);
5
- return (React.createElement("svg", Object.assign({ viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg" }, props, { ref: ref, width: width, height: height }),
6
- React.createElement("path", { d: "M20.0156 18V9H15.9844V18H20.0156ZM15 12.9844V9H3.98438V12.9844H15ZM15 18V14.0156H3.98438V18H15ZM20.0156 3.98438C20.5469 3.98438 21 4.1875 21.375 4.59375C21.7812 5 21.9844 5.46875 21.9844 6V18C21.9844 18.5312 21.7812 19 21.375 19.4062C21 19.8125 20.5469 20.0156 20.0156 20.0156H3.98438C3.45312 20.0156 2.98438 19.8125 2.57812 19.4062C2.20312 19 2.01562 18.5312 2.01562 18V6C2.01562 5.46875 2.20312 5 2.57812 4.59375C2.98438 4.1875 3.45312 3.98438 3.98438 3.98438H20.0156Z" })));
7
- });