Skip to content

Modify JavaScript so Ruby and Svelte are included in Filter on Projects page #6071

@jphamtv

Description

@jphamtv

Overview

Ruby and Svelte languages are being excluded from the 'Languages / Technologies' filter because of a conditional in the createFilter function in assets/js/current-projects.js file. We need to modify the code so they are included in the 'Languages / Technologies' filter on the Projects and Home pages.

Action Items

  • Locate the createFilter function in the assets/js/current-projects.js file
  • Replace the following code:
'technologies': [...new Set(sortedProjectData.map(item => (item.project.technologies && item.project.languages?.length > 0) ? [item.project.languages, item.project.technologies].flat() : '').flat() ) ].filter(v=>v!='').sort(),
  • With:
'technologies': [
    ...new Set(
        sortedProjectData.map(item => {
            let combined = [];
            if (item.project.languages?.length > 0) {
                combined = combined.concat(item.project.languages);
            }
            if (item.project.technologies?.length > 0) {
                combined = combined.concat(item.project.technologies);
            }
            return combined;
        }).flat()
    )
].filter(v => v).sort(),
  • Using Docker, test changes on Projects and Home pages to make sure filters are working correctly
  • Confirm Ruby and Svelte display in the 'Languages / Technologies' filter

Resources/Instructions

assets/js/current-projects.js
Projects page
Home page
See comments where the issue was found
ER #6274: Modify JavaScript so Ruby and Svelte are included in the Filter on Projects page

Metadata

Metadata

Assignees

Labels

Complexity: SmallTake this type of issues after the successful merge of your second good first issueP-Feature: Home pagehttps://www.hackforla.org/P-Feature: Projects pagehttps://www.hackforla.org/projects/role: front endTasks for front end developerssize: 0.25ptCan be done in 0.5 to 1.5 hours

Type

No type

Projects

Status

QA

Relationships

None yet

Development

No branches or pull requests

Issue actions