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

Add id value to yml collection #4146

Closed
2 of 5 tasks
steven-positive-tran opened this issue Mar 10, 2023 · 11 comments
Closed
2 of 5 tasks

Add id value to yml collection #4146

steven-positive-tran opened this issue Mar 10, 2023 · 11 comments
Labels
Complexity: Medium Feature: Infrastructure For changes on site technical architecture role: back end/devOps Tasks for back-end developers size: 2pt Can be done in 7-12 hours
Milestone

Comments

@steven-positive-tran
Copy link
Member

steven-positive-tran commented Mar 10, 2023

Dependency

Prerequisite

  1. Be a member of Hack for LA. (There are no fees to join.) If you have not joined yet, please follow the steps on our Getting Started page.

  2. Please make sure you have read our Hack for LA Contributing Guide before you claim/start working on an issue.

Overview

As a developer, we want to add an id key pair value to each component so that when we program in the backend we can refer to each component using the id or create components of certain elements using an id.

From jyaymine #2216

Okay, so here is the gist. In HTML the id attribute is used to identify an HTML object. For example:

<div id="div-1" />

Now imagine that you have a function that programmatically inserts these ids, say for instance:

function add_ids_to_divs(id):
  div.add(id)

This function will work in code, but when the resulting

is rendered through the brower's engine the HTML will crash if we insert any values that does not follow the HTML5 standard. In order to work around this then, we need checks to:

1. make sure all ids are unique

2. make sure that there are no spaces

3. make sure that there is at least 1 character

But imagine if we need to reuse this id, for some other function, which has other criteria such as:

1. it cannot have symbols

2. it cannot container upper cases

You can see how this will increasingly constrain the id and make it near impossible to account for. Since we are using some visible field to construct the ID, such as the project's name, we need to apply escaping, since we cannot simply change the name directly to use it as an id field (we do not want to end up displaying "HackforLA Website" as "HackForLAWebsite").

Therefore, we need some other value that can act as a value for the id attribute in html tags. This value should not be displayed, so we do not have to worry about how it'll appear to visitors, should not change, and also be unique (that way, we can use the id as exceptions, such as in if id is "12345" then do this).

Action Items

  • For each yml file add an id key value for each component.
    • For community, press, credits, and program-area each component are in a seperate yml file
      For example using communities/data-science
    name: Data Science
    description: This group is a space where data science professionals from different projects can come together to share effective 
    ...


    id: communities_id
  • The rest all the components are in the same file so you have to add the id key pair value to each.
    For example in internal/accomplishments.yml
- title: National Day of Civic Hacking (NdoCH)
  ...
  id: accomplishment_id
- title: Food Oasis
  ...
  id: accomplishment_id

  etc

Resources

@steven-positive-tran steven-positive-tran added role: back end/devOps Tasks for back-end developers Feature: Infrastructure For changes on site technical architecture ready for dev lead Issues that tech leads or merge team members need to follow up on size: 2pt Can be done in 7-12 hours labels Mar 10, 2023
@steven-positive-tran steven-positive-tran added Complexity: Small Take this type of issues after the successful merge of your second good first issue and removed Complexity: Missing labels Mar 10, 2023
@ExperimentsInHonesty
Copy link
Member

@steven-positive-tran FYI

  • I moved this issue to the new issue approval column the only issues that go in the icebox are ones with unresolved dependencies, and I see that you are actually trying to close the other issue. See my notes on Audit yml collections for specific ids #2216 about how to close.
  • I reformatted the issue to conform to our standard issue template. I don't know if we use prerequisites on issues other than good first issue, but it's causing no harm, so I left it.

Here is the standard formatting.

### Dependencies
ANY ISSUE NUMBERS THAT ARE BLOCKERS OR OTHER REASONS WHY THIS WOULD LIVE IN THE ICEBOX

### Overview
WE NEED TO DO X FOR Y REASON

### Action Items
A STEP BY STEP LIST OF ALL THE TASK ITEMS THAT YOU CAN THINK OF NOW EXAMPLES INCLUDE: Research, reporting, etc.

### Resources/Instructions
REPLACE THIS TEXT -If there is a website which has documentation that helps with this issue provide the link(s) here.

@ExperimentsInHonesty
Copy link
Member

@steven-positive-tran generally small issues aren't 2pts. I am not saying it could not be, but just want you to double check that. This seems more like a medium or large size issue.

