open-life-science.github.io icon indicating copy to clipboard operation
open-life-science.github.io copied to clipboard

Link from bios to OLS projects people participated to

Open bebatut opened this issue 3 years ago β€’ 32 comments

Suggested by a community member:

"When I go in projects and participants of previous OLSs, like OLS5, I can click on the project leads of each project (https://openlifesci.org/ols-5/projects-participants/), and that takes me to their bios. It'd be nice that if I am in the bios, I can see which project XY person is related to."

bebatut avatar Sep 16 '22 14:09 bebatut

Hi @bebatut πŸ‘‹πŸΌπŸ™‚ I'm an Outreachy intern and would absolutely love to work on this issue. Thanks!

NPDebs avatar Oct 09 '22 03:10 NPDebs

Hello @bebatut My name is Jolade, I am an Outreachy applicant, I will be working on this issue. thank you.

Jolah1 avatar Oct 10 '22 12:10 Jolah1

As defined in the OLS Outreachy contribution guide,

  • If someone else has already commented, let them try first
  • If they don’t update after three days, the issue is β€œfree” again, and you can pick it up.

@NPDebs were the first one to comment here. Are you still interested to work on this issue? You are already interested in other issues. You might need to pick one

bebatut avatar Oct 10 '22 12:10 bebatut

As defined in the OLS Outreachy contribution guide,

  • If someone else has already commented, let them try first
  • If they don’t update after three days, the issue is β€œfree” again, and you can pick it up.

@NPDebs were the first one to comment here. Are you still interested to work on this issue? You are already interested in other issues. You might need to pick one

Hi @bebatut Yeah. I was throwing darts, hoping to land as many contributions as possible! πŸ˜…

I'll take whatever you assign to me. Thank you!

NPDebs avatar Oct 10 '22 15:10 NPDebs

You are already assigned to another one. Finish it and if this issue is still not assigned you could work on it later

bebatut avatar Oct 11 '22 08:10 bebatut

You are already assigned to another one. Finish it and if this issue is still not assigned you could work on it later

Alrightie. Thank you! @bebatut

NPDebs avatar Oct 11 '22 11:10 NPDebs

You are already assigned to another one. Finish it and if this issue is still not assigned you could work on it later

Hi @bebatut. πŸ˜ƒ

I'm now free as a bird! Well, technically, my PRs are yet to be reviewed and merged. πŸ˜…

Can I please start working on this one while I wait? Please, please, pretty please! πŸ™πŸΌ

NPDebs avatar Oct 13 '22 03:10 NPDebs

Ok. I assign it to you @NPDebs

bebatut avatar Oct 13 '22 07:10 bebatut

Thank you, @bebatut ! πŸ™ŒπŸΌπŸ₯°

Just to verify my understanding of the issue, I have a few questions, please.

This is a project called "ABC..." Vicky Hellon is a participant.

Screenshot_20221013-082844_Chrome.jpg

When I click on her name, it goes to her bio. The goal of this issue is to add a section that states what projects she's involved in, right?

Screenshot_20221013-082912_Chrome.jpg

NPDebs avatar Oct 13 '22 07:10 NPDebs

Yes that is the idea. If you look also at the people page, you can see the role of people in the different cohorts. It could be nice when they were participants to add also there the link to their project in the cohort they participated to

bebatut avatar Oct 13 '22 07:10 bebatut

Okay. πŸ‘ŒπŸΌ I understand the first part of the task.

When I go to the people page, this is what I find...

Screenshot_20221013-085059_Chrome.jpg

To be clear, are you asking me to do the same thing to the bio of all the people here, who were participants in a project?

NPDebs avatar Oct 13 '22 07:10 NPDebs

below you see more details about the people

bebatut avatar Oct 13 '22 08:10 bebatut

below you see more details about the people

Ah. Yes yes! Seen.

I'll get right on it, and revert to you if I have some more questions. Thanks for your patience. πŸ™πŸΌ

NPDebs avatar Oct 13 '22 08:10 NPDebs

Hi @bebatut. πŸ‘‹ Here's a little progress update from me to you...

