Added option to target environment
Needed a way to target a specific envrionment on the target space.
Added environment and spaceId to SpaceConfig (old id has become <spaceId>-<environmentName>)
@jvtroyen - I think this goes a bit beyond what I think we should be doing. From my POV, the idea of this app is to target content that is published and production ready before it can be referenced across spaces. In that scenario, we should only be targeting master as the environment.
That being said - I could see value in allowing users to opt-in to using a lower environment as something of a "Developer" option. In that scenario - the spaceConfig option should remain unchanged, and we'd use that to pull in the available environments when selecting the entry. We could potentially extend the configuration to allow the user to select which environments are acceptable for pulling entries from by adding an environment array to the configuration object with a boolean value per environment.
The other thing that would need to change if we introduce environment would be to include the environment id in the JSON output of the field, something like:
{
"sys": {
"type": "Link",
"linkType": "CrossSpaceEntry",
"id": "<entry-id>",
"space": {
"sys": {
"type": "Link",
"linkType": "Space",
"id": "<space-id>"
}
},
"environment": {
"sys": {
"id": "<environment-id>",
"type": "Link",
"linkType": "Environment",
}
}
}
}