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

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

Closed
4 of 5 tasks
ronaldpaek opened this issue Jun 19, 2023 · 5 comments · Fixed by #5034
Assignees
Labels
Complexity: Small Take this type of issues after the successful merge of your second good first issue Feature: Refactor JS / Liquid Page is working fine - JS / Liquid needs changes to become consistent with other pages P-Feature: Projects page https://www.hackforla.org/projects/ role: front end Tasks for front end developers size: 0.5pt Can be done in 3 hours or less time sensitive Needs to be worked on by a particular timeframe

Comments

@ronaldpaek
Copy link
Member

ronaldpaek commented Jun 19, 2023

Overview

The purpose of this issue is to refactor the code in the current-project 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.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

  • Confirm that the Tools data is rendering correctly/ as before on the Projects page.

Merge team:

Resources/Instructions

@ronaldpaek ronaldpaek added role: front end Tasks for front end developers time sensitive Needs to be worked on by a particular timeframe Feature: Refactor JS / Liquid Page is working fine - JS / Liquid needs changes to become consistent with other pages Complexity: Small Take this type of issues after the successful merge of your second good first issue P-Feature: Projects page https://www.hackforla.org/projects/ size: 0.5pt Can be done in 3 hours or less labels Jun 19, 2023
@t-will-gillis t-will-gillis added the Draft Issue is still in the process of being created label Jun 21, 2023
@t-will-gillis t-will-gillis added Ready for Prioritization and removed Draft Issue is still in the process of being created labels Jul 3, 2023
@ExperimentsInHonesty

This comment was marked as outdated.

@ronaldpaek

This comment was marked as outdated.

@t-will-gillis
Copy link
Member

@ExperimentsInHonesty I confirmed that @ronaldpaek's changes will render the Tools data correctly before, during, and after the transition from the string to the list/array datatype. I have deleted the image since it is no longer relevant to the issue, and I will hide the comments.

@github-actions
Copy link

Hi @t-will-gillis, thank you for taking up this issue! Hfla appreciates you :)

Do let fellow developers know about your:-
i. Availability: (When are you available to work on the issue/answer questions other programmers might have about your issue?)
ii. ETA: (When do you expect this issue to be completed?)

You're awesome!

P.S. - You may not take up another issue until this issue gets merged (or closed). Thanks again :)

@ronaldpaek
Copy link
Member Author

Did you end up doing this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: Small Take this type of issues after the successful merge of your second good first issue Feature: Refactor JS / Liquid Page is working fine - JS / Liquid needs changes to become consistent with other pages P-Feature: Projects page https://www.hackforla.org/projects/ role: front end Tasks for front end developers size: 0.5pt Can be done in 3 hours or less time sensitive Needs to be worked on by a particular timeframe
Projects
Development

Successfully merging a pull request may close this issue.

3 participants