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] Changing from a new action to just expanding power of existing actions #2764

Merged
merged 16 commits into from
Aug 20, 2024

Conversation

vgoodric
Copy link
Contributor

@vgoodric vgoodric commented Aug 19, 2024

Made a new branch and PR so we can compare the 2 and decide what we want to change.

  • 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: can recognize consumer blocks, can enforce sections are direct children of main but still handle if main is in the selector from manifest
  • no longer adding a new action called update but instead allowing most actions to accept html or text
  • 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)

Resolves: MWPW-148284

Since I'm no longer using a new action name, I made a new page that pulls in a new manifest. So it's easiest to compare the original page with original libs to my page with the new libs.
Also, I added the same console message to both branches so you can easily see the exact way the selector is modified for some fringe cases.

Test URLs:

@vgoodric vgoodric requested a review from a team as a code owner August 19, 2024 23:58
Copy link
Contributor

aem-code-sync bot commented Aug 19, 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

@vgoodric vgoodric requested review from chrischrischris and a team August 19, 2024 23:58
@aem-code-sync aem-code-sync bot temporarily deployed to mepreplaceregex August 20, 2024 19:57 Inactive
Copy link

codecov bot commented Aug 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.86%. Comparing base (a689d1c) to head (4c8405b).
Report is 1 commits behind head on MWPW-148284.

Additional details and impacted files
@@               Coverage Diff               @@
##           MWPW-148284    #2764      +/-   ##
===============================================
- Coverage        95.86%   95.86%   -0.01%     
===============================================
  Files              173      173              
  Lines            45823    45847      +24     
===============================================
+ Hits             43930    43950      +20     
- Misses            1893     1897       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aem-code-sync aem-code-sync bot temporarily deployed to mepreplaceregex August 20, 2024 20:24 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to mepreplaceregex August 20, 2024 20:58 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to mepreplaceregex August 20, 2024 21:32 Inactive
@vgoodric vgoodric merged commit aa56554 into MWPW-148284 Aug 20, 2024
11 of 12 checks passed
@vgoodric vgoodric deleted the mepreplaceregex branch August 20, 2024 22:49
milo-pr-merge bot pushed a commit that referenced this pull request Sep 2, 2024
…L instead of just fragments (#2683)

* getSelectedElement - V2

* getSelectedElement - V2

* getSelectedElement - V2

* getSelectedElement - V2

* getSelectedElement - V2

* added test coverage for  action

* cleanup

* added comments

* comments

* comments

* fixes erroring but still has failure

* rooEl fix

* fixed tests

* added modifier

* eslint

* lint

* removed reduncant try catch

* Add target analytics for update action

* removed test-results and added to .gitignore

* reverted a deletion of a prependtosection validation code

* removed comments

* updated validation for appendtosdection

* removed comments and eslint escapes

* change modifier to an array that is not a separate column

* add highight for update

* add timeout to merch-card highlight

* remove setTimeout and move preview.js call from loadPostLCP to loadDeferred

* update unit test

* remove update to git ignore

* add temp console message for easy QA

* MWPW-155566 [MEP] Changing from a new action to just expanding power of existing actions (#2764)

* stash

* use replace instead of update, allow html for create commands, update simplified selectors

* streamline

* remove export on MILO_BLOCKS

* change prependToSection and appendToSection to just prepend and append

* remove unused function param

* change from includes to ===

* remove use of .parentElement

* move spoof param test so you can reload the other tests

* account for number used after dot notation

* add test to insertbefore and insert after href

* more coverage

* more coverage

* hopefully final coverage

* remove console

* rename checkSelectorType to getSelectorType

* move parts of createContent into sub functions

* small big fix

* update modifySelectorTerm function per suggestion

* update modifyNonFragmentSelector per suggestion

* update to getSelectedElement

* change equal to not equal

* fix end number update

* codecov

* no longer require fragments be in URL for fragments because of gnav

* call getModifiers in modifyNonFragmentSelector instead

* require space before first flag

* update unit tests to need space before flags

* handle adding flags to fragment selectors

* revert for demo

* put back

* remove utils update so it does not conflict

---------

Co-authored-by: Denys Fedotov <dfedotov@Denyss-MacBook-Pro.local>
Co-authored-by: vgoodric <vgoodric@adobe.com>
Co-authored-by: markpadbe <markp@adobe.com>
Co-authored-by: Vivian A Goodrich <101133187+vgoodric@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant