-
Notifications
You must be signed in to change notification settings - Fork 198
feat(Gong) - allow setting the retention period in GongOptionComponent
#11384
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
Conversation
5a836d7 to
10edcc4
Compare
JulesBelveze
left a comment
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.
LGTM, left a few nits.
Could we add a screenshot? 🙏🏼
| isAdmin: boolean; | ||
| dataSource: DataSourceType; | ||
| }) { | ||
| const configKey = "gongRetentionPeriodDays"; |
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.
nit: Let's extract a global var?
| owner: WorkspaceType; | ||
| readOnly: boolean; | ||
| isAdmin: boolean; | ||
| dataSource: DataSourceType; |
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.
Let's extract everything as an interface ? 🙏🏼
| import { useConnectorConfig } from "@app/lib/swr/connectors"; | ||
|
|
||
| function checkIsPositiveInteger(value: string) { | ||
| return /^[0-9]+$/.test(value); |
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.
Noob question: any reason for a regex over a parseInt + inequality?
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.
not really, we can def do a parseInt + inequality 👍
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.
actually parseInt is less restrictive, keeping the regex
> parseInt("123abc", 10);
123
…nt` (#11384) * add an Input to update the retention period * fix: update imports to use @app/types instead of the deprecated @dust-tt/types * add a global variable for RETENTION_PERIOD_CONFIG_KEY * rename the global variable * add an interface GongOptionComponentProps * replace regex check with parseInt + inequality * rename checkIsPositiveInteger into checkIsNonNegativeInteger since 0 is allowed * Revert "rename checkIsPositiveInteger into checkIsNonNegativeInteger since 0 is allowed" This reverts commit 4d59803. * Revert "replace regex check with parseInt + inequality" This reverts commit 5c79fab. * rename checkIsPositiveInteger into checkIsNonNegativeInteger since 0 is allowed
…nt` (#11384) * add an Input to update the retention period * fix: update imports to use @app/types instead of the deprecated @dust-tt/types * add a global variable for RETENTION_PERIOD_CONFIG_KEY * rename the global variable * add an interface GongOptionComponentProps * replace regex check with parseInt + inequality * rename checkIsPositiveInteger into checkIsNonNegativeInteger since 0 is allowed * Revert "rename checkIsPositiveInteger into checkIsNonNegativeInteger since 0 is allowed" This reverts commit 4d59803. * Revert "replace regex check with parseInt + inequality" This reverts commit 5c79fab. * rename checkIsPositiveInteger into checkIsNonNegativeInteger since 0 is allowed
Description
GongOptionComponentto allow setting the desired retention period (in number of days).setConfigurationKeyto update the retention period (backend already implemented).Tests
Risk
Deploy Plan