mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 05:19:39 +02:00
feat(oci): oci helm support [r8s-361] (#787)
This commit is contained in:
parent
b6a6ce9aaf
commit
2697d6c5d7
80 changed files with 4264 additions and 812 deletions
|
@ -1,4 +1,5 @@
|
|||
import _ from 'lodash';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import { Select } from '@@/form-components/ReactSelect';
|
||||
|
||||
|
@ -15,6 +16,7 @@ interface Props {
|
|||
dataCy: string;
|
||||
inputId?: string;
|
||||
placeholder?: string;
|
||||
allowSelectAll?: boolean;
|
||||
}
|
||||
|
||||
export function NamespacesSelector({
|
||||
|
@ -25,23 +27,34 @@ export function NamespacesSelector({
|
|||
dataCy,
|
||||
inputId,
|
||||
placeholder,
|
||||
allowSelectAll,
|
||||
}: Props) {
|
||||
const options = useMemo(() => {
|
||||
if (allowSelectAll) {
|
||||
return [{ id: 'all', name: 'Select all' }, ...namespaces];
|
||||
}
|
||||
return namespaces;
|
||||
}, [namespaces, allowSelectAll]);
|
||||
return (
|
||||
<Select
|
||||
name={name}
|
||||
isMulti
|
||||
getOptionLabel={(namespace) => namespace.name}
|
||||
getOptionValue={(namespace) => String(namespace.id)}
|
||||
options={namespaces}
|
||||
options={options}
|
||||
value={_.compact(
|
||||
value.map((namespaceName) =>
|
||||
namespaces.find((namespace) => namespace.name === namespaceName)
|
||||
)
|
||||
)}
|
||||
closeMenuOnSelect={false}
|
||||
onChange={(selectedTeams) =>
|
||||
onChange(selectedTeams.map((namespace) => namespace.name))
|
||||
}
|
||||
onChange={(selectedNamespaces) => {
|
||||
if (selectedNamespaces.some((namespace) => namespace.id === 'all')) {
|
||||
onChange(namespaces.map((namespace) => namespace.name));
|
||||
} else {
|
||||
onChange(selectedNamespaces.map((namespace) => namespace.name));
|
||||
}
|
||||
}}
|
||||
data-cy={dataCy}
|
||||
id={dataCy}
|
||||
inputId={inputId}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue