From 2672d09202fbf3706c57c474ef278e9e616504a7 Mon Sep 17 00:00:00 2001 From: Jari Kolehmainen Date: Fri, 27 Nov 2020 15:58:33 +0200 Subject: [PATCH] tweak Signed-off-by: Jari Kolehmainen --- src/extensions/stores/cluster-store.ts | 24 ++++++++++++++---------- src/extensions/stores/workspace-store.ts | 9 +++++++-- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/extensions/stores/cluster-store.ts b/src/extensions/stores/cluster-store.ts index 5c9e524671..60c409b525 100644 --- a/src/extensions/stores/cluster-store.ts +++ b/src/extensions/stores/cluster-store.ts @@ -2,6 +2,7 @@ import { clusterStore as internalClusterStore, ClusterId } from "../../common/cl import type { ClusterModel } from "../../common/cluster-store"; import { Cluster } from "../../main/cluster"; import { Singleton } from "../core-api/utils"; +import { ObservableMap } from "mobx"; export { Cluster } from "../../main/cluster"; export type { ClusterModel, ClusterId } from "../../common/cluster-store"; @@ -14,12 +15,23 @@ export class ClusterStore extends Singleton { /** * Active cluster id */ - activeClusterId = internalClusterStore.activeCluster; + get activeClusterId(): string { + return internalClusterStore.activeCluster; + } + + /** + * Set active cluster id + */ + set activeClusterId(id : ClusterId) { + internalClusterStore.activeCluster = id; + } /** * Map of all clusters */ - clusters = internalClusterStore.clusters; + get clusters(): ObservableMap { + return internalClusterStore.clusters; + } /** * Get active cluster (a cluster which is currently visible) @@ -52,14 +64,6 @@ export class ClusterStore extends Singleton { return internalClusterStore.connectedClustersList; } - isActive(id: ClusterId) { - return internalClusterStore.isActive(id); - } - - setActive(id: ClusterId) { - return internalClusterStore.setActive(id); - } - /** * Get cluster object by cluster id * @param id cluster id diff --git a/src/extensions/stores/workspace-store.ts b/src/extensions/stores/workspace-store.ts index f23d9034ac..f8ad49fec1 100644 --- a/src/extensions/stores/workspace-store.ts +++ b/src/extensions/stores/workspace-store.ts @@ -1,5 +1,6 @@ import { Singleton } from "../core-api/utils"; import { workspaceStore as internalWorkspaceStore, WorkspaceStore as InternalWorkspaceStore, Workspace, WorkspaceId } from "../../common/workspace-store"; +import { ObservableMap } from "mobx"; export { Workspace } from "../../common/workspace-store"; export type { WorkspaceId, WorkspaceModel } from "../../common/workspace-store"; @@ -16,12 +17,16 @@ export class WorkspaceStore extends Singleton { /** * Currently active workspace id */ - currentWorkspaceId = internalWorkspaceStore.currentWorkspaceId; + get currentWorkspaceId(): string { + return internalWorkspaceStore.currentWorkspaceId; + } /** * Map of all workspaces */ - workspaces = internalWorkspaceStore.workspaces; + get workspaces(): ObservableMap { + return internalWorkspaceStore.workspaces; + } /** * Currently active workspace