mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
dc08f1dadd
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: ![image](https://user-images.githubusercontent.com/455064/202149719-fa74b3b7-3936-443b-9d0e-8f1ca2e779f4.png) ## 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. |
||
---|---|---|
.. | ||
access-store.ts | ||
addon-store.ts | ||
api-token-store.ts | ||
client-applications-store.ts | ||
client-instance-store.ts | ||
client-metrics-store-v2.ts | ||
context-field-store.ts | ||
db-pool.ts | ||
environment-store.ts | ||
event-store.test.ts | ||
event-store.ts | ||
feature-environment-store.ts | ||
feature-strategy-store.ts | ||
feature-tag-store.ts | ||
feature-toggle-client-store.ts | ||
feature-toggle-store.ts | ||
feature-type-store.ts | ||
group-store.ts | ||
index.ts | ||
pat-store.ts | ||
project-store.ts | ||
public-signup-token-store.ts | ||
reset-token-store.ts | ||
role-store.ts | ||
segment-store.ts | ||
session-store.ts | ||
setting-store.ts | ||
strategy-store.ts | ||
tag-store.ts | ||
tag-type-store.ts | ||
user-feedback-store.ts | ||
user-splash-store.ts | ||
user-store.ts |