1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-11-01 19:07:38 +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 fix: add projects and environments field to addon select 2022-07-12 14:32:24 +02:00
api-token-store.ts Feat/add alias to api tokens (#1931) 2022-08-19 10:48:33 +02:00
client-applications-store.ts fix: Stores as typescript and with interfaces. (#902) 2021-08-12 15:04:37 +02:00
client-instance-store.ts fix: uintroduce call to update last_seen on client-instance 2021-12-10 09:31:54 +01:00
client-metrics-store-v2.ts refactor: batch feature metric inserts (#1928) 2022-08-19 10:38:26 +02:00
context-field-store.ts Feat/stats service (#2211) 2022-10-25 13:10:27 +02:00
db-pool.ts feat: add "application_name" as an optional DB option #1170 (#1478) 2022-04-07 20:55:56 +02:00
environment-store.ts Update environments (#2339) 2022-11-11 10:24:56 +00:00
event-store.test.ts feat: add event search endpoint (#1893) 2022-08-09 16:14:50 +02:00
event-store.ts feat: add count to event list (#2036) 2022-09-02 08:35:31 +02:00
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 fix: tag validation duplicate message (#1756) 2022-06-28 08:04:43 +02:00
feature-toggle-client-store.ts Feature toggles: Filtering by tags (#2396) 2022-11-15 10:24:36 +00:00
feature-toggle-store.ts Added missing archivedAt to featureSchema (#1779) 2022-07-01 11:51:26 +00:00
feature-type-store.ts refactor: add OpenAPI schema to feature types controller (#1684) 2022-06-09 13:17:13 +02:00
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 Feat/invite user (#2061) 2022-09-30 13:01:32 +02:00
reset-token-store.ts fix: Stores as typescript and with interfaces. (#902) 2021-08-12 15:04:37 +02:00
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 fix: be explicit when specifying time & replace moment with date-fns (#1072) 2021-11-02 15:13:46 +01:00
setting-store.ts fix: Stores as typescript and with interfaces. (#902) 2021-08-12 15:04:37 +02:00
strategy-store.ts Feat/stats service (#2211) 2022-10-25 13:10:27 +02:00
tag-store.ts fix: Stores as typescript and with interfaces. (#902) 2021-08-12 15:04:37 +02:00
tag-type-store.ts fix: Stores as typescript and with interfaces. (#902) 2021-08-12 15:04:37 +02:00
user-feedback-store.ts fix: Stores as typescript and with interfaces. (#902) 2021-08-12 15:04:37 +02:00
user-splash-store.ts refactor: add schemas to user admin controller (#1692) 2022-06-22 14:55:43 +02:00
user-store.ts fix: PAT not taking into account expires_at (#2167) 2022-10-10 15:38:47 +01:00