Bug 27436 - Set focus for cursor to report name field when creating new SQL report
Summary: Set focus for cursor to report name field when creating new SQL report
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Katrin Fischer
QA Contact: Kyle M Hall (khall)
URL:
Keywords: Academy
Depends on:
Blocks: 31411
  Show dependency treegraph
 
Reported: 2021-01-14 16:28 UTC by Owen Leonard
Modified: 2023-12-28 20:42 UTC (History)
7 users (show)

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


Attachments
Bug 27436: Set focus for cursor to report name field when creating new SQL report (1.33 KB, patch)
2021-01-19 01:32 UTC, James O'Keeffe
Details | Diff | Splinter Review
Bug 27436: Set focus for cursor to report name field when creating new SQL report (1.39 KB, patch)
2021-01-19 11:39 UTC, PTFS Europe Sandboxes
Details | Diff | Splinter Review
Bug 27436: Set focus for cursor to report name field when creating new SQL report (1.46 KB, patch)
2021-01-21 16:16 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 27436: Set focus on first input when adding a new SQL report (1.75 KB, patch)
2022-08-18 20:09 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 27436: Set focus on first input when adding a new SQL report (1.81 KB, patch)
2022-08-18 20:46 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 27436: Set focus on first input when adding a new SQL report (1.87 KB, patch)
2022-09-02 14:37 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2021-01-14 16:28:29 UTC
When adding a new SQL report you have to tab to or click the report name field.  It would be more efficient to set the focus automatically by adding a "focus" class to the <input>
Comment 1 James O'Keeffe 2021-01-19 01:32:13 UTC
Created attachment 115275 [details] [review]
Bug 27436: Set focus for cursor to report name field when creating new SQL report

This patch focuses the cursor on the 'Report name' field when creating a
new SQL report

Test plan:
1. Navigate to the 'Create report from SQL' page (Home -> Reports ->
        Guided reports Wizard -> Create from SQL)
2. Observe that the 'Report name' box is not focused on
3. Apply the patch, log in, log out.
4. Repeat step 1. The 'Report name' box should now be focused on.
Comment 2 PTFS Europe Sandboxes 2021-01-19 11:39:48 UTC
Created attachment 115307 [details] [review]
Bug 27436: Set focus for cursor to report name field when creating new SQL report

This patch focuses the cursor on the 'Report name' field when creating a
new SQL report

Test plan:
1. Navigate to the 'Create report from SQL' page (Home -> Reports ->
        Guided reports Wizard -> Create from SQL)
2. Observe that the 'Report name' box is not focused on
3. Apply the patch, log in, log out.
4. Repeat step 1. The 'Report name' box should now be focused on.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Comment 3 Sally 2021-01-19 11:40:07 UTC
Works as described.
Comment 4 Kyle M Hall (khall) 2021-01-21 16:16:30 UTC
Created attachment 115573 [details] [review]
Bug 27436: Set focus for cursor to report name field when creating new SQL report

This patch focuses the cursor on the 'Report name' field when creating a
new SQL report

Test plan:
1. Navigate to the 'Create report from SQL' page (Home -> Reports ->
        Guided reports Wizard -> Create from SQL)
2. Observe that the 'Report name' box is not focused on
3. Apply the patch, log in, log out.
4. Repeat step 1. The 'Report name' box should now be focused on.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Kyle M Hall (khall) 2021-01-21 16:17:19 UTC
It might be nice to have the sql textarea focused when editing an existing report, but this is a great improvement!
Comment 6 Jonathan Druart 2021-01-22 13:09:24 UTC
Focus must be put using the "focus" class instead.
Comment 7 Katrin Fischer 2022-08-18 20:09:29 UTC
Created attachment 139419 [details] [review]
Bug 27436: Set focus on first input when adding a new SQL report

When adding a new SQL report, the focus/cursor should be
in the first input field of the form: Report name

To test:
* Add a new SQL report in reports > new from SQL
  - cursur is in no field
* Apply patch
* Add another new SQL report
  - cursor is now in the first input field of the form: Report name
Comment 8 Katrin Fischer 2022-08-18 20:13:06 UTC
I implemented the standard solution for setting the focus using the CSS class as suggested in comment#6. As both patches were one line fixes mine replaces James' previous patch. I didn't see a better way, if you prefer this as a follow-up, please let me know.

I didn't change the behavior for editing an existing patch as I think while SQL might be the most 'common' field to change, it could also be a danger of making unwanted changes and I found other examples where on editing the focus is on top.
Comment 9 ByWater Sandboxes 2022-08-18 20:46:04 UTC
Created attachment 139427 [details] [review]
Bug 27436: Set focus on first input when adding a new SQL report

When adding a new SQL report, the focus/cursor should be
in the first input field of the form: Report name

To test:
* Add a new SQL report in reports > new from SQL
  - cursur is in no field
* Apply patch
* Add another new SQL report
  - cursor is now in the first input field of the form: Report name

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Comment 10 Kyle M Hall (khall) 2022-09-02 14:37:26 UTC
Created attachment 140157 [details] [review]
Bug 27436: Set focus on first input when adding a new SQL report

When adding a new SQL report, the focus/cursor should be
in the first input field of the form: Report name

To test:
* Add a new SQL report in reports > new from SQL
  - cursur is in no field
* Apply patch
* Add another new SQL report
  - cursor is now in the first input field of the form: Report name

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 11 Tomás Cohen Arazi (tcohen) 2022-09-07 20:46:10 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!