Skip to content

FEATURE: Add Neos.Dimension helper #4085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 10, 2023
Merged

FEATURE: Add Neos.Dimension helper #4085

merged 4 commits into from
Mar 10, 2023

Conversation

ahaeslich
Copy link
Member

@ahaeslich ahaeslich commented Mar 9, 2023

Add Neos.Dimension to find informations regarding node dimensions and find variants of nodes.

  • currentValue(Node $node, ContentDimensionId|string $dimensionName): ?string
  • originValue(Node $node, ContentDimensionId|string $dimensionName): ?string
  • all(ContentRepositoryId|Node $subject): array<string,ContentDimension>
  • findVariantInDimension(Node $node, ContentDimensionId|string $dimensionName, ContentDimensionValue|string $dimensionValue): ?Node

In addtion:

  • rename nodeAddressToString to serializedNodeAddress in Neos.Node helper

Review instructions

  • Not test case was added as all actual computation is delegated to the content repository. So static analysis should be sufficient here.
  • This helper was introduced to help with the ESCR compatibility of Neos.Seo

Relates: neos/neos-seo#172

Checklist

  • Code follows the PSR-2 coding style
  • Tests have been created, run and adjusted as needed
  • The PR is created against the lowest maintained branch
  • Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • Reviewer - The first section explains the change briefly for change-logs
  • Reviewer - Breaking Changes are marked with !!! and have upgrade-instructions

@ahaeslich ahaeslich requested review from mficzel and nezaniel March 9, 2023 13:11
@bwaidelich bwaidelich changed the title FEATURE: Add Neos.Dimension helper 9.0: FEATURE: Add Neos.Dimension helper Mar 9, 2023
@bwaidelich bwaidelich changed the title 9.0: FEATURE: Add Neos.Dimension helper FEATURE: Add Neos.Dimension helper Mar 9, 2023
Copy link
Member

@mficzel mficzel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I generally approve concept and code but the phpstan issues should be resolved.

@ahaeslich ahaeslich force-pushed the feature/dimension-helper branch 3 times, most recently from 6270524 to f2b4366 Compare March 9, 2023 16:30
Copy link
Member

@skurfuerst skurfuerst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comments. Thanks @ahaeslich :)

- currentValue(Node $node, string|ContentDimensionId $dimensionName): ?string
- originValue(Node $node, string|ContentDimensionId $dimensionName): ?string
- findDefaultValue(Node $node, string|ContentDimensionId $dimensionName): ?string
- findDimensions(Node $node): array<string,ContentDimension>
- findVariantInDimension(Node $node, string|ContentDimensionId $dimensionName, string|ContentDimensionValue $dimensionValue): ?Node
- findVariantsInDimension(Node $node, string|ContentDimensionId $dimensionName): Nodes
- findPotentialDimensionValues(Node $node, string|ContentDimensionId $dimensionName): ContentDimensionValues
@ahaeslich ahaeslich force-pushed the feature/dimension-helper branch from f2b4366 to 7c01e09 Compare March 10, 2023 10:43
@ahaeslich ahaeslich requested a review from skurfuerst March 10, 2023 10:49
@ahaeslich
Copy link
Member Author

@skurfuerst adjusted as discussed

@mficzel mficzel self-requested a review March 10, 2023 10:50
Copy link
Member

@mficzel mficzel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still valid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants