@antscorp/antsomi-ui 1.3.5-beta.348 → 1.3.5-beta.349
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.
|
@@ -31,6 +31,7 @@ export const HeaderV2 = memo(props => {
|
|
|
31
31
|
const { auth, env: envContext, languageCode = 'en', appCode: contextAppCode, urlLogout: urlLogoutProvider = '', menuCode: contextMenuCode, } = useContextSelector(AppConfigContext, state => state);
|
|
32
32
|
const { search } = useLocation();
|
|
33
33
|
const { replace } = useCustomRouter();
|
|
34
|
+
console.log({ headerProps: props });
|
|
34
35
|
// * Prefer to use Header in AppConfigContext
|
|
35
36
|
const { className, style, breadcrumbs, showLogo = false, rightContent, pageTitle = '', accountSelection = {}, helpConfig, notificationConfig = {}, accountSharingConfig, useURLParam, config, } = props;
|
|
36
37
|
/** General config for children component */
|
|
@@ -29,7 +29,7 @@ import '@antscorp/processing-notification/dist/index.css';
|
|
|
29
29
|
import { useLayoutStore } from './stores';
|
|
30
30
|
// Utils
|
|
31
31
|
import { hasSelectAccountPermission } from './utils';
|
|
32
|
-
import {
|
|
32
|
+
import { useMutationObserver } from '@antscorp/antsomi-ui/es/hooks';
|
|
33
33
|
const { DATAFLOWS, APP_ANTALYSER } = APP_CODES;
|
|
34
34
|
export const Layout = memo(props => {
|
|
35
35
|
const { leftMenuProps, headerProps = {}, workspaceProps, contentWrapperProps, processingNotificationProps, children, onActiveMenuChange, } = props;
|
|
@@ -39,8 +39,6 @@ export const Layout = memo(props => {
|
|
|
39
39
|
const { auth, languageCode, appCode, env } = appConfig;
|
|
40
40
|
const { token, userId, portalId } = auth || {};
|
|
41
41
|
const showLeftMenu = useLayoutStore(store => store.state.leftMenu.show);
|
|
42
|
-
const contentWrapper = useLayoutStore(store => store.state.contentWrapper);
|
|
43
|
-
const workspace = useLayoutStore(store => store.state.workspace);
|
|
44
42
|
const layoutState = useLayoutStore(store => store.state);
|
|
45
43
|
const [showAccountSelection, setShowAccountSelection] = useState(false);
|
|
46
44
|
const [noSpaceTopContent, setNoSpaceTopContent] = useState(false);
|
|
@@ -104,15 +102,9 @@ export const Layout = memo(props => {
|
|
|
104
102
|
INSIGHT_U_OGS: 'uogs',
|
|
105
103
|
} }) }), accountSharingConfig: Object.assign(Object.assign({}, headerProps === null || headerProps === void 0 ? void 0 : headerProps.accountSharingConfig), { u_ogs: 'uogs', appCode: 'APP_CUSTOMER_360' }), accountSelection: Object.assign(Object.assign({}, headerProps === null || headerProps === void 0 ? void 0 : headerProps.accountSelection), { show: !!((_b = headerProps === null || headerProps === void 0 ? void 0 : headerProps.accountSelection) === null || _b === void 0 ? void 0 : _b.show) && showAccountSelection }) }));
|
|
106
104
|
}, [headerProps, iamDomain, permissionDomain, showAccountSelection]);
|
|
107
|
-
const mergeHeaderProps =
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
const mergeContentWrapperProps = useDeepCompareMemo(() => merge(cloneDeep(contentWrapperProps), cloneDeep(layoutState.contentWrapper)),
|
|
111
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
112
|
-
[contentWrapperProps, layoutState.contentWrapper]);
|
|
113
|
-
const mergeWorkSpaceProps = useDeepCompareMemo(() => merge(cloneDeep(restOfWorkspaceProps), cloneDeep(omit(layoutState.workspace, 'workspaceContentProps'))),
|
|
114
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
115
|
-
[restOfWorkspaceProps, layoutState.workspace]);
|
|
105
|
+
const mergeHeaderProps = merge(cloneDeep(initialHeaderProps), cloneDeep(layoutState.header));
|
|
106
|
+
const mergeContentWrapperProps = merge(cloneDeep(contentWrapperProps), cloneDeep(layoutState.contentWrapper));
|
|
107
|
+
const mergeWorkSpaceProps = merge(cloneDeep(restOfWorkspaceProps), cloneDeep(omit(layoutState.workspace, 'workspaceContentProps')));
|
|
116
108
|
const antsProcessingNotificationConfig = useMemo(() => (Object.assign({ permissionDomain, socketDomain: SOCKET_API, token, accountId: userId, userId, lang: languageCode, networkId: portalId }, processingNotificationProps)), [permissionDomain, token, userId, languageCode, portalId, processingNotificationProps]);
|
|
117
109
|
const onActiveMenuCodeChange = useCallback((activeItemPath, flattenPermissionList) => {
|
|
118
110
|
var _a;
|