Wizard: Remove redundant code, fix addItem
Removed redundant code and updated `addItem` to check for duplicate arguments in both required and non-required list.
This commit is contained in:
parent
1b21852518
commit
6a29f7f344
2 changed files with 8 additions and 12 deletions
|
|
@ -35,17 +35,13 @@ const KernelArguments = () => {
|
|||
oscapProfileInfo?.kernel?.append?.split(' ').includes(arg)
|
||||
);
|
||||
|
||||
const notRequiredByOpenSCAP = kernelAppend.filter(
|
||||
(arg) => !oscapProfileInfo?.kernel?.append?.split(' ').includes(arg)
|
||||
);
|
||||
|
||||
return (
|
||||
<FormGroup isRequired={false} label="Append">
|
||||
<ChippingInput
|
||||
ariaLabel="Add kernel argument"
|
||||
placeholder="Add kernel argument"
|
||||
validator={isKernelArgumentValid}
|
||||
list={notRequiredByOpenSCAP}
|
||||
list={kernelAppend.filter((arg) => !requiredByOpenSCAP.includes(arg))}
|
||||
requiredList={requiredByOpenSCAP}
|
||||
item="Kernel argument"
|
||||
addAction={addKernelArg}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue