1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

removed occasional changes related to typescript 4.1

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman 2020-12-04 14:44:20 +02:00
parent 39fc5a7f84
commit 99c613546e
9 changed files with 30 additions and 25 deletions

View File

@ -383,7 +383,7 @@
"typedoc": "0.17.0-3", "typedoc": "0.17.0-3",
"typedoc-plugin-markdown": "^2.4.0", "typedoc-plugin-markdown": "^2.4.0",
"typeface-roboto": "^0.0.75", "typeface-roboto": "^0.0.75",
"typescript": "^4.0.2", "typescript": "4.0.2",
"url-loader": "^4.1.0", "url-loader": "^4.1.0",
"webpack": "^4.44.2", "webpack": "^4.44.2",
"webpack-cli": "^3.3.11", "webpack-cli": "^3.3.11",

View File

@ -44,7 +44,7 @@ export abstract class ClusterFeature {
* *
* @param cluster the cluster that the feature is to be installed on * @param cluster the cluster that the feature is to be installed on
*/ */
abstract install(cluster: Cluster): Promise<void>; abstract async install(cluster: Cluster): Promise<void>;
/** /**
* to be implemented in the derived class, this method is typically called by Lens when a user has indicated that this feature is to be upgraded. The implementation * to be implemented in the derived class, this method is typically called by Lens when a user has indicated that this feature is to be upgraded. The implementation
@ -52,7 +52,7 @@ export abstract class ClusterFeature {
* *
* @param cluster the cluster that the feature is to be upgraded on * @param cluster the cluster that the feature is to be upgraded on
*/ */
abstract upgrade(cluster: Cluster): Promise<void>; abstract async upgrade(cluster: Cluster): Promise<void>;
/** /**
* to be implemented in the derived class, this method is typically called by Lens when a user has indicated that this feature is to be uninstalled. The implementation * to be implemented in the derived class, this method is typically called by Lens when a user has indicated that this feature is to be uninstalled. The implementation
@ -60,7 +60,7 @@ export abstract class ClusterFeature {
* *
* @param cluster the cluster that the feature is to be uninstalled from * @param cluster the cluster that the feature is to be uninstalled from
*/ */
abstract uninstall(cluster: Cluster): Promise<void>; abstract async uninstall(cluster: Cluster): Promise<void>;
/** /**
* to be implemented in the derived class, this method is called periodically by Lens to determine details about the feature's current status. The implementation * to be implemented in the derived class, this method is called periodically by Lens to determine details about the feature's current status. The implementation
@ -72,7 +72,7 @@ export abstract class ClusterFeature {
* *
* @return a promise, resolved with the updated ClusterFeatureStatus * @return a promise, resolved with the updated ClusterFeatureStatus
*/ */
abstract updateStatus(cluster: Cluster): Promise<ClusterFeatureStatus>; abstract async updateStatus(cluster: Cluster): Promise<ClusterFeatureStatus>;
/** /**
* this is a helper method that conveniently applies kubernetes resources to the cluster. * this is a helper method that conveniently applies kubernetes resources to the cluster.

View File

@ -70,7 +70,7 @@ describe("globalPageRegistry", () => {
], ext); ], ext);
}); });
describe("getByPageMenuTarget", () => { describe("getByPageTarget", () => {
it("matching to first registered page without id", () => { it("matching to first registered page without id", () => {
const page = globalPageRegistry.getByPageTarget({ extensionId: ext.name }); const page = globalPageRegistry.getByPageTarget({ extensionId: ext.name });

View File

@ -272,7 +272,7 @@ export class Kubectl {
logger.info(`Downloading kubectl ${this.kubectlVersion} from ${this.url} to ${this.path}`); logger.info(`Downloading kubectl ${this.kubectlVersion} from ${this.url} to ${this.path}`);
return new Promise<void>((resolve, reject) => { return new Promise((resolve, reject) => {
const stream = customRequest({ const stream = customRequest({
url: this.url, url: this.url,
gzip: true, gzip: true,

View File

@ -183,7 +183,7 @@ export class LensBinary {
throw(error); throw(error);
}); });
return new Promise<void>((resolve, reject) => { return new Promise((resolve, reject) => {
file.on("close", () => { file.on("close", () => {
this.logger.debug(`${this.originalBinaryName} binary download closed`); this.logger.debug(`${this.originalBinaryName} binary download closed`);
if (!this.tarPath) fs.chmod(binaryPath, 0o755, (err) => { if (!this.tarPath) fs.chmod(binaryPath, 0o755, (err) => {

View File

@ -50,7 +50,7 @@ export class Select extends React.Component<SelectProps> {
}), }),
}; };
protected isValidOption(opt: SelectOption | any): opt is SelectOption { protected isValidOption(opt: SelectOption | any) {
return typeof opt === "object" && opt.value !== undefined; return typeof opt === "object" && opt.value !== undefined;
} }
@ -72,7 +72,7 @@ export class Select extends React.Component<SelectProps> {
const { autoConvertOptions, options } = this.props; const { autoConvertOptions, options } = this.props;
if (autoConvertOptions && Array.isArray(options)) { if (autoConvertOptions && Array.isArray(options)) {
return (options as any[]).map(opt => { return options.map(opt => {
return this.isValidOption(opt) ? opt : { value: opt, label: String(opt) }; return this.isValidOption(opt) ? opt : { value: opt, label: String(opt) };
}); });
} }

View File

@ -1,7 +1,7 @@
import "./table.scss"; import "./table.scss";
import React from "react"; import React from "react";
import lodash from "lodash"; import { orderBy } from "lodash";
import { observer } from "mobx-react"; import { observer } from "mobx-react";
import { observable } from "mobx"; import { observable } from "mobx";
import { autobind, cssNames, noop } from "../../utils"; import { autobind, cssNames, noop } from "../../utils";
@ -104,10 +104,10 @@ export class Table extends React.Component<TableProps> {
} }
getSorted(items: any[]) { getSorted(items: any[]) {
const { sortBy, orderBy } = this.sortParams; const { sortBy, orderBy: order } = this.sortParams;
const sortingCallback = this.props.sortable[sortBy] || noop; const sortingCallback = this.props.sortable[sortBy] || noop;
return lodash.orderBy(items, sortingCallback, orderBy as any); return orderBy(items, sortingCallback, order as any);
} }
@autobind() @autobind()

View File

@ -15,8 +15,8 @@ export interface UrlParamInit<V = any> {
export class UrlParam<V = any | any[]> { export class UrlParam<V = any | any[]> {
static SYSTEM_PREFIX = "lens-"; static SYSTEM_PREFIX = "lens-";
public name: string; readonly name: string;
public urlName: string; readonly urlName: string;
constructor(private init: UrlParamInit<V>, private history: IObservableHistory) { constructor(private init: UrlParamInit<V>, private history: IObservableHistory) {
const { isSystem, name, skipEmpty = true } = init; const { isSystem, name, skipEmpty = true } = init;

View File

@ -14545,7 +14545,12 @@ typeface-roboto@^0.0.75:
resolved "https://registry.yarnpkg.com/typeface-roboto/-/typeface-roboto-0.0.75.tgz#98d5ba35ec234bbc7172374c8297277099cc712b" resolved "https://registry.yarnpkg.com/typeface-roboto/-/typeface-roboto-0.0.75.tgz#98d5ba35ec234bbc7172374c8297277099cc712b"
integrity sha512-VrR/IiH00Z1tFP4vDGfwZ1esNqTiDMchBEXYY9kilT6wRGgFoCAlgkEUMHb1E3mB0FsfZhv756IF0+R+SFPfdg== integrity sha512-VrR/IiH00Z1tFP4vDGfwZ1esNqTiDMchBEXYY9kilT6wRGgFoCAlgkEUMHb1E3mB0FsfZhv756IF0+R+SFPfdg==
typescript@^4.0.2, typescript@^4.0.3: typescript@4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.2.tgz#7ea7c88777c723c681e33bf7988be5d008d05ac2"
integrity sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==
typescript@^4.0.3:
version "4.1.2" version "4.1.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.2.tgz#6369ef22516fe5e10304aae5a5c4862db55380e9" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.2.tgz#6369ef22516fe5e10304aae5a5c4862db55380e9"
integrity sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ== integrity sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ==