-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add error for showConsentManager
when viewState is TCF_EU
#157
Conversation
This pull request has been linked to 1 task:
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
showConsentManager
when viewState is TCF_EUshowConsentManager
when viewState is TCF_EU
src/api.ts
Outdated
return; | ||
} | ||
logger.warn( | ||
'TCF_EU view state is not valid. Please configure your regime to use this view state.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'TCF_EU view state is not valid. Please configure your regime to use this view state.', | |
'TCF_EU view state is not valid for this user experience. Please configure your Regional Experience to use this view state and try again.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should also only throw this error for TCF_EU explicitly, and if the userpass in any other view state, we should throw a different error & log out the list of valid view states for them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm, if a user uses 'banana' as a view state, that's when we list out the valid view state?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@linh-transcend yea, that's when i think we say "'${input}' is not a valid view state. Valid view states are: ..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/api.ts
Outdated
options?.viewState && | ||
!Object.values(ViewState).includes(options.viewState) | ||
) { | ||
logger.warn( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do error instead of warn?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry i missed that. just updated it to an error. i need to do the same for the warning in the tcf-ui
src/api.ts
Outdated
`${ | ||
options.viewState | ||
} is not a valid view state. Valid view states include ${Object.values( | ||
ViewState, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@linh-transcend actually let's only list the "open" view states and not closed view states like closed/collapsed/hidden
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LanguageOptions doesn't seem right either, hmm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the enum to use: https://github.com/transcend-io/airgap.js-types/blob/main/src/enums/viewState.ts#L64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/settings.ts
Outdated
@@ -63,7 +63,7 @@ const inheritLogLevels = (logLevels: LogLevel[]): LogLevel[] => { | |||
}; | |||
|
|||
const wildcardLogLevels = ['all', '*']; | |||
const logLevelsSetting = (settings.log ?? '').toLowerCase(); | |||
const logLevelsSetting = (settings.log ?? 'warn error').toLowerCase(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm let's not change this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oi i forgot to remove this from testing. thanks for catching!
Related Issues
showConsentManager
isTCF_EU
show and error that tells the user to update regimes to see that view state. When input is not a valid view state, error too.Security Implications
[none]
System Availability
[none]