My Projects View - senior-design-marketplace/vue-typescript-client GitHub Wiki
Basics
The my projects view allows the user to see project that are relevant to them. This includes projects that they are an administrator on, projects they are a member of, and projects they have starred.
Contains the following components:
Toolbar
The view has a toolbar at the top of the page that filters what project cards are visible to them. By default, it displays either projects they are a part of OR projects they starred, whichever has more. The amount of projects in each category is displayed as a badge on its corresponding button.
- Crown - projects user is an administrator
- Person - projects user is a contributor
- Star - projects user has starred
Note: projects can count for multiple categories, say a user stars a project they are a member of. The card deck, however, only displays unique projects, even if a project is in multiple of the provided categories.
Logic behind filtering
There are three arrays of projects in the store: administratorOn
, contributorOn
, and starred
. Each of these contains information about their respective projects. Computed values are created from these values that are then used to create the displayProjects
computed array. This computed value works similar to a method that is ran on any update to information. displayProjects
is basically an array that pushes project information from the other arrays if the view
array contains admin
, contrib
, or starred
and the project is not already in displayProjects
. The displayProjects
array is then passed to the embedded card deck for displaying.