From a6570c75258d28953effe3f274735f4e1a2ea3a2 Mon Sep 17 00:00:00 2001 From: Benjamin Kiah Stroud <32469930+bkiahstroud@users.noreply.github.com> Date: Thu, 27 Jun 2024 17:35:02 -0700 Subject: [PATCH] propagate locale between group form tabs This is a UX improvement. However, it also fixes a bug where some users were getting an error message on these pages for the locale param being an empty string (`?locale=`). Strangely, this only appeared to be affecting users using Windows, but that may not be causation. Originally implemented in PALNI/PALCI's Hyku: - https://github.com/scientist-softserv/palni-palci/pull/1041/commits/6bb1f07ca5b7fcac760177a811decf0c87a48d29 --- app/presenters/hyku/admin/group/navigation_presenter.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/presenters/hyku/admin/group/navigation_presenter.rb b/app/presenters/hyku/admin/group/navigation_presenter.rb index 02aa5679c..51a0329b9 100644 --- a/app/presenters/hyku/admin/group/navigation_presenter.rb +++ b/app/presenters/hyku/admin/group/navigation_presenter.rb @@ -29,7 +29,7 @@ def edit_tab name: I18n.t('hyku.admin.groups.nav.attributes'), controller: 'admin/groups', action: 'edit', - path: Rails.application.routes.url_helpers.edit_admin_group_path(group_id), + path: Rails.application.routes.url_helpers.edit_admin_group_path(group_id, locale: I18n.locale), context: params ) end @@ -39,7 +39,7 @@ def members_tab name: I18n.t('hyku.admin.groups.nav.members'), controller: 'admin/group_users', action: 'index', - path: Rails.application.routes.url_helpers.admin_group_users_path(group_id), + path: Rails.application.routes.url_helpers.admin_group_users_path(group_id, locale: I18n.locale), context: params ) end @@ -49,7 +49,7 @@ def roles_tab name: I18n.t('hyku.admin.groups.nav.roles'), controller: 'admin/group_roles', action: 'index', - path: Rails.application.routes.url_helpers.admin_group_roles_path(group_id), + path: Rails.application.routes.url_helpers.admin_group_roles_path(group_id, locale: I18n.locale), context: params ) end @@ -59,7 +59,7 @@ def remove_tab name: I18n.t('hyku.admin.groups.nav.delete'), controller: 'admin/groups', action: 'remove', - path: Rails.application.routes.url_helpers.remove_admin_group_path(group_id), + path: Rails.application.routes.url_helpers.remove_admin_group_path(group_id, locale: I18n.locale), context: params ) end