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

Csmccarthy/z index config #147

Merged
merged 8 commits into from
Oct 12, 2023
Merged

Csmccarthy/z index config #147

merged 8 commits into from
Oct 12, 2023

Conversation

csmccarthy
Copy link
Member

@csmccarthy csmccarthy commented Oct 6, 2023

Related Issues

links https://transcend.height.app/T-30079

Internal Changelog

Context: Eventbrite took umbridge with the consent banner staying at the maximum z-index and blocking a payment modal of theirs

Fix: We added a new config option to allow for a manually specified z-index on the consent banner

Notes: We don't want to make this easy to enable, since in general "hiding" the consent banner like this is a bad pattern to follow. There may or may not be a better place to set this config value to better achieve that goal of making hiding sufficiently difficult (if there is, let me know).

Additionally, I made a change to when the playground's loadOptions are retrieved from localStorage -- we waited until after mount to retrieve them, when the consent manager ui had already initialized with the base config, so any changes made in the playground's loadOptions editing modal didn't appear. Moving that retrieval into the index before the ui script is initialized seemed to do the trick

Future Improvements:

  • I think we should do away with the (Optional|Required)ConsentManagerConfig type distinction. They would seem to suggest config entries that (do|don't) have default entries, but we seem to set defaults for some required config fields anyway, so - I would suggest grouping everything that either must be defined or has a default into required, then reserve Optional for future values that can be undefined and have no defaults.
  • It's currently possible to overwrite most of our default load options if a customer enters in a custom config object (specifically through editing self.transcend.consentManagerConfig) with undefined keys, either on purpose or by accident. If we scrub out undefined values from that extraConfig object then our defaults could initialize properly (we could also throw a console warning or something if we detect that, if it is in fact a customer error)

@csmccarthy csmccarthy requested a review from a team October 6, 2023 21:53
@height
Copy link

height bot commented Oct 6, 2023

This pull request has been linked to 1 task:

💡Tip: Add "Close T-30079" to the pull request title or description, to a commit message, or in a comment to mark this task as "Pending Deploy" when the pull request is merged.

@vercel
Copy link

vercel bot commented Oct 6, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
consent-manager-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 10, 2023 9:08pm

@csmccarthy
Copy link
Member Author

Just realized this is going to need a version bump for airgap.js-types, still need to figure out how to make a new release. That'll be a Monday thing

@csmccarthy csmccarthy marked this pull request as draft October 6, 2023 21:56
@MadDataScience
Copy link
Contributor

Just realized this is going to need a version bump for airgap.js-types, still need to figure out how to make a new release. That'll be a Monday thing

Once you've bumped the version in transcend-io/airgap.js-types#99 and merged it, bump the version at

"@transcend-io/airgap.js-types": "^10.6.1",
and you should be good to go. (It does take a minute for the new version to become available, so if you're too fast yarn might tell you that version doesn't exist. Just wait until you see 10.6.2 at https://github.com/transcend-io/airgap.js-types/pkgs/npm/airgap.js-types then you should be good.)

Oh, and don't forget to bump the version at

"version": "4.8.2",
too! Then, once this is merged, please bump the version of consent-manager-ui at https://github.com/transcend-io/main/blob/dev/consent-manager/ui/package.json#L29. That will probably mean bumping the version of airgap.js in https://github.com/transcend-io/main/blob/dev/consent-manager/airgap.js/package.json#L5 and adding a corresponding entry to the AIRGAP_VERSION_CHANGELOG at https://github.com/transcend-io/main/blob/dev/frontend-support/cm-types/src/constants.ts#L152

@csmccarthy csmccarthy marked this pull request as ready for review October 10, 2023 20:33
@@ -15,6 +14,7 @@ import { ConsentManagerLanguageKey } from '@transcend-io/internationalization';
import { makeConsentManagerAPI } from '../api';
import { TranscendEventTarget } from '../event-target';
import { useState } from 'preact/hooks';
import { MergedConsentManagerConfig } from 'src/types';
Copy link
Member

Choose a reason for hiding this comment

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

This is importing src @csmccarthy

Copy link
Member

Choose a reason for hiding this comment

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

Should be ./types

Copy link
Member

@eligrey eligrey left a comment

Choose a reason for hiding this comment

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

lgtm!

Copy link
Member

@anotherminh anotherminh left a comment

Choose a reason for hiding this comment

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

@csmccarthy this is excellent!!

For the stuff you mentioned in future improvements, I'd make Height tasks as appropriate under "cm-ui" and "tech-debt" lists.

@csmccarthy csmccarthy merged commit c70a757 into main Oct 12, 2023
9 checks passed
@delete-merged-branch delete-merged-branch bot deleted the csmccarthy/z-index-config branch October 12, 2023 15:45
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.

4 participants