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 edit application functionality from topology #3788
Add edit application functionality from topology #3788
Conversation
frontend/packages/dev-console/src/components/edit-application/edit-application-utils.ts
Outdated
Show resolved
Hide resolved
frontend/packages/dev-console/src/components/edit-application/edit-application-utils.ts
Show resolved
Hide resolved
frontend/packages/dev-console/src/components/edit-application/edit-application-utils.ts
Outdated
Show resolved
Hide resolved
frontend/packages/dev-console/src/components/edit-application/edit-application-utils.ts
Show resolved
Hide resolved
@divyanshiGupta If I create a new source secret from the Edit Application modal then the Source Secret modal opens up but the Edit Application modal closes in the background. P.S.: Not sure if we should be opening one modal over another modal. |
@divyanshiGupta While editing the application if I change the application grouping name by creating a new one:
|
@serenamarie125 @parvathyvr how should we handle this edge case? |
Fixed. |
frontend/packages/dev-console/src/components/edit-application/edit-application-utils.ts
Show resolved
Hide resolved
frontend/packages/dev-console/src/components/edit-application/EditApplicationForm.tsx
Outdated
Show resolved
Hide resolved
frontend/packages/dev-console/src/components/edit-application/EditApplicationForm.tsx
Outdated
Show resolved
Hide resolved
frontend/packages/dev-console/src/components/edit-application/edit-application-utils.ts
Outdated
Show resolved
Hide resolved
/test e2e-gcp-console |
name: namespace, | ||
}, | ||
git: EditApplicationUtils.getGitData(_.get(resources, 'buildConfig.data')), | ||
docker: { |
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.
Any specific reason to not have util to get docker data in edit-application-utils?
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.
So I created utils for the sections that were most complex to populate with data and have a single source of data. Docker section needs only the port information and docker file path and we get that info from two different resources so didnt created a specific util for this.
10, | ||
), | ||
}, | ||
image: { |
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.
Any specific reason to not have util to get image data in edit-application-utils?
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.
Same reason as above.
<form className="modal-content" onSubmit={handleSubmit}> | ||
<ModalTitle>Edit Application</ModalTitle> | ||
<ModalBody> | ||
{!_.isEmpty(values.build.strategy) && <GitSection />} |
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 it better to check for Source strategy here?
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.
We show GitSection
for both strategies Source
and Docker
and hence I am just checking if there is a strategy show GitSection
and if empty do not show it.
couple of points:
|
@serenamarie125 I will be aligning with the final UXD in the deploy image story this sprint since I see that the doc has some unresolved comments and is not closed yet. |
frontend/packages/dev-console/src/components/edit-application/EditApplication.tsx
Outdated
Show resolved
Hide resolved
frontend/packages/dev-console/src/components/edit-application/edit-application-types.ts
Outdated
Show resolved
Hide resolved
frontend/packages/dev-console/src/components/edit-application/edit-application-types.ts
Show resolved
Hide resolved
frontend/packages/dev-console/src/components/edit-application/edit-application-utils.ts
Outdated
Show resolved
Hide resolved
frontend/packages/dev-console/src/components/edit-application/edit-application-utils.ts
Outdated
Show resolved
Hide resolved
frontend/packages/dev-console/src/components/edit-application/edit-application-types.ts
Outdated
Show resolved
Hide resolved
frontend/packages/dev-console/src/components/import/app/AppSection.tsx
Outdated
Show resolved
Hide resolved
That modal in the gif needs to be wider. |
I know but this is the modal we use across console and I didnt wanted to make any css changes since I knew things are going to change and now as we know its no more a modal but a page again. Just wanted to get the first pass done and deal with aligning with UX. Will align with final UXD in deploy image story 🙈 |
Oh we circled back once again to a page? hah. I can't keep up! |
Yes, I was also not aware of that change and then I looked at the doc and I was like where did the modal go. 😪 |
@divyanshiGupta Sometimes the resource object modifies behind the scene and we end up with this error. We have seen this while editing YAML for a resource. For that, there is an option to reload the YAML. Maybe something similar for this as well? cc: @serenamarie125 |
@divyanshiGupta Whenever a label is edited and then saved it triggers a new rollout and also it takes really long to open the modal. |
@sahil143 sure we can look at adding something similar. @serenamarie125 should we add a similar page reload button or there will be a different UX for this case? |
@divyanshiGupta I think this problem will be solved if you use the deployment resources fetched by firehose instead of sending it from the modal. That way it will automatically get updated. I think you are working on the deploy image edit story where you're going to convert this to a full page from modal, for that you'll have to fetch the resource using firehose anyway. |
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.
/approve
/lgtm |
/assign @christianvogt |
/test analyze |
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.
Please see my 👀 flagged comments, there may not be any changes needed but some questions to be answered.
@@ -20,3 +20,17 @@ export const ModifyApplication = (kind, obj): KebabOption => { | |||
}, | |||
}; | |||
}; | |||
|
|||
export const EditApplication = (model, obj): KebabOption => { |
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 EditApplication = (model, obj): KebabOption => { | |
export const EditApplication = (model: K8sKind, obj: K8sResourceKind): KebabOption => { |
I'd appreciate it if you updated the ModifyApplication
option as well. We should strive to type everything.
editAppResource, | ||
) | ||
.then(() => { | ||
actions.setSubmitting(false); |
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.
Disable submitting just before you submit? Any reason why?
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.
If you see the submitting is getting disabled after the promise is resolved, i.e when the form is already submitted.
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.
We discussed, I misread the code. No issue here.
) | ||
.then(() => { | ||
actions.setSubmitting(false); | ||
actions.setStatus({ error: '' }); |
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 error
different from submitError
in the catch block? If so, did we want to clear both?
status, | ||
isSubmitting, | ||
}) => ( | ||
<form className="modal-content" onSubmit={handleSubmit}> |
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.
Hmmm... Would we not want to use import { Form } from '@patternfly/react-core';
? HTML form
s refresh the page on submit (and this needs to be suppressed usually - perhaps Formik handles this for us).
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.
Using Form
from pf as a modal wrapper introduces css issues and that is why form
is being used here and at other places also where modal is being rendered. Anyways according to new UX we need to show a page and not a modal and I am aligning with new UX in my current story so form
will be replaced by Form
.
@@ -12,7 +15,7 @@ const ResourceLimitSection: React.FC = () => { | |||
label="Request" | |||
unitName="limits.cpu.requestUnit" | |||
unitOptions={CPUUnits} | |||
defaultUnitSize="m" | |||
defaultUnitSize={`${cpuLimits.value.requestUnit}`} |
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.
Oh boy this makes me uncomfortable. default
based props are not supposed to change. I followed it down into the underlying component and it feels wrong there too... so I am unsure what to do here. I don't think this change is needed for it to work but I haven't fully tested.
@divyanshiGupta if this change was to fix the storing of the correct information then please keep it. If it is not a needed change, I think we shouldn't do it... but overall I don't think it's super important one way or another. It just feels wrong using a default
prop as the live update 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.
I made this change to show the unit size that was selected when the application was created as the default. I can create a separate prop in limits section for the default value which will be only initialized once and will not update with selecting another unit from the dropdown.
@@ -153,15 +156,18 @@ export const createBuildConfig = ( | |||
}; | |||
|
|||
const buildConfig = { |
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.
Suggestion (for future changes):
_.merge({}, (originalBuildConfig || {}), newData)
@@ -124,6 +125,7 @@ export interface DockerData { | |||
} | |||
|
|||
export interface RouteData { | |||
show?: boolean; |
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.
Isn't this always there? Or does RouteData
get used by an interface that doesn't have this functionality yet?
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.
So we need to show the create route option only when the route was not created when the application was created. If a route already exists we need not show the create route option. Now according to new UX we need to disable the option and not hide it. Aligning with new UX in my current story.
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.
/approve
/assign @christianvogt
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
/approve
Christian will have to give the actual approval. But for all intensive purposes (until the e2e tests are fixed) this is reviewed.
/hold |
/kind feature |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andrewballantyne, christianvogt, divyanshiGupta, rohitkrai03 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold cancel |
/retest Please review the full test history for this PR and help us cut down flakes. |
3 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
Jira stories: https://jira.coreos.com/browse/ODC-2346, https://jira.coreos.com/browse/ODC-2349
In this PR I have added the edit application scenario for the applications created using import from git/dockerfile/catalog flow. Knative service editing scenarios are also handled.
ToDo -
Note : I will be doing the following things in remaining story(from: deployImage) of edit-application epic in the next sprint: