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(
|
it(
|
||||||
"should navigate around common cluster pages",
|
"should navigate around common cluster pages",
|
||||||
|
|
||||||
async () => {
|
async () => {
|
||||||
const scenariosByParent = pipeline(
|
const scenariosByParent = pipeline(
|
||||||
scenarios,
|
scenarios,
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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)}
|
||||||
|
|||||||
@ -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>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user