Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Bugfix/3477 infinite loading indicator remove dom event #3750

Draft
wants to merge 2 commits into
base: 8.3
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Classes/Fusion/ExceptionHandler/PageExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ protected function prepareFluidView(): ViewInterface
$fluidView->setFormat('html');
$fluidView->setTemplatePathAndFilename('resource://Neos.Neos.Ui/Private/Templates/Error/ErrorMessage.html');

$guestNotificationScript = new StandaloneView();
$guestNotificationScript->setTemplatePathAndFilename('resource://Neos.Neos.Ui/Private/Templates/Backend/GuestNotificationScript.html');
$fluidView->assign('guestNotificationScript', $guestNotificationScript->render());

return $fluidView;
}
}
6 changes: 0 additions & 6 deletions Resources/Private/Fusion/Prototypes/Page.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ prototype(Neos.Neos:Page) {
neosBackendContainer.@position = 'before closingBodyTag'
neosBackendContainer.@if.inBackend = ${documentNode.context.inBackend}

neosBackendNotification = Neos.Fusion:Template {
@position = 'before closingBodyTag'
templatePath = 'resource://Neos.Neos.Ui/Private/Templates/Backend/GuestNotificationScript.html'
@if.inBackend = ${documentNode.context.inBackend}
}

@exceptionHandler = 'Neos\\Neos\\Ui\\Fusion\\ExceptionHandler\\PageExceptionHandler'
}

Expand Down

This file was deleted.

3 changes: 1 addition & 2 deletions Resources/Private/Templates/Error/ErrorMessage.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
<meta charset="utf-8">
<title>Neos Error</title>
<link rel="stylesheet" href="{f:uri.resource(path: 'Styles/Error.css', package: 'Neos.Neos')}"/>
{guestNotificationScript -> f:format.raw()}
</head>
<body class="neos">
<div id="neos-backend-container" class="neos-error-screen">{message -> f:format.raw()}</div>
<div class="neos-error-screen">{message -> f:format.raw()}</div>
</body>
</html>
27 changes: 12 additions & 15 deletions packages/react-ui-components/src/Frame/frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ReactDOM from 'react-dom';
export interface FrameProps extends React.IframeHTMLAttributes<HTMLIFrameElement> {
readonly src: string;
readonly mountTarget: string;
readonly contentDidUpdate: (window: Window, document: Document, mountTarget: Element) => void;
readonly contentDidUpdate: (window: Window, document: Document) => void;
readonly onLoad: (event: SyntheticEvent<HTMLIFrameElement>) => void;
readonly onUnload: () => void;
readonly children: ReactNode;
Expand Down Expand Up @@ -48,6 +48,16 @@ export default class Frame extends PureComponent<FrameProps> {
}

public componentDidMount(): void {
if (this.ref) {
this.ref.addEventListener('load', () => {
if (this.ref && this.ref.contentDocument && this.ref.contentWindow) {
const doc = this.ref.contentDocument;
const win = this.ref.contentWindow;
this.props.contentDidUpdate(win, doc);
}
});
}

this.updateIframeUrlIfNecessary();
this.addClickListener();
}
Expand Down Expand Up @@ -106,19 +116,6 @@ export default class Frame extends PureComponent<FrameProps> {
}
}

public UNSAFE_componentWillMount(): void {
document.addEventListener('Neos.Neos.Ui.ContentReady', () => {
if (this.ref && this.ref.contentDocument && this.ref.contentWindow) {
const doc = this.ref.contentDocument;
const win = this.ref.contentWindow;
const mountTarget = doc.querySelector(this.props.mountTarget);
if (mountTarget) {
this.props.contentDidUpdate(win, doc, mountTarget);
}
}
});
}

private readonly handleUnload = () => {
this.setState({
transitioning: true
Expand Down Expand Up @@ -184,7 +181,7 @@ export default class Frame extends PureComponent<FrameProps> {

public componentWillUnmount(): void {
if (this.ref) {
document.removeEventListener('Neos.Neos.Ui.ContentReady', this.renderFrameContents);
this.ref.removeEventListener('load', this.renderFrameContents);
}
this.removeClickListener();
}
Expand Down
Loading