Refactor `groups_list_item.vue` and `projects_list_item.vue` into shared layout component
Background
This is a maintenancerefactor issue about combining shared logic between two Vue components to improve maintainability. Currently these components are only used in organizations but in the future they will be used in epics such as &13066.
We have project and group list components in ~/vue_shared/components/projects_list
and ~/vue_shared/components/groups_list
. Originally these components were built sepereatly because we weren't sure how similar the layout and logic would be. It has become clear that there is quite a bit of shared layout and logic so we should move that to a shared component.
Engineering guide
- Create a
resource_list.vue
component to~/vue_shared/components/resource_lists
- Create a
resource_list_item.vue
component to~/vue_shared/components/resource_lists
- Move shared logic and layout from
~/vue_shared/components/projects_list
and~/vue_shared/components/groups_list
to those components. This should be a combination of slots and props. I think we should only move the logic that is simple. If there is something that requires a logic to add to the shared then we should consider if it is worth moving.
Edited by Peter Hegman