mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
workspace edit fixes
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
089d928cb3
commit
28c8946324
@ -1,6 +1,6 @@
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { workspaceStore } from "../../../common/workspace-store";
|
||||
import { WorkspaceStore, workspaceStore } from "../../../common/workspace-store";
|
||||
import { commandRegistry } from "../../../extensions/registries/command-registry";
|
||||
import { Input, InputValidator } from "../input";
|
||||
import { CommandOverlay } from "../command-palette/command-container";
|
||||
@ -75,7 +75,8 @@ export class EditWorkspace extends React.Component<{}, EditWorkspaceState> {
|
||||
|
||||
commandRegistry.add({
|
||||
id: "workspace.editCurrentWorkspace",
|
||||
title: "Workspace: Edit current workspace...",
|
||||
title: "Workspace: Edit current workspace ...",
|
||||
scope: "global",
|
||||
action: () => CommandOverlay.open(<EditWorkspace />)
|
||||
action: () => CommandOverlay.open(<EditWorkspace />),
|
||||
isActive: (context) => context.workspace?.id !== WorkspaceStore.defaultId
|
||||
});
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { computed} from "mobx";
|
||||
import { workspaceStore } from "../../../common/workspace-store";
|
||||
import { WorkspaceStore, workspaceStore } from "../../../common/workspace-store";
|
||||
import { commandRegistry } from "../../../extensions/registries/command-registry";
|
||||
import { Select } from "../select";
|
||||
import { navigate } from "../../navigation";
|
||||
@ -25,6 +25,10 @@ export class ChooseWorkspace extends React.Component {
|
||||
|
||||
if (options.length > 1) {
|
||||
options.push({ value: ChooseWorkspace.removeActionId, label: "Remove workspace ..." });
|
||||
|
||||
if (workspaceStore.currentWorkspace.id !== WorkspaceStore.defaultId) {
|
||||
options.push({ value: ChooseWorkspace.editActionId, label: "Edit current workspace ..." });
|
||||
}
|
||||
}
|
||||
|
||||
return options;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user