Hi and thank you for this great module!
I just saw that the option "use-grouping-header" doesn't exist in the modules schema.yml file. The other options exist.
I didn't check if that leads to problems, but I guess it should exist? Or is that option stored somewhere else?
// ...
$c = count($this->options['grouping']);
// Add a form use group header field for every grouping, plus one.
for ($i = 0; $i <= $c; $i++) {
$grouping = !empty($this->options['grouping'][$i]) ? $this->options['grouping'][$i] : [];
$grouping += ['use-grouping-header' => 0];
$form['grouping'][$i]['use-grouping-header'] = [
'#type' => 'checkbox',
'#title' => $this->t('Use the group header as the Accordion header'),
'#default_value' => $grouping['use-grouping-header'],
'#description' => $this->t("If checked, the Group's header will be used to open/close the accordion."),
'#states' => [
'invisible' => [
':input[name="style_options[grouping][' . $i . '][field]"]' => ['value' => ''],
],
],
];
}
$form['grouping']['#prefix'] = '<div class="form-item">' . $this->t('<strong>IMPORTANT:</strong> The <em>first field</em> in order of appearance <em>will</em> be the one used as the "header" or "trigger" of the accordion action.') . '</div>';
$form['disableifone'] = [
'#type' => 'checkbox',
'#title' => $this->t('Disable if only one result'),
'#default_value' => $this->options['disableifone'],
'#description' => $this->t("If set, the accordion will not be shown when there are less than 2 results."),
];
$form['row-start-open'] = [
'#type' => 'select',
'#title' => $this->t('Row to display opened on start'),
'#default_value' => $this->options['row-start-open'],
'#description' => $this->t('Choose which row should start opened when the accordion first loads. If you want all to start closed, choose "None", and make sure to have "Allow for all rows to be closed" on below.'),
'#options' => $rsopen_options,
];
// ...
vs.
views.style.views_accordion:
type: views_style
label: 'Views Accordion'
mapping:
disableifone:
type: integer
label: 'Disable if only one result'
row-start-open:
type: string
label: 'Row to display opened on start'
collapsible:
type: integer
label: 'Collapsible'
animated:
type: string
label: 'Animation effect'
animation_time:
type: string
label: 'Animation time'
heightStyle:
type: string
label: 'heightStyle'
event:
type: string
label: 'Event'
use_header_icons:
type: integer
label: 'Use header icons'
icon_header:
type: 'string'
label: 'Closed row header icon'
icon_active_header:
type: 'string'
label: 'Opened row header icon'
Comments
Comment #2
anybodyComment #3
anybodyComment #4
manuel garcia commentedThanks for having a look @Anybody - you are correct, the schema is currently not entirely correct.
Current tests did not pick this up because we do not have coverage for these options yet (the test view doesn't have the options enabled). So I've opened #3035375: Add test coverage for field grouping for this. Let's fix this as part of that task. Hope you don't mind me closing this, let's work on the test along with this :)