@diosmosis opened this Pull Request on March 9th 2022 Member

Description:

Changes:

  • Convert _addEditGoal.twig and dependent twig templates + piwik-manage-goals directive to Vue.
  • Add exception for target=_blank to DOMPurify configuration (only if rel="noopener noreferrer" is present).
  • Allow model value for FieldCheckbox to be a number as well as boolean.
  • Remove use of const in piwikHelper.js as that should be vanilla JS.
  • Modify piwikHelper.compileVueEntryComponents so it can support multiple named slots.

Notes:

  • There are several twig events that had to be respected during migration. BC is provided through two separate methods:
    • vue-entry + named slots: Using the Vue component directly (ManageGoals), and supplying named slots where the twig postEvent call is used. This is the simpler approach and works in cases where the twig template was not parameterized. It doesn't work when, eg, the event is called inside a twig for loop, as that can't be translated to a v-for loop in the frontend.
    • using {% set %} to save the result of a postEvent call in twig, passing this into the template, and referencing this as a dynamic component via <component :is=.... This allows us to iterate over data in the twig template, save the result and pass it to Vue for use. The <component :is usage is done specifically so the HTML is directly inserted. Using v-html would require a parent element which is not always acceptable (eg, when a postEvent() call is made between <th> or <td> elements.

Both approaches will be documented.

Review

@diosmosis commented on March 11th 2022 Member

@sgiehl hopefully its fixed

This Pull Request was closed on March 11th 2022
Powered by GitHub Issue Mirror