Skip to content
Open
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
8 changes: 4 additions & 4 deletions Classes/Controller/ModuleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ public function createVocabularyAction(string $rootNodeAddress, string $name, ar

$rootNode = $this->taxonomyService->getNodeByNodeAddress($rootNodeAddress);
$subgraph = $this->taxonomyService->getSubgraphForNode($rootNode);
$generalizations = $contentRepository->getVariationGraph()->getRootGeneralizations();
$generalizations = $contentRepository->getVariationGraph()->getDimensionSpacePoints() ? $contentRepository->getVariationGraph()->getDimensionSpacePoints() : $contentRepository->getVariationGraph()->getRootGeneralizations();

$nodeAddress = NodeAddress::fromJsonString($rootNodeAddress);
$originDimensionSpacePoint = OriginDimensionSpacePoint::fromDimensionSpacePoint($nodeAddress->dimensionSpacePoint);

Expand Down Expand Up @@ -252,7 +253,6 @@ public function updateVocabularyAction(string $vocabularyNodeAddress, string $na
{
$vocabularyNode = $this->taxonomyService->getNodeByNodeAddress($vocabularyNodeAddress);
$subgraph = $this->contentRepositoryRegistry->subgraphForNode($vocabularyNode);
$rootNode = $this->taxonomyService->findOrCreateRoot($subgraph);

$this->contentRepository->handle(
SetNodeProperties::create(
Expand Down Expand Up @@ -283,7 +283,7 @@ public function updateVocabularyAction(string $vocabularyNodeAddress, string $na
);
}

$this->redirect('index', null, null, ['rootNodeAddress' => NodeAddress::fromNode($rootNode)]);
$this->redirect('index');
}

/**
Expand Down Expand Up @@ -350,7 +350,7 @@ public function createTaxonomyAction(string $parentNodeAddress, string $name, ar
}
$subgraph = $this->taxonomyService->getSubgraphForNode($parentNode);

$generalizations = $this->contentRepository->getVariationGraph()->getRootGeneralizations();
$generalizations = $this->contentRepository->getVariationGraph()->getDimensionSpacePoints() ? $this->contentRepository->getVariationGraph()->getDimensionSpacePoints() : $this->contentRepository->getVariationGraph()->getRootGeneralizations();
$nodeAddress = NodeAddress::fromJsonString($parentNodeAddress);
$originDimensionSpacePoint = OriginDimensionSpacePoint::fromDimensionSpacePoint($nodeAddress->dimensionSpacePoint);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,41 @@ prototype(Sitegeist.Taxonomy:Views.Fragments.DimensionSelector) < prototype(Neos
field.value={Neos.Dimension.currentValue(props.contextNode, dimensionKey).value}
attributes.onchange="this.form.submit()"
>
<Neos.Fusion.Form:Select.Option >{String.firstLetterToUpperCase(dimensionKey)}: {Neos.Dimension.currentValue(props.contextNode, dimensionKey).value}</Neos.Fusion.Form:Select.Option>
<Neos.Fusion:Loop items={dimension.values.rootValues} itemName="dimensionValue" itemKey="presetIdentifier">
<Neos.Fusion.Form:Select.Option option.value={dimensionValue.value}>{String.firstLetterToUpperCase(dimensionKey)}: {dimensionValue.value}</Neos.Fusion.Form:Select.Option>
</Neos.Fusion:Loop>
<Sitegeist.Taxonomy:Views.Fragments.DimensionSelector.Options dimension={dimension} dimensionKey={dimensionKey} contextNode={props.contextNode} />
</Neos.Fusion.Form:Select>
</Neos.Fusion:Loop>

</Neos.Fusion.Form:Form>
`
}

prototype(Sitegeist.Taxonomy:Views.Fragments.DimensionSelector.Options) < prototype(Neos.Fusion:Component) {
dimension = null
dimensionKey = null
contextNode = null

@context {
dimension = ${this.dimension}
dimensionKey = ${this.dimensionKey}
contextNode = ${this.contextNode}
}

renderer = Neos.Fusion:Case {
dimensionConfigured {
condition = ${dimension.values}
renderer = afx`
<Neos.Fusion:Loop items={dimension.values} itemName="dimensionValue" itemKey="presetIdentifier">
<Neos.Fusion.Form:Select.Option attributes.selected={Neos.Dimension.currentValue(contextNode, dimensionKey).value == dimensionValue.value} option.value={dimensionValue.value}>{String.firstLetterToUpperCase(dimensionKey)}: {dimensionValue.value}</Neos.Fusion.Form:Select.Option>
</Neos.Fusion:Loop>
`
}
default {
condition = ${dimension.rootValues}
renderer = afx`
<Neos.Fusion.Form:Select.Option >{String.firstLetterToUpperCase(dimensionKey)}: {Neos.Dimension.currentValue(props.contextNode, dimensionKey).value}</Neos.Fusion.Form:Select.Option>
<Neos.Fusion:Loop items={dimension.values.rootValues} itemName="dimensionValue" itemKey="presetIdentifier">
<Neos.Fusion.Form:Select.Option option.value={dimensionValue.value}>{String.firstLetterToUpperCase(dimensionKey)}: {dimensionValue.value}</Neos.Fusion.Form:Select.Option>
</Neos.Fusion:Loop>
`
}
}
}