Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combined: Fix column widths in grid layout #3220

Closed
Closed
Changes from 1 commit
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
c80bc1e
Eliminate duplicate list object retrieval logic. (#2887)
demiankatz May 31, 2023
e2eca52
Fix and clean up results scripts. (#2878)
EreMaijala May 31, 2023
e78f2a3
Merge branch 'dev' into dev-10.0
EreMaijala Jun 6, 2023
75ebced
Merge branch 'dev' into dev-10.0
demiankatz Jun 7, 2023
43a81d4
Language labels matching MARC standard
damien-git Jun 7, 2023
41ed3bf
Merge branch 'dev' into dev-10.0
demiankatz Jun 14, 2023
a007483
Fixed encoding for language_map.properties
damien-git Jun 15, 2023
d0fb822
Revert "Fixed encoding for language_map.properties"
damien-git Jun 15, 2023
1143e1f
Merge branch 'dev' into dev-10.0
demiankatz Jun 20, 2023
04c0a75
Merge branch 'dev' into dev-10.0
demiankatz Jun 21, 2023
3d43085
Merge branch 'dev' into language_map
damien-git Jun 28, 2023
aec3118
Merge branch 'dev' into dev-10.0
demiankatz Jun 29, 2023
3b6181b
Merge branch 'dev' into dev-10.0
demiankatz Jun 30, 2023
15ae37a
Merge branch 'dev' into dev-10.0
demiankatz Jul 10, 2023
6bed15c
Merge branch 'dev' into dev-10.0
demiankatz Jul 12, 2023
37f4479
Merge branch 'dev' into dev-10.0
demiankatz Jul 17, 2023
690586c
Merge branch 'dev' into dev-10.0
demiankatz Jul 19, 2023
7443e22
Merge branch 'dev' into dev-10.0
demiankatz Jul 27, 2023
9331b11
Merge branch 'dev' into dev-10.0
EreMaijala Aug 3, 2023
cc7796a
Expose setupQRCodeLinks method. (#3021)
EreMaijala Aug 3, 2023
1bc1f33
Merge branch 'dev' into dev-10.0
EreMaijala Aug 14, 2023
8cb851c
Merge branch 'dev' into dev-10.0
EreMaijala Aug 16, 2023
11d9b08
Introduce results-list template between results and list templates. (…
EreMaijala Aug 16, 2023
7fe9109
Add support for configurable paginator on top of search results. (#3034)
EreMaijala Aug 16, 2023
dff8b1d
Merge branch 'dev' into dev-10.0
demiankatz Aug 17, 2023
4276f8d
php-cs-fixer update.
demiankatz Aug 17, 2023
fc9040b
Move record version key handling to the new Versions helper. (#3033)
EreMaijala Aug 17, 2023
b6af536
Merge branch 'dev' into dev-10.0
EreMaijala Aug 18, 2023
741e945
Merge branch 'dev' into dev-10.0
EreMaijala Aug 29, 2023
ae46bbc
Merge branch 'dev' into dev-10.0
demiankatz Aug 31, 2023
d30b079
Merge branch 'dev' into dev-10.0
EreMaijala Aug 31, 2023
d08a23a
Merge branch 'dev' into dev-10.0
demiankatz Sep 5, 2023
3e80cab
Merge branch 'dev' into dev-10.0
EreMaijala Sep 7, 2023
28226c7
Merge branch 'dev' into dev-10.0
EreMaijala Sep 8, 2023
cd28615
Merge branch 'dev' into dev-10.0
EreMaijala Sep 19, 2023
5ff6385
Merge branch 'dev' into dev-10.0
demiankatz Oct 3, 2023
a2696fc
Merge branch 'dev' into dev-10.0
demiankatz Oct 5, 2023
daaf51c
Merge branch 'dev' into dev-10.0
demiankatz Oct 18, 2023
55bb2d4
Merge branch 'dev' into dev-10.0
EreMaijala Oct 19, 2023
6b1284f
Minor facet improvements. (#3168)
EreMaijala Oct 19, 2023
b285234
Merge remote-tracking branch 'origin/dev-10.0' into dev
demiankatz Oct 19, 2023
31f7c84
Composed ILS Driver (#3112)
ThoWagen Oct 19, 2023
76476e4
Merge branch 'release-9.1' into dev
demiankatz Oct 20, 2023
47cb72d
Merge branch 'release-9.1' into dev
demiankatz Oct 20, 2023
a28656a
Merge branch 'release-9.1' into dev
demiankatz Oct 23, 2023
e91110b
Merge branch 'release-9.1' into dev
demiankatz Oct 23, 2023
fe46607
Remove outdated, unused tag help screen. (#3174)
demiankatz Oct 23, 2023
1b4c54e
Add support for a description column in fines. (#3171)
EreMaijala Oct 23, 2023
af91639
Merge branch 'release-9.1' into dev
demiankatz Oct 24, 2023
9712140
Improve stability of testAddCommentWithCaptcha test. (#3179)
EreMaijala Oct 25, 2023
50e662e
Merge branch 'release-9.1' into dev
demiankatz Oct 25, 2023
c0a6cc3
Merge branch 'release-9.1' into dev
demiankatz Oct 26, 2023
ae00377
Add setting to allow deep searching within collections. (#3182)
demiankatz Oct 26, 2023
672a6e0
Merge branch 'release-9.1' into dev
demiankatz Oct 30, 2023
41600b8
Fix raw type warnings (#3184)
maccabeelevine Oct 30, 2023
68c66e9
Remove unused imports (#3183)
maccabeelevine Oct 30, 2023
91dd26c
Merge branch 'release-9.1' into dev
demiankatz Oct 31, 2023
b3e216d
Merge remote-tracking branch 'origin/release-9.1' into dev
demiankatz Oct 31, 2023
e3836c6
Merge branch 'release-9.1' into dev
demiankatz Nov 2, 2023
3020e71
Better config validation for XCNCIP2 ILS driver (#3188)
xmorave2 Nov 2, 2023
0a02fa8
Optional dataMethod params for RecordDataFormatter (#3189)
ThoWagen Nov 3, 2023
f3c6678
NCIP ILS driver test improvement (#3191)
xmorave2 Nov 3, 2023
9e56d78
Fix Java 9 deprecation warnings (#3185)
maccabeelevine Nov 3, 2023
f8b8842
Merge branch 'release-9.1' into dev
demiankatz Nov 7, 2023
4de017d
Merge branch 'release-9.1' into dev
demiankatz Nov 7, 2023
f748add
Updated jQuery to Javascript for button disable on submit (#3181)
padmasreegade Nov 8, 2023
30a119b
Add auth_method parameter to SimulatedSSO. (#3201)
EreMaijala Nov 8, 2023
8620357
Eliminate jQuery from ReCaptcha setup on Google script load logic (#3…
padmasreegade Nov 8, 2023
e1f0d8c
Add option to return an HTMLElement from the icon helper (#3126)
LuomaJuha Nov 8, 2023
9ea42cc
Accessibility: Use $headTitle as <h1> on results (#3175)
maccabeelevine Nov 8, 2023
33d4a14
Replace substr with e.g. str_starts_with or str_ends_with where appro…
EreMaijala Nov 9, 2023
25e62f5
Add test for bulk deleting from favorite list. (#3202)
demiankatz Nov 9, 2023
53c8192
Add option to enable hierarchical facet filters for advanced search f…
LuomaJuha Nov 9, 2023
4438319
Add an option to always display the "Reset Filters" button. (#3197)
EreMaijala Nov 9, 2023
07eb39f
Adding optional virtual keyboard to searchbox (#2952)
ThoWagen Nov 10, 2023
b0fa438
Recommend databases based on result facets (#3160)
maccabeelevine Nov 10, 2023
954d5ac
Change url to an indexed field in Solr. (#3211)
demiankatz Nov 10, 2023
d70acd0
Merge branch 'release-9.1' into dev
demiankatz Nov 13, 2023
ebc65dc
Make SimulatedSSO module configurable. (#3208)
demiankatz Nov 13, 2023
2c3a12e
ProxyUrl: Determine whether to proxy via web service (#3199)
maccabeelevine Nov 13, 2023
18b4cee
Add log writability check to SystemStatus. (#3212)
EreMaijala Nov 13, 2023
1e899ad
Merge pull request #2933 from MSU-Libraries/language_map
sturkel89 Nov 13, 2023
d31c96f
Merge branch 'release-9.1' into dev
demiankatz Nov 13, 2023
443a4fa
Merge branch 'release-9.1' into dev
demiankatz Nov 14, 2023
4f10e0b
Change side recommendation headings to <h2> (#3209)
maccabeelevine Nov 14, 2023
c8a3c83
Databases: Include search query matches (#3216)
maccabeelevine Nov 14, 2023
cedd5bf
Combined: Fix column widths in grid layout
maccabeelevine Nov 14, 2023
ec7a698
Support filters and custom heading on recommendation modules (#3192)
maccabeelevine Nov 14, 2023
b6eacfd
Merge branch 'release-9.1' into dev
demiankatz Nov 15, 2023
7bc4821
Setup QR code links without jQuery (#3206)
padmasreegade Nov 15, 2023
cd00a63
Virtual keyboard: Avoid !important with more specific selectors, esca…
EreMaijala Nov 16, 2023
a043501
Fix deprecation warnings in tests; make PHPUnit more strict. (#3224)
demiankatz Nov 16, 2023
d8d8fd6
Combined: Fix scope of search cart form (#3219)
maccabeelevine Nov 16, 2023
6ea6143
Fix searchbox_controls init function if textInput or resetButton are …
LuomaJuha Nov 17, 2023
49bffd4
Sierra: Add support for statistic group in holds and renewals. (#3190)
EreMaijala Nov 17, 2023
f5e3500
Check exit codes for commands in the browse_build function (#3227)
meganschanz Nov 17, 2023
c7b7eb9
Configurable fields for RecordDataFormatter (#3193)
ThoWagen Nov 17, 2023
23274f2
Check querySelector result when updating combined jump links. (#3231)
EreMaijala Nov 17, 2023
c02ff37
Fix setupQrCodeLinks call in initResultScripts. (#3230)
EreMaijala Nov 17, 2023
7c88922
Merge branch 'dev' into combined-grid-width
maccabeelevine Nov 17, 2023
b06d135
Wrap with overflow-wrap: anywhere
maccabeelevine Nov 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Configurable fields for RecordDataFormatter (#3193)
ThoWagen authored Nov 17, 2023
commit c7b7eb900148bd4ed300cf829af60b86f6f566fd
57 changes: 57 additions & 0 deletions config/vufind/RecordDataFormatter.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
; This file can be used to set global default options for fields, to add new fields and to configure fields
; in the RecordDataFormatter.

; This section is used to set global default option.
[Global]
; Enable or disable all fields by default (default is true)
;enabled = false
; Change the default renderMethod (default is "Simple")
;renderType = "CombineAlt"
; Change the default separator for array values (default is <br />)
;separator = "; "
; One can also add any other option. See https://vufind.org/wiki/development:architecture:record_data_formatter
; for all available options.

; In this section, extra fields can be added that are not already included in the RecordDataFormatterFactory.
; Add the name of the field to the respective array. The options of the field need to be set in
; this file (see below for explanation).
[Defaults]
;collection-info[] =
;collection-record[] =
;core[] =
;description[] =

; Example:
;core[] = "Extra"
;core[] = "MySpecialField"
; to add the two fields "Extra" and "MySpecialField" to core. See below for the configuration.

; To change options on a specific field one has to add a section [Field_<field's name>].
; E.g. to enable ISBNs and to override the separator option use:
;
;[Field_ISBN]
;enabled = true
;separator = ' ; '
;
; And to configure the fields added in the example of the [Defaults] section:
;
;[Field_Extra]
;dataMethod = "getExtra"
;pos = 1000
;
;[Field_MySpecialField]
;dataMethod = "getMySpecialField"
;pos = 1500
;renderType = "RecordDriverTemplate"
;template = "data-mySpecialField.phtml"

; If you want to apply some options to a specific context only you can use the overrideContext option.
; Add overrideContext[<context>] = <context options section> where <context> is either "collection-info",
; "collection-record", "core" or "description" and add the options in a new section [<context options section>].
; E.g. to enable "Published" in the core view only:
;[Field_Published]
;enabled = false
;overrideContext['core'] = Core_Published
;
;[Core_Published]
;enabled = true
Original file line number Diff line number Diff line change
@@ -66,6 +66,23 @@ class RecordDataFormatter extends AbstractHelper
*/
protected $driver = null;

/**
* Config.
*
* @var \Laminas\Config\Config
*/
protected $config;

/**
* Constructor
*
* @param ?\Laminas\Config\Config $config Config
*/
public function __construct($config = null)
{
$this->config = $config;
}

/**
* Store a record driver object and return this object so that the appropriate
* data can be rendered.
@@ -122,10 +139,14 @@ protected function allowValue($value, $options, $ignoreCombineAlt = false)
* @param mixed $data Data to render
* @param array $options Rendering options
*
* @return array
* @return ?array
*/
protected function render($field, $data, $options)
{
if (!($options['enabled'] ?? true)) {
return null;
}

// Check whether the data is worth rendering.
if (!$this->allowValue($data, $options, true)) {
return null;
@@ -219,6 +240,14 @@ public function getDefaults($key)
throw new \Exception('Callback for ' . $key . ' must return array');
}
}
// Adding defaults from config
foreach ($this->config->Defaults->$key ?? [] as $field) {
$this->defaults[$key][$field] = [];
}
// Adding options from config
foreach ($this->defaults[$key] as $field => $options) {
$this->defaults[$key][$field] = $this->addOptions($key, $field, $options);
}
// Send back array:
return $this->defaults[$key];
}
@@ -240,6 +269,36 @@ public function setDefaults($key, $values)
$this->defaults[$key] = $values;
}

/**
* Add global and configured options to options of a field.
*
* @param string $context Context of the field.
* @param string $field Field
* @param array $options Options of a field.
*
* @return ?array
*/
protected function addOptions($context, $field, $options)
{
if ($globalOptions = ($this->config->Global ?? false)) {
$options = array_merge($globalOptions->toArray(), $options);
}

$section = 'Field_' . $field;
if ($fieldOptions = ($this->config->$section ?? false)) {
$options = array_merge($options, $fieldOptions->toArray());
}

$contextSection = $options['overrideContext'][$context] ?? false;
if (
$contextOptions = $this->config->$contextSection ?? false
) {
$options = array_merge($options, $contextOptions->toArray());
}

return $options;
}

/**
* Extract data (usually from the record driver).
*
Original file line number Diff line number Diff line change
@@ -74,7 +74,10 @@ public function __invoke(
if (!empty($options)) {
throw new \Exception('Unexpected options sent to factory.');
}
$helper = new $requestedName();
$config = $container
->get(\VuFind\Config\PluginManager::class)
->get('RecordDataFormatter');
$helper = new $requestedName($config);
$helper->setDefaults(
'collection-info',
[$this, 'getDefaultCollectionInfoSpecs']
Loading