diff --git a/app/kubernetes/react/components/index.ts b/app/kubernetes/react/components/index.ts index 37934f126..2d8befbc7 100644 --- a/app/kubernetes/react/components/index.ts +++ b/app/kubernetes/react/components/index.ts @@ -76,7 +76,12 @@ export const ngModule = angular ) .component( 'createNamespaceRegistriesSelector', - r2a(RegistriesSelector, ['inputId', 'onChange', 'options', 'value']) + r2a(withUIRouter(withReactQuery(withCurrentUser(RegistriesSelector))), [ + 'inputId', + 'onChange', + 'options', + 'value', + ]) ) .component( 'kubeNodesDatatable', diff --git a/app/react/kubernetes/namespaces/components/RegistriesFormSection/RegistriesSelector.tsx b/app/react/kubernetes/namespaces/components/RegistriesFormSection/RegistriesSelector.tsx index 5e6c5697f..e06c26b83 100644 --- a/app/react/kubernetes/namespaces/components/RegistriesFormSection/RegistriesSelector.tsx +++ b/app/react/kubernetes/namespaces/components/RegistriesFormSection/RegistriesSelector.tsx @@ -1,8 +1,10 @@ import { MultiValue } from 'react-select'; import { Registry } from '@/react/portainer/registries/types'; +import { useCurrentUser } from '@/react/hooks/useUser'; import { Select } from '@@/form-components/ReactSelect'; +import { Link } from '@@/Link'; interface Props { value: MultiValue; @@ -17,18 +19,40 @@ export function RegistriesSelector({ options, inputId, }: Props) { + const { isAdmin } = useCurrentUser(); + return ( - option.Name} + getOptionValue={(option) => String(option.Id)} + options={options} + value={value} + closeMenuOnSelect={false} + onChange={onChange} + inputId={inputId} + data-cy="namespaceCreate-registrySelect" + placeholder="Select one or more registries" + /> + ); }