Skip to content

Commit

Permalink
fix HubNamespace type
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaiahWren committed Jul 17, 2023
1 parent 3cf288a commit df9c030
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 27 deletions.
19 changes: 1 addition & 18 deletions frontend/hub/namespaces/HubNamespace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
9 changes: 3 additions & 6 deletions frontend/hub/namespaces/HubNamespaceDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -74,12 +74,9 @@ function CollectionsTab(props: { namespace?: HubNamespace }) {
const toolbarFilters = useCollectionFilters();
const tableColumns = useCollectionColumns();
const view = useHubView<CollectionVersionSearch>({
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);
Expand Down
6 changes: 3 additions & 3 deletions frontend/hub/namespaces/HubNamespaceForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,17 @@ function HubNamespaceInputs() {
isRequired
/>
<PageFormTextInput<HubNamespace>
name="description"
name="latest_metadata.description"
label={t('Description')}
placeholder={t('Enter description')}
/>
<PageFormTextInput<HubNamespace>
name="company"
name="latest_metadata.company"
label={t('Company')}
placeholder={t('Enter company')}
/>
<PageFormTextInput<HubNamespace>
name="avatar_url"
name="latest_metadata.avatar_url"
label={t('Logo URL')}
placeholder={t('Enter logo URL')}
/>
Expand Down

0 comments on commit df9c030

Please sign in to comment.