Bug 40418 - Update the item type translation process to avoid Greybox modal
Summary: Update the item type translation process to avoid Greybox modal
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Owen Leonard
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on: 14100
Blocks: 40422 40453
  Show dependency treegraph
 
Reported: 2025-07-16 16:24 UTC by Owen Leonard
Modified: 2025-07-22 07:58 UTC (History)
4 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 40418: Update the item type translation process to avoid Greybox modal (14.11 KB, patch)
2025-07-17 11:15 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 40418: Update the item type translation process to avoid Greybox modal (14.18 KB, patch)
2025-07-18 13:06 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 40418: (follow-up) Remove popup flag from INCLUDE (890 bytes, patch)
2025-07-21 16:55 UTC, Owen Leonard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2025-07-16 16:24:39 UTC
I propose that we update the item type translation process in order to avoid using a Greybox modal. We can just as easily move from page to page as the process progresses.
Comment 1 Owen Leonard 2025-07-17 11:15:37 UTC Comment hidden (obsolete)
Comment 2 Caroline Cyr La Rose 2025-07-17 20:34:47 UTC
I had some trouble with "Test the process of performing an inline edit of an existing translation by clicking the table cell." I had never noticed this was possible! It seems you can't modify it right after adding it?

- From the item types list, click "Edit" next to Maps
- Click "Translate into other languages"
- Choose language (fr-CA)
- Enter "Cartes" in translation
- Click "Add"
- Double click "Cartes" to change it
  --> Nothing happens
- Click "Return to item type 'MP'"
- Click "Translate into other languages"
- Double click "Cartes" to change it
  --> Now it's OK, but not very visible that the cell is editable now
- Change to "Cartes géographiques"
- Click outside the table

I wonder if this is a functionality worth keeping. It's very rare that table cells are editable in Koha in general (only point of sale uses it I think?)
Comment 3 Owen Leonard 2025-07-18 13:04:28 UTC
I think you're absolutely right that the feature is unusual. I find that the issue with not being able to edit a newly-added translation happens in master as well.

I think these are issues which should be addressed outside this bug.
Comment 4 Caroline Cyr La Rose 2025-07-18 13:06:16 UTC
Created attachment 184376 [details] [review]
Bug 40418: Update the item type translation process to avoid Greybox modal

This patch updates the item type translation process so that it takes
place on a separate standalone page instead of in a Greybox modal.

Although currently only item types can be translated in this way, the
original plan was to expand the range of data that could be translated.
For this reason I used [% SWITCH %] in localization.tt for determining
whether to use the term "item type." This accommodates, I hope,
expansion of the feature.

To test you must have more than one installed translation.

- Apply the patch and go to Administration -> Item types.
- Edit an item type.
- On the "Description" line, click "Translate into other languages."
- You should be redirected to a new page, "Add translations for item
  type 'XXX.'
- Confirm that the page title, breadcrumbs, and heading are correct.
- Test the process of adding and deleting a translation.
- Test the process of performing an inline edit of an existing
  translation by clicking the table cell.
- Test that the "Return to item type 'XXX'" button returns you to the
  item type you were editing.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 5 Caroline Cyr La Rose 2025-07-18 13:06:38 UTC
Alright! I added my so
Comment 6 Jonathan Druart 2025-07-18 13:17:00 UTC
(In reply to Owen Leonard from comment #3)
> I think you're absolutely right that the feature is unusual. I find that the
> issue with not being able to edit a newly-added translation happens in
> master as well.

Yes, it has always been like that.
Comment 7 Jonathan Druart 2025-07-21 07:14:32 UTC
1. There is a JS error: "Uncaught TypeError: antiClickjack is null"
on http://localhost:8081/cgi-bin/koha/admin/localization.pl?entity=itemtypes&code=BK

2. "Return to item type" is a button, shouldn't it be a link instead?

3. When I edit and save: Entity itemtypes (code BK) for lang fr-FR has correctly been updated with 'Français (fr-FR)English (en)हिन्दी (hi)Deutsch (de-DE)Català (ca-ES)Español (es-ES)Svenska (sv-SE)'

4. The confirmation message shows up then hides. Shouldn't we keep it displayed? (not a behaviour change)
Comment 8 Owen Leonard 2025-07-21 16:50:48 UTC
(In reply to Jonathan Druart from comment #7)
> 1. There is a JS error: "Uncaught TypeError: antiClickjack is null"

Will fix in a follow-up.
 
> 2. "Return to item type" is a button, shouldn't it be a link instead?

We're not consistent, and there isn't an official guideline for this. Sometimes we use a button and sometimes we use a link.
 
> 3. When I edit and save: Entity itemtypes (code BK) for lang fr-FR has
> correctly been updated with 'Français (fr-FR)English (en)हिन्दी (hi)Deutsch
> (de-DE)Català (ca-ES)Español (es-ES)Svenska (sv-SE)'

This is an existing bug which is fixed in Bug 40453
 
> 4. The confirmation message shows up then hides. Shouldn't we keep it
> displayed? (not a behaviour change)

I think that's outside the scope of this bug, but worth a discussion.
Comment 9 Owen Leonard 2025-07-21 16:55:43 UTC
Created attachment 184447 [details] [review]
Bug 40418: (follow-up) Remove popup flag from INCLUDE