From cb1307907764397e9f6b31a4a2da99c6f5460f04 Mon Sep 17 00:00:00 2001 From: Alex Andreev Date: Wed, 18 Nov 2020 16:11:07 +0300 Subject: [PATCH] Activate clusters from workspaces page Signed-off-by: Alex Andreev --- src/renderer/components/+workspaces/workspaces.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/+workspaces/workspaces.tsx b/src/renderer/components/+workspaces/workspaces.tsx index 4442a772e8..a482c78a95 100644 --- a/src/renderer/components/+workspaces/workspaces.tsx +++ b/src/renderer/components/+workspaces/workspaces.tsx @@ -13,6 +13,7 @@ import { Input } from "../input"; import { cssNames, prevDefault } from "../../utils"; import { Button } from "../button"; import { isRequired, InputValidator } from "../input/input_validators"; +import { clusterStore } from "../../../common/cluster-store"; @observer export class Workspaces extends React.Component { @@ -70,6 +71,12 @@ export class Workspaces extends React.Component { this.editingWorkspaces.set(id, toJS(workspace)); } + activateWorkspace = (id: WorkspaceId) => { + const clusterId = workspaceStore.getById(id).lastActiveClusterId; + workspaceStore.setActive(id); + clusterStore.setActive(clusterId); + } + clearEditing = (id: WorkspaceId) => { this.editingWorkspaces.delete(id); } @@ -135,7 +142,7 @@ export class Workspaces extends React.Component { {!isEditing && ( - workspaceStore.setActive(workspaceId))}>{name} + this.activateWorkspace(workspaceId))}>{name} {isActive && (current)} {description}