Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions frontend/__tests__/components/safety-first.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('When calling setter from `useState()` hook in an unsafe React componen

let wrapper = mount<Props>(<Unsafe loader={null} />);
const loader = () =>
new Promise((resolve) => {
new Promise<void>((resolve) => {
expect(wrapper.text()).toEqual('Loading...');
wrapper.unmount();
resolve();
Expand Down Expand Up @@ -67,7 +67,7 @@ describe('useSafetyFirst', () => {

it('does not attempt to set React state if unmounted (using hook)', (done) => {
const loader = () =>
new Promise((resolve) => {
new Promise<void>((resolve) => {
expect(wrapper.text()).toEqual('Loading...');
wrapper.unmount();
resolve();
Expand All @@ -90,7 +90,7 @@ describe('useSafetyFirst', () => {

it('will set React state if mounted (using hook)', (done) => {
const loader = () =>
new Promise((resolve) => {
new Promise<void>((resolve) => {
expect(wrapper.text()).toEqual('Loading...');
resolve();
});
Expand Down
4 changes: 2 additions & 2 deletions frontend/integration-tests/tests/secrets.scenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ describe('Add Secret to Workloads', () => {
describe('Add Secret to Workloads as Enviroment Variables', () => {
it('Add Secret to Deployment as Env', async () => {
await secretsView.addSecretToWorkloadAsEnv(resourceName, envPrefix);
await new Promise((resolve) =>
await new Promise<void>((resolve) =>
(function checkForValues() {
const output = secretsView.getResourceJSON(resourceName, testName, resourceKind);
if (JSON.parse(output).status.observedGeneration === 2) {
Expand Down Expand Up @@ -448,7 +448,7 @@ describe('Add Secret to Workloads', () => {
describe('Add Secret to Workloads as Volume', () => {
it('Add Secret to Deployment as Vol', async () => {
await secretsView.addSecretToWorkloadAsVol(resourceName, mountPath);
await new Promise((resolve) =>
await new Promise<void>((resolve) =>
(function checkForValues() {
const output = secretsView.getResourceJSON(resourceName, testName, resourceKind);
if (JSON.parse(output).status.observedGeneration === 3) {
Expand Down
8 changes: 4 additions & 4 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
"apollo-client": "^2.6.8",
"apollo-link-http": "^1.0.20",
"apollo-link-ws": "^1.0.20",
"axios": "^0.21.2",
"axios": "^1.13.5",
"classnames": "2.x",
"d3": "^5.16.0",
"file-saver": "1.3.x",
Expand Down Expand Up @@ -290,7 +290,7 @@
"eslint-plugin-tsdoc": "^0.2.14",
"file-loader": "1.x",
"find-up": "4.x",
"fork-ts-checker-webpack-plugin": "4.x",
"fork-ts-checker-webpack-plugin": "6.5.2",
"geckodriver": "1.x",
"glob": "7.x",
"glslify-loader": "^2.0.0",
Expand Down Expand Up @@ -331,9 +331,9 @@
"style-loader": "^2.0.0",
"thread-loader": "^3.0.4",
"ts-jest": "21.x",
"ts-loader": "^6.2.2",
"ts-loader": "^8.4.0",
"ts-node": "^10.2.1",
"typescript": "3.8.3",
"typescript": "4.5.x",
"umd-compat-loader": "^2.1.2",
"webpack": "^4.47.0",
"webpack-bundle-analyzer": "3.9.x",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const PVCType: React.FC<PVCTypeProps> = ({ state, dispatch }) => {
};

// Fix for updating the storage class by force rerender
const forceUpdate = React.useCallback(() => updateState({}), []);
const forceUpdate = React.useCallback(() => updateState({} as any), []);

React.useEffect(() => {
forceUpdate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('file-upload-utils', () => {
});

it('should return true for jar file', () => {
const file: File = {
const file = {
name: 'spring-boot-artifacts.jar',
type: 'application/x-java-archive',
lastModified: 15464,
Expand All @@ -50,12 +50,13 @@ describe('file-upload-utils', () => {
slice: undefined,
stream: undefined,
text: undefined,
};
webkitRelativePath: '',
} as unknown as File;
expect(isFileSupported(file.name, fileExtensions)).toBe(true);
});

it('should return true for yaml file', () => {
const file: File = {
const file = {
name: 'sleep-1-minute-pipeline.yaml',
size: 220,
type: 'application/x-yaml',
Expand All @@ -64,12 +65,13 @@ describe('file-upload-utils', () => {
slice: undefined,
stream: undefined,
text: undefined,
};
webkitRelativePath: '',
} as unknown as File;
expect(isFileSupported(file.name, fileExtensions)).toBe(true);
});

it('should return true for JAR file', () => {
const file: File = {
const file = {
name: 'spring-boot-artifacts.JAR',
type: 'application/x-java-archive',
lastModified: 15464,
Expand All @@ -78,12 +80,13 @@ describe('file-upload-utils', () => {
slice: undefined,
stream: undefined,
text: undefined,
};
webkitRelativePath: '',
} as unknown as File;
expect(isFileSupported(file.name, fileExtensions)).toBe(true);
});

it('should return false for zip file', () => {
const file: File = {
const file = {
name: 'sleep-1-minute-pipeline.zip',
size: 220,
type: 'application/x-zip',
Expand All @@ -92,12 +95,13 @@ describe('file-upload-utils', () => {
slice: undefined,
stream: undefined,
text: undefined,
};
webkitRelativePath: '',
} as unknown as File;
expect(isFileSupported(file.name, fileExtensions)).toBe(false);
});

it('should return false for xyz type file', () => {
const file: File = {
const file = {
name: 'sleep-1-minute-pipeline.jar.xyz',
size: 220,
type: 'application/x-jar',
Expand All @@ -106,12 +110,13 @@ describe('file-upload-utils', () => {
slice: undefined,
stream: undefined,
text: undefined,
};
webkitRelativePath: '',
} as unknown as File;
expect(isFileSupported(file.name, fileExtensions)).toBe(false);
});

it('should return false for file with no extension', () => {
const file: File = {
const file = {
name: 'jar',
size: 220,
type: '',
Expand All @@ -120,7 +125,8 @@ describe('file-upload-utils', () => {
slice: undefined,
stream: undefined,
text: undefined,
};
webkitRelativePath: '',
} as unknown as File;
expect(isFileSupported(file.name, fileExtensions)).toBe(false);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ class VirtualReference implements PopperJSReference {
right: x + width,
top: y,
width,
x,
y,
toJSON() {
return this;
},
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const menuActionRemove = (
isDisabled: !!isDeleteDisabled,
callback: () =>
withProgress(
new Promise((resolve) => {
new Promise<void>((resolve) => {
removeNIC(id);
resolve();
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const menuActionRemove = (
isDisabled: isDeleteDisabled,
callback: () =>
withProgress(
new Promise((resolve) => {
new Promise<void>((resolve) => {
removeStorage(id);
resolve();
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('Status descriptor details items', () => {
it('renders a resource status', () => {
descriptor['x-descriptors'] = [
`${StatusCapability.k8sResourcePrefix}Service`,
] as SpecCapability[];
] as unknown as SpecCapability[];
descriptor.path = 'service';
wrapper = wrapper.setProps({ descriptor });
const resourceLink = wrapper.find(ResourceLink);
Expand Down
11 changes: 9 additions & 2 deletions frontend/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import * as webpack from 'webpack';
import * as path from 'path';
import * as _ from 'lodash';
import * as HtmlWebpackPlugin from 'html-webpack-plugin';
import * as ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import * as MiniCssExtractPlugin from 'mini-css-extract-plugin';
import * as ReactRefreshWebpackPlugin from '@pmmmwh/react-refresh-webpack-plugin';

Expand All @@ -13,6 +12,8 @@ import { resolvePluginPackages } from '@console/plugin-sdk/src/codegen/plugin-re
import { ConsoleActivePluginsModule } from '@console/plugin-sdk/src/webpack/ConsoleActivePluginsModule';
import { CircularDependencyPreset } from './webpack.circular-deps';

const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');

interface Configuration extends webpack.Configuration {
devServer?: WebpackDevServerConfiguration;
}
Expand Down Expand Up @@ -211,7 +212,13 @@ const config: Configuration = {
},
plugins: [
new webpack.NormalModuleReplacementPlugin(/^lodash$/, 'lodash-es'),
new ForkTsCheckerWebpackPlugin({ checkSyntacticErrors: true, memoryLimit: 4096 }),
new ForkTsCheckerWebpackPlugin({
typescript: {
configFile: path.resolve(__dirname, 'tsconfig.json'),
diagnosticOptions: { syntactic: true, semantic: true },
memoryLimit: 4096,
},
}),
new HtmlWebpackPlugin({
filename: './tokener.html',
template: './public/tokener.html',
Expand Down
Loading