In the people.yaml file, I added a new key, named projects and assigned its value to be the name of the project the individual participated in. (Note: This info was gotten from the projects.yaml file of each cohort)

Additionally, I specified the cohort of the individual as a new key.

In lines 74-79 of the people.html file (under _includes), you will find the block of code I used to reference these new keys, and print them on the "bio card" of each participant.

On click, the link goes to "https://openlifesci.org/{{% user.cohort %}}/projects-participants/".

ols-progress-update

I have only done this for the members of cohort ols-1. Please, kindly let me know if I am on the right track, so that I can do the same for the remaining cohorts.

I have attached a link to the commit containing the aforementioned changes, right HERE.

Thank you for your time. Best regards.

NPDebs avatar Oct 15 '22 19:10 NPDebs

Thanks @NPDebs for the initial work there.

Regarding adding project information in the people.yaml file

  • I try to avoid adding several time the same information in different location: it gets easily unsynchronized. The information about in which project people are involved is already available in the ols-x-projects.yaml files
  • The people.yaml should also only keep information about the people, not their participation in OLS

In the people.html file, you can see starting on line 41 that I already extract information about roles of people in the different OLS cohorts. You could add there the extraction of the name of project in which they participated.

Btw, I realize the information about participation in OLS cohorts is not displayed anymore in the card as it used to be inside the "Role in OLS: " blurb That would be nice to fix that, and then for participants, adding there the link to their project as {{ site.ur }}/{{ cohort }}/projects-participants/{{ project }} (adding then also the link to the project section in the page, a bit like done in the table on the bottom the project page)

bebatut avatar Oct 17 '22 08:10 bebatut

Hi @bebatut. Thank you so much for your guidance. I now realise how redundant my method would have been.

I'll revert the last commit and get to work, using your roadmap. πŸ‘

NPDebs avatar Oct 17 '22 09:10 NPDebs

Hi @bebatut. πŸ‘‹

Progress update: Not so much progress. I successfully extracted the projects in each cohort by looping through ols-1-projects.yaml.

    {% for proj in project.name %}
        {% capture ols-1-projectnames %}{{ ols-1-projectnames }} {{ proj }}{% endcapture %}
    {% endfor %}

I rendered that on a page to confirmed that it worked. See screenshot below:

Screenshot (298)

To render the specific project a person is associated with (on their bio card), I wrote this block of code. πŸ‘‡

    {% for person in ols-1-participants &}
        {% for project in ols-1-projects %}
            {% if project contains person %}
                {% capture project-name %}{{ project-name }}{{ project.name }}{% endcapture %}
            {% endif %}
        {% endfor %}
    {% endfor %}

Explanation: The variable ols-1-participants stores all the participants, and ols-1-projectnames contains all the projects.

So, I attempted to loop through each person. For that person, loop through the projects, checking for the person in the project.

Since project here represents a unique project (with name, participants, mentors and description), the condition ought to check if the person is in the project. If this condition is met, then capture the name of the project (i.e project.name of the project containing the participant, person).

A link to my commits are attached here....

Please tell me know your thoughts on this. Thank you for your patience! 🀝

NPDebs avatar Oct 18 '22 21:10 NPDebs

It sounds like a great start and you seem to go in the good direction. One comment, what is display in the card in your screenshot looks like the project description not the name πŸ˜„

In the commit you linked I could not see all the changes you mentioned. Did you push all changes?

bebatut avatar Oct 19 '22 14:10 bebatut

Hi @bebatut. I'm glad you approve of my approach, however fruitless it may seem at the moment. πŸ˜‚

What's displayed on the card is actually the name, and not the description of the projects. That particular project seemed to have a really long title. πŸ˜ƒ

About the linked commit.......I removed the block of code that threw an error. Would you like me to put that back in and push?

NPDebs avatar Oct 19 '22 14:10 NPDebs

Up to you right now πŸ˜„ How can I help you on that?

bebatut avatar Oct 19 '22 15:10 bebatut

Up to you right now πŸ˜„ How can I help you on that?

Well, for one...I'd like to know how I can relate all the keys in a particular project to each other.

