Improve CKE5 plugins (alert, panel)

Created on 24 October 2024, about 2 months ago

Problem/Motivation

There are a few issues with the alert and panel CKE5 plugins in WxT:

  • The alert plugin uses an H3 for the title, and this is not configurable. If you switch to Source view and change it to an H2 manually, the widget breaks and the title is moved outside of the alert.
  • The select list for changing an existing panel/alert type doesn't default to the current type.
  • The alert plugin expects the body of the alert to be wrapped in a <div> element. When migrating content, I'm noticing that many alert bodies are just

    tags. When editing this content, the alert markup completely breaks and the markup is not recognized as a widget anymore.

Example migrated alert markup:

<section id="cvitp-eng" class="alert alert-info"> 
    <h2 class="h4"><span class="nowrap">COVID-19</span>: Important updates</h2>
    <p>For the 2022 tax season, some community organizations are hosting free virtual tax clinics. Volunteers may be able to complete and file your taxes for free, by videoconference, by phone or through a drop-off clinic. To find a clinic, please check our <a href="https://apps.cra-arc.gc.ca/ebci/oecv/external/prot/startClinicSearch.action?request_locale=en_CA">directory</a> or if you live in Quebec, contact <a href="https://www.revenuquebec.ca/en/fair-for-all/helping-you-meet-your-obligations/income-tax-assistance-volunteer-program/">Revenu Québec</a>.</p>
</section>
Feature request
Status

Active

Version

5.3

Component

Code

Created by

🇨🇦Canada smulvih2 Canada 🍁

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @smulvih2
  • 🇨🇦Canada smulvih2 Canada 🍁

    This has been merged into the 5.3.x branch. Including a patch here for others if this is needed in previous versions.

    Fixes:

    • Building the CKE5 plugins uses npm, and the version of CKE5 that was being used was old, before the breaking change in 41.3.1 discussed here - https://www.drupal.org/project/wxt/issues/3469267#comment-15755549 . As part of this fix I upgraded the version of CKE5 that is being used to build the plugin code.
    • Added Heading level select field on alert plugin to allow user to set heading level to use.
    • Allow users to select an existing widget, and change the type and heading level. Ensured that content of the widget is not modified when changing these options. Also selecting an existing widget the select fields will be populated with the current values.
    • Allow alerts to be more flexible with body contents, now works if migrated content wraps body in <p> tag.
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024