Skip to content

Conversation

@bozojovicic
Copy link
Contributor

@bozojovicic bozojovicic commented Dec 3, 2025

Add DRAFT/PUBLISHED landscape toggle switch and MAS defaults on/off toggle switch
to the top right corner of OST.

Screenshot 2025-12-16 at 12 40 38

the toggle switch is placed in the top right corner, it simply changes the value of the commerce.landscape and commerce.defaults query parameters and reloads the page. In this way no changes in tacocat are needed. 

By defaults MAS defaults will be enabled and landscape will be PUBLISHED.

Resolves: MWPW-180988

Test URLs:

@bozojovicic bozojovicic marked this pull request as ready for review December 3, 2025 15:52
@bozojovicic bozojovicic requested review from a team and colloyd as code owners December 3, 2025 15:52
Copy link
Contributor

@Roycethan Roycethan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bozojovicic

  1. with https://mwpw180988--milo--bozojovicic.aem.live/tools/ost?token=<>
    i'm able to see the toggle on the first screen here:
image

But to check the next screen the offers are are not getting listing/populated in this branch, is there anything needs to be configured to see the products/offers and move to next screen ?

  1. In here https://main--cc--adobecom.aem.live/products/catalog?milolibs=mwpw180988--milo--bozojovicic
    The analytics events are not getting fired( i don' t see them in my network tab) for these below ones , i see its getting fired for other clicks...
    Typing "acro" inside Search box
    Clicking on Popularity or Alphabetical sorting options

Other than these non regressions are looking fine.

@bozojovicic
Copy link
Contributor Author

bozojovicic commented Dec 10, 2025

@Roycethan 1) works for me, it was always working, I did this so many times with token parameter and now I did it as well, never had problems
Screenshot 2025-12-10 at 13 46 41

For 2) you are right. Probably something is wrong with the git branch. I will check.

UPDATE: As I thought, something was wrong with the branch. I updated it with the fresh stage code and now analytics works fine

https://main--cc--adobecom.aem.live/products/catalog?milolibs=mwpw180988--milo--bozojovicic

@Roycethan Roycethan added verified PR has been E2E tested by a reviewer Ready for Stage and removed Ready for Stage labels Dec 10, 2025
@github-actions
Copy link
Contributor

Reminder to set the Ready for Stage label - to queue this to get merged to stage & production.

Copy link
Contributor

@mirafedas mirafedas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add unit tests?

@bozojovicic
Copy link
Contributor Author

@mirafedas I added unit tests that enable/disable both toggle switches. I had to slightly adapt some functions in ost.js to make them testable. Please check again.

const el = document.createElement('div');
const ostEnv = { landscape: 'PUBLISHED' };
const windowObj = { location: {} };
const cbs = addToggleSwitches(el, ostEnv, true, windowObj);
Copy link
Contributor

@mirafedas mirafedas Dec 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UPD: I forgot that assigning to window.location.href is restricted in our test environment. Instead of passing the window object around, could we return the new window.location.href value? That way the test can simply assert that it changed as expected. If no, then nevermind :)

Nit: please separate every it(...) with a new line, to have it consistent with the rest of the files

@github-actions
Copy link
Contributor

github-actions bot commented Jan 3, 2026

This PR has not been updated recently and will be closed in 7 days if no action is taken. Please ensure all checks are passing, https://github.com/orgs/adobecom/discussions/997 provides instructions. If the PR is ready to be merged, please mark it with the "Ready for Stage" label.

@github-actions github-actions bot added the Stale label Jan 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stale verified PR has been E2E tested by a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants