@antscorp/antsomi-ui 1.3.5-beta.546 → 1.3.5-beta.548

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.
@@ -205,6 +205,7 @@ export const getMappingAppChildren = (args) => {
205
205
  appItem.children = (_a = Object.values(HOME_MENU_ITEMS)) === null || _a === void 0 ? void 0 : _a.map(childMenuItem => {
206
206
  var _a;
207
207
  return (Object.assign(Object.assign({}, getInitialFeatureMenuItem({
208
+ menu_item_domain: appItem.menu_item_domain,
208
209
  menu_item: childMenuItem.menu_item_code,
209
210
  menu_item_code: childMenuItem.menu_item_code,
210
211
  menu_item_name: childMenuItem.menu_item_name,
@@ -22,7 +22,7 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  import React, { memo, useCallback, useMemo, useRef, useState } from 'react';
23
23
  import { useContextSelector } from 'use-context-selector';
24
24
  import AntsProcessingNotification from '@antscorp/processing-notification';
25
- import { cloneDeep, isString, merge, omit } from 'lodash';
25
+ import { cloneDeep, get, isString, merge, omit } from 'lodash';
26
26
  import isEqual from 'react-fast-compare';
27
27
  import { translations } from '@antscorp/antsomi-ui/es/locales/translations';
28
28
  import { Helmet } from 'react-helmet';
@@ -38,7 +38,7 @@ import { HeaderV2, AccessDenied } from '../../molecules';
38
38
  // Contexts
39
39
  import { AppConfigContext } from '../../..';
40
40
  // Constants
41
- import { APP_CODES, APP_IAM_DOMAIN, APP_PERMISSION_DOMAIN, IAM_API, PERMISSION_API, PORTALS_IDS, SOCKET_API, UOGS_PREFIX, } from '../../../constants';
41
+ import { APP_CODES, APP_IAM_DOMAIN, APP_PERMISSION_DOMAIN, CDP_ROUTE, IAM_API, PERMISSION_API, PORTALS_IDS, SOCKET_API, UOGS_PREFIX, } from '../../../constants';
42
42
  import { ENV } from '@antscorp/antsomi-ui/es/config';
43
43
  // Css
44
44
  import '@antscorp/processing-notification/dist/index.css';
@@ -208,6 +208,32 @@ export const Layout = memo(props => {
208
208
  };
209
209
  window.postMessage(messageContent);
210
210
  }), [activeMenu === null || activeMenu === void 0 ? void 0 : activeMenu.menu_item_name, portalId, userId]);
211
+ // Handle callback processing notification
212
+ const handleCallbackNotify = useCallback((type, data) => {
213
+ var _a;
214
+ switch (type) {
215
+ case 'forecast_name': {
216
+ const cdpDomain = CDP_ROUTE[env || 'development'];
217
+ const portalId = get(data, 'row.network_id', '');
218
+ const notificationId = get(data, 'row._id', '');
219
+ if (cdpDomain && portalId && notificationId) {
220
+ const searchParams = new URLSearchParams();
221
+ searchParams.set('use', 'forecast-segment');
222
+ searchParams.set('notification-id', notificationId);
223
+ const url = `${cdpDomain}/gen2/${portalId}/profile/segments?${searchParams.toString()}`;
224
+ window.open(url, '_blank', 'noopener,noreferrer');
225
+ }
226
+ else {
227
+ throw new Error('CDP domain or portal id or notification id is not correct');
228
+ }
229
+ break;
230
+ }
231
+ default: {
232
+ break;
233
+ }
234
+ }
235
+ (_a = antsProcessingNotificationConfig.callback) === null || _a === void 0 ? void 0 : _a.call(antsProcessingNotificationConfig, type, data);
236
+ }, [antsProcessingNotificationConfig, env]);
211
237
  return (React.createElement(LayoutWrapper, { showLeftMenu: !!showLeftMenu },
212
238
  React.createElement(Helmet, null,
213
239
  React.createElement("meta", { charSet: "utf-8" }),
@@ -224,6 +250,6 @@ export const Layout = memo(props => {
224
250
  isExpandable: !isAccessDenied && ((_a = mergeLeftMenuProps.customization) === null || _a === void 0 ? void 0 : _a.isExpandable) }), appConfig: leftMenuAppConfig, onActiveMenuCodeChange: onActiveMenuCodeChange }))),
225
251
  React.createElement(ContentWrapper, Object.assign({ "$noPadding": noPadding, "$noSpaceTopContent": noSpaceTopContent }, mergeContentWrapperProps), (activeMenu === null || activeMenu === void 0 ? void 0 : activeMenu.menu_item_code) === HOME_MENU_ITEMS.RECOMMENDATION.menu_item_code ? (React.createElement("div", { className: "layout-body__content" },
226
252
  React.createElement(RecommendationWorkspace, null))) : (React.createElement("div", Object.assign({ className: `layout-body__content ${(workspaceProps === null || workspaceProps === void 0 ? void 0 : workspaceProps.className) || ''}` }, mergeWorkSpaceProps),
227
- React.createElement(NotificationWrapper, { className: "process-notification", ref: notificationWrapperRef }, showNotification && (React.createElement(AntsProcessingNotification, Object.assign({}, antsProcessingNotificationConfig)))),
253
+ React.createElement(NotificationWrapper, { className: "process-notification", ref: notificationWrapperRef }, showNotification && (React.createElement(AntsProcessingNotification, Object.assign({}, antsProcessingNotificationConfig, { callback: handleCallbackNotify })))),
228
254
  React.createElement(ChildrenWrapper, Object.assign({}, workspaceContentProps), isAccessDenied ? (React.createElement(AccessDenied, { onClickRequestAccess: onClickRequestAccess, onClickSwitchAccount: onClickSwitchAccount })) : (React.createElement("div", null, children)))))))));
229
255
  }, (prevProps, nextProps) => isEqual(prevProps, nextProps));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.546",
3
+ "version": "1.3.5-beta.548",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",