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:
parent
39fc5a7f84
commit
99c613546e
@ -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",
|
||||||
|
|||||||
@ -41,42 +41,42 @@ export abstract class ClusterFeature {
|
|||||||
/**
|
/**
|
||||||
* 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 installed. 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 installed. The implementation
|
||||||
* of this method should install kubernetes resources using the applyResources() method, or by directly accessing the kubernetes api (K8sApi)
|
* of this method should install kubernetes resources using the applyResources() method, or by directly accessing the kubernetes api (K8sApi)
|
||||||
*
|
*
|
||||||
* @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
|
||||||
* of this method should upgrade the kubernetes resources already installed, if relevant to the feature
|
* of this method should upgrade the kubernetes resources already installed, if relevant to the feature
|
||||||
*
|
*
|
||||||
* @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
|
||||||
* of this method should uninstall kubernetes resources using the kubernetes api (K8sApi)
|
* of this method should uninstall kubernetes resources using the kubernetes api (K8sApi)
|
||||||
*
|
*
|
||||||
* @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
|
||||||
* of this method should provide the current status information. The currentVersion and latestVersion fields may be displayed by Lens in describing the feature.
|
* of this method should provide the current status information. The currentVersion and latestVersion fields may be displayed by Lens in describing the feature.
|
||||||
* The installed field should be set to true if the feature has been installed, otherwise false. Also, Lens relies on the canUpgrade field to determine if the feature
|
* The installed field should be set to true if the feature has been installed, otherwise false. Also, Lens relies on the canUpgrade field to determine if the feature
|
||||||
* can be upgraded so the implementation should set the canUpgrade field according to specific rules for the feature, if relevant.
|
* can be upgraded so the implementation should set the canUpgrade field according to specific rules for the feature, if relevant.
|
||||||
*
|
*
|
||||||
* @param cluster the cluster that the feature may be installed on
|
* @param cluster the cluster that the feature may be installed on
|
||||||
*
|
*
|
||||||
* @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.
|
||||||
*
|
*
|
||||||
* @param cluster the cluster that the resources are to be applied to
|
* @param cluster the cluster that the resources are to be applied to
|
||||||
* @param resourceSpec as a string type this is a folder path that is searched for files specifying kubernetes resources. The files are read and if any of the resource
|
* @param resourceSpec as a string type this is a folder path that is searched for files specifying kubernetes resources. The files are read and if any of the resource
|
||||||
* files are templated, the template parameters are filled using the templateContext field (See renderTemplate() method). Finally the resources are applied to the
|
* files are templated, the template parameters are filled using the templateContext field (See renderTemplate() method). Finally the resources are applied to the
|
||||||
@ -101,9 +101,9 @@ export abstract class ClusterFeature {
|
|||||||
/**
|
/**
|
||||||
* this is a helper method that conveniently reads kubernetes resource files into a string array. It also fills templated resource files with the template parameter values
|
* this is a helper method that conveniently reads kubernetes resource files into a string array. It also fills templated resource files with the template parameter values
|
||||||
* specified by the templateContext field. Templated files must end with the extension '.hb' and the template syntax must be compatible with handlebars.js
|
* specified by the templateContext field. Templated files must end with the extension '.hb' and the template syntax must be compatible with handlebars.js
|
||||||
*
|
*
|
||||||
* @param folderPath this is a folder path that is searched for files defining kubernetes resources.
|
* @param folderPath this is a folder path that is searched for files defining kubernetes resources.
|
||||||
*
|
*
|
||||||
* @return an array of strings, each string being the contents of a resource file found in the folder path. This can be passed directly to applyResources()
|
* @return an array of strings, each string being the contents of a resource file found in the folder path. This can be passed directly to applyResources()
|
||||||
*/
|
*/
|
||||||
protected renderTemplates(folderPath: string): string[] {
|
protected renderTemplates(folderPath: string): string[] {
|
||||||
|
|||||||
@ -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 });
|
||||||
|
|
||||||
|
|||||||
@ -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,
|
||||||
|
|||||||
@ -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) => {
|
||||||
|
|||||||
@ -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) };
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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()
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -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==
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user