Deduplicate state properties from vulnerabilities & security reports store modules
- Discussion for context: #8146 (comment 214915760)
- Related issue: #8146 (closed)
- Affected source files:
The security dashboard and security reports stores tend to duplicate some properties to notify both the vulnerabilities listing and the vulnerability modal of state changes triggered by XHR requests and user interactions. Thus multiple mutations set properties on both the root state AND the modal's state which feels redundant.
An example is the isDismissingVulnerability
property: https://gitlab.com/gitlab-org/gitlab/blob/f5d6f4f30b7d5ebccb51ca4c8a1bb1be2000191d/ee/app/assets/javascripts/security_dashboard/store/modules/vulnerabilities/mutations.js#L243-244
Having to set these properties in 2 different locations in the state is error prone and doesn't have any benefit feature-wise at the moment.
To clean this up, we could remove these duplicated properties from the modal's state and refactor the modal component so that it accesses those properties from the rootState
, rather than from its own state.