Skip to content

Commit 5c8fa6e

Browse files
committed
Fix UI regression with editing metadata.
1 parent 4e31a72 commit 5c8fa6e

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

ui/ui-app/src/app/pages/artifactVersion/ArtifactVersionPage.tsx

+13-12
Original file line numberDiff line numberDiff line change
@@ -220,16 +220,16 @@ export const ArtifactVersionPage: FunctionComponent<ArtifactVersionPageProps> =
220220
return artifact?.type || "";
221221
};
222222

223-
const artifactName = (): string => {
224-
return artifact?.name || "";
223+
const versionName = (): string => {
224+
return artifactVersion?.name || "";
225225
};
226226

227-
const artifactDescription = (): string => {
228-
return artifact?.description || "";
227+
const versionDescription = (): string => {
228+
return artifactVersion?.description || "";
229229
};
230230

231-
const artifactLabels = (): { [key: string]: string } => {
232-
return artifact?.labels || {};
231+
const versionLabels = (): { [key: string]: string } => {
232+
return artifactVersion?.labels || {};
233233
};
234234

235235
const onUploadFormValid = (isValid: boolean): void => {
@@ -303,10 +303,10 @@ export const ArtifactVersionPage: FunctionComponent<ArtifactVersionPageProps> =
303303
const doEditMetaData = (metaData: EditableMetaData): void => {
304304
groups.updateArtifactVersionMetaData(groupId as string, artifactId as string, version as string, metaData).then( () => {
305305
if (artifact) {
306-
setArtifact({
307-
...artifact,
306+
setArtifactVersion({
307+
...artifactVersion,
308308
...metaData
309-
} as ArtifactMetaData);
309+
} as VersionMetaData);
310310
}
311311
}).catch( error => {
312312
setPageError(toPageError(error, "Error editing artifact metadata."));
@@ -447,9 +447,10 @@ export const ArtifactVersionPage: FunctionComponent<ArtifactVersionPageProps> =
447447
>
448448
<p>Do you want to delete this artifact and all of its versions? This action cannot be undone.</p>
449449
</Modal>
450-
<EditMetaDataModal name={artifactName()}
451-
description={artifactDescription()}
452-
labels={artifactLabels()}
450+
<EditMetaDataModal
451+
name={versionName()}
452+
description={versionDescription()}
453+
labels={versionLabels()}
453454
isOpen={isEditModalOpen}
454455
onClose={onEditModalClose}
455456
onEditMetaData={doEditMetaData}

0 commit comments

Comments
 (0)