-
Notifications
You must be signed in to change notification settings - Fork 36
feat(feedback): add feedback modal #698
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: main
Are you sure you want to change the base?
Changes from all commits
d79232f
2c810ee
316898d
e491cdb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Primary color for konflux is of orange shade. This red color in svg might conflict with the overall theme of konflux |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| .feedback-modal { | ||
| border-radius: 5px; | ||
| & > .pf-v5-c-modal-box__body { | ||
| padding: 0; | ||
| margin: 0; | ||
| } | ||
| &__feedback-flex { | ||
| margin-right: 0px !important; | ||
| } | ||
| &__feedback-description { | ||
| margin-inline-end: 0 !important; | ||
| } | ||
| &__image-flex { | ||
| background-color: var(--pf-v5-global--BackgroundColor--200); | ||
| } | ||
| &__feedback-image { | ||
| width: 100%; | ||
| height: 100%; | ||
| } | ||
| &__panel-content { | ||
| padding: var(--pf-v5-global--spacer--xl); | ||
| gap: var(--pf-v5-global--spacer--md); | ||
| height: 100%; | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: flex-start; | ||
| } | ||
| &__panel-footer { | ||
| display: flex; | ||
| align-self: stretch; | ||
| flex-wrap: wrap; | ||
| padding: 0 0 var(--pf-v5-global--spacer--sm) 0 !important; | ||
| margin-top: auto; | ||
| box-shadow: none !important; | ||
| column-gap: var(--pf-v5-global--spacer--xl); | ||
| } | ||
| &__panel-header { | ||
| padding: 0 37px var(--pf-v5-global--spacer--sm) 0 !important; | ||
| } | ||
| &__content-main { | ||
| max-height: 450px !important; | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-self: stretch; | ||
| } | ||
| &__cards-list { | ||
| gap: var(--pf-v5-global--spacer--md); | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: flex-start; | ||
| padding: inherit !important; | ||
| } | ||
| &__section-card { | ||
| background-color: var(--pf-v5-global--BackgroundColor--200); | ||
| border-radius: 5px; | ||
| width: 100%; | ||
| &:hover { | ||
| cursor: pointer; | ||
| border: 1px solid var(--pf-v5-global--link--Color--light); | ||
| } | ||
| } | ||
|
|
||
| &__input-field { | ||
| padding-top: var(--pf-v5-global--spacer--md); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,179 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import * as React from 'react'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ModalVariant, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Flex, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FlexItem, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Bullseye, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Spinner, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Button, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ButtonType, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Panel, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PanelFooter, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } from '@patternfly/react-core'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { ErrorBoundary } from '@sentry/react'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { Formik, Form } from 'formik'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { isEmpty } from 'lodash-es'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { ComponentProps, createModalLauncher } from '~/components/modal/createModalLauncher'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { useKonfluxPublicInfo } from '~/hooks/useKonfluxPublicInfo'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import RHsupportLight from '../../assets/rh_feedback.svg'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import BeginningSection from './components/BeginningSection'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { FeedbackSections } from './consts'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { BugInfo, FeatureInfo, getBugURL, getFeatureURL } from './feedback-utils'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| BugSectionValidationSchema, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FeatureSectionValidationSchema, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FeedbackSectionValidationSchema, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } from './FeedbackValidationSchemas'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const BugRFESection = React.lazy(() => import('./components/BugRFESection')); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const FeedbackSection = React.lazy(() => import('./components/FeedbackSection')); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import './FeedbackModal.scss'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export type FeedbackFormValues = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bug?: BugInfo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| feature?: FeatureInfo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| feedback?: { description: string; scale: number }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const FeedbackModal: React.FC<React.PropsWithChildren<ComponentProps>> = ({ onClose }) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const [currentSection, setCurrentSection] = React.useState<FeedbackSections>( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FeedbackSections.BeginningSection, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const [konfluxInfo] = useKonfluxPublicInfo(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+39
to
+44
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Search for feedback-related flags in flags.ts
rg -n 'feedback' --type=ts -i src/feature-flags/flags.tsRepository: konflux-ci/konflux-ui Length of output: 47 🏁 Script executed: #!/bin/bash
# Check the current content of flags.ts to see defined flags
head -100 src/feature-flags/flags.tsRepository: konflux-ci/konflux-ui Length of output: 3114 🏁 Script executed: #!/bin/bash
# Search for IfFeature or useIsOnFeatureFlag usage in FeedbackModal.tsx
rg -n 'IfFeature|useIsOnFeatureFlag' src/components/FeedbackSection/FeedbackModal.tsxRepository: konflux-ci/konflux-ui Length of output: 47 🏁 Script executed: #!/bin/bash
# Check HelpDropdown.tsx for FeedbackModal usage and any feature flag wrapping
rg -n 'FeedbackModal|Feedback' src/components/HelpDropdown/ -A 3Repository: konflux-ci/konflux-ui Length of output: 133 🏁 Script executed: #!/bin/bash
# Get the full FeedbackModal.tsx file to check for flag implementation
wc -l src/components/FeedbackSection/FeedbackModal.tsxRepository: konflux-ci/konflux-ui Length of output: 117 🏁 Script executed: #!/bin/bash
# Get full flags.ts to see all defined flags
cat src/feature-flags/flags.ts | tail -50Repository: konflux-ci/konflux-ui Length of output: 1625 🏁 Script executed: #!/bin/bash
# Read the FeedbackModal.tsx file to understand its content
cat -n src/components/FeedbackSection/FeedbackModal.tsxRepository: konflux-ci/konflux-ui Length of output: 8283 🏁 Script executed: #!/bin/bash
# Search for where FeedbackModal is imported or used
rg -n 'FeedbackModal' --type=tsx --type=tsRepository: konflux-ci/konflux-ui Length of output: 92 🏁 Script executed: #!/bin/bash
# Search for FeedbackModal imports and usage
rg -n 'FeedbackModal' --type=tsRepository: konflux-ci/konflux-ui Length of output: 808 🏁 Script executed: #!/bin/bash
# Also search in tsx files using different approach
fd -e tsx -e ts -x rg -l 'FeedbackModal' {}Repository: konflux-ci/konflux-ui Length of output: 212 🏁 Script executed: #!/bin/bash
# Search for where createFeedbackModal is used
rg -n 'createFeedbackModal'Repository: konflux-ci/konflux-ui Length of output: 383 🏁 Script executed: #!/bin/bash
# Check HelpDropdown.tsx to see the full context
cat -n src/components/Header/HelpDropdown.tsxRepository: konflux-ci/konflux-ui Length of output: 3068 Wrap the FeedbackModal feature and its trigger behind a feature flag. Per project conventions, new features must be gated using the 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const handleSubmit = (values: { bug?: BugInfo; feature?: FeatureInfo }) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (currentSection === FeedbackSections.BugSection) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const { bug } = values; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const url = getBugURL(bug, konfluxInfo); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| window.open(url, '_blank'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| onClose(null, { submitClicked: true }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (currentSection === FeedbackSections.FeatureSection) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const { feature } = values; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const url = getFeatureURL(feature); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| window.open(url, '_blank'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| onClose(null, { submitClicked: true }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (currentSection === FeedbackSections.FeedbackSection) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Add Sentry/Segment connection here | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| onClose(null, { submitClicked: true }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+46
to
+63
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Proposed defensive check const handleSubmit = (values: { bug?: BugInfo; feature?: FeatureInfo }) => {
if (currentSection === FeedbackSections.BugSection) {
const { bug } = values;
+ if (!bug) return;
const url = getBugURL(bug, konfluxInfo);
window.open(url, '_blank');
onClose(null, { submitClicked: true });
}
if (currentSection === FeedbackSections.FeatureSection) {
const { feature } = values;
+ if (!feature) return;
const url = getFeatureURL(feature);📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Formik | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I dont think you need formik for such simple forms. You can just use HTML forms here without formik |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| initialValues={ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| currentSection === FeedbackSections.BugSection | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ? { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bug: { title: '', description: '', getAdditionalInfo: false }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| : currentSection === FeedbackSections.FeatureSection | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ? { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| feature: { title: '', description: '' }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| : { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| feedback: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description: '', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| scale: 5, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| onSubmit={handleSubmit} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| validationSchema={ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| currentSection === FeedbackSections.BugSection | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ? BugSectionValidationSchema | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| : currentSection === FeedbackSections.FeatureSection | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ? FeatureSectionValidationSchema | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| : FeedbackSectionValidationSchema | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+67
to
+92
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: Formik won't reinitialize when switching sections.
Fix: Either add Recommended fix — add key to force remount <Formik
+ key={currentSection}
initialValues={
currentSection === FeedbackSections.BugSection📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {({ isSubmitting, errors, touched }) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Form> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Flex | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| className="feedback-modal__feedback-flex" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| direction={{ default: 'row' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| alignItems={{ default: 'alignItemsStretch' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <FlexItem | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| className="feedback-modal__feedback-description" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| flex={{ default: 'flex_2' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Panel isScrollable className="feedback-modal__panel-content"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <ErrorBoundary> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <React.Suspense | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fallback={ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Bullseye> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Spinner size="xl" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </Bullseye> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {currentSection === FeedbackSections.BeginningSection && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <BeginningSection setCurrentSection={setCurrentSection} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {currentSection === FeedbackSections.FeedbackSection && <FeedbackSection />} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {currentSection === FeedbackSections.BugSection && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <BugRFESection currentSection={FeedbackSections.BugSection} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {currentSection === FeedbackSections.FeatureSection && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <BugRFESection currentSection={FeedbackSections.FeatureSection} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </React.Suspense> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </ErrorBoundary> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <PanelFooter className="feedback-modal__panel-footer"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {(currentSection === FeedbackSections.BugSection || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| currentSection === FeedbackSections.FeatureSection) && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Button | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| variant="primary" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type={ButtonType.submit} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isDisabled={isEmpty(touched) || !isEmpty(errors) || isSubmitting} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Preview on Github | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </Button> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {currentSection === FeedbackSections.FeedbackSection && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Button | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| variant="primary" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type={ButtonType.submit} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isDisabled={isEmpty(touched) || !isEmpty(errors) || isSubmitting} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Submit feedback | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </Button> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {currentSection !== FeedbackSections.BeginningSection && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Button | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| variant="secondary" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| onClick={() => setCurrentSection(FeedbackSections.BeginningSection)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Back | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </Button> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Button variant="link" onClick={() => onClose(null, { submitClicked: false })}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Cancel | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </Button> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+130
to
+157
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These buttons should be part of their own forms |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </PanelFooter> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </Panel> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </FlexItem> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <FlexItem className="feedback-modal__image-flex" flex={{ default: 'flex_1' }}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <RHsupportLight className="feedback-modal__feedback-image" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </FlexItem> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </Flex> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </Form> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </Formik> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export const createFeedbackModal = createModalLauncher(FeedbackModal, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'data-test': 'feedback-modal', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| variant: ModalVariant.large, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| className: 'feedback-modal', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export default FeedbackModal; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,31 @@ | ||||||||||||||||||||||||||||||||||||||||
| import * as yup from 'yup'; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| export const BugSectionValidationSchema = yup.object({ | ||||||||||||||||||||||||||||||||||||||||
| bug: yup.object({ | ||||||||||||||||||||||||||||||||||||||||
| title: yup.string().required('Required').max(400, 'Should be less than 400 characters.'), | ||||||||||||||||||||||||||||||||||||||||
| description: yup | ||||||||||||||||||||||||||||||||||||||||
| .string() | ||||||||||||||||||||||||||||||||||||||||
| .required('Required') | ||||||||||||||||||||||||||||||||||||||||
| .max(2000, 'Should be less than 2000 characters.'), | ||||||||||||||||||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| export const FeatureSectionValidationSchema = yup.object({ | ||||||||||||||||||||||||||||||||||||||||
| feature: yup.object({ | ||||||||||||||||||||||||||||||||||||||||
| title: yup.string().required('Required').max(400, 'Should be less than 400 characters.'), | ||||||||||||||||||||||||||||||||||||||||
| description: yup | ||||||||||||||||||||||||||||||||||||||||
| .string() | ||||||||||||||||||||||||||||||||||||||||
| .required('Required') | ||||||||||||||||||||||||||||||||||||||||
| .max(2000, 'Should be less than 2000 characters.'), | ||||||||||||||||||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| export const FeedbackSectionValidationSchema = yup.object({ | ||||||||||||||||||||||||||||||||||||||||
| feedback: yup.object({ | ||||||||||||||||||||||||||||||||||||||||
| scale: yup.number().required('Required'), | ||||||||||||||||||||||||||||||||||||||||
| description: yup | ||||||||||||||||||||||||||||||||||||||||
| .string() | ||||||||||||||||||||||||||||||||||||||||
| .required('Required') | ||||||||||||||||||||||||||||||||||||||||
| .max(2000, 'Should be less than 2000 characters.'), | ||||||||||||||||||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+23
to
+31
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing email validation in The Proposed addition export const FeedbackSectionValidationSchema = yup.object({
feedback: yup.object({
scale: yup.number().required('Required'),
description: yup
.string()
.required('Required')
.max(2000, 'Should be less than 2000 characters.'),
+ email: yup.string().email('Must be a valid email address'),
}),
});📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { render } from '@testing-library/react'; | ||
| import BeginningSection from '../components/BeginningSection'; | ||
|
|
||
| const setCurrentSectionMock = jest.fn(); | ||
|
|
||
| describe('BeginningSection', () => { | ||
| it('should initialize with BeginingSection', () => { | ||
| const screen = render(<BeginningSection setCurrentSection={setCurrentSectionMock} />); | ||
| screen.getByText('Share feedback'); | ||
| screen.getByText('Report a bug'); | ||
| screen.getByText('Request a new feature'); | ||
| }); | ||
| }); |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,25 @@ | ||||||||||||||
| import BugRFESection from '../components/BugRFESection'; | ||||||||||||||
| import { FeedbackSections } from '../consts'; | ||||||||||||||
| import { formikRenderer } from '~/unit-test-utils'; | ||||||||||||||
|
Comment on lines
+1
to
+3
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix import order per ESLint rule. The Proposed fix-import BugRFESection from '../components/BugRFESection';
-import { FeedbackSections } from '../consts';
-import { formikRenderer } from '~/unit-test-utils';
+import { formikRenderer } from '~/unit-test-utils';
+import BugRFESection from '../components/BugRFESection';
+import { FeedbackSections } from '../consts';📝 Committable suggestion
Suggested change
🧰 Tools🪛 ESLint[error] 3-3: (import/order) 🤖 Prompt for AI Agents |
||||||||||||||
|
|
||||||||||||||
| describe('BugRFESection', () => { | ||||||||||||||
| it('should show BugForm when current Section is BugSection', () => { | ||||||||||||||
| const screen = formikRenderer(<BugRFESection currentSection={FeedbackSections.BugSection} />); | ||||||||||||||
| screen.getByText('Report a bug'); | ||||||||||||||
| screen.getByText( | ||||||||||||||
| 'Describe the bug you encountered. For urgent issues, use #konflux-user-forum instead', | ||||||||||||||
| ); | ||||||||||||||
| screen.getByText('Title'); | ||||||||||||||
| screen.getByText('Please provide detailed description of the bug'); | ||||||||||||||
| }); | ||||||||||||||
|
|
||||||||||||||
| it('should show RFEForm when current Section is FeatureSection', () => { | ||||||||||||||
| const screen = formikRenderer( | ||||||||||||||
| <BugRFESection currentSection={FeedbackSections.FeatureSection} />, | ||||||||||||||
| ); | ||||||||||||||
| screen.getByText('Request a new feature'); | ||||||||||||||
| screen.getByText(/Please provide detailed description of the feature/); | ||||||||||||||
| screen.getByText('Title'); | ||||||||||||||
| screen.getByText(/Please provide detailed description of the bug/); | ||||||||||||||
| }); | ||||||||||||||
|
Comment on lines
+16
to
+24
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# First, find and display the BugRFESection component
fd 'BugRFESection.tsx' --exclude '__tests__' -x cat {}Repository: konflux-ci/konflux-ui Length of output: 2882 🏁 Script executed: #!/bin/bash
# Also examine the full test file to understand the context
fd 'BugRFESection.spec.tsx' -x wc -l {} && fd 'BugRFESection.spec.tsx' -x cat {}Repository: konflux-ci/konflux-ui Length of output: 1191 Remove the incorrect assertion on line 23. The test asserts 🤖 Prompt for AI Agents |
||||||||||||||
| }); | ||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,19 @@ | ||||||||||||||||||||||
| import { render } from '@testing-library/react'; | ||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Locate and examine FeedbackModal component
fd 'FeedbackModal\.tsx' --exclude '__tests__' --type fRepository: konflux-ci/konflux-ui Length of output: 113 🏁 Script executed: #!/bin/bash
# Check the test file content
cat -n src/components/FeedbackSection/__tests__/FeedbackModal.spec.tsxRepository: konflux-ci/konflux-ui Length of output: 871 🏁 Script executed: #!/bin/bash
# Examine FeedbackModal component content
cat -n src/components/FeedbackSection/FeedbackModal.tsxRepository: konflux-ci/konflux-ui Length of output: 8315 🏁 Script executed: #!/bin/bash
# Check what rendering utilities exist in unit-test-utils
fd 'rendering-utils\|test.*utils' --type f | grep -E 'unit-test-utils|test-utils'Repository: konflux-ci/konflux-ui Length of output: 47 🏁 Script executed: #!/bin/bash
# Look for formikRenderer usage in existing tests
rg 'formikRenderer|renderWithQueryClientAndRouter|renderWithQueryClient' --type tsx --type ts -A 2Repository: konflux-ci/konflux-ui Length of output: 92 🏁 Script executed: #!/bin/bash
# Find unit-test-utils directory and rendering utilities
find . -path '*unit-test-utils*' -name '*.ts' -o -path '*unit-test-utils*' -name '*.tsx' | head -20Repository: konflux-ci/konflux-ui Length of output: 749 🏁 Script executed: #!/bin/bash
# Search for formikRenderer and other rendering utilities
rg 'formikRenderer|renderWithQueryClientAndRouter|renderWithQueryClient' -l --max-count 20Repository: konflux-ci/konflux-ui Length of output: 6617 🏁 Script executed: #!/bin/bash
# Examine the rendering-utils.tsx file
cat -n src/unit-test-utils/rendering-utils.tsxRepository: konflux-ci/konflux-ui Length of output: 3271 🏁 Script executed: #!/bin/bash
# Check other FeedbackSection test files to see rendering patterns
find src/components/FeedbackSection -name '*.spec.tsx' -o -name '*.spec.ts'Repository: konflux-ci/konflux-ui Length of output: 259 🏁 Script executed: #!/bin/bash
# Look at BeginningSection to see if it needs React Query or Router
cat -n src/components/FeedbackSection/components/BeginningSection.tsxRepository: konflux-ci/konflux-ui Length of output: 3516 🏁 Script executed: #!/bin/bash
# Check what rendering utility is used in other FeedbackSection tests
head -20 src/components/FeedbackSection/__tests__/BeginningSection.spec.tsxRepository: konflux-ci/konflux-ui Length of output: 537 🏁 Script executed: #!/bin/bash
# Check BugRFESection test
head -30 src/components/FeedbackSection/__tests__/BugRFESection.spec.tsxRepository: konflux-ci/konflux-ui Length of output: 1122 Use FeedbackModal wraps its content in a import { formikRenderer } from '~/unit-test-utils';
it('should initialize with BeginingSection Cards', () => {
const screen = formikRenderer(<FeedbackModal />);
// ... rest of test
});🤖 Prompt for AI Agents |
||||||||||||||||||||||
| import FeedbackModal from '../FeedbackModal'; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| jest.mock('~/hooks/useKonfluxPublicInfo', () => ({ | ||||||||||||||||||||||
| useKonfluxPublicInfo: jest.fn(() => [{ visibility: 'private' }]), | ||||||||||||||||||||||
| })); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| describe('FeedbackModal', () => { | ||||||||||||||||||||||
| it('should initialize with BeginingSection Cards', () => { | ||||||||||||||||||||||
| const screen = render(<FeedbackModal />); | ||||||||||||||||||||||
| screen.getByText('Share feedback'); | ||||||||||||||||||||||
| screen.getByText('Report a bug'); | ||||||||||||||||||||||
| screen.getByText('Request a new feature'); | ||||||||||||||||||||||
|
Comment on lines
+9
to
+13
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo in test name and inconsistent assertion style.
Proposed fix- it('should initialize with BeginingSection Cards', () => {
- const screen = render(<FeedbackModal />);
- screen.getByText('Share feedback');
- screen.getByText('Report a bug');
- screen.getByText('Request a new feature');
+ it('should initialize with BeginningSection Cards', () => {
+ const { getByText } = render(<FeedbackModal />);
+ expect(getByText('Share feedback')).toBeInTheDocument();
+ expect(getByText('Report a bug')).toBeInTheDocument();
+ expect(getByText('Request a new feature')).toBeInTheDocument();📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||
| }); | ||||||||||||||||||||||
| it('should have a Cancel button', () => { | ||||||||||||||||||||||
| const screen = render(<FeedbackModal />); | ||||||||||||||||||||||
| expect(screen.getByRole('button', { name: /Cancel/i })).toBeInTheDocument(); | ||||||||||||||||||||||
| }); | ||||||||||||||||||||||
| }); | ||||||||||||||||||||||
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.
This svg doesn't looks right for dark theme. Collaborate with ux to improve the svg. You can also refer to the patternfly feedback form svg for light and dark theme