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
Bug 1826646: shows alert in eventsources form if knative service is not present in namespace #5144
Bug 1826646: shows alert in eventsources form if knative service is not present in namespace #5144
Conversation
@invincibleJai: This pull request references Bugzilla bug 1826646, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
In response to this:
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/test-infra repository. |
@serenamarie125 PTAL , needed your review /kind bug |
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
verifed changes locally
/lgtm cancel |
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.
@invincibleJai spacing between heading the alert doesn't seem right.
UX design
Please confirm with UX.
1f9b242
to
6effaf2
Compare
@sahil143 updated , PTAL |
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.
Thanks for making these changes & collaborating on the design approach @invincibleJai ! Approved by UX
{...props} | ||
namespace={namespace} | ||
projects={projects} | ||
showSinkAlert={service?.loaded && !service?.data?.length} |
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.
@invincibleJai Why not render the alert here in this component only? The alert doesn't seem to be related to the form in any way.
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.
Done
{showSinkAlert && ( | ||
<Alert variant="default" title="Event Source can not be created" isInline> | ||
An event source must sink to Knative Service, but no Knative Service exist in this project | ||
</Alert> | ||
)} |
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.
Move to separate component and have it do it's own fetching of the knative service to show the alert.
Right now this change is spread across 3 different components when it should be isolated to a single component.
Also try to use the firehose hook.
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.
Have fixed it and refactored code Projects are also fetched with useK8sWatchResource
6effaf2
to
b86bb9d
Compare
b86bb9d
to
701e923
Compare
@invincibleJai: This pull request references Bugzilla bug 1826646, which is valid. 3 validation(s) were run on this bug
In response to this:
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/test-infra repository. |
frontend/packages/knative-plugin/src/components/add/ShowResourceAlert.tsx
Outdated
Show resolved
Hide resolved
f5708d7
to
a52717d
Compare
|
||
type EventSourcePageProps = RouteComponentProps<{ ns?: string }>; | ||
|
||
const EventSourcePage: React.FC<EventSourcePageProps> = ({ match, location }) => { | ||
const namespace = match.params.ns; | ||
const searchParams = new URLSearchParams(location.search); | ||
const resources = [{ kind: ProjectModel.kind, prop: ProjectModel.id, isList: true }]; | ||
const knServiceResource = { ...knativeServingResourcesServices(namespace)[0], limit: 1 }; |
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 you should still move this into NoKnativeServiceAlert
and pass the namespace as a prop.
There's no need for the parent to have to deal with passing along a firehose query because then there's no constrain on the resource or limit.
If you just pass the namespace, internal to NoKnativeServiceAlert
it knows exactly what to look for.
a52717d
to
81a3c4f
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: christianvogt, invincibleJai, serenamarie125 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 |
@invincibleJai: All pull requests linked via external trackers have merged: openshift/console#5144. Bugzilla bug 1826646 has been moved to the MODIFIED state. In response to this:
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/test-infra repository. |
Fixes:
https://issues.redhat.com/browse/ODC-3439
Analysis / Root cause:
In Console EventSources form supports only sink to knative Service and in case of no associated service for that form will be never get enabled and user has not much information apart from form field
Solution Description:
Adds an Alert in EventSources form which would be shown if there are no knative service in that namespace
Gif/Image:
Tests:
Browser conformance: