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

Added option to target environment #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jvtroyen
Copy link

@jvtroyen jvtroyen commented Apr 6, 2022

Needed a way to target a specific envrionment on the target space.

Added environment and spaceId to SpaceConfig (old id has become -)

@jgrahamdev
Copy link
Owner

@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",
          }
        }
    }
}

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

Successfully merging this pull request may close these issues.

2 participants