src: Run lint autofix
This commit is contained in:
parent
4c098db796
commit
e9025e460c
35 changed files with 177 additions and 176 deletions
|
|
@ -155,9 +155,8 @@ export const ImportBlueprintModal: React.FunctionComponent<
|
|||
blueprintFromFile.content_sources &&
|
||||
blueprintFromFile.content_sources.length > 0
|
||||
) {
|
||||
const imported = await handleRepositoryImport(
|
||||
blueprintFromFile
|
||||
);
|
||||
const imported =
|
||||
await handleRepositoryImport(blueprintFromFile);
|
||||
customRepos = imported ?? [];
|
||||
}
|
||||
|
||||
|
|
@ -308,10 +307,10 @@ export const ImportBlueprintModal: React.FunctionComponent<
|
|||
{isRejected
|
||||
? 'Must be a valid Blueprint JSON/TOML file no larger than 512 KB'
|
||||
: isInvalidFormat
|
||||
? 'Not compatible with the blueprints format.'
|
||||
: isOnPrem
|
||||
? 'Importing on-premises blueprints is currently in beta. Results may vary.'
|
||||
: 'Upload your blueprint file. Supported formats: JSON, TOML.'}
|
||||
? 'Not compatible with the blueprints format.'
|
||||
: isOnPrem
|
||||
? 'Importing on-premises blueprints is currently in beta. Results may vary.'
|
||||
: 'Upload your blueprint file. Supported formats: JSON, TOML.'}
|
||||
</HelperTextItem>
|
||||
</HelperText>
|
||||
</FormHelperText>
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ type ToggleGroupProps = Omit<FormGroupProps<boolean>, 'isDisabled'>;
|
|||
const AWSConfigToggle = ({ value, onChange }: ToggleGroupProps) => {
|
||||
const handleChange = (
|
||||
_event: React.FormEvent<HTMLInputElement>,
|
||||
checked: boolean,
|
||||
checked: boolean
|
||||
) => {
|
||||
onChange(checked);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ export const CloudProviderConfig = () => {
|
|||
dispatch(changeAWSCredsPath(credentials));
|
||||
}
|
||||
},
|
||||
[dispatch, setEnabled],
|
||||
[dispatch, setEnabled]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
|||
|
|
@ -442,10 +442,10 @@ const CreateImageWizard = ({ isEdit }: CreateImageWizardProps) => {
|
|||
!isAzureSubscriptionIdValid(azureSubscriptionId) ||
|
||||
!isAzureResourceGroupValid(azureResourceGroup)
|
||||
: azureShareMethod === 'sources'
|
||||
? !isAzureTenantGUIDValid(azureTenantId) ||
|
||||
!isAzureSubscriptionIdValid(azureSubscriptionId) ||
|
||||
!isAzureResourceGroupValid(azureResourceGroup)
|
||||
: azureSource === undefined
|
||||
? !isAzureTenantGUIDValid(azureTenantId) ||
|
||||
!isAzureSubscriptionIdValid(azureSubscriptionId) ||
|
||||
!isAzureResourceGroupValid(azureResourceGroup)
|
||||
: azureSource === undefined
|
||||
}
|
||||
/>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,8 +116,8 @@ const getValidationState = (
|
|||
const validated = isPristine
|
||||
? 'default'
|
||||
: (isRequired && errorMessage) || errorMessage
|
||||
? 'error'
|
||||
: 'success';
|
||||
? 'error'
|
||||
: 'success';
|
||||
|
||||
return validated;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -142,8 +142,14 @@ const TargetEnvironment = () => {
|
|||
};
|
||||
|
||||
if (isFetching) {
|
||||
return <EmptyState titleText="Loading target environments" headingLevel="h6" icon={Spinner} />
|
||||
};
|
||||
return (
|
||||
<EmptyState
|
||||
titleText="Loading target environments"
|
||||
headingLevel="h6"
|
||||
icon={Spinner}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (isError) {
|
||||
return (
|
||||
|
|
@ -152,10 +158,11 @@ const TargetEnvironment = () => {
|
|||
variant="danger"
|
||||
isInline
|
||||
>
|
||||
Target environments couldn't be loaded, please refresh the page or try again later.
|
||||
Target environments couldn't be loaded, please refresh the page or
|
||||
try again later.
|
||||
</Alert>
|
||||
)
|
||||
};
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<FormGroup
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ const ProfileSelector = () => {
|
|||
const onKeyDown = (event: React.KeyboardEvent) => {
|
||||
if (event.key === 'Enter') {
|
||||
event.preventDefault();
|
||||
|
||||
|
||||
if (!isOpen) {
|
||||
setIsOpen(true);
|
||||
} else if (selectOptions.length === 1) {
|
||||
|
|
@ -220,7 +220,7 @@ const ProfileSelector = () => {
|
|||
profileID: singleProfile.id,
|
||||
toString: () => singleProfile.name || '',
|
||||
};
|
||||
|
||||
|
||||
setInputValue(singleProfile.name || '');
|
||||
setFilterValue('');
|
||||
applyChanges(selection);
|
||||
|
|
|
|||
|
|
@ -1485,8 +1485,8 @@ const Packages = () => {
|
|||
packages.length + groups.length === 0
|
||||
? ''
|
||||
: packages.length + groups.length <= 100
|
||||
? ` (${packages.length + groups.length})`
|
||||
: ' (100+)'
|
||||
? ` (${packages.length + groups.length})`
|
||||
: ' (100+)'
|
||||
}`}
|
||||
buttonId="toggle-selected"
|
||||
isSelected={toggleSelected === 'toggle-selected'}
|
||||
|
|
@ -1501,10 +1501,10 @@ const Packages = () => {
|
|||
searchTerm === '' && toggleSelected === 'toggle-available'
|
||||
? 0
|
||||
: showPackages && showGroups
|
||||
? transformedPackages.length + transformedGroups.length
|
||||
: showPackages
|
||||
? transformedPackages.length
|
||||
: transformedGroups.length
|
||||
? transformedPackages.length + transformedGroups.length
|
||||
: showPackages
|
||||
? transformedPackages.length
|
||||
: transformedGroups.length
|
||||
}
|
||||
perPage={perPage}
|
||||
page={page}
|
||||
|
|
@ -1550,10 +1550,10 @@ const Packages = () => {
|
|||
searchTerm === '' && toggleSelected === 'toggle-available'
|
||||
? 0
|
||||
: showPackages && showGroups
|
||||
? transformedPackages.length + transformedGroups.length
|
||||
: showPackages
|
||||
? transformedPackages.length
|
||||
: transformedGroups.length
|
||||
? transformedPackages.length + transformedGroups.length
|
||||
: showPackages
|
||||
? transformedPackages.length
|
||||
: transformedGroups.length
|
||||
}
|
||||
perPage={perPage}
|
||||
page={page}
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ const SatelliteRegistration = () => {
|
|||
const validated = stepValidation.errors['certificate']
|
||||
? 'error'
|
||||
: stepValidation.errors['certificate'] === undefined && caCertificate
|
||||
? 'success'
|
||||
: 'default';
|
||||
? 'success'
|
||||
: 'default';
|
||||
const handleClear = () => {
|
||||
dispatch(changeSatelliteCaCertificate(''));
|
||||
};
|
||||
|
|
@ -79,17 +79,17 @@ const SatelliteRegistration = () => {
|
|||
isRejected || validated === 'error'
|
||||
? 'error'
|
||||
: validated === 'success'
|
||||
? 'success'
|
||||
: 'default'
|
||||
? 'success'
|
||||
: 'default'
|
||||
}
|
||||
>
|
||||
{isRejected
|
||||
? 'Must be a .PEM/.CER/.CRT file no larger than 512 KB'
|
||||
: validated === 'error'
|
||||
? stepValidation.errors['certificate']
|
||||
: validated === 'success'
|
||||
? 'Certificate was uploaded'
|
||||
: 'Drag and drop a valid certificate file or upload one'}
|
||||
? stepValidation.errors['certificate']
|
||||
: validated === 'success'
|
||||
? 'Certificate was uploaded'
|
||||
: 'Drag and drop a valid certificate file or upload one'}
|
||||
</HelperTextItem>
|
||||
{(isRejected || validated !== 'success') && (
|
||||
<HelperTextItem>
|
||||
|
|
|
|||
|
|
@ -140,8 +140,8 @@ export const SnapshotTable = ({
|
|||
snapshotForDate.length > 0
|
||||
? snapshotForDate.map(({ repository_uuid }) => repository_uuid).join()
|
||||
: template && templateData && templateData.repository_uuids
|
||||
? templateData.repository_uuids.join(',')
|
||||
: '',
|
||||
? templateData.repository_uuids.join(',')
|
||||
: '',
|
||||
origin: ContentOrigin.REDHAT + ',' + ContentOrigin.CUSTOM, // Make sure to show both redhat and external
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -313,10 +313,10 @@ export const TargetEnvGCPList = () => {
|
|||
{accountType === 'group'
|
||||
? 'Google group'
|
||||
: accountType === 'serviceAccount'
|
||||
? 'Service account'
|
||||
: accountType === 'user'
|
||||
? 'Google account'
|
||||
: 'Domain'}
|
||||
? 'Service account'
|
||||
: accountType === 'user'
|
||||
? 'Google account'
|
||||
: 'Domain'}
|
||||
</Content>
|
||||
<Content
|
||||
component={ContentVariants.dt}
|
||||
|
|
@ -520,10 +520,10 @@ export const ContentList = () => {
|
|||
useLatest
|
||||
? 'Use the latest repository content'
|
||||
: template
|
||||
? 'Use content from the content template'
|
||||
: `Repositories as of ${yyyyMMddFormat(
|
||||
new Date(snapshotDate)
|
||||
)}`
|
||||
? 'Use content from the content template'
|
||||
: `Repositories as of ${yyyyMMddFormat(
|
||||
new Date(snapshotDate)
|
||||
)}`
|
||||
}
|
||||
hasAutoWidth
|
||||
minWidth="60rem"
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ export const AwsAccountId = () => {
|
|||
readOnlyVariant="default"
|
||||
isRequired
|
||||
id="aws-account-id"
|
||||
value={sourceId && data ? data.aws?.account_id ?? '' : ''}
|
||||
value={sourceId && data ? (data.aws?.account_id ?? '') : ''}
|
||||
aria-label="aws account id"
|
||||
/>
|
||||
</FormGroup>
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ const AWSRegion = ({ value, onChange }: FormGroupProps<string>) => {
|
|||
|
||||
const onSelect = (
|
||||
_event: React.MouseEvent<Element, MouseEvent> | undefined,
|
||||
value: string | number | undefined,
|
||||
value: string | number | undefined
|
||||
) => {
|
||||
onChange(value as string);
|
||||
setIsOpen(false);
|
||||
|
|
|
|||
|
|
@ -51,14 +51,14 @@ export const PasswordValidatedInput = ({
|
|||
|
||||
const PasswordToggleButton = () => {
|
||||
return (
|
||||
<Button
|
||||
variant="control"
|
||||
onClick={togglePasswordVisibility}
|
||||
aria-label={isPasswordVisible ? 'Hide password' : 'Show password'}
|
||||
isDisabled={isEditingWithoutValue}
|
||||
>
|
||||
{isPasswordVisible ? <EyeSlashIcon /> : <EyeIcon />}
|
||||
</Button>
|
||||
<Button
|
||||
variant="control"
|
||||
onClick={togglePasswordVisibility}
|
||||
aria-label={isPasswordVisible ? 'Hide password' : 'Show password'}
|
||||
isDisabled={isEditingWithoutValue}
|
||||
>
|
||||
{isPasswordVisible ? <EyeSlashIcon /> : <EyeIcon />}
|
||||
</Button>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
@ -78,13 +78,13 @@ export const PasswordValidatedInput = ({
|
|||
</InputGroupItem>
|
||||
<InputGroupItem>
|
||||
{isEditingWithoutValue ? (
|
||||
<Tooltip content="Passwords cannot be viewed when editing a blueprint for security reasons">
|
||||
<Tooltip content="Passwords cannot be viewed when editing a blueprint for security reasons">
|
||||
<span>
|
||||
<PasswordToggleButton/>
|
||||
<PasswordToggleButton />
|
||||
</span>
|
||||
</Tooltip>
|
||||
</Tooltip>
|
||||
) : (
|
||||
<PasswordToggleButton/>
|
||||
<PasswordToggleButton />
|
||||
)}
|
||||
</InputGroupItem>
|
||||
</InputGroup>
|
||||
|
|
|
|||
|
|
@ -165,12 +165,12 @@ const getLatestRelease = (distribution: Distributions) => {
|
|||
return distribution.startsWith('rhel-10')
|
||||
? RHEL_10
|
||||
: distribution.startsWith('rhel-9')
|
||||
? RHEL_9
|
||||
: distribution.startsWith('rhel-8')
|
||||
? RHEL_8
|
||||
: distribution === ('centos-8' as Distributions)
|
||||
? CENTOS_9
|
||||
: distribution;
|
||||
? RHEL_9
|
||||
: distribution.startsWith('rhel-8')
|
||||
? RHEL_8
|
||||
: distribution === ('centos-8' as Distributions)
|
||||
? CENTOS_9
|
||||
: distribution;
|
||||
};
|
||||
|
||||
function commonRequestToState(
|
||||
|
|
@ -256,13 +256,13 @@ function commonRequestToState(
|
|||
policyTitle: undefined,
|
||||
}
|
||||
: oscapProfile !== undefined
|
||||
? {
|
||||
complianceType: 'openscap' as ComplianceType,
|
||||
profileID: oscapProfile,
|
||||
policyID: undefined,
|
||||
policyTitle: undefined,
|
||||
}
|
||||
: initialState.compliance,
|
||||
? {
|
||||
complianceType: 'openscap' as ComplianceType,
|
||||
profileID: oscapProfile,
|
||||
policyID: undefined,
|
||||
policyTitle: undefined,
|
||||
}
|
||||
: initialState.compliance,
|
||||
firstBoot: request.customizations
|
||||
? {
|
||||
script: getFirstBootScript(request.customizations.files),
|
||||
|
|
@ -393,8 +393,8 @@ export const mapRequestToState = (request: BlueprintResponse): wizardState => {
|
|||
? 'register-now-rhc'
|
||||
: 'register-now-insights'
|
||||
: getSatelliteCommand(request.customizations.files)
|
||||
? 'register-satellite'
|
||||
: 'register-later',
|
||||
? 'register-satellite'
|
||||
: 'register-later',
|
||||
activationKey: isRhel(request.distribution)
|
||||
? request.customizations.subscription?.['activation-key']
|
||||
: undefined,
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ const ProvisioningLink = ({
|
|||
scope: 'provisioning',
|
||||
module: './ProvisioningWizard',
|
||||
},
|
||||
{},
|
||||
{}
|
||||
);
|
||||
|
||||
const { permissions, isLoading: isLoadingPermission } =
|
||||
|
|
@ -126,7 +126,7 @@ const ProvisioningLink = ({
|
|||
// Recomputing this value on every render made the modal crash. Using a state
|
||||
// helps avoiding this situation as the value is only set the first time.
|
||||
const [appendTo] = useState(
|
||||
document.querySelector(MODAL_ANCHOR) as HTMLElement,
|
||||
document.querySelector(MODAL_ANCHOR) as HTMLElement
|
||||
);
|
||||
|
||||
const selectedBlueprintId = useAppSelector(selectSelectedBlueprintId);
|
||||
|
|
@ -137,10 +137,10 @@ const ProvisioningLink = ({
|
|||
{
|
||||
selectFromResult: ({ data }) => ({
|
||||
selectedBlueprintVersion: data?.data.find(
|
||||
(blueprint: BlueprintItem) => blueprint.id === selectedBlueprintId,
|
||||
(blueprint: BlueprintItem) => blueprint.id === selectedBlueprintId
|
||||
)?.version,
|
||||
}),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
if (
|
||||
|
|
@ -270,7 +270,7 @@ export const OciInstance = ({ compose, isExpired }: OciInstancePropTypes) => {
|
|||
|
||||
if (options && !isOciUploadStatus(options)) {
|
||||
throw TypeError(
|
||||
`Error: options must be of type OciUploadStatus, not ${typeof options}.`,
|
||||
`Error: options must be of type OciUploadStatus, not ${typeof options}.`
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -404,7 +404,7 @@ export const AwsS3Instance = ({
|
|||
|
||||
if (options && !isAwss3UploadStatus(options)) {
|
||||
throw TypeError(
|
||||
`Error: options must be of type Awss3UploadStatus, not ${typeof options}.`,
|
||||
`Error: options must be of type Awss3UploadStatus, not ${typeof options}.`
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,10 @@ import React from 'react';
|
|||
import { Skeleton } from '@patternfly/react-core';
|
||||
|
||||
import { targetOptions } from '../../constants';
|
||||
import { ComposesResponseItem, useGetComposeClonesQuery } from '../../store/imageBuilderApi';
|
||||
import {
|
||||
ComposesResponseItem,
|
||||
useGetComposeClonesQuery,
|
||||
} from '../../store/imageBuilderApi';
|
||||
|
||||
type TargetPropTypes = {
|
||||
compose: ComposesResponseItem;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue