Altinn / altinn-studio

Next generation open source Altinn platform and applications.
https://docs.altinn.studio
BSD 3-Clause "New" or "Revised" License
114 stars 70 forks source link

When component is deleted, ensure to remove all configuration for the deleted component #12576

Closed framitdavid closed 3 months ago

framitdavid commented 6 months ago

What: When a user deletes a component, we need to ensure that all configurations pointing to this component are appropriately removed across all files.

Relevant possible occurrences:

Backend: This issue can be resolved by implementing synchronization logic to handle the deletion of configurations distributed across multiple files in backend. Suggest that we implement this in the same way as we do with ProcessEditor task-id.

Frontend: The front end needs to add invalidation for all files specified in the SyncSuccess message received from the backend. We should rely on the backend to inform us about the changed files, and subsequently, we invalidate the cache accordingly. This issue entails implementing the necessary logic to invalidate cache entries based on the files specified in the SyncSuccess message from the backend.

### Acceptance criteria
- [ ] Users can delete components with configurations referenced in other files, and the system will clean up associated files.
- [ ] After deleting the component, users should observe an updated UI wherein all configurations related to the deleted component are removed.
### Playwrigth (e2e-tests)
- [ ] Add two different components to Page 1
- [ ] Configure component one to include an expression referencing component two.
- [ ] Delete component two
- [ ] Verify that the expression configuration referencing component two has been deleted.
lassopicasso commented 6 months ago

Related issue: https://github.com/Altinn/altinn-studio/issues/12564

framitdavid commented 3 months ago

Great work! Tested OK in dev. 👏