mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
ensure namespace placeholder reflects what will be saved to local storage (#4176)
This commit is contained in:
parent
860f6e2e6d
commit
8cbb4c29d5
@ -37,15 +37,15 @@ const Placeholder = observer((props: PlaceholderProps<any, boolean>) => {
|
|||||||
const getPlaceholder = (): React.ReactNode => {
|
const getPlaceholder = (): React.ReactNode => {
|
||||||
const namespaces = namespaceStore.contextNamespaces;
|
const namespaces = namespaceStore.contextNamespaces;
|
||||||
|
|
||||||
switch (namespaces.length) {
|
if (!namespaceStore.selectedNamespaces.length || !namespaces.length) {
|
||||||
case 0:
|
|
||||||
case namespaceStore.allowedNamespaces.length:
|
|
||||||
return <>All namespaces</>;
|
return <>All namespaces</>;
|
||||||
case 1:
|
|
||||||
return <>Namespace: {namespaces[0]}</>;
|
|
||||||
default:
|
|
||||||
return <>Namespaces: {namespaces.join(", ")}</>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (namespaces.length === 1) {
|
||||||
|
return <>Namespace: {namespaces[0]}</>;
|
||||||
|
}
|
||||||
|
|
||||||
|
return <>Namespaces: {namespaces.join(", ")}</>;
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -101,9 +101,9 @@ export class NamespaceSelectFilter extends React.Component<SelectProps> {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex gaps align-center">
|
<div className="flex gaps align-center">
|
||||||
<Icon small material="layers"/>
|
<Icon small material="layers" />
|
||||||
<span>{namespace}</span>
|
<span>{namespace}</span>
|
||||||
{isSelected && <Icon small material="check" className="box right"/>}
|
{isSelected && <Icon small material="check" className="box right" />}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user