@jdingeman
Copy link
Member

Message from @ExperimentsInHonesty: I don't doubt this issue needs to be done, but I would like to know more about it, we need a wiki page that explains the usage #4146 Also, I need to know more about it so I can add the milestone properly. For now I am going to assume its related to making the accomplishments on the about page work, so i'll put it in Know HfLA.

From merge team: When will you be able to come to a meeting so we can discuss this?

@ExperimentsInHonesty
Copy link
Member

@ExperimentsInHonesty ExperimentsInHonesty added the Draft Issue is still in the process of being created label Mar 21, 2023
@steven-positive-tran steven-positive-tran added Complexity: Medium and removed Complexity: Small Take this type of issues after the successful merge of your second good first issue labels Mar 22, 2023
@jdingeman
Copy link
Member

@ExperimentsInHonesty, I think this could either be 1 issue working across all the files, or turn into an epic with a bunch of smaller issues since it is multiple files.

@steven-positive-tran, for those that say id: accomplishment_id are you saying they should just be id: accomplishment_id or would the id be something like

- title: National Day of Civic Hacking (NdoCH)
  ...
  id: accomplishment_nationaldayofcivichacking
- title: Food Oasis
  ...
  id: accomplishment_foodoasis

 etc

@jdingeman jdingeman added ready for product and removed ready for dev lead Issues that tech leads or merge team members need to follow up on labels Apr 7, 2023
@steven-positive-tran
Copy link
Member Author

I was thinking id: accomplishment_id because in my eye we are just listing and not doing anything unique with each and every individual accomplisments.
image

@ExperimentsInHonesty
Copy link
Member

ExperimentsInHonesty commented Apr 12, 2023

@steven-positive-tran @jdingeman We are in the process of re-architecting the accomplishments section on this issue #4188 (see also notes). So I want to put reviewing this issue on hold until that issue is addressed, unless you have a different use case where adding IDs is needed now.

@steven-positive-tran steven-positive-tran added the Dependency An issue is blocking the completion or starting of another issue label Apr 19, 2023
@ExperimentsInHonesty ExperimentsInHonesty added ready for dev lead Issues that tech leads or merge team members need to follow up on and removed Dependency An issue is blocking the completion or starting of another issue labels Jan 24, 2024
@ExperimentsInHonesty
Copy link
Member

@roslynwythe I moved this into the new issue review column because the dependency is resolved. Please add a ready for prioritization label if its ready.

@roslynwythe
Copy link
Member

roslynwythe commented Jun 16, 2024

@steven-positive-tran @ExperimentsInHonesty I am not entirely convinced of the need for this issue but if we do puruse it, I advise that each item in each yml file (for example, each accomplishment) should be assigned a unique id. Regarding the composition of the ids, I like Justin's suggestion above:

- title: National Day of Civic Hacking (NdoCH)
  ...
  id: accomplishment_nationaldayofcivichacking
- title: Food Oasis
  ...
  id: accomplishment_foodoasis

 etc

@roslynwythe
Copy link
Member

roslynwythe commented Sep 2, 2024

@ExperimentsInHonesty I am not convinced of the need for this issue. The audit was not clear on this point but I am not aware of any webpages in which it has been necessary to include an id attribute. If the need arises to include an id attribute when generating HTML elements from YML data, it would seem that there are programmatic means of composing unique ids, that would be more reliable than manually maintaining ids.

@ExperimentsInHonesty
Copy link
Member

We have not found a compelling reason for this doing this, at this time, or in the near future.

@ExperimentsInHonesty ExperimentsInHonesty closed this as not planned Won't fix, can't repro, duplicate, stale Sep 3, 2024
@github-project-automation github-project-automation bot moved this from New Issue Approval to QA in P: HfLA Website: Project Board Sep 3, 2024
@ExperimentsInHonesty ExperimentsInHonesty removed Draft Issue is still in the process of being created Added to dev/pm agenda ready for dev lead Issues that tech leads or merge team members need to follow up on labels Sep 3, 2024
@kgold2018 kgold2018 moved this from QA to Done in P: HfLA Website: Project Board Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: Medium Feature: Infrastructure For changes on site technical architecture role: back end/devOps Tasks for back-end developers size: 2pt Can be done in 7-12 hours
Projects
Development

No branches or pull requests

5 participants