Skip to content

Conversation

@zackcl
Copy link
Collaborator

@zackcl zackcl commented Jul 10, 2024

This PR updates the frontend/projects/upgrade/src/assets/js/demo-app.js file used by the demo app to interact with UpGrade v5.2.0's (mdc-migrated) frontend for guided tours.

Closes #1538

@zackcl zackcl self-assigned this Jul 10, 2024
@zackcl zackcl added the demo label Jul 10, 2024
@danoswaltCL
Copy link
Collaborator

danoswaltCL commented Jul 11, 2024

not sure who needs to review, I have to assume this is in working condition if this is the standard operating procedure for selecting elements.

can you explain the reason for this switch list though? is it not possible for you to put unique selectors on your elements in the html itself that can be selected withs id or data- selectors? like:

<div data-upgrade-logo-link>

function getElementById(id) {
  const selector = `[data-${id}]`;
  return document.querySelector(selector);
}

@danoswaltCL
Copy link
Collaborator

o wait duh, i forgot that these selectors are picking up on elements from the upgrade app. still, that switch list makes my stomach hurt, my code review brain wants desperately want to turn that into an object map, but that's just me looking at this one file at a glance.

@zackcl
Copy link
Collaborator Author

zackcl commented Jul 12, 2024

Yes, those selectors need to be in that file to access the UI elements from UpGrade. I agree that some parts of the code can be moved to the demo app, but it's difficult to generalize the element selecting pattern since new tours might require different ways to access UpGrade elements. I plan to clean up the code in the demo-app.js file once we are sure no new tours need to be added.

@zackcl zackcl merged commit 766ff91 into dev Jul 12, 2024
@zackcl zackcl deleted the feature/1538-update-demo-app branch July 12, 2024 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Demo App to use the latest version of UpGrade

3 participants