-
Notifications
You must be signed in to change notification settings - Fork 32
Add provision to recipe parameters while enrolling applicaiton #1934
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: master
Are you sure you want to change the base?
Add provision to recipe parameters while enrolling applicaiton #1934
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: TimothyAsirJeyasing The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
...omponents/discovered-application-wizard/wizard-steps/configuration-step/recipe-selection.tsx
Outdated
Show resolved
Hide resolved
...omponents/discovered-application-wizard/wizard-steps/configuration-step/recipe-selection.tsx
Outdated
Show resolved
Hide resolved
...omponents/discovered-application-wizard/wizard-steps/configuration-step/recipe-selection.tsx
Outdated
Show resolved
Hide resolved
...omponents/discovered-application-wizard/wizard-steps/configuration-step/recipe-selection.tsx
Outdated
Show resolved
Hide resolved
...omponents/discovered-application-wizard/wizard-steps/configuration-step/recipe-selection.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/discovered-application-wizard/wizard-steps/review-step/review-step.tsx
Outdated
Show resolved
Hide resolved
7de232b
to
ea6b330
Compare
...omponents/discovered-application-wizard/wizard-steps/configuration-step/recipe-selection.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/discovered-application-wizard/wizard-steps/review-step/review-step.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/discovered-application-wizard/wizard-steps/review-step/review-step.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/discovered-application-wizard/wizard-steps/review-step/review-step.tsx
Outdated
Show resolved
Hide resolved
f7f2655
to
149bd07
Compare
@raghavendra-talur, as per this implementation, UI passes one value per key, is that ok, or will it create any problem? |
The params type is It needs to match this. We can ask the users to provide the list in comma separated way and put the values in the []. |
packages/mco/components/discovered-application-wizard/utils/k8s-utils.ts
Outdated
Show resolved
Hide resolved
...mponents/discovered-application-wizard/wizard-steps/configuration-step/recipe-parameters.tsx
Outdated
Show resolved
Hide resolved
...mponents/discovered-application-wizard/wizard-steps/configuration-step/recipe-parameters.tsx
Outdated
Show resolved
Hide resolved
...omponents/discovered-application-wizard/wizard-steps/configuration-step/recipe-selection.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/discovered-application-wizard/wizard-steps/review-step/review-step.tsx
Outdated
Show resolved
Hide resolved
https://issues.redhat.com/browse/DFBUGS-857 Signed-off-by: Timothy Asir Jeyasingh <[email protected]>
149bd07
to
1f1025c
Compare
@TimothyAsirJeyasing: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
export const formatRecipeParametersForDisplay = ( | ||
params: Record<string, string[]> | ||
): string => { | ||
return Object.entries(params || {}) | ||
.map(([key, values]) => `${key}: ${values.join(', ')}`) | ||
.join('; '); | ||
}; |
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 formatRecipeParametersForDisplay = ( | |
params: Record<string, string[]> | |
): string => { | |
return Object.entries(params || {}) | |
.map(([key, values]) => `${key}: ${values.join(', ')}`) | |
.join('; '); | |
}; |
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.
It is for display only, let's keep it inside the review-step.tsx file.
@@ -37,6 +42,9 @@ export const Review: React.FC<ReviewProps> = ({ state }) => { | |||
drPolicy.spec.schedulingInterval === '0m' | |||
? REPLICATION_DISPLAY_TEXT(t).sync | |||
: REPLICATION_DISPLAY_TEXT(t).async; | |||
const displayRecipeParameters = formatRecipeParametersForDisplay( | |||
convertToRecipeParameters(recipeParameters) |
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.
Here,
The parameters are already comma-separated strings,
convertToRecipeParameters is converting the parameter into a list, and formatRecipeParametersForDisplay is again converting it back to comma comma-separated string.
This looks redundant, I think only the whitespace trimming logic has to be common between these two functions.
https://issues.redhat.com/browse/DFBUGS-857