@antscorp/antsomi-ui 1.3.5-beta.922 → 1.3.5-beta.924
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.
|
@@ -26,7 +26,11 @@ export const HeaderV2 = memo(props => {
|
|
|
26
26
|
// * Prefer to use Header in AppConfigContext
|
|
27
27
|
const { show = true, className, style, breadcrumbs, showLogo = false, rightContent, pageTitle = '', accountSelection = {}, helpConfig, notificationConfig = {}, accountSharingConfig, useURLParam, config, onCLickLogo, } = props;
|
|
28
28
|
/** General config for children component */
|
|
29
|
-
const { env = envContext, language = languageCode,
|
|
29
|
+
const { env = envContext, language = languageCode,
|
|
30
|
+
// NOTE: Just hot fix for change userId to accountId
|
|
31
|
+
userId = isNaN(Number(auth?.accountId || auth?.userId))
|
|
32
|
+
? 0
|
|
33
|
+
: Number(auth?.accountId || auth?.userId), portalId = auth?.portalId, token = auth?.token, permissionDomain = PERMISSION_API, iamDomain = IAM_API, appCode = contextAppCode, menuCode = contextMenuCode, } = config || {};
|
|
30
34
|
const { currentAccount, inputStyle = 'select', onSelectAccount, ...accountSelectionProps } = accountSelection;
|
|
31
35
|
const urlParams = useMemo(() => new URLSearchParams(search), [search]);
|
|
32
36
|
const oidParam = urlParams.get('oid') || currentAccount || 'all';
|
|
@@ -10,6 +10,7 @@ import { isEmpty } from 'lodash';
|
|
|
10
10
|
import { differenceInMonths, formatUTCDateTZ, startOfMonth, subMonths, } from '@antscorp/antsomi-ui/es/utils/date';
|
|
11
11
|
import { getPortalTimeZone } from '@antscorp/antsomi-ui/es/utils/portal';
|
|
12
12
|
import { EmptyData } from '../../molecules';
|
|
13
|
+
import clsx from 'clsx';
|
|
13
14
|
export const ActivityTimeline = (props) => {
|
|
14
15
|
const { timelines = [], isLoading = false, title = translate(translations._BLOCK_TIMELINE_CUS), timezone = getPortalTimeZone(), objectName = '_THIS_PERSON_UPPERCASE', onFetchMore, eventTracking: eventTrackingProp = [], header, className, } = props;
|
|
15
16
|
let { timelineAvailable } = props;
|
|
@@ -96,5 +97,5 @@ export const ActivityTimeline = (props) => {
|
|
|
96
97
|
}
|
|
97
98
|
return (_jsxs(_Fragment, { children: [header, showMainContent(timelines, objectName), showBottomComponent()] }));
|
|
98
99
|
};
|
|
99
|
-
return (_jsxs(StyledRoot, { className: className, children: [_jsx(StyldTitle, { children: title }), renderContent()] }));
|
|
100
|
+
return (_jsxs(StyledRoot, { className: clsx(className, 'activity-timeline'), children: [_jsx(StyldTitle, { children: title }), renderContent()] }));
|
|
100
101
|
};
|
|
@@ -40,21 +40,12 @@ export const getValuesReplace = (objectReplace, data) => {
|
|
|
40
40
|
return values;
|
|
41
41
|
};
|
|
42
42
|
const parseUrl = (params) => {
|
|
43
|
-
const { name = 'N/A'
|
|
43
|
+
const { name = 'N/A' } = params;
|
|
44
44
|
const validateName = name.replace(/https|http|www|\/\/|:/gi, '');
|
|
45
|
-
if (
|
|
45
|
+
if (validateName !== 'N/A') {
|
|
46
46
|
return validateName;
|
|
47
47
|
}
|
|
48
|
-
|
|
49
|
-
validateName === 'N/A' ||
|
|
50
|
-
(positionSlice > validateName.length && validateName !== 'N/A') ||
|
|
51
|
-
positionSlice === validateName.length) {
|
|
52
|
-
return name;
|
|
53
|
-
}
|
|
54
|
-
if (validateName[positionSlice] === ' ') {
|
|
55
|
-
return `${validateName.slice(0, positionSlice - 1)}...`;
|
|
56
|
-
}
|
|
57
|
-
return `${validateName.slice(0, positionSlice)}...`;
|
|
48
|
+
return name;
|
|
58
49
|
};
|
|
59
50
|
export const getStringHtmlByType = (item, eType = 'product') => {
|
|
60
51
|
const validateDate = item || {};
|
|
@@ -183,6 +174,7 @@ export const getInfoEvent = (eType, itemEvent, eventTracking, customerName, conf
|
|
|
183
174
|
itemEvent.pageType === 'view' ||
|
|
184
175
|
itemEvent.pageType === 'add_to_cart') {
|
|
185
176
|
// PAGETYPE CLICK OR VIEW
|
|
177
|
+
// eslint-disable-next-line no-console
|
|
186
178
|
console.log('itemEvent.items[0]', itemEvent);
|
|
187
179
|
data.product_name = getStringHtmlByType(itemEvent.items[0], eType);
|
|
188
180
|
}
|
|
@@ -253,10 +253,10 @@ export const Layout = memo(props => {
|
|
|
253
253
|
useDeepCompareEffect(() => {
|
|
254
254
|
const { userId: userIdParam } = (params || {});
|
|
255
255
|
console.log('🚀 ~ useDeepCompareEffect ~ userId:', userIdParam, userId);
|
|
256
|
-
if (userIdParam &&
|
|
257
|
-
replace(`${location.pathname.replace(userIdParam, `${
|
|
256
|
+
if (userIdParam && accountId && +userIdParam !== +accountId && location.pathname) {
|
|
257
|
+
replace(`${location.pathname.replace(userIdParam, `${accountId}`)}${location.search}`);
|
|
258
258
|
}
|
|
259
|
-
}, [params, location.pathname,
|
|
259
|
+
}, [params, location.pathname, accountId, replace]);
|
|
260
260
|
/** If left menu props has customization then set layout loading to false, because we don't need check permission here */
|
|
261
261
|
useDeepCompareEffect(() => {
|
|
262
262
|
if (mergeLeftMenuProps.customization) {
|