-
Notifications
You must be signed in to change notification settings - Fork 6
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
Conversation
f85af6a
to
0a99819
Compare
0a99819
to
9ace98a
Compare
Please fix the commit message and PR title. "Feature/1798 document list" doesn't mean a lot. |
There was a problem hiding this 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.
src/open_inwoner/components/templates/components/File/File.html
Outdated
Show resolved
Hide resolved
src/open_inwoner/components/templates/components/File/File.html
Outdated
Show resolved
Hide resolved
src/open_inwoner/components/templates/components/File/File.html
Outdated
Show resolved
Hide resolved
9ace98a
to
b64f3e2
Compare
There was a problem hiding this 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.
src/open_inwoner/components/templates/components/File/File.html
Outdated
Show resolved
Hide resolved
&__symbol { | ||
display: flex; | ||
align-items: center; | ||
background-color: var(--color-gray-lightest); | ||
padding: var(--spacing-large); |
There was a problem hiding this comment.
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;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/open_inwoner/components/templates/components/File/File.html
Outdated
Show resolved
Hide resolved
src/open_inwoner/components/templates/components/File/File.html
Outdated
Show resolved
Hide resolved
b64f3e2
to
ec141e2
Compare
There was a problem hiding this 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!
src/open_inwoner/components/templates/components/File/File.html
Outdated
Show resolved
Hide resolved
&__symbol { | ||
display: flex; | ||
align-items: center; | ||
background-color: var(--color-gray-lightest); | ||
padding: var(--spacing-large); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0b49b8a
to
16b7d66
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
There was a problem hiding this 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.
src/open_inwoner/components/templates/components/File/File.html
Outdated
Show resolved
Hide resolved
src/open_inwoner/components/templates/components/File/File.html
Outdated
Show resolved
Hide resolved
src/open_inwoner/components/templates/components/File/File.html
Outdated
Show resolved
Hide resolved
src/open_inwoner/components/templates/components/File/File.html
Outdated
Show resolved
Hide resolved
&__symbol { | ||
display: flex; | ||
align-items: center; | ||
background-color: var(--color-gray-lightest); | ||
padding: var(--spacing-large); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Added date - Added 'new' indicator to documents created no more than 24h in the past
16b7d66
to
b199501
Compare
@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? |
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( |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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): |
- 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.
Taiga #1798
TODO: