Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Tools Filter to Projects Check Page #5444

Merged
merged 6 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions _projects/home-unite-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,16 @@ looking:
technologies:
- React
- NoSQL
- AWS
- Flask
- Amazon Cognito
- OIDC
- OAuth2
- MongoDB
location:
- Remote
tools:
tools:
- Figma
- AWS
- Nginx
- Style Components
- Zoom
Expand Down
12 changes: 6 additions & 6 deletions _projects/lucky-parking.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ leadership:
- name: Sam Sengupta
role: UX/UI Designer
links:
slack:
github:
slack:
github:
picture: https://avatars.githubusercontent.com/u/41702879
- name: Seymour Liao
role: Data Scientist
Expand All @@ -81,8 +81,8 @@ leadership:
- name: Carlos Olivas
role: Data Scientist
links:
slack:
github:
slack:
github:
picture: https://avatars.githubusercontent.com/u/41702877
- name: Pratibha Shivanand
role: Data Scientist
Expand Down Expand Up @@ -128,17 +128,17 @@ looking:
skill: Data Analyst/Data Scientist (data cleaning)
technologies:
- React
- AWS
- PostgreSQL
- Node.js
- Mapbox
location:
# - Santa Monica
- Remote
partner: Department of Neighborhood Empowerment
tools:
tools:
- Jupyter Notebooks
- Google Colab
- AWS
program-area:
- Citizen Engagement
visible: true
Expand Down
7 changes: 4 additions & 3 deletions _projects/metro-ontime.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,16 @@ links:
url: 'https://www.metro.net/'
- name: Observable
url: 'https://observablehq.com/@ctsexton/railstats-marey-diagram'
technologies:
- AWS
location:
# - Downtown LA
- Remote
partner: LA Metro
tools:
- AWS
tools:
- Observable
visible: true
program-area:
program-area:
- Environment
status: Completed
---
14 changes: 8 additions & 6 deletions assets/js/current-projects-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ document.addEventListener("DOMContentLoaded",function(){

// create filter dictionary from sorted project data
let filters = createFilter(sortedProjectData);

// Insert Checkbox Filter Into The Dom
for(let [filterName,filterValue] of Object.entries(filters)){
// Add displayed filter title, resolves issue of "program areas" not being valid html attribute name due to spacing
Expand Down Expand Up @@ -161,9 +161,10 @@ function createFilter(sortedProjectData){
return {
// 'looking': [ ... new Set( (sortedProjectData.map(item => item.project.looking ? item.project.looking.map(item => item.category) : '')).flat() ) ].filter(v=>v!='').sort(),
// ^ See issue #1997 for more info on why this is commented out

'technologies': [...new Set(sortedProjectData.map(item => (item.project.technologies?.length > 0) ? [item.project.technologies].flat() : '').flat() ) ].filter(v=>v!='').sort(),
'languages': [...new Set(sortedProjectData.map(item => (item.project.languages?.length > 0) ? [item.project.languages].flat() : '').flat() ) ].filter(v=>v!='').sort(),
'tools': [...new Set(sortedProjectData.map(item => (item.project.tools?.length > 0) ? [item.project.tools].flat() : '').flat() ) ].filter(v=>v!='').sort(),

}
}
Expand Down Expand Up @@ -253,7 +254,7 @@ function updateFilterFrequency(){
let filterFrequencyObject = allFilters.reduce((acc,curr)=> (acc[curr]=0,acc),{});


// Update values on the filterFrquencyObject if item in onPageFilter array exist as a key in this object.
// Update values on the filterFrequencyObject if item in onPageFilter array exist as a key in this object.
for(const item of onPageFilters){
if(item in filterFrequencyObject){
filterFrequencyObject[item] += 1;
Expand Down Expand Up @@ -318,7 +319,7 @@ function updateProjectCardDisplayState(filterParams){
}

/**
* Updates the filter tags show on the page based on the url paramenter
* Updates the filter tags show on the page based on the url parameter
*/
function updateFilterTagDisplayState(filterParams){
// Clear all filter tags
Expand Down Expand Up @@ -429,6 +430,7 @@ return `
data-looking="${project.looking ? [... new Set(project.looking.map(looking => looking.category)) ] : ''}"
data-technologies="${project.technologies ? [... new Set(project.technologies.map(tech => tech))] : '' }"
data-languages="${project.languages ? [... new Set(project.languages.map(lang => lang))] : '' }"
data-tools="${project.tools ? [... new Set(project.tools.map(tool => tool))] : '' }"
data-location="${project.location? project.location.map(city => city) : '' }"
data-programs="${project.programAreas ? project.programAreas.map(programArea => programArea) : '' }"
>
Expand Down Expand Up @@ -485,7 +487,7 @@ return `
// ^ See issue #1997 for more info on why this is commented out
}

${project.languages?.length > 0 ?
${project.languages?.length > 0 ?
`
<div class="project-languages">
<strong>Languages: </strong>
Expand Down Expand Up @@ -517,7 +519,7 @@ return `
}

/**
* Takes a filter category name and array of filter stirings and returns the html string representing a single filter component
* Takes a filter category name and array of filter strings and returns the html string representing a single filter component
*/
function dropDownFilterComponent(categoryName,filterArray,filterTitle){
return `
Expand Down