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:
parent
31544a386a
commit
413fa8a815
@ -46,7 +46,6 @@ utils.describeIf(minikubeReady(TEST_NAMESPACE))("Minikube based tests", () => {
|
||||
|
||||
it(
|
||||
"should navigate around common cluster pages",
|
||||
|
||||
async () => {
|
||||
const scenariosByParent = pipeline(
|
||||
scenarios,
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
import type { Cluster } from "../cluster/cluster";
|
||||
|
||||
export interface ClusterContext {
|
||||
cluster?: Cluster;
|
||||
cluster: Cluster;
|
||||
allNamespaces: string[]; // available / allowed namespaces from cluster.ts
|
||||
contextNamespaces: string[]; // selected by user (see: namespace-select.tsx)
|
||||
hasSelectedAll: boolean;
|
||||
|
||||
@ -114,7 +114,7 @@ export class NamespaceStore extends KubeObjectStore<Namespace, NamespaceApi> {
|
||||
* 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
|
||||
*/
|
||||
if (!this.context?.cluster?.accessibleNamespaces.length) {
|
||||
if (this.context.cluster.accessibleNamespaces.length > 0) {
|
||||
return noop;
|
||||
}
|
||||
|
||||
|
||||
@ -103,11 +103,9 @@ class NonInjectedKubeObjectMenu<TKubeObject extends KubeObject, Props extends Ku
|
||||
}
|
||||
|
||||
render() {
|
||||
const { remove, update, renderRemoveMessage, isEditable, isRemovable, store } = this;
|
||||
const { remove, update, renderRemoveMessage, isEditable, isRemovable } = this;
|
||||
const { className, editable, removable, object, ...menuProps } = this.props;
|
||||
|
||||
console.log(object, store);
|
||||
|
||||
return (
|
||||
<MenuActions
|
||||
className={cssNames("KubeObjectMenu", className)}
|
||||
|
||||
@ -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.
|
||||
//we'll debounce it to ensure it isn't
|
||||
submit = debounce(() => {
|
||||
if (this.form?.noValidate && this.form.checkValidity()) {
|
||||
if (!this.form) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.form.noValidate || this.form.checkValidity()) {
|
||||
this.next();
|
||||
}
|
||||
}, 100);
|
||||
@ -246,7 +250,6 @@ export class WizardStep<D> extends React.Component<WizardStepProps<D>, WizardSte
|
||||
hidden={hideNextBtn}
|
||||
waiting={waiting ?? this.state.waiting}
|
||||
disabled={disabledNext}
|
||||
onClick={this.next}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@ -77,7 +77,7 @@ export interface SubscribableStore {
|
||||
readonly apiBase: string;
|
||||
readonly kind: string;
|
||||
};
|
||||
loadAll(opts?: KubeObjectStoreLoadAllParams): Promise<any>;
|
||||
loadAll(opts?: KubeObjectStoreLoadAllParams): Promise<unknown>;
|
||||
subscribe(opts?: KubeObjectStoreSubscribeParams): Disposer;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user