Skip to content

Commit

Permalink
Merge pull request neos#3739 from NicoleNitschke/bugfix/neos#3671-dis…
Browse files Browse the repository at this point in the history
…able-custom-ratio

BUGFIX neos#3671: add check if custom ratios for images are allowed
  • Loading branch information
mhsdesign authored Mar 14, 2024
2 parents 5245d97 + bf60b81 commit 1df37d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ export default class AspectRatioDropDown extends PureComponent {
PropTypes.instanceOf(AspectRatioOption)
),
placeholder: PropTypes.string,
allowCustomRatios: PropTypes.boolean,

onSelect: PropTypes.func.isRequired,
onClear: PropTypes.func.isRequired
};

render() {
const {options, current, placeholder, onSelect, onClear} = this.props;
const {options, current, placeholder, allowCustomRatios, onSelect, onClear} = this.props;

const dropDownHeaderClasses = mergeClassNames({
[style.dropDown__btn]: true,
Expand All @@ -58,7 +59,8 @@ export default class AspectRatioDropDown extends PureComponent {
<DropDown.Header className={dropDownHeaderClasses}>
{current.label}
</DropDown.Header>
<IconButton icon="times" onClick={onClear} className={style.dropDown__clear}/>
{allowCustomRatios && (
<IconButton icon="times" onClick={onClear} className={style.dropDown__clear}/>)}
</div>
) : (
<DropDown.Header className={dropDownHeaderClasses}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ export default class ImageCropper extends PureComponent {
{!aspectRatioLocked && <AspectRatioDropDown
placeholder={`${i18nRegistry.translate('Neos.Neos:Main:imageCropper__aspect-ratio-placeholder')}`}
current={cropConfiguration.aspectRatioStrategy}
allowCustomRatios={allowCustomRatios}
options={cropConfiguration.aspectRatioOptions}
onSelect={this.handleSetAspectRatio}
onClear={this.handleClearAspectRatio}
Expand Down

0 comments on commit 1df37d0

Please sign in to comment.