Skip to content
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

Add single_snippet_selection content type resolver #56

Merged
merged 3 commits into from
Nov 25, 2020

Conversation

TheCadien
Copy link
Member

See #3

@TheCadien
Copy link
Member Author

Think later it would make sence to create a seperate PR to exclude functions like "getDefaultSnippetId" in own Service to reduce multiple code lines

https://github.com/sulu/SuluHeadlessBundle/pull/56/files#diff-f004113f6462052303a64e1398cc6b9f695bc8995d836e1926b79262dd2f4823R100

Copy link
Contributor

@niklasnatter niklasnatter left a comment

Choose a reason for hiding this comment

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

looks good otherwise. thanks a lot! 🙂


$resolvedSnippet = $this->structureResolver->resolve($snippet, $locale, $loadExcerpt);

return new ContentView($resolvedSnippet, ['id' => $data]);
Copy link
Contributor

Choose a reason for hiding this comment

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

would you mind to adjust the existing SnippetSelectionResolver to use this format too? 🙂 (['ids' => ...]). then this would be consistent for the snippet selections

Copy link
Member

@alexander-schranz alexander-schranz Nov 23, 2020

Choose a reason for hiding this comment

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

Looks like we forget that when fixing #46 same should be done for the PageSelectionResolver and SinglePageSelectionResolver. Then I think all should be consistent.

Copy link
Contributor

Choose a reason for hiding this comment

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

i guess it would also make sense to use that format in case there is no value set 🙂 for example here:

if (null === $data) {
return new ContentView(null);
}

but we dont need to do this in this pull request

Copy link
Member Author

Choose a reason for hiding this comment

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

sorry i'm not sure anymore :D should i change something more ?

Copy link
Contributor

Choose a reason for hiding this comment

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

no - i will create a PR for the other resolvers 🙂

@alexander-schranz alexander-schranz changed the title [ADD] "single_snippet_selection" content type resolver Add single_snippet_selection content type resolver Nov 23, 2020
@alexander-schranz alexander-schranz added the Feature New functionality not yet included in the Bundle label Nov 25, 2020
@niklasnatter
Copy link
Contributor

Nice work - thanks a lot!

@niklasnatter niklasnatter merged commit cc288eb into sulu:master Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New functionality not yet included in the Bundle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants