-
Notifications
You must be signed in to change notification settings - Fork 103
fix(manager-pci-common): add undefined type to the project on isDisco… #17728
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
base: develop
Are you sure you want to change the base?
Conversation
…veryProject ref: #17727 Signed-off-by: LIDRISSI Hamid <lidrissi.hamid@gmail.com>
@@ -11,7 +11,7 @@ import '../../../translations/discovery-banner'; | |||
|
|||
const DISCOVERY_PROJECT_PLAN_CODE = 'project.discovery'; | |||
|
|||
export const isDiscoveryProject = (project: TProject) => | |||
export const isDiscoveryProject = (project: TProject | undefined) => |
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.
export const isDiscoveryProject = (project: TProject | undefined) => | |
export const isDiscoveryProject = (project?: TProject) => |
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.
Is the same idea no ?
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.
Yes, but the first one is verbose regarding how TS defines optional parameters (https://www.typescriptlang.org/docs/handbook/2/functions.html#optional-parameters)
it's up to you as of course it's non blocking ;)
@@ -11,7 +11,7 @@ import '../../../translations/discovery-banner'; | |||
|
|||
const DISCOVERY_PROJECT_PLAN_CODE = 'project.discovery'; | |||
|
|||
export const isDiscoveryProject = (project: TProject) => | |||
export const isDiscoveryProject = (project: TProject | undefined) => |
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.
For me we should not have an undefined project at this step. You should catch errors at the top app level, and throughout your entire app consider that the project exists.
Because with this implementation we check multiple times in each banner and screen if a project exists.
…veryProject
ref: #17727