Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

Commit

Permalink
Merge branch '4.2.x' into snyk-upgrade-c23cb8e8eddec618fe7b83e64d388509
Browse files Browse the repository at this point in the history
  • Loading branch information
podarok authored May 11, 2022
2 parents 09ddae5 + 603fc0a commit 45b36f8
Show file tree
Hide file tree
Showing 44 changed files with 17,376 additions and 3,593 deletions.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,39 @@ document.addEventListener('openy_activity_finder_event', (e) => {
...
})
```

### Add custom component in between of results

it allows flexibility in terms of results rendering for the developer:
```
<ResultsList
:results="data.table"
:ages="ages"
:selected-ages="selectedAges"
:legacy-mode="legacyMode"
:disable-spots-available="disableSpotsAvailable"
@showActivityDetailsModal="showActivityDetailsModal($event)"
/>
```
can be changed to this:
```
<ResultsList
:results="data.table.slice(0, 2)"
:ages="ages"
:selected-ages="selectedAges"
:legacy-mode="legacyMode"
:disable-spots-available="disableSpotsAvailable"
@showActivityDetailsModal="showActivityDetailsModal($event)"
/>
<YGBWAds />
<ResultsList
:results="data.table.slice(2)"
:ages="ages"
:selected-ages="selectedAges"
:legacy-mode="legacyMode"
:disable-spots-available="disableSpotsAvailable"
@showActivityDetailsModal="showActivityDetailsModal($event)"
/>
```
where YGBWAds is custom component to render custom content in between the results.
See https://github.com/ymcatwincities/openy_activity_finder/pull/148
2 changes: 2 additions & 0 deletions config/install/openy_activity_finder.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ hb_modal_text2: "The options you've selected do not match any activities availab
hb_modal_text3: "Please select one of the options below to proceed:"
hb_modal_text4: "View available locations"
hb_modal_text5: "Adjust my filters"
disable_program_search_log: 1
disable_cache_debug_log: 1
4 changes: 2 additions & 2 deletions config/optional/search_api.index.default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ field_settings:
label: 'Max Age'
datasource_id: 'entity:node'
property_path: field_session_max_age
type: integer
type: string
dependencies:
config:
- field.storage.node.field_session_max_age
Expand All @@ -245,7 +245,7 @@ field_settings:
label: 'Min Age'
datasource_id: 'entity:node'
property_path: field_session_min_age
type: integer
type: string
dependencies:
config:
- field.storage.node.field_session_min_age
Expand Down
7 changes: 7 additions & 0 deletions js/programs_search.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,13 @@
}
}

if (typeof this.$route.query.sort != 'undefined') {
var sortGet = decodeURIComponent(this.$route.query.sort);
if (sortGet) {
this.sort = sortGet;
}
}

this.runAjaxRequest();

component.afPageRef = 'OpenY' in window && typeof window.OpenY.field_prgf_af_page_ref !== 'undefined' && typeof window.OpenY.field_prgf_af_page_ref[0] !== 'undefined' ? window.OpenY.field_prgf_af_page_ref[0]['url'] : '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
function openy_paragraph_activity_finder_search_update_8002() {
$cim = \Drupal::service('config_import.importer');
$cim->setDirectory(drupal_get_path('module', 'openy_paragraph_activity_finder_search') . '/config/install');
$cim->setDirectory(\Drupal::service('extension.list.module')->getPath('openy_paragraph_activity_finder_search') . '/config/install');
$cim->importConfigs([
'field.field.paragraph.activity_finder_search.field_prgf_af_page_ref',
'core.entity_view_display.paragraph.activity_finder_search.default',
Expand All @@ -23,7 +23,7 @@ function openy_paragraph_activity_finder_search_update_8002() {
*/
function openy_paragraph_activity_finder_search_update_8003() {
$cim = \Drupal::service('config_import.importer');
$cim->setDirectory(drupal_get_path('module', 'openy_paragraph_activity_finder_search') . '/config/install');
$cim->setDirectory(\Drupal::service('extension.list.module')->getPath('openy_paragraph_activity_finder_search') . '/config/install');
$cim->importConfigs([
'field.field.paragraph.activity_finder_search.field_prgf_af_show_weeks_filter',
'field.storage.paragraph.field_prgf_af_show_weeks_filter',
Expand All @@ -36,7 +36,7 @@ function openy_paragraph_activity_finder_search_update_8003() {
* Update configs with deprecation notices.
*/
function openy_paragraph_activity_finder_search_update_8004() {
$config_dir = drupal_get_path('module', 'openy_paragraph_activity_finder_search') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_paragraph_activity_finder_search') . '/config/install/';
$configs = [
'paragraphs.paragraphs_type.activity_finder_search' => [
'label',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
function openy_prgf_activity_finder_update_8001() {
$cim = \Drupal::service('config_import.importer');
$cim->setDirectory(drupal_get_path('module', 'openy_prgf_activity_finder') . '/config/install');
$cim->setDirectory(\Drupal::service('extension.list.module')->getPath('openy_prgf_activity_finder') . '/config/install');
$cim->importConfigs([
'field.storage.paragraph.field_prgf_af_categ_excl',
'field.storage.paragraph.field_prgf_af_categ',
Expand All @@ -27,7 +27,7 @@ function openy_prgf_activity_finder_update_8001() {
*/
function openy_prgf_activity_finder_update_8002() {
$cim = \Drupal::service('openy_upgrade_tool.importer');
$cim->setDirectory(drupal_get_path('module', 'openy_prgf_activity_finder') . '/config/install');
$cim->setDirectory(\Drupal::service('extension.list.module')->getPath('openy_prgf_activity_finder') . '/config/install');
$cim->importConfigs([
'field.storage.paragraph.field_prgf_hide_program_block',
'field.field.paragraph.activity_finder.field_prgf_hide_program_block',
Expand All @@ -41,7 +41,7 @@ function openy_prgf_activity_finder_update_8002() {
*/
function openy_prgf_activity_finder_update_8003() {
$cim = \Drupal::service('openy_upgrade_tool.importer');
$cim->setDirectory(drupal_get_path('module', 'openy_prgf_activity_finder') . '/config/install');
$cim->setDirectory(\Drupal::service('extension.list.module')->getPath('openy_prgf_activity_finder') . '/config/install');
$cim->importConfigs([
'core.entity_form_display.paragraph.activity_finder.default',
'core.entity_view_display.paragraph.activity_finder.default',
Expand All @@ -54,7 +54,7 @@ function openy_prgf_activity_finder_update_8003() {
* Update configs with deprecation notices.
*/
function openy_prgf_activity_finder_update_8004() {
$config_dir = drupal_get_path('module', 'openy_prgf_activity_finder') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_prgf_activity_finder') . '/config/install/';
$configs = [
'paragraphs.paragraphs_type.activity_finder' => [
'label',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Update configs with new labels/descriptions.
*/
function openy_prgf_activity_finder_4_update_8400() {
$config_dir = drupal_get_path('module', 'openy_prgf_activity_finder_4') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_prgf_activity_finder_4') . '/config/install/';
$configs = [
'paragraphs.paragraphs_type.activity_finder_4' => [
'label',
Expand Down
7 changes: 7 additions & 0 deletions openy_activity_finder.api.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,10 @@ function hook_activity_finder_program_process_results_alter(array &$data, NodeIn
function hook_activity_finder_program_more_info_alter(&$data) {

}

/**
* Alter location list.
*/
function hook_activity_finder_location_list_alter(array &$data) {

}
45 changes: 36 additions & 9 deletions openy_activity_finder.install
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function openy_activity_finder_update_dependencies() {
* Update configs.
*/
function openy_activity_finder_update_8001() {
$openy_activity_finder_dir = drupal_get_path('module', 'openy_activity_finder');
$openy_activity_finder_dir = \Drupal::service('extension.list.module')->getPath('openy_activity_finder');
$cim = \Drupal::service('config_import.importer');
$cim->setDirectory($openy_activity_finder_dir . '/config/install');
$cim->importConfigs(['openy_activity_finder.settings']);
Expand All @@ -63,7 +63,7 @@ function openy_activity_finder_update_8001() {
*/
function openy_activity_finder_update_8002() {
$cim = \Drupal::service('config_import.importer');
$cim->setDirectory(drupal_get_path('module', 'openy_activity_finder') . '/config/optional');
$cim->setDirectory(\Drupal::service('extension.list.module')->getPath('openy_activity_finder') . '/config/optional');
$config = \Drupal::config('search_api.index.default');
if (!$config->isNew()) {
// Import config only in case it already exist.
Expand All @@ -77,7 +77,7 @@ function openy_activity_finder_update_8002() {
function openy_activity_finder_update_8003() {
\Drupal::service('module_installer')->install(['openy']);
$cim = \Drupal::service('config_import.importer');
$cim->setDirectory(drupal_get_path('module', 'openy_activity_finder') . '/config/install');
$cim->setDirectory(\Drupal::service('extension.list.module')->getPath('openy_activity_finder') . '/config/install');
$cim->importConfigs(['openy_activity_finder.settings']);
}

Expand All @@ -96,7 +96,7 @@ function openy_activity_finder_update_8004(&$sandbox) {
*/
function openy_activity_finder_update_8005() {
$cim = \Drupal::service('config_import.importer');
$cim->setDirectory(drupal_get_path('module', 'openy_activity_finder') . '/config/optional');
$cim->setDirectory(\Drupal::service('extension.list.module')->getPath('openy_activity_finder') . '/config/optional');
$config = \Drupal::config('search_api.index.default');
if (!$config->isNew()) {
// Import config only in case it already exist.
Expand Down Expand Up @@ -152,7 +152,7 @@ function openy_activity_finder_update_8007(&$sandbox) {
*/
function openy_activity_finder_update_8008() {
$cim = \Drupal::service('config_import.importer');
$cim->setDirectory(drupal_get_path('module', 'openy_activity_finder') . '/config/optional');
$cim->setDirectory(\Drupal::service('extension.list.module')->getPath('openy_activity_finder') . '/config/optional');
$config = \Drupal::config('search_api.index.default');
if (!$config->isNew()) {
// Import config only in case it already exist.
Expand All @@ -165,7 +165,7 @@ function openy_activity_finder_update_8008() {
*/
function openy_activity_finder_update_8009() {
$cim = \Drupal::service('config_import.importer');
$cim->setDirectory(drupal_get_path('module', 'openy_activity_finder') . '/config/optional');
$cim->setDirectory(\Drupal::service('extension.list.module')->getPath('openy_activity_finder') . '/config/optional');
$config = \Drupal::config('search_api.index.default');
if (!$config->isNew()) {
// Import config only in case it already exist.
Expand All @@ -179,7 +179,7 @@ function openy_activity_finder_update_8009() {
function openy_activity_finder_update_8400() {
// Import config for rest endpoint.
$cim = \Drupal::service('config_import.importer');
$cim->setDirectory(drupal_get_path('module', 'openy_activity_finder') . '/config/install');
$cim->setDirectory(\Drupal::service('extension.list.module')->getPath('openy_activity_finder') . '/config/install');
$cim->importConfigs(['rest.resource.openy_activity_finder_session_data']);
// Add permissions to anonymous and authenticated roles.
$permissions = [
Expand All @@ -202,7 +202,7 @@ function openy_activity_finder_update_8400() {
*/
function openy_activity_finder_update_8401() {
$cim = \Drupal::service('config_import.importer');
$cim->setDirectory(drupal_get_path('module', 'openy_activity_finder') . '/config/optional');
$cim->setDirectory(\Drupal::service('extension.list.module')->getPath('openy_activity_finder') . '/config/optional');
$config = \Drupal::config('search_api.index.default');
if (!$config->isNew()) {
// Import config only in case it already exists.
Expand All @@ -225,10 +225,37 @@ function openy_activity_finder_update_8402() {
*/
function openy_activity_finder_update_8403() {
$cim = \Drupal::service('config_import.importer');
$cim->setDirectory(drupal_get_path('module', 'openy_activity_finder') . '/config/optional');
$cim->setDirectory(\Drupal::service('extension.list.module')->getPath('openy_activity_finder') . '/config/optional');
$config = \Drupal::config('search_api.index.default');
if (!$config->isNew()) {
// Import config only in case it already exists.
$cim->importConfigs(['search_api.index.default']);
}
}

/**
* Update configs for search index.
*/
function openy_activity_finder_update_8404() {
_af_config_import();
}

/**
* Update configs for search index. Configs should be sent in an array where the
* key is the directory and the value is an array of config files.
*/
function _af_config_import($import = ['optional' => ['search_api.index.default']]) {
$cim = \Drupal::service('config_import.importer');
// Loop through keys as directories...
foreach ($import as $dir => $configs) {
$cim->setDirectory(\Drupal::service('extension.list.module')->getPath('openy_activity_finder') . '/config/'. $dir);
// Now process each config to be imported.
foreach ($configs as $name) {
$config = \Drupal::config($name);
if (!$config->isNew()) {
// Import config only in the case that it already exists.
$cim->importConfigs([$name]);
}
}
}
}
2 changes: 1 addition & 1 deletion openy_activity_finder.libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ openy_activity_finder_search:
- core/jquery.cookie

activity_finder_4:
version: 4.0.13
version: 4.0.15
js:
openy_af4_vue_app/dist/activity_finder_4.umd.min.js: { minified: true }
css:
Expand Down
1 change: 1 addition & 0 deletions openy_af4_vue_app/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v14.18.1
2 changes: 1 addition & 1 deletion openy_af4_vue_app/dist/activity_finder_4.css

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion openy_af4_vue_app/dist/activity_finder_4.umd.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 45b36f8

Please sign in to comment.