Skip to content

Commit

Permalink
Fix for breaking changes with 24.2 (#385)
Browse files Browse the repository at this point in the history
  • Loading branch information
tumms2021389 authored Sep 5, 2024
1 parent 17b6d05 commit 9b3a094
Show file tree
Hide file tree
Showing 6 changed files with 221 additions and 58 deletions.
101 changes: 88 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
"build:dev:ci": "npm run ci && npm run build:dev",
"build:prod": "run-p -l lint build-prod-only",
"build:prod:ci": "npm run ci && npm run build:prod",
"start-dev": "webpack serve",
"start-dev-https": "webpack serve --https",
"start-prod": "http-server ./dist --port 3502 --gzip --brotli --cors --proxy http://localhost:3502?",
"start-prod-https": "http-server ./dist --port 3502 --gzip --brotli --cors --ssl --cert private.pem --key private.key --proxy https://localhost:3502?",
"start-dev": "webpack serve --mode='development'",
"start-dev-https": "webpack serve --server-type https --mode='development'",
"start-prod": "http-server ./dist --port 3502 --ext html -c-1 --gzip --brotli --cors --proxy http://localhost:3502?",
"start-prod-https": "http-server ./dist --port 3502 --ext html -c-1 --gzip --brotli --cors --ssl --cert private.pem --key private.key --proxy https://localhost:3502?",
"test": "node scripts/playwright-message.js && playwright test --project=chromium MediaCo/portal MediaCo/embedded",
"test:headed": "playwright test --headed --project=chromium MediaCo/portal MediaCo/embedded",
"test-report": "playwright show-report tests/playwright-report",
Expand All @@ -54,6 +54,7 @@
"@material-ui/lab": "^4.0.0-alpha.60",
"@material-ui/pickers": "^3.3.10",
"@pega/auth": "^0.2.14",
"@pega/constellationjs": "^0.242.3",
"@tinymce/tinymce-react": "^4.3.2",
"@types/react": "^17.0.74",
"dayjs": "^1.11.10",
Expand All @@ -75,7 +76,6 @@
"@pega/commitlint-config": "^0.7.1",
"@pega/commitlint-plugin": "^0.7.1",
"@pega/configs": "^0.7.1",
"@pega/constellationjs": "24.1.0",
"@pega/cspell-config": "^0.7.1",
"@pega/eslint-config": "^0.7.1",
"@pega/pcore-pconnect-typedefs": "~3.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export default function RootContainer(props: PropsWithChildren<RootContainerProp
const pConn = getPConnect();

const options = { context: 'app' };
const rootView = useRef(null);

const [componentName, setComponentName] = useState('');

Expand Down Expand Up @@ -146,7 +147,6 @@ export default function RootContainer(props: PropsWithChildren<RootContainerProp
return noPortalContent;
}

let rootView: any;
let rootViewConfig: any = null;

useEffect(() => {
Expand Down Expand Up @@ -181,15 +181,15 @@ export default function RootContainer(props: PropsWithChildren<RootContainerProp
};

if (!isEqual(currentRootConfig, prevRootConfig)) {
rootView = createElement(createPConnectComponent(), PCore.createPConnect(currentRootConfig));
rootView.current = createElement(createPConnectComponent(), PCore.createPConnect(currentRootConfig)) as any;
}

// debugging/investigation help
// console.log(`rootView.props.getPConnect().getComponentName(): ${rootView.props.getPConnect().getComponentName()}`);

return (
<div id='ModalManager'>
{rootView}
{rootView.current}
{MemoizedModalViewContainer}
<div id='MemoizedPreviewViewContainer' />
<div id='ReAuthMessageModal' />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,25 @@ export default function AppShell(props: PropsWithChildren<AppShellProps>) {
setMapChildren(tempMap);
}, []);

useEffect(() => {
// @ts-ignore
const caseTypesAvailableToCreateDP = PCore.getEnvironmentInfo().environmentInfoObject?.pxApplication?.pyCaseTypesAvailableToCreateDP;
if (caseTypesAvailableToCreateDP) {
const portalID = pConn.getValue('.pyOwner');
PCore.getDataPageUtils()
.getPageDataAsync(caseTypesAvailableToCreateDP, pConn.getContextName(), {
PortalName: portalID
})
.then(response => {
if (response?.pyCaseTypesAvailableToCreate) {
pConn.replaceState('.pyCaseTypesAvailableToCreate', response.pyCaseTypesAvailableToCreate, {
skipDirtyValidation: true
});
}
});
}
}, []);

const [iconURL, setIconURL] = useState('');
const [fullIconURL, setFullIconURL] = useState('');
useEffect(() => {
Expand Down
Loading

0 comments on commit 9b3a094

Please sign in to comment.