-
Notifications
You must be signed in to change notification settings - Fork 12
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
Admin missing translations and tiny improvements. #2023
Conversation
🧪 Review environmenthttps://cqf2wmzgzrikyse3gcfucku2mq0fjvmr.lambda-url.ca-central-1.on.aws/ |
<p class="mb-0 text-base text-gray-800">{{ message }}</p> | ||
{% macro empty_list(heading, message=None, img="emptyFlower", link=None, linkText="", attributes="") %} | ||
<div | ||
class="flex items-center border-dashed border-1 border-gray-400 p-8 sm:bg-{{img}} sm:bg-right bg-empty-state min-h-emptyState" |
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've only added a min-height. The rest is auto formatting.
app/templates/components/table.html
Outdated
<td class="table-empty-message p-6" colspan="10"> | ||
{{ empty_message }} | ||
<td class="table-empty-message h-10" colspan="10"> | ||
{{ empty_list(heading=empty_message) }} |
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.
Why not use the empty 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.
Could you move this change into its own PR? Along with the change to the empty_list component.
app/templates/components/table.html
Outdated
{% macro row_heading(cell_width=None) -%} | ||
<th class="table-field {{ cell_width if cell_width}}" scope="row"> | ||
{% macro row_heading(cell_width=None, rowspan="1") -%} | ||
<th class="table-field {{ cell_width if cell_width}}" scope="row" rowspan="{{ rowspan }}"> |
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 lets us create <th>
that span many rows, like we have on the admin panel for each service usage. Defaults to 1
<li> | ||
<a href="{{ url_for('.organisation_dashboard', org_id=current_org.id) }}" {{ org_navigation.is_selected('dashboard') | ||
}}> | ||
{{ _("Usage") }} |
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 looks worse than it is, I simply added the _()
calls and reformated the html.
@@ -103,7 +103,7 @@ | |||
{{ nav_menu_item(url=url_for('main.contact', service_id=current_service.id),localised_txt=_('Contact us'), is_active=header_navigation.is_selected('contact')) }} | |||
{% endif %} | |||
{% else %} {# current_user.platform_admin #} | |||
{% if not platform_admin_view_ind %} | |||
|
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 fixes the empty main navigation in platform admin. ✨ No more layout shift ✨ 🎉
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.
Could you move this change into its own PR? So we can make this PR just translation changes?
@@ -113,9 +113,10 @@ | |||
{{ nav_menu_item(url=url_for('main.service_settings', service_id=current_service.id),localised_txt=_('Settings'), is_active=header_navigation.is_selected('settings')) }} | |||
{% else %} {# not current_user.has_permissions, i.e. services not in context #} | |||
{{ nav_menu_item(url=url_for('main.choose_account'),localised_txt=_('Your services'),css_classes='pl-0',id_key='choose_account', is_active=header_navigation.is_selected('choose_account')) }} | |||
{{ nav_menu_item(url=url_for('main.live_services', service_id=current_service.id),localised_txt=_('Admin panel')) }} | |||
{{ nav_menu_item(url=url_for('main.live_services', service_id=current_service.id),localised_txt=_('Admin panel'), | |||
is_active=header_navigation) }} |
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.
Just adding the aria-current
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.
</h1> | ||
<ul> | ||
{% for service in current_org.live_services %} | ||
<li class="browse-list-item"> | ||
<a href="{{ url_for('main.usage', service_id=service.id) }}" class="browse-list-link">{{ service['name'] }}</a> | ||
<a href="{{ url_for('main.service_dashboard', service_id=service.id) }}" class="browse-list-link">{{ service['name'] |
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.
Found out that there is not sid/usage
page. Staging and prod fall back to dashboard somehow, so I've changed it to actually be the dashboard. (And fixed the tests)
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.
makes sense to me!
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 haven't noticed any issues with the translations you've added - they look great!
Could you split this PR into a few different ones so that we can merge it in piece by piece?
@@ -103,7 +103,7 @@ | |||
{{ nav_menu_item(url=url_for('main.contact', service_id=current_service.id),localised_txt=_('Contact us'), is_active=header_navigation.is_selected('contact')) }} | |||
{% endif %} | |||
{% else %} {# current_user.platform_admin #} | |||
{% if not platform_admin_view_ind %} | |||
|
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.
Could you move this change into its own PR? So we can make this PR just translation changes?
app/templates/components/table.html
Outdated
<td class="table-empty-message p-6" colspan="10"> | ||
{{ empty_message }} | ||
<td class="table-empty-message h-10" colspan="10"> | ||
{{ empty_list(heading=empty_message) }} |
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.
Could you move this change into its own PR? Along with the change to the empty_list component.
@@ -113,9 +113,10 @@ | |||
{{ nav_menu_item(url=url_for('main.service_settings', service_id=current_service.id),localised_txt=_('Settings'), is_active=header_navigation.is_selected('settings')) }} | |||
{% else %} {# not current_user.has_permissions, i.e. services not in context #} | |||
{{ nav_menu_item(url=url_for('main.choose_account'),localised_txt=_('Your services'),css_classes='pl-0',id_key='choose_account', is_active=header_navigation.is_selected('choose_account')) }} | |||
{{ nav_menu_item(url=url_for('main.live_services', service_id=current_service.id),localised_txt=_('Admin panel')) }} | |||
{{ nav_menu_item(url=url_for('main.live_services', service_id=current_service.id),localised_txt=_('Admin panel'), | |||
is_active=header_navigation) }} |
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.
Looks great @amazingphilippe! I think I looked at all the pages you touched and they all look good. I noticed a couple minor things that were missing translations but let's deal with those in a different PR.
</h1> | ||
<ul> | ||
{% for service in current_org.live_services %} | ||
<li class="browse-list-item"> | ||
<a href="{{ url_for('main.usage', service_id=service.id) }}" class="browse-list-link">{{ service['name'] }}</a> | ||
<a href="{{ url_for('main.service_dashboard', service_id=service.id) }}" class="browse-list-link">{{ service['name'] |
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.
makes sense to me!
app/assets/stylesheets/index.css
Outdated
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.
why did this file change? was this left over form the other changes that you removed from this PR? if so lets revert changes to this file
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.
Probably due to the rebuild after I reverted the changes.
Summary | Résumé
This addresses cds-snc/notification-planning#998
Test instructions | Instructions pour tester la modification