Bug 33490: Improve max date handling
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 14 Apr 2023 09:09:33 +0000 (11:09 +0200)
committerMatt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Mon, 15 May 2023 13:21:04 +0000 (13:21 +0000)
commit754f632174d782b0f26925b99eee381264b97f6d
tree474fa49bb6eb6226e07ebf3dc9efb01f493adfea
parent61d4a4ffa43f1218f6aa19fb4002d2df2c142af4
Bug 33490: Improve max date handling

It fixes:
1. /agreements?by_expired=true do no longer explode
2. Fill date with today's date when we setup the component and when we
hit "filter"

However there are a couple of things totally wrong:
1. We should not need is_fp_disabled, we could be able to use
  :disabled="!filters.by_expired"
in the template, but it does not work
2. We should not need to deal with filters.max_expiration_date the "old
JS way", but should use a Vue computed value instead. I've failed at
that

I think those 2 problems have the same root, the way we deal with
filters in data() is wrong, and we may be loosing the ref at some point.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e3286c4b0b82ef976f75fb3892d609d71ac7b74d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue