mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
fixes based on code review
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
debdabb617
commit
d12ff4c10d
@ -18,7 +18,7 @@ export async function requestMain(channel: string, ...args: any[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getSubFrames(): ClusterFrameInfo[] {
|
function getSubFrames(): ClusterFrameInfo[] {
|
||||||
return Array.from(clusterFrameMap.values());
|
return toJS(Array.from(clusterFrameMap.values()));
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function broadcastMessage(channel: string, ...args: any[]) {
|
export async function broadcastMessage(channel: string, ...args: any[]) {
|
||||||
@ -80,6 +80,6 @@ export function unsubscribeAllFromBroadcast(channel: string) {
|
|||||||
|
|
||||||
export function bindBroadcastHandlers() {
|
export function bindBroadcastHandlers() {
|
||||||
handleRequest(subFramesChannel, async () => {
|
handleRequest(subFramesChannel, async () => {
|
||||||
return toJS(await getSubFrames(), { recurseEverything: true });
|
return await getSubFrames(), { recurseEverything: true };
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,7 +16,7 @@ const uniqueWorkspaceName: InputValidator = {
|
|||||||
@observer
|
@observer
|
||||||
export class AddWorkspace extends React.Component {
|
export class AddWorkspace extends React.Component {
|
||||||
onSubmit(name: string) {
|
onSubmit(name: string) {
|
||||||
if (name.trim() === "") {
|
if (!name.trim()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const workspace = workspaceStore.addWorkspace(new Workspace({
|
const workspace = workspaceStore.addWorkspace(new Workspace({
|
||||||
|
|||||||
@ -30,7 +30,7 @@ export class CommandOverlay {
|
|||||||
|
|
||||||
@observer
|
@observer
|
||||||
export class CommandContainer extends React.Component<{cluster?: Cluster}> {
|
export class CommandContainer extends React.Component<{cluster?: Cluster}> {
|
||||||
@observable commandComponent: React.ReactElement;
|
@observable.ref commandComponent: React.ReactElement;
|
||||||
|
|
||||||
private escHandler(event: KeyboardEvent) {
|
private escHandler(event: KeyboardEvent) {
|
||||||
if (event.key === "Escape") {
|
if (event.key === "Escape") {
|
||||||
@ -55,14 +55,6 @@ export class CommandContainer extends React.Component<{cluster?: Cluster}> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onClusterAction(commandId: string) {
|
|
||||||
const command = this.findCommandById(commandId);
|
|
||||||
|
|
||||||
if (command) {
|
|
||||||
this.runCommand(command);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
if (this.props.cluster) {
|
if (this.props.cluster) {
|
||||||
subscribeToBroadcast(`command-palette:run-action:${this.props.cluster.id}`, (event, commandId: string) => {
|
subscribeToBroadcast(`command-palette:run-action:${this.props.cluster.id}`, (event, commandId: string) => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user