mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
addressed some review comments
Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
This commit is contained in:
1 parent
0058e9f0e2
commit
6d63c39b11
9 files changed
+80
-109
No files matched your search
@@ -22,7 +22,7 @@
|
||||
import "./port-forward-dialog.scss";
|
||||
|
||||
import React, { Component } from "react";
|
||||
import { computed, observable, makeObservable } from "mobx";
|
||||
import { observable, makeObservable } from "mobx";
|
||||
import { observer } from "mobx-react";
|
||||
import { Dialog, DialogProps } from "../components/dialog";
|
||||
import { Wizard, WizardStep } from "../components/wizard";
|
||||
@@ -30,12 +30,16 @@ import { Input } from "../components/input";
|
||||
import { Notifications } from "../components/notifications";
|
||||
import { cssNames } from "../utils";
|
||||
import { addPortForward, modifyPortForward } from "./port-forward.store";
|
||||
import type { ForwardedPort } from "./port-forward.store";
|
||||
import type { ForwardedPort } from "./port-forward-item";
|
||||
import { openPortForward } from ".";
|
||||
|
||||
interface Props extends Partial<DialogProps> {
|
||||
}
|
||||
|
||||
interface PortForwardDialogOpenOptions {
|
||||
openInBrowser: boolean
|
||||
}
|
||||
|
||||
const dialogState = observable.object({
|
||||
isOpen: false,
|
||||
data: null as ForwardedPort,
|
||||
@@ -53,10 +57,10 @@ export class PortForwardDialog extends Component<Props> {
|
||||
makeObservable(this);
|
||||
}
|
||||
|
||||
static open(portForward: ForwardedPort, openInBrowser = false) {
|
||||
static open(portForward: ForwardedPort, options : PortForwardDialogOpenOptions = { openInBrowser: false }) {
|
||||
dialogState.isOpen = true;
|
||||
dialogState.data = portForward;
|
||||
dialogState.openInBrowser = openInBrowser;
|
||||
dialogState.openInBrowser = options.openInBrowser;
|
||||
}
|
||||
|
||||
static close() {
|
||||
@@ -71,15 +75,6 @@ export class PortForwardDialog extends Component<Props> {
|
||||
PortForwardDialog.close();
|
||||
};
|
||||
|
||||
@computed get scaleMax() {
|
||||
const { currentPort } = this;
|
||||
const defaultMax = 50;
|
||||
|
||||
return currentPort <= defaultMax
|
||||
? defaultMax * 2
|
||||
: currentPort * 2;
|
||||
}
|
||||
|
||||
onOpen = async () => {
|
||||
const { portForward } = this;
|
||||
|
||||
|
||||
Reference in new issue
Block a user