Skip to content

Commit

Permalink
EPMRPP-87396 || Error on extension page (#3639)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bam6ycha authored and Vadim73i committed Nov 13, 2023
1 parent 821fa87 commit 6cfb0b7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 20 deletions.
1 change: 1 addition & 0 deletions app/src/components/extensionLoader/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const useDynamicScript = (scope, url) => {
element.onerror = () => {
setReady(false);
setFailed(true);
element.remove();
};

document.head.appendChild(element);
Expand Down
47 changes: 27 additions & 20 deletions app/src/pages/common/uiExtensionPage/uiExtensionPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,33 @@ export const UiExtensionPage = ({ extensions, activePluginPage }) => {

const [headerNodes, setHeaderNodes] = useState({});

const pageLayout =
extension && extension.newLayout ? (
<>
<div className={cx('header')}>
<Header titleNode={headerNodes.titleNode} title={extension.title || extension.name}>
{headerNodes.children}
</Header>
</div>
<PageSection>
<ExtensionLoader extension={extension} withPreloader setHeaderNodes={setHeaderNodes} />
</PageSection>
</>
) : (
<PageLayout>
{extension && <PageHeader breadcrumbs={[{ title: extension.title || extension.name }]} />}
<PageSection>
<ExtensionLoader extension={extension} withPreloader />
</PageSection>
</PageLayout>
);
let pageLayout = null;

if (extension) {
if (extension.newLayout) {
pageLayout = (
<>
<div className={cx('header')}>
<Header titleNode={headerNodes.titleNode} title={extension.title || extension.name}>
{headerNodes.children}
</Header>
</div>
<PageSection>
<ExtensionLoader extension={extension} withPreloader setHeaderNodes={setHeaderNodes} />
</PageSection>
</>
);
} else {
pageLayout = (
<PageLayout>
<PageHeader breadcrumbs={[{ title: extension.title || extension.name }]} />
<PageSection>
<ExtensionLoader extension={extension} withPreloader />
</PageSection>
</PageLayout>
);
}
}

return pageLayout;
};
Expand Down

0 comments on commit 6cfb0b7

Please sign in to comment.