Manually revert "Fedora-services: add support for fedora env"
This reverts #2984 as Fedora service frontend is not being currently actively maintained.
This commit is contained in:
parent
969497e722
commit
0597541af2
14 changed files with 47 additions and 216 deletions
|
|
@ -46,7 +46,6 @@ import {
|
|||
} from '../../store/imageBuilderApi';
|
||||
import { imageBuilderApi } from '../../store/service/enhancedImageBuilderApi';
|
||||
import { resolveRelPath } from '../../Utilities/path';
|
||||
import { useGetEnvironment } from '../../Utilities/useGetEnvironment';
|
||||
|
||||
type blueprintSearchProps = {
|
||||
blueprintsTotal: number;
|
||||
|
|
@ -62,7 +61,6 @@ type emptyBlueprintStateProps = {
|
|||
|
||||
const BlueprintsSidebar = () => {
|
||||
const [userData, setUserData] = useState<ChromeUser | void>(undefined);
|
||||
const { isFedoraEnv } = useGetEnvironment();
|
||||
const { analytics, auth } = useChrome();
|
||||
|
||||
const selectedBlueprintId = useAppSelector(selectSelectedBlueprintId);
|
||||
|
|
@ -124,7 +122,7 @@ const BlueprintsSidebar = () => {
|
|||
dispatch(setBlueprintId(undefined));
|
||||
};
|
||||
|
||||
if (!process.env.IS_ON_PREMISE && !isFedoraEnv) {
|
||||
if (!process.env.IS_ON_PREMISE) {
|
||||
const orgId = userData?.identity?.internal?.org_id;
|
||||
|
||||
analytics.group(orgId, {
|
||||
|
|
|
|||
|
|
@ -65,7 +65,6 @@ import {
|
|||
RHEL_10_BETA,
|
||||
RHEL_10,
|
||||
AARCH64,
|
||||
CENTOS_9,
|
||||
AMPLITUDE_MODULE_NAME,
|
||||
RHEL_9,
|
||||
} from '../../constants';
|
||||
|
|
@ -88,11 +87,10 @@ import {
|
|||
selectGcpShareMethod,
|
||||
selectImageTypes,
|
||||
addImageType,
|
||||
changeRegistrationType,
|
||||
} from '../../store/wizardSlice';
|
||||
import isRhel from '../../Utilities/isRhel';
|
||||
import { resolveRelPath } from '../../Utilities/path';
|
||||
import { useFlag, useGetEnvironment } from '../../Utilities/useGetEnvironment';
|
||||
import { useFlag } from '../../Utilities/useGetEnvironment';
|
||||
import { ImageBuilderHeader } from '../sharedComponents/ImageBuilderHeader';
|
||||
|
||||
type CustomWizardFooterPropType = {
|
||||
|
|
@ -197,17 +195,13 @@ const CreateImageWizard = ({ isEdit }: CreateImageWizardProps) => {
|
|||
const navigate = useNavigate();
|
||||
const dispatch = useAppDispatch();
|
||||
const [searchParams] = useSearchParams();
|
||||
const { isFedoraEnv } = useGetEnvironment();
|
||||
|
||||
// Feature flags
|
||||
const complianceEnabled = useFlag('image-builder.compliance.enabled');
|
||||
|
||||
// IMPORTANT: Ensure the wizard starts with a fresh initial state
|
||||
useEffect(() => {
|
||||
dispatch(initializeWizard());
|
||||
if (isFedoraEnv) {
|
||||
dispatch(changeDistribution(CENTOS_9));
|
||||
dispatch(changeRegistrationType('register-later'));
|
||||
}
|
||||
if (searchParams.get('release') === 'rhel8') {
|
||||
dispatch(changeDistribution(RHEL_8));
|
||||
}
|
||||
|
|
@ -331,14 +325,14 @@ const CreateImageWizard = ({ isEdit }: CreateImageWizardProps) => {
|
|||
);
|
||||
|
||||
// Only this code is different from the original
|
||||
const status = (step?.id !== activeStep?.id && step?.status) || 'default';
|
||||
const status = (step.id !== activeStep.id && step.status) || 'default';
|
||||
|
||||
return (
|
||||
<WizardNavItem
|
||||
key={step?.id}
|
||||
id={step?.id}
|
||||
key={step.id}
|
||||
id={step.id}
|
||||
content={step.name}
|
||||
isCurrent={activeStep?.id === step?.id}
|
||||
isCurrent={activeStep.id === step.id}
|
||||
isDisabled={
|
||||
step.isDisabled ||
|
||||
(!step.isVisited &&
|
||||
|
|
@ -523,9 +517,7 @@ const CreateImageWizard = ({ isEdit }: CreateImageWizardProps) => {
|
|||
navItem={CustomStatusNavItem}
|
||||
status={snapshotValidation.disabledNext ? 'error' : 'default'}
|
||||
isHidden={
|
||||
distribution === RHEL_10_BETA ||
|
||||
!!process.env.IS_ON_PREMISE ||
|
||||
isFedoraEnv
|
||||
distribution === RHEL_10_BETA || !!process.env.IS_ON_PREMISE
|
||||
}
|
||||
footer={
|
||||
<CustomWizardFooter
|
||||
|
|
@ -542,9 +534,7 @@ const CreateImageWizard = ({ isEdit }: CreateImageWizardProps) => {
|
|||
key="wizard-custom-repositories"
|
||||
navItem={CustomStatusNavItem}
|
||||
isHidden={
|
||||
distribution === RHEL_10_BETA ||
|
||||
!!process.env.IS_ON_PREMISE ||
|
||||
isFedoraEnv
|
||||
distribution === RHEL_10_BETA || !!process.env.IS_ON_PREMISE
|
||||
}
|
||||
isDisabled={snapshotValidation.disabledNext}
|
||||
footer={
|
||||
|
|
@ -558,7 +548,6 @@ const CreateImageWizard = ({ isEdit }: CreateImageWizardProps) => {
|
|||
id="wizard-additional-packages"
|
||||
key="wizard-additional-packages"
|
||||
navItem={CustomStatusNavItem}
|
||||
isHidden={isFedoraEnv}
|
||||
isDisabled={snapshotValidation.disabledNext}
|
||||
footer={
|
||||
<CustomWizardFooter disableNext={false} optional={true} />
|
||||
|
|
@ -677,7 +666,7 @@ const CreateImageWizard = ({ isEdit }: CreateImageWizardProps) => {
|
|||
key="wizard-first-boot"
|
||||
navItem={CustomStatusNavItem}
|
||||
status={firstBootValidation.disabledNext ? 'error' : 'default'}
|
||||
isHidden={!!process.env.IS_ON_PREMISE || isFedoraEnv}
|
||||
isHidden={!!process.env.IS_ON_PREMISE}
|
||||
footer={
|
||||
<CustomWizardFooter
|
||||
disableNext={firstBootValidation.disabledNext}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ import {
|
|||
RHEL_10_FULL_SUPPORT,
|
||||
RHEL_10_MAINTENANCE_SUPPORT,
|
||||
ON_PREM_RELEASES,
|
||||
FEDORA_RELEASES,
|
||||
} from '../../../../../constants';
|
||||
import { useAppDispatch, useAppSelector } from '../../../../../store/hooks';
|
||||
import { Distributions } from '../../../../../store/imageBuilderApi';
|
||||
|
|
@ -34,10 +33,7 @@ import {
|
|||
} from '../../../../../store/wizardSlice';
|
||||
import isRhel from '../../../../../Utilities/isRhel';
|
||||
import { toMonthAndYear } from '../../../../../Utilities/time';
|
||||
import {
|
||||
useFlag,
|
||||
useGetEnvironment,
|
||||
} from '../../../../../Utilities/useGetEnvironment';
|
||||
import { useFlag } from '../../../../../Utilities/useGetEnvironment';
|
||||
|
||||
const ReleaseSelect = () => {
|
||||
// What the UI refers to as the "release" is referred to as the "distribution" in the API.
|
||||
|
|
@ -46,18 +42,12 @@ const ReleaseSelect = () => {
|
|||
const distribution = useAppSelector(selectDistribution);
|
||||
const dispatch = useAppDispatch();
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const { isFedoraEnv } = useGetEnvironment();
|
||||
const [showDevelopmentOptions, setShowDevelopmentOptions] =
|
||||
useState(isFedoraEnv);
|
||||
const [showDevelopmentOptions, setShowDevelopmentOptions] = useState(false);
|
||||
|
||||
const isRHEL9BetaEnabled = useFlag('image-builder.rhel9.beta.enabled');
|
||||
const isRHEL10BetaEnabled = useFlag('image-builder.rhel10.beta.enabled');
|
||||
|
||||
const releases = isFedoraEnv
|
||||
? FEDORA_RELEASES
|
||||
: process.env.IS_ON_PREMISE
|
||||
? ON_PREM_RELEASES
|
||||
: RELEASES;
|
||||
const releases = process.env.IS_ON_PREMISE ? ON_PREM_RELEASES : RELEASES;
|
||||
|
||||
const handleSelect = (_event: React.MouseEvent, selection: Distributions) => {
|
||||
if (selection !== ('loader' as Distributions)) {
|
||||
|
|
|
|||
|
|
@ -31,8 +31,6 @@ import {
|
|||
selectDistribution,
|
||||
selectImageTypes,
|
||||
} from '../../../../../store/wizardSlice';
|
||||
import isRhel from '../../../../../Utilities/isRhel';
|
||||
import { useGetEnvironment } from '../../../../../Utilities/useGetEnvironment';
|
||||
|
||||
type TargetEnvironmentCardProps = {
|
||||
title: string;
|
||||
|
|
@ -101,14 +99,10 @@ const TargetEnvironment = () => {
|
|||
const arch = useAppSelector(selectArchitecture);
|
||||
const environments = useAppSelector(selectImageTypes);
|
||||
const distribution = useAppSelector(selectDistribution);
|
||||
const { isFedoraEnv } = useGetEnvironment();
|
||||
|
||||
const { data } = useGetArchitecturesQuery(
|
||||
{
|
||||
distribution: distribution,
|
||||
},
|
||||
{ skip: isFedoraEnv && isRhel(distribution) }
|
||||
);
|
||||
const { data } = useGetArchitecturesQuery({
|
||||
distribution: distribution,
|
||||
});
|
||||
// TODO: Handle isFetching state (add skeletons)
|
||||
// TODO: Handle isError state (very unlikely...)
|
||||
|
||||
|
|
@ -120,7 +114,7 @@ const TargetEnvironment = () => {
|
|||
const prefetchActivationKeys = rhsmApi.usePrefetch('listActivationKeys');
|
||||
|
||||
useEffect(() => {
|
||||
if (!isFedoraEnv) prefetchActivationKeys();
|
||||
prefetchActivationKeys();
|
||||
}, []);
|
||||
|
||||
const supportedEnvironments = data?.find(
|
||||
|
|
|
|||
|
|
@ -37,16 +37,12 @@ import {
|
|||
selectComplianceType,
|
||||
clearKernelAppend,
|
||||
} from '../../../../store/wizardSlice';
|
||||
import {
|
||||
useFlag,
|
||||
useGetEnvironment,
|
||||
} from '../../../../Utilities/useGetEnvironment';
|
||||
import { useFlag } from '../../../../Utilities/useGetEnvironment';
|
||||
import { useOnPremOpenSCAPAvailable } from '../../../../Utilities/useOnPremOpenSCAP';
|
||||
|
||||
const OscapContent = () => {
|
||||
const dispatch = useAppDispatch();
|
||||
const { analytics } = useChrome();
|
||||
const { isFedoraEnv } = useGetEnvironment();
|
||||
const complianceEnabled = useFlag('image-builder.compliance.enabled');
|
||||
const complianceType = useAppSelector(selectComplianceType);
|
||||
const profileID = useAppSelector(selectComplianceProfileID);
|
||||
|
|
@ -93,7 +89,7 @@ const OscapContent = () => {
|
|||
dispatch(clearKernelAppend());
|
||||
};
|
||||
|
||||
if (!process.env.IS_ON_PREMISE && !isFedoraEnv) {
|
||||
if (!process.env.IS_ON_PREMISE) {
|
||||
if (complianceEnabled) {
|
||||
analytics.screen('ib-createimagewizard-step-security-compliance');
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ import {
|
|||
} from '../../../../../store/imageBuilderApi';
|
||||
import { selectPackages } from '../../../../../store/wizardSlice';
|
||||
import { createAnalytics } from '../../../../../Utilities/analytics';
|
||||
import { useGetEnvironment } from '../../../../../Utilities/useGetEnvironment';
|
||||
|
||||
type CreateDropdownProps = {
|
||||
getBlueprintPayload: () => Promise<'' | CreateBlueprintRequest | undefined>;
|
||||
|
|
@ -52,12 +51,11 @@ export const CreateSaveAndBuildBtn = ({
|
|||
fixedCacheKey: 'createBlueprintKey',
|
||||
});
|
||||
const dispatch = useAppDispatch();
|
||||
const { isFedoraEnv } = useGetEnvironment();
|
||||
const onSaveAndBuild = async () => {
|
||||
const requestBody = await getBlueprintPayload();
|
||||
setIsOpen(false);
|
||||
|
||||
if (!process.env.IS_ON_PREMISE && !isFedoraEnv && requestBody) {
|
||||
if (!process.env.IS_ON_PREMISE && requestBody) {
|
||||
const analyticsData = createAnalytics(requestBody, packages, isBeta);
|
||||
analytics.track(`${AMPLITUDE_MODULE_NAME} - Blueprint Created`, {
|
||||
...analyticsData,
|
||||
|
|
@ -108,7 +106,6 @@ export const CreateSaveButton = ({
|
|||
})();
|
||||
}, [auth]);
|
||||
const packages = useAppSelector(selectPackages);
|
||||
const { isFedoraEnv } = useGetEnvironment();
|
||||
|
||||
const [createBlueprint, { isLoading }] = useCreateBlueprintMutation({
|
||||
fixedCacheKey: 'createBlueprintKey',
|
||||
|
|
@ -161,7 +158,7 @@ export const CreateSaveButton = ({
|
|||
const requestBody = await getBlueprintPayload();
|
||||
setIsOpen(false);
|
||||
|
||||
if (!process.env.IS_ON_PREMISE && !isFedoraEnv && requestBody) {
|
||||
if (!process.env.IS_ON_PREMISE && requestBody) {
|
||||
const analyticsData = createAnalytics(requestBody, packages, isBeta);
|
||||
analytics.track(`${AMPLITUDE_MODULE_NAME} - Blueprint Created`, {
|
||||
...analyticsData,
|
||||
|
|
@ -169,11 +166,13 @@ export const CreateSaveButton = ({
|
|||
account_id: userData?.identity.internal?.account_id || 'Not found',
|
||||
});
|
||||
}
|
||||
|
||||
const blueprint =
|
||||
requestBody &&
|
||||
(await createBlueprint({
|
||||
createBlueprintRequest: requestBody,
|
||||
}).unwrap());
|
||||
|
||||
if (blueprint) {
|
||||
dispatch(setBlueprintId(blueprint?.id));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import {
|
|||
useUpdateBlueprintMutation,
|
||||
} from '../../../../../store/backendApi';
|
||||
import { resolveRelPath } from '../../../../../Utilities/path';
|
||||
import { useGetEnvironment } from '../../../../../Utilities/useGetEnvironment';
|
||||
import { mapRequestFromState } from '../../../utilities/requestMapper';
|
||||
import { useIsBlueprintValid } from '../../../utilities/useValidation';
|
||||
|
||||
|
|
@ -35,7 +34,6 @@ const ReviewWizardFooter = () => {
|
|||
useUpdateBlueprintMutation({ fixedCacheKey: 'updateBlueprintKey' });
|
||||
const { auth } = useChrome();
|
||||
const { composeId } = useParams();
|
||||
const { isFedoraEnv } = useGetEnvironment();
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const store = useStore();
|
||||
const onToggleClick = () => {
|
||||
|
|
@ -53,7 +51,7 @@ const ReviewWizardFooter = () => {
|
|||
}, [isUpdateSuccess, isCreateSuccess, resetCreate, resetUpdate, navigate]);
|
||||
|
||||
const getBlueprintPayload = async () => {
|
||||
if (!process.env.IS_ON_PREMISE && !isFedoraEnv) {
|
||||
if (!process.env.IS_ON_PREMISE) {
|
||||
const userData = await auth?.getUser();
|
||||
const orgId = userData?.identity?.internal?.org_id;
|
||||
const requestBody = orgId && mapRequestFromState(store, orgId);
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ import {
|
|||
selectUsers,
|
||||
selectKernel,
|
||||
} from '../../../../store/wizardSlice';
|
||||
import { useGetEnvironment } from '../../../../Utilities/useGetEnvironment';
|
||||
|
||||
const Review = () => {
|
||||
const { goToStepById } = useWizardContext();
|
||||
|
|
@ -187,7 +186,6 @@ const Review = () => {
|
|||
);
|
||||
};
|
||||
|
||||
const { isFedoraEnv } = useGetEnvironment();
|
||||
return (
|
||||
<>
|
||||
<ExpandableSection
|
||||
|
|
@ -359,23 +357,21 @@ const Review = () => {
|
|||
>
|
||||
<FSCList />
|
||||
</ExpandableSection>
|
||||
{!isFedoraEnv && (
|
||||
<ExpandableSection
|
||||
toggleContent={composeExpandable(
|
||||
'Content',
|
||||
'revisit-custom-repositories',
|
||||
'wizard-custom-repositories'
|
||||
)}
|
||||
onToggle={(_event, isExpandedContent) =>
|
||||
onToggleContent(isExpandedContent)
|
||||
}
|
||||
isExpanded={isExpandedContent}
|
||||
isIndented
|
||||
data-testid="content-expandable"
|
||||
>
|
||||
<ContentList />
|
||||
</ExpandableSection>
|
||||
)}
|
||||
<ExpandableSection
|
||||
toggleContent={composeExpandable(
|
||||
'Content',
|
||||
'revisit-custom-repositories',
|
||||
'wizard-custom-repositories'
|
||||
)}
|
||||
onToggle={(_event, isExpandedContent) =>
|
||||
onToggleContent(isExpandedContent)
|
||||
}
|
||||
isExpanded={isExpandedContent}
|
||||
isIndented
|
||||
data-testid="content-expandable"
|
||||
>
|
||||
<ContentList />
|
||||
</ExpandableSection>
|
||||
{users.length > 0 && (
|
||||
<ExpandableSection
|
||||
toggleContent={composeExpandable(
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import {
|
|||
import { FSReviewTable } from './ReviewStepTables';
|
||||
|
||||
import {
|
||||
FEDORA_RELEASES,
|
||||
ON_PREM_RELEASES,
|
||||
RELEASES,
|
||||
RHEL_10,
|
||||
|
|
@ -81,7 +80,6 @@ import {
|
|||
selectRedHatRepositories,
|
||||
} from '../../../../store/wizardSlice';
|
||||
import { toMonthAndYear, yyyyMMddFormat } from '../../../../Utilities/time';
|
||||
import { useGetEnvironment } from '../../../../Utilities/useGetEnvironment';
|
||||
import {
|
||||
getConversionFactor,
|
||||
MinimumSizePopover,
|
||||
|
|
@ -106,12 +104,8 @@ const ExpirationWarning = () => {
|
|||
export const ImageOutputList = () => {
|
||||
const distribution = useAppSelector(selectDistribution);
|
||||
const arch = useAppSelector(selectArchitecture);
|
||||
const { isFedoraEnv } = useGetEnvironment();
|
||||
const releases = isFedoraEnv
|
||||
? FEDORA_RELEASES
|
||||
: process.env.IS_ON_PREMISE
|
||||
? ON_PREM_RELEASES
|
||||
: RELEASES;
|
||||
const releases = process.env.IS_ON_PREMISE ? ON_PREM_RELEASES : RELEASES;
|
||||
|
||||
return (
|
||||
<Content>
|
||||
{(distribution === RHEL_8 || distribution === RHEL_9) && (
|
||||
|
|
|
|||
|
|
@ -87,7 +87,6 @@ import {
|
|||
timestampToDisplayString,
|
||||
timestampToDisplayStringDetailed,
|
||||
} from '../../Utilities/time';
|
||||
import { useGetEnvironment } from '../../Utilities/useGetEnvironment';
|
||||
|
||||
const ImagesTable = () => {
|
||||
const [page, setPage] = useState(1);
|
||||
|
|
@ -104,7 +103,6 @@ const ImagesTable = () => {
|
|||
const blueprintsOffset = useAppSelector(selectOffset) || PAGINATION_OFFSET;
|
||||
const blueprintsLimit = useAppSelector(selectLimit) || PAGINATION_LIMIT;
|
||||
|
||||
const { isFedoraEnv } = useGetEnvironment();
|
||||
const { analytics, auth } = useChrome();
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
|
|
@ -225,7 +223,7 @@ const ImagesTable = () => {
|
|||
}
|
||||
const itemCount = data?.meta.count || 0;
|
||||
|
||||
if (!process.env.IS_ON_PREMISE && !isFedoraEnv) {
|
||||
if (!process.env.IS_ON_PREMISE) {
|
||||
const orgId = userData?.identity.internal?.org_id;
|
||||
|
||||
analytics.group(orgId, {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue