Giter VIP home page Giter VIP logo

openy_repeat's People

Contributors

andreymaximov avatar andreyzb avatar andriokha avatar danylevskyi avatar david-storm avatar dchubar-fj avatar froboy avatar manachynskyi avatar oleh-rymar avatar podarok avatar sardis93 avatar sathyaymca avatar shuklina avatar svicervlad avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

openy_repeat's Issues

The application stops working in some content conditions

In some situations, the Schedule pages stop working after the initial load and change in filters/date. The application simply freezes and there is an error in the console.
image

The cause of the issue relates to the key attribute of v-for constructions.
Whenever a v-for construction is used with the key attribute the attribute values must be unique (see https://vuejs.org/v2/guide/list.html#Maintaining-State).

The openy_repeat module does have at least one v-for construction with the key attribute
https://github.com/ynorth-projects/openy_repeat/blob/9.x-2.x/templates/openy-repeat-schedule-dashboard--table.html.twig#L36
The values used as keys are not guaranteed to be unique in this situation as Node IDs of session nodes are used. In order to reproduce the non-unique keys, just add a couple of session time paragraphs that will schedule that event more than once a day.

For production, the module uses the production build of the Vue.js (see https://github.com/ymcatwincities/openy/blob/9.x-2.x/modules/custom/openy_system/openy_system.libraries.yml#L14). The production build suppresses all the warnings.

The non-minified (non-production) build of the Vue.js (https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.11/vue.js) will show warnings:
image

For large schedules (with more than a single page of content a day), the error might occur:

Production Non-prouduction Vue.js
image image

Interestingly, the issue is not reproduced in the Carnation. That's because the template is overridden ๐Ÿคฆ :
https://github.com/ymcatwincities/openy/blob/9.x-2.x/themes/openy_themes/openy_carnation/templates/openy_repeat/openy-repeat-schedule-dashboard--table.html.twig#L36
The key attribute is removed in that override.


The solution.

Technically, removing the key attribute should work just fine.


Error messages:

Production error message

 TypeError: Cannot read properties of undefined (reading 'key')   vue.min.js:6 
     at ir (vue.min.js:6)
     at vue.min.js:6
     at x (vue.min.js:6)
     at vue.min.js:6
     at x (vue.min.js:6)
     at a.__patch__ (vue.min.js:6)
     at a.e._update (vue.min.js:6)
     at a.r (vue.min.js:6)
     at fn.get (vue.min.js:6)
     at fn.run (vue.min.js:6)

Non-production error messages

 [Vue warn]: Error in nextTick: "TypeError: Cannot read properties of undefined (reading 'key')"
 warn @ vue.js:634

 TypeError: Cannot read properties of undefined (reading 'key') 
     at sameVnode (vue.js:5818)
     at updateChildren (vue.js:6220)
     at patchVnode (vue.js:6320)
     at updateChildren (vue.js:6194)
     at patchVnode (vue.js:6320)
     at VueComponent.patch [as __patch__] (vue.js:6481)
     at VueComponent.Vue._update (vue.js:3949)
     at VueComponent.updateComponent (vue.js:4067)
     at Watcher.get (vue.js:4478)
     at Watcher.run (vue.js:4553)

Memory consumption is high

When the openy_repeat paragraphs are loading for the first time, the OpenyRepeatRepository::getLocations() method tends to get most session nodes loaded. This makes the entity memory cache service consume quite some memory, in our case, more than 256 MB.

See

public function getLocationsIds() {

Location and Class detail popups are not centralized

Steps to Reproduce:

  1. Enable lb_repeat_schedules block
  2. Edit the layout of demo-schedules landing page
  3. Place the Repeat (Group) Schedules layout builder block
  4. Click on Location or Class

Result:
Popup is placed at the bottom of the screen

Screenshare.-.2024-06-03.1_00_03.PM.mp4

Feature Request - Use the preferred location on Repeat Schedules

Make location pre-selected on the sidebar filter according to the Preferred Branch selection.

In the distribution, we have a "set preferred branch" functionality. When the user has already set their branch we will use this default value in the location filter.

Ideally, we would like this to be a flag that can be turned on/off in the Repeat Schedules paragraph so it doesn't affect functionality on the current Ys.

Don't require nodes to have children

Hi,

I started using this module on a site that has existing programs, program subcategories and activities, but that wasn't using classes and sessions. When trying to update existing activities I'm getting a fatal error.

Steps to reproduce

  1. Ensure openy_repeat_nodes is active.
  2. Create a published activity node without any associated classes.
  3. Update the name of the activity node.

Results

The website encountered an unexpected error. Please try again later.

Drupal\Core\Entity\EntityStorageException: Query condition 'node__field_session_class.field_session_class_target_id IN ()' cannot be empty. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 815 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Drupal\Core\Database\Query\Select->condition('node__field_session_class.field_session_class_target_id', Array, 'IN') (Line: 77)
Drupal\Core\Entity\Query\Sql\Condition->compile(Object) (Line: 177)
Drupal\Core\Entity\Query\Sql\Query->compile() (Line: 81)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 105)
openy_repeat_nodes_actualize_sessions(Object) (Line: 37)
openy_repeat_nodes_entity_update(Object)
call_user_func_array(Object, Array) (Line: 409)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object, 'openy_repeat_nodes') (Line: 388)
Drupal\Core\Extension\ModuleHandler->invokeAllWith('entity_update', Object) (Line: 416)
Drupal\Core\Extension\ModuleHandler->invokeAll('entity_update', Array) (Line: 217)
Drupal\Core\Entity\EntityStorageBase->invokeHook('update', Object) (Line: 900)
Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('update', Object) (Line: 564)
Drupal\Core\Entity\EntityStorageBase->doPostSave(Object, 1) (Line: 781)
Drupal\Core\Entity\ContentEntityStorageBase->doPostSave(Object, 1) (Line: 489)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 804)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 339)
Drupal\Core\Entity\EntityBase->save() (Line: 270)
Drupal\node\NodeForm->save(Array, Object)
call_user_func_array(Array, Array) (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 597)
Drupal\Core\Form\FormBuilder->processForm('node_activity_edit_form', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object) (Line: 39)
Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 163)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 58)
Drupal\openy_block_date\StackMiddleware\BlockDateCacheInvalidator->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 692)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Incorrect calendar download if filtered by location

Hi, thanks for the hard work on this module!

We had a user tell us that they tried downloading a particular event for their calendar, but the downloaded file referenced a different event. After some trial and error I was able to reproduce it by filtering on location without reloading the page. Just to check whether it was an issue local to our site I tried to see if I could reproduce it on the Greensboro site, and I could.

Repro

  1. Go to https://www.ymcagreensboro.org/open-gym-and-pool?date=2024-06-03&locations=&categories=&cn=
  2. Go down the list to 5am Open Gym, Eden Family YMCA and click Add To Calendar.
  3. Copy the ICalendar link: it should be https://addtocalendar.com/atc/ical?utz=60&uln=en-US&vjs=1.5&e[0][date_start]=2024-06-3%2005%3A00%3A00&e[0][date_end]=2024-06-3%2020%3A00%3A00&e[0][timezone]=America%2FNew_York&e[0][title]=Open%20Gym&e[0][description]=&e[0][location]=&e[0][organizer]=
    (note the title is Open%20Gym)
  4. Now use the location filter on the left to filter by Eden Family YMCA.
  5. Next to 5am Open Gym, Eden Family YMCA click Add To Calendar.
  6. Copy the ICalendar link.

Expected result

It should be the same calendar link

Actual result

https://addtocalendar.com/atc/ical?utz=60&uln=en-US&vjs=1.5&e[0][date_start]=2024-06-3%2005%3A00%3A00&e[0][date_end]=2024-06-3%2015%3A00%3A00&e[0][timezone]=America%2FNew_York&e[0][title]=Pickleball&e[0][description]=&e[0][location]=&e[0][organizer]=
(note the title is Pickeball)

It looks like that's the link to the first item when you first loaded the page (ie before applying the filter). If you reload the page with the filter it works fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.