src: Resolve problems ater updating API

'centos-8' was dropped from Distributions, causing a few problems. This resolves them.
This commit is contained in:
regexowl 2024-07-30 14:30:24 +02:00 committed by Ondřej Ezr
parent 434c90a6b8
commit 9a1d348a77
4 changed files with 9 additions and 3 deletions

View file

@ -132,7 +132,7 @@ const getLatestRelease = (distribution: Distributions) => {
? RHEL_9
: distribution.startsWith('rhel-8')
? RHEL_8
: distribution === 'centos-8'
: distribution === ('centos-8' as Distributions)
? CENTOS_9
: distribution;
};

View file

@ -19,6 +19,7 @@ import {
BlueprintItem,
useGetBlueprintsQuery,
useGetBlueprintComposesQuery,
Distributions,
} from '../../store/imageBuilderApi';
import { BlueprintActionsMenu } from '../Blueprints/BlueprintActionsMenu';
import BlueprintVersionFilter from '../Blueprints/BlueprintVersionFilter';
@ -96,7 +97,10 @@ const ImagesTableToolbar: React.FC<imagesTableToolbarProps> = ({
const isBlueprintDistroCentos8 = () => {
if (isSuccessBlueprintsCompose) {
return blueprintsComposes.data[0].request.distribution === 'centos-8';
return (
blueprintsComposes.data[0].request.distribution ===
('centos-8' as Distributions)
);
}
};

View file

@ -24,6 +24,7 @@ const Release = ({ release }: ReleaseProps) => {
'rhel-92': 'RHEL 9.2',
'rhel-93': 'RHEL 9.3',
'rhel-94': 'RHEL 9.4',
'rhel-10-nightly': 'RHEL 10',
'centos-8': 'CentOS Stream 8',
'centos-9': 'CentOS Stream 9',
'centos-10': 'CentOS Stream 10',

View file

@ -4,6 +4,7 @@ import {
CreateBlueprintResponse,
GetBlueprintComposesApiResponse,
GetBlueprintApiResponse,
Distributions,
} from '../../store/imageBuilderApi';
export const mockBlueprintsCreation: CreateBlueprintResponse[] = [
@ -322,7 +323,7 @@ export const mockCentosBlueprintComposes: GetBlueprintComposesApiResponse = {
created_at: '2021-04-27T12:31:12Z',
blueprint_version: 1,
request: {
distribution: 'centos-8',
distribution: 'centos-8' as Distributions,
image_requests: [
{
architecture: 'x86_64',