Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
Development and Code Review
(Moderator:
fabian
) »
modal opened with 'clone $thing' has a misleading title of 'edit $clonedthing'
« previous
next »
Print
Pages: [
1
]
Author
Topic: modal opened with 'clone $thing' has a misleading title of 'edit $clonedthing' (Read 1776 times)
Wolfspyre
Newbie
Posts: 42
Karma: 2
modal opened with 'clone $thing' has a misleading title of 'edit $clonedthing'
«
on:
July 10, 2024, 10:57:18 pm »
hai all!
This is something of a widespread behavior within opnsense, and so bringing it up here as it feels like it's prolly a low-level behavioral issue not scoped to any one service or facet of the ui
When a user clicks on 'clone $thing' (rule, server, alias, firewall rule, dhcp reservation, haproxy config, etc)
(read 'pretty much anything that has a clone button')
The resulting modal popup has a title which conveys that the user is editing the original resource, rather than creating a new one from it.
This looks like its controlled by jquery, and the label seems like it would be targetable, thus if one clicks on 'clone' the title could read 'Clone $objectType' or 'Cloning $originalObjectTitle' rather than 'Edit $objectType'
While it's true, one is TECHNICALLY editing an item of that type, it's misleading, as the window appears the same as if one clicked the 'edit $thing' button...
I'm sure there's a good reason for this behavior, but I'm having a hard time intuiting it...
Can someone more familiar with the code help me see what I'm missing?
Logged
franco
Administrator
Hero Member
Posts: 17665
Karma: 1611
Re: modal opened with 'clone $thing' has a misleading title of 'edit $clonedthing'
«
Reply #1 on:
July 11, 2024, 07:50:22 am »
I think this is just a shortcut in the JS code handling this. If you open a ticket on GitHub I'll fix that. Shouldn't be much more than a one-liner.
Cheers,
Franco
Logged
Wolfspyre
Newbie
Posts: 42
Karma: 2
Re: modal opened with 'clone $thing' has a misleading title of 'edit $clonedthing'
«
Reply #2 on:
July 11, 2024, 09:19:14 am »
awesome! wilco! jus thought it best to ask here before doing so.
Logged
Wolfspyre
Newbie
Posts: 42
Karma: 2
Re: modal opened with 'clone $thing' has a misleading title of 'edit $clonedthing'
«
Reply #3 on:
July 12, 2024, 03:32:25 am »
Created
https://github.com/opnsense/core/issues/7613
as requested
Logged
franco
Administrator
Hero Member
Posts: 17665
Karma: 1611
Re: modal opened with 'clone $thing' has a misleading title of 'edit $clonedthing'
«
Reply #4 on:
July 12, 2024, 08:25:32 am »
Thanks. I took a peek and it hardwires the clone/copy to the same edit dialog. It's not a one line fix since the dialog is embedded in each GUI page instead of being created by the JS code, but we will discuss this further internally.
Cheers,
Franco
Logged
Wolfspyre
Newbie
Posts: 42
Karma: 2
Re: modal opened with 'clone $thing' has a misleading title of 'edit $clonedthing'
«
Reply #5 on:
July 12, 2024, 10:01:01 am »
Nod.. is this likely something you’ll wanna internationalize?
Not an ask, I just dunno if it’s toil, toil relief, carrot, stick, or terrible idea 😊
Logged
franco
Administrator
Hero Member
Posts: 17665
Karma: 1611
Re: modal opened with 'clone $thing' has a misleading title of 'edit $clonedthing'
«
Reply #6 on:
July 19, 2024, 11:09:17 am »
It's already translated but hereby lies the problem. The dialog is hardcoded as is the title. Changing the title requires to stuff another title in all the pages using an edit dialog and then adding the JS glue to switch it according to the action requirement (edit or clone or add also actually).
The other solution would be to ditch the custom title and just hardcode (translatable) "edit item", "clone item" and "add item" titles. But it also requires to touch all dialogs eventually to get rid of the defunct boilerplate that is the custom title name.
I'm not sure if it's worth it. Neither approach seems optimal. The current one also isn't optimal of course.
Cheers,
Franco
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
Development and Code Review
(Moderator:
fabian
) »
modal opened with 'clone $thing' has a misleading title of 'edit $clonedthing'