@@ -2,7 +2,6 @@ import { FunctionComponent, useEffect, useState } from "react";
2
2
import "./ArtifactPage.css" ;
3
3
import { Breadcrumb , BreadcrumbItem , PageSection , PageSectionVariants , Tab , Tabs } from "@patternfly/react-core" ;
4
4
import { Link , useParams } from "react-router-dom" ;
5
- import { ArtifactMetaData } from "@models/artifactMetaData.model.ts" ;
6
5
import { PageDataLoader , PageError , PageErrorHandler , toPageError } from "@app/pages" ;
7
6
import {
8
7
ChangeOwnerModal ,
@@ -21,10 +20,8 @@ import {
21
20
ArtifactPageHeader ,
22
21
VersionsTabContent
23
22
} from "@app/pages/artifact/components" ;
24
- import { SearchedVersion } from "@models/searchedVersion.model.ts" ;
25
- import { CreateVersion } from "@models/createVersion.model.ts" ;
26
23
import { ApiError } from "@models/apiError.model.ts" ;
27
- import { Rule , RuleType } from "@sdk/lib/generated-client/models" ;
24
+ import { ArtifactMetaData , CreateVersion , Rule , RuleType , SearchedVersion } from "@sdk/lib/generated-client/models" ;
28
25
29
26
30
27
export type ArtifactPageProps = {
@@ -183,7 +180,7 @@ export const ArtifactPage: FunctionComponent<ArtifactPageProps> = () => {
183
180
const onViewVersion = ( version : SearchedVersion ) : void => {
184
181
const groupId : string = encodeURIComponent ( artifact ?. groupId || "default" ) ;
185
182
const artifactId : string = encodeURIComponent ( artifact ?. artifactId || "" ) ;
186
- const ver : string = encodeURIComponent ( version . version ) ;
183
+ const ver : string = encodeURIComponent ( version . version ! ) ;
187
184
appNavigation . navigateTo ( `/explore/${ groupId } /${ artifactId } /${ ver } ` ) ;
188
185
} ;
189
186
@@ -218,8 +215,8 @@ export const ArtifactPage: FunctionComponent<ArtifactPageProps> = () => {
218
215
219
216
groups . createArtifactVersion ( groupId as string , artifactId as string , data ) . then ( versionMetaData => {
220
217
const groupId : string = encodeURIComponent ( versionMetaData . groupId ? versionMetaData . groupId : "default" ) ;
221
- const artifactId : string = encodeURIComponent ( versionMetaData . artifactId ) ;
222
- const version : string = encodeURIComponent ( versionMetaData . version ) ;
218
+ const artifactId : string = encodeURIComponent ( versionMetaData . artifactId ! ) ;
219
+ const version : string = encodeURIComponent ( versionMetaData . version ! ) ;
223
220
const artifactVersionLocation : string = `/explore/${ groupId } /${ artifactId } /${ version } ` ;
224
221
logger . info ( "[ArtifactPage] Artifact version successfully created. Redirecting to details: " , artifactVersionLocation ) ;
225
222
pleaseWait ( false ) ;
0 commit comments