Grouping for Product - Group create/edit front end#886
Draft
stanislavsemeniuk wants to merge 5 commits intoguacsec:mainfrom
Draft
Grouping for Product - Group create/edit front end#886stanislavsemeniuk wants to merge 5 commits intoguacsec:mainfrom
stanislavsemeniuk wants to merge 5 commits intoguacsec:mainfrom
Conversation
…age, separated Add Labels form as a separate reusable component, renamed component filename
Contributor
Reviewer's GuideImplements a reusable SBOM group create/edit modal and a generic label-adding hook-form component, wires the modal into the SBOM toolbar with a new "Create Group" action, and extends the hook-form group controller to accept extra react-hook-form Controller props. Sequence diagram for SBOM group modal open and form submissionsequenceDiagram
actor User
participant SbomToolbar
participant SBOMGroupFormModal
participant ReactHookForm
participant HookFormPFAddLabels
User->>SbomToolbar: click Create Group button
SbomToolbar->>SbomToolbar: setCreateGroupOpened(true)
SbomToolbar->>SBOMGroupFormModal: render isOpen=true onClose onSubmit
SBOMGroupFormModal->>ReactHookForm: useForm(defaultValues, initialValues)
ReactHookForm-->>SBOMGroupFormModal: control handleSubmit formState
SBOMGroupFormModal->>HookFormPFAddLabels: render with control name labels restrictedLabels
HookFormPFAddLabels->>HookFormPFAddLabels: manage newLabel labelError state
User->>HookFormPFAddLabels: type label and press Enter
HookFormPFAddLabels->>HookFormPFAddLabels: validate not empty/restricted/duplicate
HookFormPFAddLabels->>ReactHookForm: onChange(updatedLabels)
User->>SBOMGroupFormModal: click Create button (submit)
SBOMGroupFormModal->>ReactHookForm: handleSubmit(onSubmitHandler)
ReactHookForm->>ReactHookForm: validate fields using controllerProps rules
ReactHookForm-->>SBOMGroupFormModal: values
SBOMGroupFormModal->>SbomToolbar: onSubmit(values)
SbomToolbar->>SbomToolbar: console.log(values) (current draft behavior)
Class diagram for SBOM group modal and hook-form label componentclassDiagram
class SbomToolbar {
+showFilters boolean
+showBulkSelector boolean
+showActions boolean
+SbomToolbar(props)
-createGroupOpened boolean
-closeCreateGroup()
}
class SBOMGroupFormModal {
+isOpen boolean
+onClose()
+onSubmit(values)
+initialValues SBOMGroupFormValues
+type string
+SBOMGroupFormModal(props)
-isAdvancedExpanded boolean
-onSubmitHandler(values)
}
class SBOMGroupFormValues {
+name string
+parentGroup string
+isProduct string
+description string
+labels string[]
}
class HookFormPFGroupController {
+control Control
+controllerProps ControllerProps
+label ReactNode
+labelIcon ReactElement
+name Path
+fieldId string
+isRequired boolean
+renderInput(renderProps)
}
class HookFormPFAddLabels {
+inputPlaceholder string
+inputAriaLabel string
+restrictedLabels string[]
+HookFormPFAddLabels(props)
-newLabel string
-labelError string
}
class HookFormPFTextInput {
+control Control
+controllerProps ControllerProps
+name Path
+label ReactNode
+fieldId string
+isRequired boolean
+placeholder string
}
class HookFormPFSelect {
+control Control
+name Path
+label ReactNode
+fieldId string
+placeholder string
}
class HookFormPFTextArea {
+control Control
+name Path
+label ReactNode
+fieldId string
+resizeOrientation string
+placeholder string
}
SbomToolbar --> SBOMGroupFormModal : renders
SBOMGroupFormModal ..> HookFormPFTextInput : uses
SBOMGroupFormModal ..> HookFormPFSelect : uses
SBOMGroupFormModal ..> HookFormPFGroupController : uses
SBOMGroupFormModal ..> HookFormPFTextArea : uses
SBOMGroupFormModal ..> HookFormPFAddLabels : uses
HookFormPFAddLabels ..> HookFormPFGroupController : wraps
HookFormPFGroupController <.. HookFormPFTextInput : base props
HookFormPFGroupController <.. HookFormPFSelect : base props
HookFormPFGroupController <.. HookFormPFTextArea : base props
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #886 +/- ##
==========================================
- Coverage 63.29% 62.12% -1.17%
==========================================
Files 184 190 +6
Lines 3264 3356 +92
Branches 742 764 +22
==========================================
+ Hits 2066 2085 +19
- Misses 910 980 +70
- Partials 288 291 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pr is trying to resolve this issue:
https://issues.redhat.com/browse/TC-3447
Implemented SBOMGroupFormModal component that can be used as a form for creating and editing sbom group. Used react hook form and patternfly input components. Also implemented reusable component for adding labels that can be used inside hook form - HookFormPFAddLabels.
Pr is only in draft stage because as far as i know we don't have api endpoint yet (could be wrong)
Summary by Sourcery
Add a modal-driven form for creating and editing SBOM groups and wire it into the SBOM list toolbar.
New Features: