1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/src/lib/db
Gastón Fournier dc08f1dadd
fix: broken UI after import (#2447)
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.
2022-11-17 14:05:57 +01:00
..
access-store.ts Permission guards in existing endpoints interacting with feature toggle configuration (#2418) 2022-11-14 15:05:26 +02:00
addon-store.ts
api-token-store.ts
client-applications-store.ts
client-instance-store.ts
client-metrics-store-v2.ts
context-field-store.ts Feat/stats service (#2211) 2022-10-25 13:10:27 +02:00
db-pool.ts
environment-store.ts Update environments (#2339) 2022-11-11 10:24:56 +00:00
event-store.test.ts
event-store.ts
feature-environment-store.ts fix: broken UI after import (#2447) 2022-11-17 14:05:57 +01:00
feature-strategy-store.ts feat: update strategy segments with edit / create strategy (#2420) 2022-11-16 15:35:39 +01:00
feature-tag-store.ts
feature-toggle-client-store.ts Feature toggles: Filtering by tags (#2396) 2022-11-15 10:24:36 +00:00
feature-toggle-store.ts
feature-type-store.ts
group-store.ts Feat/stats service (#2211) 2022-10-25 13:10:27 +02:00
index.ts Feature toggles: Filtering by tags (#2396) 2022-11-15 10:24:36 +00:00
pat-store.ts fix: limit total of PATs a user can have (#2301) 2022-11-02 08:11:35 +00:00
project-store.ts Feat/add change request settings (#2390) 2022-11-11 10:09:25 +02:00
public-signup-token-store.ts
reset-token-store.ts
role-store.ts Feat/stats service (#2211) 2022-10-25 13:10:27 +02:00
segment-store.ts Feat/stats service (#2211) 2022-10-25 13:10:27 +02:00
session-store.ts
setting-store.ts
strategy-store.ts Feat/stats service (#2211) 2022-10-25 13:10:27 +02:00
tag-store.ts
tag-type-store.ts
user-feedback-store.ts
user-splash-store.ts
user-store.ts