Bug 29735 - Remove flatpickr instantiations from .js files
Summary: Remove flatpickr instantiations from .js files
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 29394
Blocks: 29239
  Show dependency treegraph
 
Reported: 2021-12-20 10:46 UTC by Jonathan Druart
Modified: 2022-12-12 21:25 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00,21.11.02


Attachments
Bug 29735: Remove flatpickr init from categories.js and holds.js (5.62 KB, patch)
2021-12-20 11:25 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29735: Remove flatpickr init from categories.js and holds.js (5.66 KB, patch)
2021-12-20 16:52 UTC, David Nind
Details | Diff | Splinter Review
Bug 29735: Remove flatpickr init from categories.js and holds.js (5.72 KB, patch)
2021-12-20 23:17 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 29735: Fix flatpickr init from circulation.tt (1.40 KB, patch)
2022-01-21 08:44 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2021-12-20 10:46:06 UTC

    
Comment 1 Jonathan Druart 2021-12-20 11:25:00 UTC
Created attachment 128733 [details] [review]
Bug 29735: Remove flatpickr init from categories.js and holds.js

Same as bug 29394, we want the flatpickr instanciations be done at the
same place, from calendar.inc. That way they will all behave
identically.

Test plan:
Edit a patron category and confirm that the "until date" calendar has
the "yesterday" and "today" dates disabled

Place a hold on an item, go to the patron detail page, click the "holds"
tab, suspend.
That should trigger a modal that will display a calendar with
"yesterday" and "today" dates disabled
Comment 2 David Nind 2021-12-20 16:52:36 UTC
Created attachment 128765 [details] [review]
Bug 29735: Remove flatpickr init from categories.js and holds.js

Same as bug 29394, we want the flatpickr instanciations be done at the
same place, from calendar.inc. That way they will all behave
identically.

Test plan:
Edit a patron category and confirm that the "until date" calendar has
the "yesterday" and "today" dates disabled

Place a hold on an item, go to the patron detail page, click the "holds"
tab, suspend.
That should trigger a modal that will display a calendar with
"yesterday" and "today" dates disabled

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2021-12-20 16:55:05 UTC
Testing notes (koha-testing-docker):

1. Apply after applying bug 29552 so that options not selectable are greyed out.
Comment 4 Katrin Fischer 2021-12-20 23:17:04 UTC
Created attachment 128805 [details] [review]
Bug 29735: Remove flatpickr init from categories.js and holds.js

Same as bug 29394, we want the flatpickr instanciations be done at the
same place, from calendar.inc. That way they will all behave
identically.

Test plan:
Edit a patron category and confirm that the "until date" calendar has
the "yesterday" and "today" dates disabled

Place a hold on an item, go to the patron detail page, click the "holds"
tab, suspend.
That should trigger a modal that will display a calendar with
"yesterday" and "today" dates disabled

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Fridolin Somers 2022-01-14 02:38:44 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 6 Kyle M Hall 2022-01-14 14:32:24 UTC
Pushed to 21.11.x for 21.11.02
Comment 7 Andrii Nugged 2022-01-20 20:31:53 UTC
I found that string:

    [% INCLUDE 'calendar.inc' %]

reordered in:

  koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-1 / +1 lines)
  koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-1 / +1 lines)

but seems the same reordering is needed in:

  koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt


because when I pressing the "suspend" button on:

  .../cgi-bin/koha/circ/circulation.pl?borrowernumber=ANY_ONE_WITH_HOLD
 
opens a modal popup without flatpickr (but there's flatpicker for the first two mentioned above templates).
Comment 8 Jonathan Druart 2022-01-21 08:44:42 UTC
Created attachment 129684 [details] [review]
Bug 29735: Fix flatpickr init from circulation.tt
Comment 9 Andrew Fuerste-Henry 2022-01-25 17:44:52 UTC
Missing dependency, not backported to 21.05
Comment 10 Andrii Nugged 2022-02-08 06:13:18 UTC
(In reply to Kyle M Hall from comment #6)
> Pushed to 21.11.x for 21.11.02

Kyle, this post-publishing patch probably lost:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29735#c8

from just-happened 21.11.03, so maybe to include it to 21.11.04?
Comment 11 Fridolin Somers 2022-02-09 22:12:17 UTC
Second patch pushed to master :
177f938af0 Bug 29735: Fix flatpickr init from circulation.tt
Comment 12 Fridolin Somers 2022-02-14 20:47:19 UTC
I see second patch is in 21.11.x
9f7e99b8c4 Bug 29735: Fix flatpickr init from circulation.tt
Comment 13 Andrew Fuerste-Henry 2022-02-21 16:12:19 UTC
Missing dependency, not backported to 21.05