Condense project selector stores/instances
The following discussion from !64560 (merged) should be addressed:
-
@aturinske started a discussion: (+1 comment) This required a lot of methods and that was annoying. Especially since I copied all of them the instance-level security dashboard component and they all seem to work. Maybe (as a follow-up) I should create a wrapper around
project-selector
that encapsulates all these methods for these two instances? Counter-point: There are only two instances, so maybe do that if there is a third instance? There are actually two other instances of theproject-selector
(instance-level operations and environment dashboards), but both of those use aVuex
store. Oh, there is aproject_selctor Vuex store
, should I be using that instead of these copy/pasted methods?I will...look into this.
Implementation
I talked to @ekigbo about this and we decided on a two pronged approach
-
1. Work on trying to merge the Vuex stores together so that the one inDelete thevue_shared
is left. This can start by merging the actions; a lot of the actions are the exact same so import the actions from thevue_shared
one into the other and delete the repeated actions. Then simplify any extra actions that do anything different and use that actions file as an override file. Hopefully by then we will be able to see if these Vuex stores can be condensed into one or if they need to be separatesecurity dashboard project selector Vuex store
as it is only used in https://gitlab.com/gitlab-org/gitlab/blob/master/ee/spec/frontend/security_dashboard/store/modules/vulnerable_projects/mutations_spec.js, which seems like a mistake. -
2. Replace all the reused logic in instance-level security dashboard project manager with the newly created instance_project_selector
component. -
As a side note, we should also create storybook stories for the project_selector
-
Friendly reminder to make sure to ask for a UX feedback after submitting the MR.
Additional context
The current implementation has a help text. We want to keep that text.
current project selector | proposed project selector |
---|---|