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

[#1798] Refactored document list in case detail view #825

Merged
merged 4 commits into from
Nov 21, 2023

Conversation

pi-sigma
Copy link
Contributor

@pi-sigma pi-sigma commented Oct 25, 2023

Taiga #1798

  • added creation date to documents
  • added indicator for recently added documents ("recently added" made configurable)

TODO:

  • the size of the document icon on the left needs to adjust dynamically, depending on whether the "recently added" indicator is present or not (currently the size is hardwired via padding)

@pi-sigma pi-sigma force-pushed the feature/1798-document-list branch 6 times, most recently from f85af6a to 0a99819 Compare October 30, 2023 11:16
@pi-sigma pi-sigma marked this pull request as ready for review October 30, 2023 13:11
@Bartvaderkin
Copy link
Contributor

Please fix the commit message and PR title. "Feature/1798 document list" doesn't mean a lot.

@pi-sigma pi-sigma changed the title Feature/1798 document list [#1798] Refactored document list in case detail view Oct 31, 2023
Copy link
Contributor

@jiromaykin jiromaykin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting quite a few changes 🙂 - if some of it is too difficult, I can help, but this week I'm very busy with other things.

Copy link
Contributor

@jiromaykin jiromaykin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preferably do not use BR for styling, it has no structural meaning and cannot easily be overwritten by CSS.
In this case it causes a problem: we cannot change some element's padding/margin, so this does not conform to the design.

The structure that can use Flexbox should look a bit more more like this (see attachment), without any BR's, but make sure it still looks good on mobile + some columns need to be set to align-items: center; when needed, like: depending on wether they actually have a 'recently_added' element or not.

recently_added-Flexbox

&__symbol {
display: flex;
align-items: center;
background-color: var(--color-gray-lightest);
padding: var(--spacing-large);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This old padding now needs to change because the icon also adds side-padding:
padding: var(--spacing-large) 0;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the old padding by setting the side-padding to zero/0 🙂 and like i said the the earlier comment

Screenshot 2023-11-06 at 12 10 35

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still not correct.
Please add the zero to remove unnecessary padding to the left/right sides here.
(padding shorthand notation here = top/bottom right/left)

See the differences:
Screenshot 2023-11-20 at 11 53 01

Copy link
Contributor

@jiromaykin jiromaykin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know flexbox wrapping is hard to 'wrap' your mind around; just a few more changes and this is done!

&__symbol {
display: flex;
align-items: center;
background-color: var(--color-gray-lightest);
padding: var(--spacing-large);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the old padding by setting the side-padding to zero/0 🙂 and like i said the the earlier comment

Screenshot 2023-11-06 at 12 10 35

src/open_inwoner/scss/components/File/File.scss Outdated Show resolved Hide resolved
@pi-sigma pi-sigma force-pushed the feature/1798-document-list branch 4 times, most recently from 0b49b8a to 16b7d66 Compare November 10, 2023 08:38
@codecov-commenter
Copy link

codecov-commenter commented Nov 10, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5cb8198) 92.88% compared to head (b199501) 92.89%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #825   +/-   ##
========================================
  Coverage    92.88%   92.89%           
========================================
  Files          767      768    +1     
  Lines        26445    26478   +33     
========================================
+ Hits         24563    24596   +33     
  Misses        1882     1882           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@jiromaykin jiromaykin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the flex-box thing is tricky, but please do not use BR's.

&__symbol {
display: flex;
align-items: center;
background-color: var(--color-gray-lightest);
padding: var(--spacing-large);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still not correct.
Please add the zero to remove unnecessary padding to the left/right sides here.
(padding shorthand notation here = top/bottom right/left)

See the differences:
Screenshot 2023-11-20 at 11 53 01

  - Added date
  - Added 'new' indicator to documents created no more than 24h in the
    past
@pi-sigma
Copy link
Contributor Author

@jiromaykin Styling is fixed, thanks for the input. The design doesn't have the text ("Download") in the download link, but I was wondering if it's better to keep it for consistency and accessibility. What do you think?

Screenshot from 2023-11-21 09-21-01

@jiromaykin
Copy link
Contributor

"....The design doesn't have the text ("Download") in the download link, but I was wondering if it's better to keep it for consistency and accessibility. What do you think?...."

For accessibility this is not quite an issue: any text can be made invisible while remaining in the structure (with CSS you can use transform/opacity/positioning to make elements visible for screenreader-software only). Also: aria-label and title attribute can be used for tooltips.

@@ -201,6 +206,11 @@ def get_context_data(self, **kwargs):
"end_statustype_data": end_statustype_data,
"documents": documents,
"allowed_file_extensions": sorted(config.allowed_file_extensions),
"new_docs": has_new_elements(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cant we solve this dynamically within the FileList component?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alextreme @pi-sigma as discussed: the template tag implementation might not be the most favorable approach and we might want to move away from that pattern. This does raises some issues in terms of reusability and complexity which might needs to be discusses in a separate team-wide meeting.

Some concerns are:

How can we guarantee consistency of UI elements across different pages.

Previously the template tag would take a predefined "(API) interface" and would render a specialized, reusable template for that component. This allowed Django templates to be built much like other modern component based frontend tooling. The template tag approach was a more developed leftover from porting a pure frontend (Vite?) implementation but felt confusing to developers less familiar with such concepts.

Currently, some pages move away from this strategy and use a more classic Django view approach. As a result, certain (HTML) code paths might act different on different pages causing potential UI inconsistencies and DRY violations.

How can we keep context processing maintainable.

In order to facilitate all the individual frontend components, quite a lot of context processing is necessary. When moving away from template tags, this typically ends up in the get_context_data function in the views.

Looking at

def get_context_data(self, **kwargs):
I have some concerns about the complexity and maintainability of this processing, I't very unclear to me:

  • What certain processing is for.
  • If and where certain context is used.
  • What the expected shape of data is within templates

How can we keep developers happy about this setup.

All approaches have advantages and drawback but we need to find a solution that works for all team members.

@jiromaykin jiromaykin self-requested a review November 21, 2023 14:08
@svenvandescheur svenvandescheur merged commit df90e8c into develop Nov 21, 2023
14 checks passed
@svenvandescheur svenvandescheur deleted the feature/1798-document-list branch November 21, 2023 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants