Skip to content

React New design changes for self service portal.#599

Merged
tumms2021389 merged 23 commits intomainfrom
AI/AtoRv2
Mar 16, 2026
Merged

React New design changes for self service portal.#599
tumms2021389 merged 23 commits intomainfrom
AI/AtoRv2

Conversation

@SambhuPega
Copy link
Contributor

React new design changes for the self service portal

image

Comment on lines +120 to +127
if (!isMyWorklistChecked) {
const pegaMap = SdkComponentMap?.getPegaProvidedComponentMap?.();
const OOTBTodo = pegaMap?.['Todo'];
if (OOTBTodo) {
return <OOTBTodo {...props} />;
}
return null;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import OOTBTodo directly from '@pega/react-sdk-components'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

@@ -0,0 +1,23 @@
import { createContext, useContext, useState, useRef, type ReactNode, type MutableRefObject } from 'react';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check why it is needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React doesn't have a direct equivalent of Angular CDK's TemplatePortal + cdkPortalOutlet (where a template is defined in one component and physically projected into another component's render output).

The React-idiomatic way to achieve the same result is exactly what TodoPortalContext does — share data via Context, and let the consuming component render the UI. This is actually the standard React approach:

@@ -1,2 +1,69 @@
.mediaco {
// Action Buttons styles for MediaCo sample app - start
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no import for this file anywhere

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

src/index.tsx Outdated
import TopLevelApp from '../src/samples/TopLevelApp';
import './common.css';

// Suppress "Uncaught runtime errors" overlay for non-fatal Axios errors from
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines +152 to +156
width: '100%',
minHeight: '100%',
backgroundColor: '#fff',
display: 'flex',
flexDirection: 'column'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move these inline styles to classes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines +58 to +59
const OOTBSelfServiceCaseView = SdkComponentMap.getPegaProvidedComponentMap().SelfServiceCaseView;
return <OOTBSelfServiceCaseView {...props} />;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, import from components repo directly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

// Delegate to OOTB MultiStep when not on the WSS portal
const isWssPortal = (PCore.getEnvironmentInfo() as any).environmentInfoObject?.pyPortalTemplate === 'wss';
if (!isWssPortal) {
const OOTBMultiStep = SdkComponentMap.getPegaProvidedComponentMap().MultiStep;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modify the import

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines +30 to +35
const pegaMap = SdkComponentMap?.getPegaProvidedComponentMap?.();
const OOTBListView = pegaMap?.['ListView'];
if (OOTBListView) {
return <OOTBListView {...props} />;
}
return null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -0,0 +1,89 @@
/**
* Utility to build the SDK static content URL for icon/image assets.
* Mirrors the Angular Utils.getSDKStaticContentUrl / getImageSrc pattern.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

}

/**
* Fetch work list data from a data page (mirrors Angular fetchMyWorkList).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove mirrors Angular fetchMyWorkList

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

src/common.css Outdated
border-color: #6750a4 !important;
}

/* ========== MediaCo WSS: Assignment-routed banner (matches Angular mat-card style) ========== */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove matches Angular mat-card style

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


/**
* Custom ActionButtons for WSS (MediaCo) portal.
* Styled to match the Angular SDK's Material 3 button look:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

* Styled to match the Angular SDK's Material 3 button look:
* - Primary: filled pill buttons with purple background
* - Secondary: outlined pill buttons
* - Layout: left-aligned secondary, right-aligned primary (matching Angular's button-bar)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove matching Angular's button-bar

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -0,0 +1,53 @@
/**
* ListView-specific helpers — co-located with the ListView component.
* Mirrors Angular's list-view/listViewHelpers.ts + utils.ts pattern.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove Angular mention

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

)}
</div>

{/* Main case view with flex layout (matching Angular SDK) */}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove matching Angular SDK

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

const isWssPortal = (PCore.getEnvironmentInfo() as any).environmentInfoObject?.pyPortalTemplate === 'wss';
if (!isWssPortal) {
const OOTBActionButtons = SdkComponentMap.getPegaProvidedComponentMap().ActionButtons;
return <OOTBActionButtons {...props} />;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import from the components repo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -0,0 +1,113 @@
import { type PropsWithChildren, useEffect, useState } from 'react';
import OOTBAppShell from '@pega/react-sdk-components/lib/components/template/AppShell';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make the OOTB to Appshell

Comment on lines +33 to +35
if (!isWssPortal) {
return <OOTBMultiStep {...(props as any)} />;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not required

Comment on lines +1 to +7
import { Avatar, Card, CardHeader, Divider, Typography, Button, Menu, MenuItem } from '@mui/material';
import { useState, type MouseEvent } from 'react';
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
import OOTBSelfServiceCaseView from '@pega/react-sdk-components/lib/components/template/SelfServiceCaseView';
import { prepareCaseSummaryData, filterUtilities } from '@pega/react-sdk-components/lib/components/template/utils';
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update components repo


// Fetch case types available to create
useEffect(() => {
const ei: any = PCore.getEnvironmentInfo();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repurpose the variable

<Box className='mc-footer-container'>
{/* Top Section */}
<Box className='mc-footer-top'>
{/* Column 1 - MediaCo */}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment

</List>
</Box>

{/* Column 3 - Support */}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

</List>
</Box>

{/* Column 4 - Contact Us */}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

@@ -0,0 +1,52 @@
/**
* ListView-specific helpers — co-located with the ListView component.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this

* Maps activity types to icons (for Account History list).
*/
export const CASE_TYPE_TO_ACTIVITY_MAP: Record<string, string> = {
'Plan Upgrade': 'Plan Upgrade',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make all of them of uniform type.

import { getActivityIcon, timeSince, CASE_TYPE_TO_ACTIVITY_MAP } from './helpers';
import Carousel from '../carousel';
import GalleryGrid from '../gallery-grid';
import OOTBListView from '@pega/react-sdk-components/lib/components/template/ListView';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove OOTB and move this above local imports


// ── If NOT a custom MediaCo data page → delegate to OOTB ListView immediately ──
if (!isCustomDataPage) {
return <OOTBListView {...(props as any)} />;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove OOTB

const template = preset?.template || '';

useEffect(() => {
const componentConfig: any = pConn.getComponentConfig();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the above const

import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography';
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
import OOTBMultiStep from '@pega/react-sdk-components/lib/components/infra/MultiStep';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove OOTB

@@ -0,0 +1,190 @@
import { Avatar, Card, CardHeader, Divider, Typography, Button, Menu, MenuItem } from '@mui/material';
import { useState, type MouseEvent } from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this at the top

@@ -0,0 +1,124 @@
import { useEffect, useState, useCallback } from 'react';
import OOTBTodo from '@pega/react-sdk-components/lib/components/widget/ToDo';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove OOTB

@@ -1,11 +1,28 @@
// Statically load all "MediaCo" components.
import './mediaCoStyles.scss';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this down

@tumms2021389 tumms2021389 merged commit d405164 into main Mar 16, 2026
6 checks passed
@tumms2021389 tumms2021389 deleted the AI/AtoRv2 branch March 16, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants