1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Proper fix for Wizard, fix NamespaceStore.subscribe

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-04-25 13:54:53 -04:00
parent 31544a386a
commit 413fa8a815
6 changed files with 9 additions and 9 deletions

View File

@ -46,7 +46,6 @@ utils.describeIf(minikubeReady(TEST_NAMESPACE))("Minikube based tests", () => {
it( it(
"should navigate around common cluster pages", "should navigate around common cluster pages",
async () => { async () => {
const scenariosByParent = pipeline( const scenariosByParent = pipeline(
scenarios, scenarios,

View File

@ -6,7 +6,7 @@
import type { Cluster } from "../cluster/cluster"; import type { Cluster } from "../cluster/cluster";
export interface ClusterContext { export interface ClusterContext {
cluster?: Cluster; cluster: Cluster;
allNamespaces: string[]; // available / allowed namespaces from cluster.ts allNamespaces: string[]; // available / allowed namespaces from cluster.ts
contextNamespaces: string[]; // selected by user (see: namespace-select.tsx) contextNamespaces: string[]; // selected by user (see: namespace-select.tsx)
hasSelectedAll: boolean; hasSelectedAll: boolean;

View File

@ -114,7 +114,7 @@ export class NamespaceStore extends KubeObjectStore<Namespace, NamespaceApi> {
* if user has given static list of namespaces let's not start watches * if user has given static list of namespaces let's not start watches
* because watch adds stuff that's not wanted or will just fail * because watch adds stuff that's not wanted or will just fail
*/ */
if (!this.context?.cluster?.accessibleNamespaces.length) { if (this.context.cluster.accessibleNamespaces.length > 0) {
return noop; return noop;
} }

View File

@ -103,11 +103,9 @@ class NonInjectedKubeObjectMenu<TKubeObject extends KubeObject, Props extends Ku
} }
render() { render() {
const { remove, update, renderRemoveMessage, isEditable, isRemovable, store } = this; const { remove, update, renderRemoveMessage, isEditable, isRemovable } = this;
const { className, editable, removable, object, ...menuProps } = this.props; const { className, editable, removable, object, ...menuProps } = this.props;
console.log(object, store);
return ( return (
<MenuActions <MenuActions
className={cssNames("KubeObjectMenu", className)} className={cssNames("KubeObjectMenu", className)}

View File

@ -181,7 +181,11 @@ export class WizardStep<D> extends React.Component<WizardStepProps<D>, WizardSte
//because submit MIGHT be called through pressing enter, it might be fired twice. //because submit MIGHT be called through pressing enter, it might be fired twice.
//we'll debounce it to ensure it isn't //we'll debounce it to ensure it isn't
submit = debounce(() => { submit = debounce(() => {
if (this.form?.noValidate && this.form.checkValidity()) { if (!this.form) {
return;
}
if (this.form.noValidate || this.form.checkValidity()) {
this.next(); this.next();
} }
}, 100); }, 100);
@ -246,7 +250,6 @@ export class WizardStep<D> extends React.Component<WizardStepProps<D>, WizardSte
hidden={hideNextBtn} hidden={hideNextBtn}
waiting={waiting ?? this.state.waiting} waiting={waiting ?? this.state.waiting}
disabled={disabledNext} disabled={disabledNext}
onClick={this.next}
/> />
</div> </div>
)} )}

View File

@ -77,7 +77,7 @@ export interface SubscribableStore {
readonly apiBase: string; readonly apiBase: string;
readonly kind: string; readonly kind: string;
}; };
loadAll(opts?: KubeObjectStoreLoadAllParams): Promise<any>; loadAll(opts?: KubeObjectStoreLoadAllParams): Promise<unknown>;
subscribe(opts?: KubeObjectStoreSubscribeParams): Disposer; subscribe(opts?: KubeObjectStoreSubscribeParams): Disposer;
} }