Skip to content

Refactor current-projects-check file to fix any formatting issue with new tools data format #4861

@ronaldpaek

Description

@ronaldpaek

Overview

The purpose of this issue is to refactor the code in the current-project-check file to handle a list of strings(tools), instead of a single one. This change will maintain consistent formatting and resolve problems introduced by the recent change in data format.

Action Items

  • Refer to current-projects-check.js and locate where tools is being referenced
  • Refactor this code so tools can work as a comma separated String or an Array
{%- if project.tools -%},
"tools": `{{ project.tools }}`
{%- endif -%}

to:

{%- if project.tools -%},
"tools": {{ project.tools | jsonify }}
{%- endif -%}
  • Refactor this code to map over tools since tools will be an Array now and not a String
${project.tools ?
`
<div class="project-tools">
<strong>Tools: </strong>
${ project.tools }
</div>
`:""
}

to:

${project.tools ?
`
<div class="project-tools">
<strong>Tools: </strong>
${(Array.isArray(project.tools) ? project.tools : project.tools.split(','))
    .map(tool => `<p class='project-card-field-inline'> ${tool}</p>`)
    .join(", ")
}
</div>
`: ""
}
  • After completing both changes this should allow us to make changes to tools without effecting the functionality of the website

Merge team:

Resources/Instructions

Metadata

Metadata

Assignees

Labels

Complexity: SmallTake this type of issues after the successful merge of your second good first issueFeature: Refactor JS / LiquidPage is working fine - JS / Liquid needs changes to become consistent with other pagesp-feature: Projects-checkWe use this page to check to make sure that teams are using the Technology section correctlyrole: front endTasks for front end developerssize: 0.5ptCan be done in 3 hours or lesstime sensitiveNeeds to be worked on by a particular timeframe

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions