Page MenuHomePhabricator

Hide work data fields when they have no value
Open, Needs TriagePublicFeature

Description

Feature summary: This feature aims to hide the work page data fields when they have no value. At the moment, when there is little data about an author, the work page looks like this:

hide-empty-work-fields-before.png (619×673 px, 76 KB)

After the feature is implemented, that same page should look like this:

hide-empty-work-fields-after.png (455×655 px, 70 KB)

Benefits: This feature will give the work page a more elegant appearance, even when there is little data about the work.

Event Timeline

This comment was removed by Miiswom.

Hello @Pepe_piton !
I completed the task, kindly review the merge request:
https://gitlab.wikimedia.org/toolforge-repos/paulina/-/merge_requests/34

Whenever merged, please let me know so that I can rebase T406949 Adding Inception Field Task (https://gitlab.wikimedia.org/toolforge-repos/paulina/-/merge_requests/26) to avoid merge conflicts

hi @Pepe_piton
i made a merge request related this issue:-https://gitlab.wikimedia.org/toolforge-repos/paulina/-/merge_requests/59
changes made

  • Added a JavaScript check to automatically hide .detail-item parent elements when their span contains the value "Unknown".
  • Ensures cleaner UI by removing unnecessary placeholders.
  • Tested locally — only valid data fields are displayed now.

Main changes are in work.html and JS around line 160. Old lines show as modified only because new JS code was added below.
I'd appreciate it if you could take a look at my work and provide feedback. I want to make sure I'm meeting expectations and understand any areas for improvemen

Good afternoon!

Please find attached the Merge Request for this microtask.

Would really appreciate your feedback and comments @Pepe_piton and @Nat_WDU

Best regards,
Farmata Kane.

@shreya-bhagat Thanks for your contribution! You've solved the problem very well using a strategy similar to the one you used in T406909. I think you're taking full advantage of the Jinja template engine's capabilities.

@Oluwatumininu.m I tried your contribution but I couldn't make it work as you provided here: https://gitlab.wikimedia.org/toolforge-repos/paulina/-/merge_requests/48/diffs
I think the error is in the syntax for appending to a list using Jinja. Jinja doesn't generally have a very user-friendly syntax for such things. But this task doesn't actually require you to do list appending. You can use a more minimalist approach, like you used for example in T406909

@Dipanshu1223 Your JS solution works super well for English language, but it doesn't work for other languages, as it looks for the string "Unknown". Anyway, it's a clever approach.

@Miiswom Good work! The feature works very well. I also like how you implemented the idea of ​​adding the text "No data available" when none of the fields have values, as @Aradhya05 suggested in the chat. One minor detail: it might be better to put the if statements for each field outside of the <div> tag of the detail-item, so the template doesn't create an empty div with margins when there is no value.
Another detail. I know that sometimes the Paulina files have unnecessary long lines and style imperfections, but I ask if you could try submitting the merge requests without so many code style improvements, so it's easier to identify the modified lines of code.

@Aradhya05 Thanks for your work. It's a very clear and well-implemented contribution, which includes the nice idea of ​​adding the "No details available" feature. You also took advantage of Jinja loops. Congrats!

One minor detail: it might be better to put the if statements for each field outside of the <div> tag of the detail-item, so the template doesn't create an empty div with margins when there is no value.

Hi @Pepe_piton, thank you for your feedback! I really appreacite it. I will modify and send through an updated merge request 👍

Another detail. I know that sometimes the Paulina files have unnecessary long lines and style imperfections, but I ask if you could try submitting the merge requests without so many code style improvements, so it's easier to identify the modified lines of code.

Ohhh no apologies for this! I have the prettier extension installed on VSCode and it automatically formats my code on save… I will disable it from now on!

hi @Pepe_piton @Nat_WDU ,
I made some updates to improve handling of unknown values:https://gitlab.wikimedia.org/toolforge-repos/paulina/-/merge_requests/59-

Changes:

  • Added data-unknown attribute to detail item divs (lines 58–66).
  • Updated JS to hide items marked as unknown, regardless of language.

Main changes are in work.html and JS around line 160 and item divs (lines 58–66) . Old lines show as modified only because new JS code was added below.

@Oluwatumininu.m I tried your contribution but I couldn't make it work as you provided here: https://gitlab.wikimedia.org/toolforge-repos/paulina/-/merge_requests/48/diffs
I think the error is in the syntax for appending to a list using Jinja. Jinja doesn't generally have a very user-friendly syntax for such things. But this task doesn't actually require you to do list appending. You can use a more minimalist approach, like you used for example in T406909

Thank you very much @Pepe_piton for the feedback. I have now removed the complex list appending mechanism that was causing failures. I also added the "No details available" feature that @Aradhya05 suggested.

Here is the update: https://gitlab.wikimedia.org/toolforge-repos/paulina/-/merge_requests/48/commits

Good morning everyone,

@Pepe_piton: I have just moved the if statements so that they wrap around the div.detail-item (instead of having them inside the div).

Here my the updated Merge Request link

Best regards,
Farmata.

Good morning everyone,

@Pepe_piton: I have just moved the if statements so that they wrap around the div.detail-item (instead of having them inside the div).

Here my the updated Merge Request link

Best regards,
Farmata.

Nice work @Miiswom .

I try keeping it minimal here https://gitlab.wikimedia.org/toolforge-repos/paulina/-/merge_requests/84 , kindly check it out.

@Pepe_piton Please kindly check this out as well

Thank you @Afanyulionel :)
You also did a nice job on your MR!

Hi @Pepe_piton,

I have completed this task by using the same logic for task T405412.
I am so grateful for the opportunity to have learned some new things in Flask. Gracias!
My Merge Request, should you want to check it out and drop feedback{F69278768}.