src: Resolve problems ater updating API
'centos-8' was dropped from Distributions, causing a few problems. This resolves them.
This commit is contained in:
parent
434c90a6b8
commit
9a1d348a77
4 changed files with 9 additions and 3 deletions
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
3
src/test/fixtures/blueprints.ts
vendored
3
src/test/fixtures/blueprints.ts
vendored
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue