mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Use @typescript-eslint/semi.
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
1 parent
0b182ccf6f
commit
460dfe4d2b
179 files changed
+556
-554
No files matched your search
@@ -22,7 +22,7 @@ interface Props {
|
||||
|
||||
@observer
|
||||
export class CreateResource extends React.Component<Props> {
|
||||
@observable error = ""
|
||||
@observable error = "";
|
||||
|
||||
get tabId() {
|
||||
return this.props.tab.id;
|
||||
@@ -35,7 +35,7 @@ export class CreateResource extends React.Component<Props> {
|
||||
onChange = (value: string, error?: string) => {
|
||||
createResourceStore.setData(this.tabId, value);
|
||||
this.error = error;
|
||||
}
|
||||
};
|
||||
|
||||
create = async () => {
|
||||
if (this.error) return;
|
||||
@@ -63,7 +63,7 @@ export class CreateResource extends React.Component<Props> {
|
||||
);
|
||||
Notifications.ok(successMessage);
|
||||
return successMessage;
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { tabId, data, error, create, onChange } = this;
|
||||
|
||||
@@ -42,13 +42,13 @@ export class Dock extends React.Component<Props> {
|
||||
if (selectedTab.pinned) close();
|
||||
else closeTab(selectedTab.id);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
onChangeTab = (tab: IDockTab) => {
|
||||
const { open, selectTab } = dockStore;
|
||||
open();
|
||||
selectTab(tab.id);
|
||||
}
|
||||
};
|
||||
|
||||
@autobind()
|
||||
renderTab(tab: IDockTab) {
|
||||
|
||||
@@ -62,7 +62,7 @@ export class EditResource extends React.Component<Props> {
|
||||
onChange = (draft: string, error?: string) => {
|
||||
this.error = error;
|
||||
this.saveDraft(draft);
|
||||
}
|
||||
};
|
||||
|
||||
save = async () => {
|
||||
if (this.error) {
|
||||
@@ -79,7 +79,7 @@ export class EditResource extends React.Component<Props> {
|
||||
<Trans>{resourceType} <b>{resourceName}</b> updated.</Trans>
|
||||
</p>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { tabId, resource, tabData, error, onChange, save } = this;
|
||||
|
||||
@@ -21,7 +21,7 @@ export class EditorPanel extends React.Component<Props> {
|
||||
|
||||
public editor: AceEditor;
|
||||
|
||||
@observable yamlError = ""
|
||||
@observable yamlError = "";
|
||||
|
||||
componentDidMount() {
|
||||
// validate and run callback with optional error
|
||||
@@ -44,23 +44,23 @@ export class EditorPanel extends React.Component<Props> {
|
||||
|
||||
onTabChange = () => {
|
||||
this.editor.focus();
|
||||
}
|
||||
};
|
||||
|
||||
onResize = () => {
|
||||
this.editor.resize();
|
||||
this.editor.focus();
|
||||
}
|
||||
};
|
||||
|
||||
onCursorPosChange = (pos: Ace.Point) => {
|
||||
EditorPanel.cursorPos.setData(this.props.tabId, pos);
|
||||
}
|
||||
};
|
||||
|
||||
onChange = (value: string) => {
|
||||
this.validate(value);
|
||||
if (this.props.onChange) {
|
||||
this.props.onChange(value, this.yamlError);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { value, tabId } = this.props;
|
||||
|
||||
@@ -38,7 +38,7 @@ export class InfoPanel extends Component<Props> {
|
||||
showSubmitClose: true,
|
||||
showInlineInfo: true,
|
||||
showNotifications: true,
|
||||
}
|
||||
};
|
||||
|
||||
@observable error = "";
|
||||
@observable waiting = false;
|
||||
@@ -66,16 +66,16 @@ export class InfoPanel extends Component<Props> {
|
||||
} finally {
|
||||
this.waiting = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
submitAndClose = async () => {
|
||||
await this.submit();
|
||||
this.close();
|
||||
}
|
||||
};
|
||||
|
||||
close = () => {
|
||||
dockStore.closeTab(this.props.tabId);
|
||||
}
|
||||
};
|
||||
|
||||
renderErrorIcon() {
|
||||
if (!this.props.showInlineInfo || !this.errorInfo) {
|
||||
|
||||
@@ -103,7 +103,7 @@ export class InstallChart extends Component<Props> {
|
||||
return (
|
||||
<p><Trans>Chart Release <b>{details.release.name}</b> successfully created.</Trans></p>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { tabId, chartData, values, versions, install } = this;
|
||||
|
||||
@@ -78,7 +78,7 @@ export class PodLogsStore extends DockTabStore<IPodLogsData> {
|
||||
this.refresher.stop();
|
||||
this.logs.set(tabId, message);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Function is used to refreser/stream-like requests.
|
||||
@@ -94,7 +94,7 @@ export class PodLogsStore extends DockTabStore<IPodLogsData> {
|
||||
});
|
||||
// Add newly received logs to bottom
|
||||
this.logs.set(tabId, [...oldLogs, ...logs]);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Main logs loading function adds necessary data to payload and makes
|
||||
@@ -119,7 +119,7 @@ export class PodLogsStore extends DockTabStore<IPodLogsData> {
|
||||
logs.pop(); // Remove last empty element
|
||||
return logs;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets newLogSince separator timestamp to split old logs from new ones
|
||||
|
||||
@@ -79,13 +79,13 @@ export class PodLogs extends React.Component<Props> {
|
||||
this.ready = false;
|
||||
await podLogsStore.load(this.tabId);
|
||||
this.ready = true;
|
||||
}
|
||||
};
|
||||
|
||||
reload = async () => {
|
||||
podLogsStore.clearLogs(this.tabId);
|
||||
this.lastLineIsShown = true;
|
||||
await this.load();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Function loads more logs (usually after user scrolls to top) and sets proper
|
||||
@@ -101,7 +101,7 @@ export class PodLogs extends React.Component<Props> {
|
||||
// Set scroll position back to place where preloading started
|
||||
this.logsElement.current.scrollTop = (podLogsStore.lines - lines) * lineHeight;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* A function for various actions after search is happened
|
||||
@@ -167,7 +167,7 @@ export class PodLogs extends React.Component<Props> {
|
||||
this.showJumpToBottom = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@action
|
||||
scrollToBottom = () => {
|
||||
@@ -177,7 +177,7 @@ export class PodLogs extends React.Component<Props> {
|
||||
this.showJumpToBottom = false;
|
||||
// Showing horizontal scrollbar after VirtualList settles down
|
||||
setTimeout(() => this.hideHorizontalScroll = false, 500);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* A function is called by VirtualList for rendering each of the row
|
||||
@@ -221,7 +221,7 @@ export class PodLogs extends React.Component<Props> {
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
renderJumpToBottom() {
|
||||
if (!this.logsElement) return null;
|
||||
|
||||
@@ -132,39 +132,39 @@ export class Terminal {
|
||||
|
||||
focus = () => {
|
||||
this.xterm.focus();
|
||||
}
|
||||
};
|
||||
|
||||
onApiData = (data: string) => {
|
||||
this.xterm.write(data);
|
||||
}
|
||||
};
|
||||
|
||||
onData = (data: string) => {
|
||||
if (!this.api.isReady) return;
|
||||
this.api.sendCommand(data);
|
||||
}
|
||||
};
|
||||
|
||||
onScroll = () => {
|
||||
this.scrollPos = this.viewport.scrollTop;
|
||||
}
|
||||
};
|
||||
|
||||
onClear = () => {
|
||||
this.xterm.clear();
|
||||
}
|
||||
};
|
||||
|
||||
onResize = () => {
|
||||
this.fitLazy();
|
||||
this.focus();
|
||||
}
|
||||
};
|
||||
|
||||
onActivate = () => {
|
||||
this.fit();
|
||||
setTimeout(() => this.focus(), 250); // delay used to prevent focus on active tab
|
||||
this.viewport.scrollTop = this.scrollPos; // restore last scroll position
|
||||
}
|
||||
};
|
||||
|
||||
onClickLink = (evt: MouseEvent, link: string) => {
|
||||
window.open(link, "_blank");
|
||||
}
|
||||
};
|
||||
|
||||
keyHandler = (evt: KeyboardEvent): boolean => {
|
||||
const { code, ctrlKey, type } = evt;
|
||||
@@ -190,7 +190,7 @@ export class Terminal {
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Terminal.init();
|
||||
@@ -62,7 +62,7 @@ export class UpgradeChart extends React.Component<Props> {
|
||||
onChange = (value: string, error?: string) => {
|
||||
upgradeChartStore.values.setData(this.tabId, value);
|
||||
this.error = error;
|
||||
}
|
||||
};
|
||||
|
||||
upgrade = async () => {
|
||||
if (this.error) return;
|
||||
@@ -79,13 +79,13 @@ export class UpgradeChart extends React.Component<Props> {
|
||||
<Trans>Release <b>{releaseName}</b> successfully upgraded to version <b>{version}</b></Trans>
|
||||
</p>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
formatVersionLabel = ({ value }: SelectOption<IChartVersion>) => {
|
||||
const chartName = this.release.getChart();
|
||||
const { repo, version } = value;
|
||||
return `${repo}/${chartName}-${version}`;
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { tabId, release, value, error, onChange, upgrade, versions, version } = this;
|
||||
|
||||
Reference in new issue
Block a user