-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
55 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 12 additions & 8 deletions
20
packages/consent/consent-tools-integration-tests/src/page-objects/consent-tools-vanilla.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
import { BasePage } from './base-page' | ||
|
||
export class ConsentToolsVanilla extends BasePage { | ||
constructor({ optIn }: { optIn: boolean }) { | ||
super( | ||
optIn | ||
? 'consent-tools-vanilla.html' | ||
: 'consent-tools-vanilla-opt-out.html' | ||
) | ||
} | ||
|
||
clickGiveConsent() { | ||
return $('#give-consent').click() | ||
} | ||
clickDenyConsent() { | ||
return $('#deny-consent').click() | ||
} | ||
} | ||
|
||
export class ConsentToolsVanillaOptOut extends ConsentToolsVanilla { | ||
constructor() { | ||
super('consent-tools-vanilla-opt-out.html') | ||
} | ||
} | ||
|
||
export class ConsentToolsVanillaOptIn extends ConsentToolsVanilla { | ||
constructor() { | ||
super('consent-tools-vanilla.html') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 8 additions & 4 deletions
12
packages/consent/consent-wrapper-onetrust/src/domain/consent-model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
import { ConsentModel } from '@segment/analytics-consent-tools' | ||
import { OtConsentModel } from '../lib/onetrust-api' | ||
|
||
export const isOptInConsentModel = (model: OtConsentModel): boolean => { | ||
/** | ||
* We don't support all consent models, so we need to coerce them to the ones we do support. | ||
*/ | ||
export const coerceConsentModel = (model: OtConsentModel): ConsentModel => { | ||
switch (model) { | ||
case OtConsentModel.optIn: | ||
case OtConsentModel.implicit: | ||
return true | ||
return 'opt-in' | ||
case OtConsentModel.optOut: | ||
case OtConsentModel.custom: | ||
case OtConsentModel.notice: | ||
return false | ||
return 'opt-out' | ||
default: | ||
return false | ||
return 'opt-out' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters