diff --git a/CHANGES/2232.fix b/CHANGES/2232.fix new file mode 100644 index 0000000000..28e78607d9 --- /dev/null +++ b/CHANGES/2232.fix @@ -0,0 +1 @@ +RepoSelector: make it clear the selector is read only now diff --git a/src/components/headers/collection-header.tsx b/src/components/headers/collection-header.tsx index 43fbcede72..e5e210de2b 100644 --- a/src/components/headers/collection-header.tsx +++ b/src/components/headers/collection-header.tsx @@ -415,10 +415,7 @@ export class CollectionHeader extends React.Component { ) } contextSelector={ - + } breadcrumbs={} versionControl={ diff --git a/src/components/repo-selector/repo-selector.scss b/src/components/repo-selector/repo-selector.scss deleted file mode 100644 index b1c507c233..0000000000 --- a/src/components/repo-selector/repo-selector.scss +++ /dev/null @@ -1,3 +0,0 @@ -.hub-input-group-text-no-wrap { - white-space: nowrap; -} diff --git a/src/components/repo-selector/repo-selector.tsx b/src/components/repo-selector/repo-selector.tsx index 7a472658d0..8d47905ccc 100644 --- a/src/components/repo-selector/repo-selector.tsx +++ b/src/components/repo-selector/repo-selector.tsx @@ -1,86 +1,44 @@ -import { i18n } from '@lingui/core'; import { t } from '@lingui/macro'; import { Flex, FlexItem, InputGroup, InputGroupText, - Select, - SelectOption, } from '@patternfly/react-core'; -import React, { useState } from 'react'; -import { useNavigate } from 'react-router-dom'; -import { Constants } from 'src/constants'; -import { Paths, formatPath } from 'src/paths'; -import './repo-selector.scss'; +import React from 'react'; interface IProps { selectedRepo: string; - // Path of the component that's using the component. This is required so that - // the url for the repo can be updated correctly. - path?: Paths; - pathParams?: Record; - isDisabled?: boolean; } -export const RepoSelector = ({ - selectedRepo, - path, - pathParams, - isDisabled, -}: IProps) => { - const [selectExpanded, setSelectExpanded] = useState(false); - const navigate = useNavigate(); - - const getRepoName = (repoName) => { - const repo = Constants.REPOSITORYNAMES[repoName]; - return repo ? i18n._(repo) : repoName; - }; - - const repoNames = Constants.REPOSITORYNAMES; +export const RepoSelector = ({ selectedRepo }: IProps) => { + const repoName = + { + community: t`Community`, + published: t`Published`, + rejected: t`Rejected`, + 'rh-certified': t`Red Hat Certified`, + staging: t`Staging`, + validated: t`Validated`, + }[selectedRepo] || selectedRepo; return ( - + {t`Repository`} - + {repoName} + diff --git a/src/constants.tsx b/src/constants.tsx index 5c796741a3..4695dbb34b 100644 --- a/src/constants.tsx +++ b/src/constants.tsx @@ -28,13 +28,6 @@ export class Constants { 'galaxy.add_group', ]; - static REPOSITORYNAMES = { - published: defineMessage({ message: `Published` }), - 'rh-certified': defineMessage({ message: `Red Hat Certified` }), - community: defineMessage({ message: `Community` }), - validated: defineMessage({ message: `Validated` }), - }; - static PROTECTED_REPOSITORIES = [ 'rh-certified', 'validated',