Skip to content

Refactor secondRepoId for clarity #5231

@JessicaLucindaCheng

Description

@JessicaLucindaCheng

Overview

We need to change secondRepoId to a more descriptive name so that it is clearer it will contain additional repository identification numbers (second, third, fourth, etc) for a project.

Details

Action Items

Developer

  • In _projects/civic-tech-index.md 1, change
    secondRepoId: '275296439'
    
    to
    additional-repo-ids: '275296439'
    
  • In _layouts/project.html 2, change
    secRepoId="{{ page.secondRepoId }}"
    
    to
    additionalRepoIdNums="{{ page.additional-repo-ids }}"
    
  • In assets/js/current-projects.js 3, change the following:
    • Change
      'secondRepoId': {{project.secondRepoId | default: 0}},
      
      to
      'additionalRepoIds': {{project.additional-repo-ids | default: 0}},
      
    • Change
                  if(project.secondRepoId != 0){
                      const secMatchingProject = projectLanguagesArr.find(x=> x.id === project.secondRepoId);
                      const langArr = [...matchingProject.languages, ...secMatchingProject.languages];
      
      to
                  if(project.additionalRepoIds != 0){
                      const additionalMatchingProject = projectLanguagesArr.find(x=> x.id === project.additionalRepoIds);
                      const langArr = [...matchingProject.languages, ...additionalMatchingProject.languages];
      
  • In assets/js/project.js 4, change
    if (scriptTag.getAttribute("secRepoId")){
        const secRepoId = scriptTag.getAttribute("secRepoId");    
        const firstLangs = project.languages;
        const secLangs = findProjectById(secRepoId).languages;
    
        let languagesArr = [...firstLangs, ...secLangs];
    
    to
    if (scriptTag.getAttribute("additionalRepoIdNums")){
        const additionalRepoIdNums = scriptTag.getAttribute("additionalRepoIdNums");    
        const firstLangs = project.languages;
        const additionalLangs = findProjectById(additionalRepoIdNums).languages;
    
        let languagesArr = [...firstLangs, ...additionalLangs];
    
  • Using Docker, on the following web pages, check everything remains the same as on the live website:

Merge Team

Resources/Instructions

Footnotes

  1. _projects/civic-tech-index.md

  2. _layouts/project.html

  3. assets/js/current-projects.js

  4. assets/js/project.js

Metadata

Metadata

Assignees

Labels

Complexity: MediumFeature: Refactor JS / LiquidPage is working fine - JS / Liquid needs changes to become consistent with other pagesP-Feature: Project Info and PageA project's detail page (e.g. https://www.hackforla.org/projects/100-automations)P-Feature: Projects pagehttps://www.hackforla.org/projects/role: back end/devOpsTasks for back-end developerssize: 1ptCan be done in 4-6 hourstime sensitiveNeeds to be worked on by a particular timeframe

Type

No type

Projects

Status

Done

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions