Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/8.0' into 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Dec 1, 2023
2 parents 80b98a4 + 3704fc9 commit a92bbff
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Classes/Controller/BackendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ protected function getSiteNodeForLoggedInUser(): ?NodeInterface
protected function findNodeToEdit(): ?NodeInterface
{
$siteNode = $this->getSiteNodeForLoggedInUser();
if (!$siteNode) {
throw new \RuntimeException('Could not find site node for current user.', 1697707361);
}
$reflectionMethod = new \ReflectionMethod($this->backendRedirectionService, 'getLastVisitedNode');
$reflectionMethod->setAccessible(true);
$node = $reflectionMethod->invoke($this->backendRedirectionService, $siteNode->getContext()->getWorkspaceName());
Expand Down
9 changes: 7 additions & 2 deletions packages/neos-ui-editors/src/Editors/Range/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ class RangeEditor extends PureComponent {
handleChange = event => {
const {options} = this.props;
const {target} = event;
const useParseInt = (options.step || 1) % 1 === 0;

let value = parseInt(target.value, 10);
let value = useParseInt ? parseInt(target.value, 10) : parseFloat(target.value, 10);
if (isNaN(value)) {
return;
}
Expand All @@ -64,6 +65,10 @@ class RangeEditor extends PureComponent {
const options = {...this.constructor.defaultProps.options, ...this.props.options};
const {value, highlight} = this.props;
const valueAsString = value === 0 ? '0' : (value || '');
// Calculate the width of the input field based on the length of the min, max and step values
const numLength = value => value.toString().length;
const additionalStepLength = numLength(options.step) - 1;
const styleWidth = Math.max(numLength(options.min), numLength(options.max)) + additionalStepLength + 'ch';

return (
<div
Expand Down Expand Up @@ -94,7 +99,7 @@ class RangeEditor extends PureComponent {
onKeyPress={this.onKeyPress}
onChange={this.handleChange}
value={valueAsString}
style={ {width: `${options.max.toString().length}ch`} }
style={ {width: styleWidth} }
disabled={options.disabled}
/>
{options.unit}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import style from './style.css';
const shouldShowUnappliedChangesOverlay = isDirty && !shouldPromptToHandleUnappliedChanges;
const shouldShowSecondaryInspector = selectors.UI.Inspector.shouldShowSecondaryInspector(state);
const focusedNode = selectors.CR.Nodes.focusedSelector(state);
const parentNode = selectors.CR.Nodes.nodeByContextPath(state)(focusedNode.parent);
const parentNode = focusedNode ? selectors.CR.Nodes.nodeByContextPath(state)(focusedNode.parent) : null;

return {
focusedNode,
Expand Down

0 comments on commit a92bbff

Please sign in to comment.