- name: Open Science Community Barcelona
  participants:
     - bonetcarne mentors:
     - zebetus
  description: > Description

If the participant is in the same object as the "name" of the project, then render the name of the project.

It seems so straightforward. Yet, the logic has been flying over my head for days.

NPDebs avatar Oct 19 '22 15:10 NPDebs

I think I am not sure to follow / understand here

bebatut avatar Oct 19 '22 15:10 bebatut

I think I am not sure to follow / understand here

Okay. Here's my train of thought.

Loop through the participants. Within that loop, begin to loop through the project.yaml file.

For each participant, check if the person's name is the same as project.participants. Then capture the project.name of that project (where person == participant name), and render it on the person's bio card.

Not sure I'm explaining this properly.

If it's not too much to ask, can we do a quick Slack call at your convenience, please? @bebatut

NPDebs avatar Oct 19 '22 16:10 NPDebs

The loop over the project.yaml file are already done before in the page to get if people participated in cohorts. You could use that loop to extract projects for each cohort.

Then when looping on the people to create the card, you could check their status (in which cohort they participated) and for the cohort in which they were participants, looping on the projects for that cohort to extract the project name

Do you understand what I mean? I am not sure if my way of explaining is clear :smile:

bebatut avatar Oct 20 '22 06:10 bebatut

Hi @bebatut. Thank you for your response. Yes, I was actually following your explanation, until my brain got stuck in all the loops. πŸ˜„

When you say a loop has already been done, do you mean from line 41?

Yesterday, I was looking at how you wrote the logic for a similar thing, here. It gave me an idea, but I still did not succeed.

This is what I did...

Screenshot (301)

Maybe we can communicate better over a call?

NPDebs avatar Oct 20 '22 07:10 NPDebs

When you say a loop has already been done, do you mean from line 41?

Yes

This is what I did...

I think I do not understand your logic there. Participants are extracted from the ols-1-projects (in loop starting in line 41) so your loop is redundant with previous one. If you need to do something it is better to use the previous loop .

And also if you loop there, you are not yet in the big loop on the people so the project name will not be rendered.

Please have a look at my suggestion from yesterday and break them in piece and see how to implement it

Maybe we can communicate better over a call?

Please join the call with @yo today (I will not be able to join)

bebatut avatar Oct 21 '22 07:10 bebatut

Hi @bebatut. Yesterday, after brainstorming with a fellow Outreachy participant, we were able to output the title of one participant's project on her card. But the twist is, it also got printed on all the participants for OLS-1. πŸ˜… A problem in the loop, apparently.

Thank you for your suggestions. I'll try to implement them as soon as I resolve the Gitpod/Miniconda situation.

Yes, I'll be joining the call, later today. I'll ask them any questions I might have and update you.

Thank you. πŸ™ŒπŸΌ

NPDebs avatar Oct 21 '22 11:10 NPDebs

Hi @bebatut.

For the Roles in OLS: part...it shows up for only the organisers of OLS. This is because only organisers have it as a key:value pair, under title. Shouldn't the other people also have titles, to be displayed as roles on their cards?

Screenshot_20221024-090424_Chrome~2 Screenshot_20221024-093419_Chrome~2

NPDebs avatar Oct 24 '22 08:10 NPDebs

The role of participants (participant, mentor, etc in the different cohorts) are extracted here: https://github.com/open-life-science/open-life-science.github.io/blob/main/_layouts/people.html It should be displayed, given the code here: https://github.com/open-life-science/open-life-science.github.io/blob/main/_includes/people.html#L59 I did not investigate why it is not the case anymore

bebatut avatar Oct 24 '22 09:10 bebatut

Hi @bebatut. πŸ‘‹

I tweaked the logic a bit and the cards now display the people's roles. Here's a link to the commit.

Screenshot (330)

Observation:

  • Onclick, the 'card-toggle' icon does not do anything. Is this to be expected?

Two quick questions, please:

  1. Would you like me to make the Roles in OLS: bold too?
  2. Can I open a PR for this fix?

Thank you! πŸ™Œ

NPDebs avatar Oct 25 '22 22:10 NPDebs