[nextjs][react][vue][angular] Add support for layout service REST configuration name #1527
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description / Motivation
This PR adds support to define what Layout Service configuration name should be used for REST calls to Layout Service in Next.js, React, Vue and Angular packages:
CONFIGURATION_NAME
environment variable, which by default holds the valuedefault
config-generator
and adds a new property in the returned configuration objectconfigurationName
config property in thelayout-service-factory
to configure theRestLayoutService
REST calls to layout service can have multiple configurations in Sitecore. The linked documentation also exposes a configuration named
jss
.However, the
RestLayoutService
has hard-coded that the configuration name has to bedefault
, which contradicts (IMHO) the provided example in the documentation.Testing Details
Prerequisits
jss
(for instance)sitecore-jss:*
jss start:connected
Test case
/default
.When the
default
layout service configuration is not configured, miss configured, or configured in a special dedicated way, it may not return thesitecore.route
object in the response, which causes the default assumptions from the routing in JSS frontend to fail and therefor to error.Tested manually as reported in the
Testing Details
sectionTypes of changes