Skip to content

Commit

Permalink
Feature: Resolve Merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
pKallert committed Dec 29, 2023
2 parents d048232 + b838ab8 commit 639b6cd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export default class DimensionSelector extends PureComponent {
const presetOptions = mapValues(
presets,
(presetConfiguration, presetName) => {

return {
label: presetConfiguration?.label,
value: presetName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ export default class DimensionSwitcher extends PureComponent {
}
}


handleApplyPresets = () => {
this.props.selectPreset(this.state.transientPresets);
this.setState({isOpen: false, transientPresets: {}});
Expand Down Expand Up @@ -277,21 +276,21 @@ export default class DimensionSwitcher extends PureComponent {

return null;
}

getDocumentDimensions(dimensionName) {
const {getNodeByContextPath, documentNode, allowedPresets, contentDimensions} = this.props;
const currentDocumentNode = getNodeByContextPath(documentNode.contextPath)
if(!currentDocumentNode.dimensions){
if (!currentDocumentNode.dimensions) {
return allowedPresets[dimensionName]
}

let variants = [...currentDocumentNode?.otherNodeVariants];
const variants = [...currentDocumentNode?.otherNodeVariants];
variants.push(currentDocumentNode.dimensions)
console.log(variants);
for(let dimensionKey of Object.keys(contentDimensions)){

Check failure on line 290 in packages/neos-ui/src/Containers/PrimaryToolbar/DimensionSwitcher/index.js

View workflow job for this annotation

GitHub Actions / Code style

Expected space(s) after "for"

Check failure on line 290 in packages/neos-ui/src/Containers/PrimaryToolbar/DimensionSwitcher/index.js

View workflow job for this annotation

GitHub Actions / Code style

'dimensionKey' is never reassigned. Use 'const' instead

Check failure on line 290 in packages/neos-ui/src/Containers/PrimaryToolbar/DimensionSwitcher/index.js

View workflow job for this annotation

GitHub Actions / Code style

Missing space before opening brace
if(dimensionKey == dimensionName && contentDimensions.length !== 1) {

Check failure on line 291 in packages/neos-ui/src/Containers/PrimaryToolbar/DimensionSwitcher/index.js

View workflow job for this annotation

GitHub Actions / Code style

Expected space(s) after "if"

Check failure on line 291 in packages/neos-ui/src/Containers/PrimaryToolbar/DimensionSwitcher/index.js

View workflow job for this annotation

GitHub Actions / Code style

Expected '===' and instead saw '=='
break;
}
console.log(this.state.transientPresets[dimensionKey])
Object.entries(variants).forEach(entry => {
const [key, value] = entry;
console.log(value[dimensionKey])
Expand All @@ -300,15 +299,14 @@ export default class DimensionSwitcher extends PureComponent {
}
});
}
let dimensions = []
const dimensions = []
Object.values(variants).forEach(entry => {
dimensions.push(entry[dimensionName]);
});
console.log(dimensions)

return dimensions;
}


presetsForDimension(dimensionName) {
const {contentDimensions, allowedPresets, i18nRegistry} = this.props;
const dimensionConfiguration = $get(dimensionName, contentDimensions);
Expand All @@ -319,7 +317,7 @@ export default class DimensionSwitcher extends PureComponent {
label: i18nRegistry.translate(presetConfiguration.label),
disallowed: !(allowedPresets[dimensionName] && allowedPresets[dimensionName].includes(presetName)),
existing: documentDimensions.some(dimension=> presetConfiguration.values.includes(dimension)),
url: this.createDirectDimensionsLink( dimensionName, presetName)
url: (Object.keys(contentDimensionsObject).length === 1) ? this.createDirectDimensionsLink( dimensionName, presetName) : null
});
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
}

.nonExistent {
opacity: 0.5;
opacity: .5;
}
.disallowed {
text-decoration: line-through;
Expand Down

0 comments on commit 639b6cd

Please sign in to comment.