@antscorp/antsomi-ui 1.3.5-beta.347 → 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;
|
|
@@ -38,12 +38,8 @@ export const Layout = memo(props => {
|
|
|
38
38
|
const appConfig = useContextSelector(AppConfigContext, state => state);
|
|
39
39
|
const { auth, languageCode, appCode, env } = appConfig;
|
|
40
40
|
const { token, userId, portalId } = auth || {};
|
|
41
|
-
const headerStore = useLayoutStore(store => store.state.header);
|
|
42
41
|
const showLeftMenu = useLayoutStore(store => store.state.leftMenu.show);
|
|
43
|
-
const contentWrapper = useLayoutStore(store => store.state.contentWrapper);
|
|
44
|
-
const workspace = useLayoutStore(store => store.state.workspace);
|
|
45
42
|
const layoutState = useLayoutStore(store => store.state);
|
|
46
|
-
console.log('🚀 ~ layoutState: joifdsjfiodsjfoids', layoutState, contentWrapper);
|
|
47
43
|
const [showAccountSelection, setShowAccountSelection] = useState(false);
|
|
48
44
|
const [noSpaceTopContent, setNoSpaceTopContent] = useState(false);
|
|
49
45
|
// Refs
|
|
@@ -106,15 +102,9 @@ export const Layout = memo(props => {
|
|
|
106
102
|
INSIGHT_U_OGS: 'uogs',
|
|
107
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 }) }));
|
|
108
104
|
}, [headerProps, iamDomain, permissionDomain, showAccountSelection]);
|
|
109
|
-
const mergeHeaderProps =
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
const mergeContentWrapperProps = useDeepCompareMemo(() => merge(cloneDeep(contentWrapperProps), cloneDeep(contentWrapper)),
|
|
113
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
114
|
-
[cloneDeep(contentWrapperProps), cloneDeep(contentWrapper)]);
|
|
115
|
-
const mergeWorkSpaceProps = useDeepCompareMemo(() => merge(cloneDeep(restOfWorkspaceProps), cloneDeep(omit(workspace, 'workspaceContentProps'))),
|
|
116
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
117
|
-
[cloneDeep(restOfWorkspaceProps), cloneDeep(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')));
|
|
118
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]);
|
|
119
109
|
const onActiveMenuCodeChange = useCallback((activeItemPath, flattenPermissionList) => {
|
|
120
110
|
var _a;
|