mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-23 00:22:19 +01:00
fix: broken UI when importing features into environments which are not linked to the feature's project ## Related to - PR: https://github.com/Unleash/unleash/pull/2209 - Issue: https://github.com/Unleash/unleash/issues/2186 - Issue: https://github.com/Unleash/unleash/issues/2193 ## Expected behaviour: After importing we should see:  ## About the changes **The problem:** when we import we have projects, features and environments. Each feature belongs to a project (this is by default and the imported file enforces that). The links between projects and features, or projects and environments, depend on us creating those relationships. When we add a feature to an environment we're not validating that the project and the environment are connected. Because of that, in some situations (like in this test), we can end up with a project with features but no environment. This breaks a weak constraint we had which is that all projects should have at least one environment. **This PR makes the following assumption when importing**: _if a feature is added to an environment, and that environment is still not linked to the project that feature belongs to, then the project and environments have to be linked_. The rationale behind this is that the user couldn't have generated this export file without the project and environment being linked together. |
||
---|---|---|
.. | ||
lib | ||
mailtemplates | ||
migrations | ||
test | ||
migrator.ts | ||
server-dev.ts | ||
server.ts |