mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
proper select-all option for NamespaceSelect (#2084)
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
1 parent
ad6de71826
commit
b514e5c833
3 files changed
+22
-5
No files matched your search
@@ -85,10 +85,9 @@ export class NamespaceSelectFilter extends React.Component {
|
||||
const namespaces = namespaceStore.getContextNamespaces();
|
||||
|
||||
switch (namespaces.length) {
|
||||
case 0:
|
||||
case namespaceStore.allowedNamespaces.length:
|
||||
return <>All namespaces</>;
|
||||
case 0:
|
||||
return <>Select a namespace</>;
|
||||
case 1:
|
||||
return <>Namespace: {namespaces[0]}</>;
|
||||
default:
|
||||
@@ -116,7 +115,7 @@ export class NamespaceSelectFilter extends React.Component {
|
||||
if (namespace) {
|
||||
namespaceStore.toggleContext(namespace);
|
||||
} else {
|
||||
namespaceStore.toggleAll(); // "All namespaces" option clicked
|
||||
namespaceStore.resetContext(); // "All namespaces" clicked, empty list considered as "all"
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user