Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/7.3' into 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Aug 28, 2023
2 parents f293a89 + 5b3fa1d commit 8fcc8fd
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 7 deletions.
3 changes: 3 additions & 0 deletions Resources/Private/Translations/en/Main.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<trans-unit id="copy__from__to--description" xml:space="preserve">
<source>Please select the position at which you want {source} inserted relative to {target}.</source>
</trans-unit>
<trans-unit id="add" xml:space="preserve">
<source>Add</source>
</trans-unit>
<trans-unit id="insert" xml:space="preserve">
<source>Insert</source>
</trans-unit>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"vfile-message": "^2.0.2"
},
"engines": {
"node": "~14"
"node": "~14 || ~16"
},
"devDependencies": {
"@neos-project/build-essentials": "*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,14 @@ export default class ImageCropper extends PureComponent {
componentDidMount() {
//
// Calculate and set maximum height for the cropped image
const containerHeight = this.containerNode.parentElement.clientHeight;
// The upper toolbars (the publish tool bar and ckeditor bar) are each 41px
const upperToolbarHeights = 41 + 41;
const secondaryEditorHeight = window.innerHeight - upperToolbarHeights;
const toolbarStyles = getComputedStyle(this.toolbarNode);
const toolbarFullHeight = parseInt(toolbarStyles.height, 10) + parseInt(toolbarStyles['margin-top'], 10) + parseInt(toolbarStyles['margin-bottom'], 10);
const spacing = 32;
const height = (containerHeight - toolbarFullHeight - spacing) + 'px';
const height = (secondaryEditorHeight - toolbarFullHeight - spacing) + 'px';

const imageNode = this.containerNode.querySelector('.ReactCrop__image');
const imageCopyNode = this.containerNode.querySelector('.ReactCrop__image-copy');
imageNode.style.maxHeight = height;
Expand Down
24 changes: 23 additions & 1 deletion packages/neos-ui/src/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
import initializeContentDomNode from '@neos-project/neos-ui-guest-frame/src/initializeContentDomNode';

import style from '@neos-project/neos-ui-guest-frame/src/style.css';
import backend from '@neos-project/neos-ui-backend-connector';

manifest('main', {}, globalRegistry => {
//
Expand Down Expand Up @@ -513,7 +514,7 @@ manifest('main', {}, globalRegistry => {
// When the server advices to replace a node (e.g. on property change), put the delivered html to the
// correct place inside the DOM
//
serverFeedbackHandlers.set('Neos.Neos.Ui:ReloadContentOutOfBand/Main', (feedbackPayload, {store, globalRegistry}) => {
serverFeedbackHandlers.set('Neos.Neos.Ui:ReloadContentOutOfBand/Main', async (feedbackPayload, {store, globalRegistry}) => {
const {contextPath, renderedContent, nodeDomAddress} = feedbackPayload;
const domNode = nodeDomAddress && findNodeInGuestFrame(
nodeDomAddress.contextPath,
Expand Down Expand Up @@ -543,6 +544,27 @@ manifest('main', {}, globalRegistry => {

const children = findAllChildNodes(contentElement);

// in case there are foreign referenced nodes, we need to put them into the store:
const uninitializedReferencedNodes = [];
for (const el of children) {
const contextPath = el.getAttribute('data-__neos-node-contextpath');
if (!selectors.CR.Nodes.byContextPathSelector(contextPath)(store.getState())) {
uninitializedReferencedNodes.push(contextPath);
}
}
if (uninitializedReferencedNodes.length) {
const {q} = backend.get();
const additionalNodes = await q(uninitializedReferencedNodes).get();
if (additionalNodes.length) {
store.dispatch(actions.CR.Nodes.merge(
additionalNodes.reduce((carry, node) => {
carry[node.contextPath] = node;
return carry;
}, {})
));
}
}

const nodes = Object.assign(
{[contextPath]: selectors.CR.Nodes.byContextPathSelector(contextPath)(store.getState())},
...children.map(el => {
Expand Down
9 changes: 6 additions & 3 deletions packages/react-ui-components/src/Dialog/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ export interface DialogProps {
readonly isOpen: boolean;

/**
* The handler which gets called once the user clicks on the close symbol in the top right corner of the Dialog.
* An optional handler, which gets called once the user clicks on the close symbol in the top right corner of the Dialog.
*/
readonly onRequestClose: () => void;
readonly onRequestClose?: () => void;

/**
* An optional boolean flag to keep the user in the dialog.
Expand Down Expand Up @@ -99,7 +99,9 @@ class DialogWithOverlay extends PureComponent<DialogProps> {
this.startShaking();
return false;
}
this.props.onRequestClose();
if (this.props.onRequestClose) {
this.props.onRequestClose();
}
return true;
},
};
Expand Down Expand Up @@ -190,6 +192,7 @@ class DialogWithOverlay extends PureComponent<DialogProps> {
actions,
theme,
type,
preventClosing,
onRequestClose,
...rest
} = this.props;
Expand Down

0 comments on commit 8fcc8fd

Please sign in to comment.