Currently it's only used for the "list" view, and so its name was
confusing.
Now it can also be used for the "show" view, and allow addition of
custom buttons.
TODO:
1. I had to pass the resource from BaseResource as ResourceList could
not access the resource[idAttr] value easily.
Ideally we shouldn't need to pass functions
getToolbarButtons().list()
getToolbarButtons().show(resource)
But only the array of buttons defs:
getToolbarButtons().list
getToolbarButtons().show
2. There is duplication of code when the default is overwritten. We
could fallback to the default when none passed, or pass a string
instead of the full button's def:
return {
list: () => {
return [
"add",
{
to: { name: "EHoldingsLocalTitlesFormImport" },
icon: "plus",
title: __("Import from list"),
},
{
to: { name: "EHoldingsLocalTitlesKBARTImport" },
icon: "plus",
title: __("Import from KBART file"),
},
],
},
show: resource => {
return ["edit", "delete"]
}
}
But that is much more work and not a blocker for now IMO
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Bring back middle mouse button click opens in new tab interaction
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
'this' is scoped inside forEarch, an error was thrown when submiting the form with errors
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This enables the 'columns', 'copy shareable link' and 'configure' table settings.
Prior to this patch, only showing on agreements table
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is important to serve as a base for when full migrating of this resource happens
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
We currently check for if a boolean is true but have no way of checking for a falsy value, this patch adds a fix for that
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
The event listener was being added infinitely. Meaning that when new realtionships were added, the previously added ones were still firing their previously registered events.
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This moves the _ concat to the concat logic rather than having it be defined at the resourceAttrs level.
This also makes it so that 'date' type attributes can also have indexRequired
The index is now only concated when the indexRequired is true
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This prevents the props from being rendered as HTML element attributes
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
We need this to render dynamic id attributes based on the resourceName
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This enables certain resources (e.g. UsageDataProviderResource) to make
partial use of BaseResource (like gotoResourceShow, doResourceDelete).
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This will format the attribute value using that callback function after the resource has been fetched from the API
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This patch changes some key terminology to improve clarity and fix some more obscure variable names
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>