From df9c03051b8c3be62bbbc4118090c61bb05a0a7a Mon Sep 17 00:00:00 2001 From: Shaiah Emigh-Doyle Date: Thu, 13 Jul 2023 14:48:00 -0400 Subject: [PATCH] fix HubNamespace type --- frontend/hub/namespaces/HubNamespace.tsx | 19 +------------------ .../hub/namespaces/HubNamespaceDetails.tsx | 9 +++------ frontend/hub/namespaces/HubNamespaceForm.tsx | 6 +++--- 3 files changed, 7 insertions(+), 27 deletions(-) diff --git a/frontend/hub/namespaces/HubNamespace.tsx b/frontend/hub/namespaces/HubNamespace.tsx index d0d0215a7e..1eccf3abbf 100644 --- a/frontend/hub/namespaces/HubNamespace.tsx +++ b/frontend/hub/namespaces/HubNamespace.tsx @@ -14,31 +14,14 @@ export interface LatestMetadataType { avatar_sha256: string | null; avatar_url: string | null; metadata_sha256: string; - groups: string[]; task: string | null; + groups: string[]; } export interface HubNamespace { pulp_href: string; pulp_created: string; - id: number; name: string; - company: string; - email: string; - avatar_url: string; - description: string; - num_collections: number; - groups: [ - { - id: number; - name: string; - object_permissions: string[]; - pulp_href?: string; - } - ]; - resources: string; - owners: string[]; - links: LinksType[]; my_permissions: string[]; latest_metadata: LatestMetadataType; } diff --git a/frontend/hub/namespaces/HubNamespaceDetails.tsx b/frontend/hub/namespaces/HubNamespaceDetails.tsx index 7fd1522518..dabf5ea7d7 100644 --- a/frontend/hub/namespaces/HubNamespaceDetails.tsx +++ b/frontend/hub/namespaces/HubNamespaceDetails.tsx @@ -22,7 +22,7 @@ import { useCollectionsActions } from '../collections/hooks/useCollectionsAction import { useCollectionColumns } from '../collections/hooks/useCollectionColumns'; import { useCollectionActions } from '../collections/hooks/useCollectionActions'; import { CollectionVersionSearch } from '../collections/CollectionVersionSearch'; -import { hubAPI } from '../api'; +import { hubAPI, idKeyFn } from '../api'; import { DropdownPosition } from '@patternfly/react-core'; @@ -74,12 +74,9 @@ function CollectionsTab(props: { namespace?: HubNamespace }) { const toolbarFilters = useCollectionFilters(); const tableColumns = useCollectionColumns(); const view = useHubView({ - url: hubAPI`/v3/plugin/ansible/search/collection-versions/`, - keyFn: (item) => item.collection_version.pulp_href + ':' + item.repository.name, - toolbarFilters, + url: hubAPI`/_ui/v1/repo/published/`, + keyFn: idKeyFn, tableColumns, - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore queryParams: { namespace: props?.namespace?.name }, }); const toolbarActions = useCollectionsActions(view.unselectItemsAndRefresh); diff --git a/frontend/hub/namespaces/HubNamespaceForm.tsx b/frontend/hub/namespaces/HubNamespaceForm.tsx index a347371bbb..c993dadcfb 100644 --- a/frontend/hub/namespaces/HubNamespaceForm.tsx +++ b/frontend/hub/namespaces/HubNamespaceForm.tsx @@ -101,17 +101,17 @@ function HubNamespaceInputs() { isRequired /> - name="description" + name="latest_metadata.description" label={t('Description')} placeholder={t('Enter description')} /> - name="company" + name="latest_metadata.company" label={t('Company')} placeholder={t('Enter company')} /> - name="avatar_url" + name="latest_metadata.avatar_url" label={t('Logo URL')} placeholder={t('Enter logo URL')} />