Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MWPW-155566] [MEP] Allow relevant actions in MEP to use text and HTML instead of just fragments #2683

Merged
merged 54 commits into from
Sep 2, 2024

Conversation

denlight
Copy link
Contributor

@denlight denlight commented Aug 2, 2024

  • Expanded the functionality of the several actions to allow text or HTML instead of just fragments: (replace, insertbefore, insertafter, prependToSection and appendToSection) It is intended to update innerText of the targeted element.(ex: update a column/row combination text to change the index of a selected tab)
  • now that prependToSection and appendToSection can text and HTML, also lifted the restriction they be used on sections and are renamed append and prepend
  • Added new "helper" selectors: primary-cta, secondary-cta, action-area with an ability to pair those with the #_href flag to update the href attributes where applicable.
  • Added ability to combine simplified and "pseudo"(simplified) selectors.

Resolves:
MWPW-155566

Also resolves:
MWPW-148285 [MILO][MEP] Add simplified selector to select the paragraph around a block's links - one of the best use cases for the update action, so was added to this PR
MWPW-148284 [MILO][MEP] Allow selectors to have a mix of CSS and simplified selectors - update for 148285 also ended up solving this

URL for testing:

Psi-check: https://mwpw-148284--milo--adobecom.hlx.page/?martech=off

Recent updates to this PR:
updated the getSelectedElement function to have a different approach:

  1. no longer adding a new action called update but instead allowing most actions to accept html or text
  2. because we allow html and text for most actions, changed appendToSection and prependToSection to just be called append and prepend (retro support for old names)
    3.updated the getSelectedElement function to have a different approach:
  • split and join the selector to add spaces around > and , for consistency
  • split the selector by whitespace
  • loop through each "term" in the selector to figure out if it starts with a simplified selector and/or ends in a child number

benefits to this approach:

  1. can recognize consumer blocks
  2. can enforce sections are direct children of main but still handle if main is in the selector from manifest
  3. can add number when there's a dot. Example .text4

@denlight denlight requested a review from a team as a code owner August 2, 2024 17:15
Copy link
Contributor

aem-code-sync bot commented Aug 2, 2024

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

@denlight denlight requested review from vgoodric and removed request for a team August 2, 2024 17:15
Copy link
Contributor

aem-code-sync bot commented Aug 2, 2024

Page Scores Audits Google
M /?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
D /?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

Copy link
Contributor

github-actions bot commented Aug 3, 2024

This pull request is not passing all required checks. Please see this discussion for information on how to get all checks passing. Inconsistent checks can be manually retried. If a test absolutely can not pass for a good reason, please add a comment with an explanation to the PR.

@markpadbe markpadbe self-requested a review August 23, 2024 23:23
@vgoodric vgoodric added verified PR has been E2E tested by a reviewer Ready for Stage run-nala Run Nala Test Automation against PR high priority Why is this a high priority? Blocker? Critical? Dependency? labels Aug 29, 2024
@milo-pr-merge milo-pr-merge bot merged commit 6362c19 into stage Sep 2, 2024
12 checks passed
@milo-pr-merge milo-pr-merge bot deleted the MWPW-148284 branch September 2, 2024 08:17
@milo-pr-merge milo-pr-merge bot mentioned this pull request Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high priority Why is this a high priority? Blocker? Critical? Dependency? Ready for Stage run-nala Run Nala Test Automation against PR verified PR has been E2E tested by a reviewer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants