Skip to content

Commit d2237dd

Browse files
author
Magnar Eivind Martinsen
committed
Fixed some bugs
1 parent 0e25ee3 commit d2237dd

File tree

3 files changed

+63
-6
lines changed

3 files changed

+63
-6
lines changed

metsis/metsis_search/config/install/views.view.metsis_elements.yml

+32-5
Original file line numberDiff line numberDiff line change
@@ -2198,9 +2198,9 @@ display:
21982198
first: '« First'
21992199
last: 'Last »'
22002200
expose:
2201-
items_per_page: false
2201+
items_per_page: true
22022202
items_per_page_label: 'Items per page'
2203-
items_per_page_options: '5, 10, 25, 50'
2203+
items_per_page_options: '5, 10, 15, 25, 50'
22042204
items_per_page_options_all: false
22052205
items_per_page_options_all_label: '- All -'
22062206
offset: false
@@ -2217,27 +2217,54 @@ display:
22172217
sort_asc_label: Asc
22182218
sort_desc_label: Desc
22192219
text_input_required: 'Select any filter and click on Apply to see results'
2220-
text_input_required_format: null
2220+
text_input_required_format: basic_html
22212221
bef:
22222222
general:
22232223
autosubmit: false
22242224
autosubmit_exclude_textfield: false
22252225
autosubmit_textfield_delay: 500
22262226
autosubmit_hide: false
22272227
input_required: false
2228-
allow_secondary: false
2228+
allow_secondary: true
22292229
secondary_label: 'Advanced options'
22302230
secondary_open: false
22312231
reset_button_always_show: false
2232-
sort:
2232+
pager:
22332233
plugin_id: default
2234+
advanced:
2235+
is_secondary: true
22342236
filter:
22352237
search_api_fulltext:
22362238
plugin_id: default
2239+
advanced:
2240+
rewrite:
2241+
filter_rewrite_values: ''
2242+
filter_rewrite_values_key: false
2243+
collapsible: false
2244+
collapsible_disable_automatic_open: false
2245+
is_secondary: false
22372246
temporal_extent_start_date:
22382247
plugin_id: default
2248+
advanced:
2249+
collapsible: false
2250+
collapsible_disable_automatic_open: false
2251+
is_secondary: false
22392252
temporal_extent_end_date:
22402253
plugin_id: default
2254+
advanced:
2255+
collapsible: false
2256+
collapsible_disable_automatic_open: false
2257+
is_secondary: false
2258+
platform_ancillary_cloud_coverage:
2259+
plugin_id: default
2260+
advanced:
2261+
placeholder_text: ''
2262+
rewrite:
2263+
filter_rewrite_values: ''
2264+
filter_rewrite_values_key: false
2265+
collapsible: false
2266+
collapsible_disable_automatic_open: false
2267+
is_secondary: false
22412268
access:
22422269
type: role
22432270
options:

metsis/metsis_search/metsis_search.module

+30
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,36 @@ function metsis_search_form_views_exposed_form_alter(&$form, FormStateInterface
604604
];*/
605605
// dpm($form);
606606
// dpm($form);
607+
}
608+
if (($view['view']->id() == 'metsis_elements') && ($view['view']->current_display == 'results')) {
609+
// $form['actions']['submit']['#value'] = t('Apply Nowx1');
610+
611+
// Always keep advanced options closed.
612+
unset($form['secondary']['#open']);
613+
614+
// Get the metsis earch config object.
615+
$config = \Drupal::config('metsis_search.settings');
616+
$enable_cloud_coverage = $config->get('enable_cloud_coverage_elements');
617+
$cloud_coverage_details = $config->get('cloud_coverage_details_elements');
618+
$disable_children_filter = $config->get('disable_children_filter_elements');
619+
// dpm($form);
620+
if (!$enable_cloud_coverage) {
621+
// unset($form['#info']['filter-platform_ancillary_cloud_coverage']);.
622+
$form['platform_ancillary_cloud_coverage']['#type'] = 'hidden';
623+
$form['platform_ancillary_cloud_coverage']['#access'] = FALSE;
624+
$form['platform_ancillary_cloud_coverage']['#multiple'] = FALSE;
625+
$form['platform_ancillary_cloud_coverage_collapsible']['#type'] = 'hidden';
626+
$form['platform_ancillary_cloud_coverage_collapsible']['#access'] = FALSE;
627+
}
628+
if ($enable_cloud_coverage && (!$cloud_coverage_details)) {
629+
unset($form['platform_ancillary_cloud_coverage_collapsible']);
630+
unset($form['platform_ancillary_cloud_coverage']['#group']);
631+
}
632+
633+
// if ($disable_children_filter) {
634+
// $form['is_parent']['#type'] = 'hidden';
635+
// $form['is_parent']['#access'] = FALSE;
636+
// }
607637
}
608638
if (($view['view']->id() == 'metsis_simple_search') && ($view['view']->current_display == 'results')) {
609639
// $form['related_dataset_id']['#type'] = 'hidden';

metsis/metsis_search/src/Form/MetsisSearchConfigurationForm.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ public function submitForm(array &$form, FormStateInterface $form_state): void {
346346
->set('cloud_coverage_details', $values['cloud_coverage_details'])
347347
->set('disable_children_filter', $values['disable_children_filter'])
348348
->set('cloud_coverage_details_elements', $values['cloud_coverage_details_elements'])
349-
->set('disable_children_filter_elements', $values['disable_children_filter_elements'])
349+
->set('enable_cloud_coverage_elements', $values['enable_cloud_coverage_elements'])
350350
->set('bbox_overlap_sort', $values['bbox_overlap_sort'])
351351
->set('search_match_children', $values['search_match_children'])
352352
->save();

0 commit comments

Comments
 (0)