Skip to content

Commit

Permalink
'
Browse files Browse the repository at this point in the history
'
  • Loading branch information
YuliaKrimerman committed Aug 16, 2024
1 parent 24fdd2e commit e98646d
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 10 deletions.
3 changes: 0 additions & 3 deletions frontend/src/__mocks__/mockRegisteredModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { createModelRegistryLabelsObject } from './utils';
type MockRegisteredModelType = {
id?: string;
name?: string;
author?: string;
owner?: string;
state?: ModelState;
description?: string;
Expand All @@ -13,7 +12,6 @@ type MockRegisteredModelType = {

export const mockRegisteredModel = ({
name = 'test',
author = 'Author 1',
owner = 'Author 1',
state = ModelState.LIVE,
description = '',
Expand All @@ -27,7 +25,6 @@ export const mockRegisteredModel = ({
lastUpdateTimeSinceEpoch: '1710404288975',
name,
state,
author,
owner,
customProperties: createModelRegistryLabelsObject(labels),
});
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ const initIntercepts = ({
],
}),
],
modelVersions = [mockModelVersion({ name: 'model version' })],
modelVersions = [
mockModelVersion({ author: 'Author 1' }),
mockModelVersion({ name: 'model version' }),
],
allowed = true,
}: HandlersProps) => {
cy.interceptOdh(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ describe('Restoring archive model', () => {
description: '',
externalID: '1234132asdfasdf',
state: 'LIVE',
owner: 'Author 1',
});
});
});
Expand Down Expand Up @@ -200,6 +201,7 @@ describe('Restoring archive model', () => {
description: '',
externalID: '1234132asdfasdf',
state: 'LIVE',
owner: 'Author 1',
});
});
});
Expand Down Expand Up @@ -233,6 +235,7 @@ describe('Archiving model', () => {
description: '',
externalID: '1234132asdfasdf',
state: 'ARCHIVED',
owner: 'Author 1',
});
});
});
Expand Down Expand Up @@ -266,6 +269,7 @@ describe('Archiving model', () => {
description: '',
externalID: '1234132asdfasdf',
state: 'ARCHIVED',
owner: 'Author 1',
});
});
});
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/concepts/modelRegistry/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ export type ModelRegistryBase = {
id: string;
name: string;
externalID?: string;
author?: string;
owner?: string;
description?: string;
createTimeSinceEpoch?: string;
lastUpdateTimeSinceEpoch: string;
Expand All @@ -96,6 +94,7 @@ export type ModelRegistryBase = {
export type ModelArtifact = ModelRegistryBase & {
uri?: string;
state?: ModelArtifactState;
author?: string;
modelFormatName?: string;
storageKey?: string;
storagePath?: string;
Expand All @@ -106,11 +105,13 @@ export type ModelArtifact = ModelRegistryBase & {

export type ModelVersion = ModelRegistryBase & {
state?: ModelState;
author?: string;
registeredModelId: string;
};

export type RegisteredModel = ModelRegistryBase & {
state?: ModelState;
owner?: string;
};

export type InferenceService = ModelRegistryBase & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const ModelDetailsView: React.FC<ModelDetailsViewProps> = ({ registeredModel: rm
</ClipboardCopy>
</DashboardDescriptionListGroup>
<DashboardDescriptionListGroup title="Owner">
<Text data-testid="registered-model-owner">{rm.author || '-'}</Text>
<Text data-testid="registered-model-owner">{rm.owner || '-'}</Text>
</DashboardDescriptionListGroup>
<DashboardDescriptionListGroup
title="Last modified at"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const registerModel = async (
name: formData.modelName,
description: formData.modelDescription,
customProperties: {},
author,
owner: author,
state: ModelState.LIVE,
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ describe('getPatchBody', () => {
it('returns a given RegisteredModel with id/name/timestamps removed, customProperties updated and other values unchanged', () => {
const registeredModel = mockRegisteredModel({
id: '1',
author: 'Author 1',
owner: 'Author 1',
name: 'test-model',
description: 'Description here',
Expand All @@ -288,7 +287,6 @@ describe('getPatchBody', () => {
);
expect(result).toEqual({
description: 'Description here',
author: 'Author 1',
customProperties: {
label1: { string_value: '', metadataType: ModelRegistryMetadataType.STRING },
},
Expand Down

0 comments on commit e98646d

Please sign in to comment.