Skip to content
This repository was archived by the owner on Aug 28, 2023. It is now read-only.

Commit 1b75ac8

Browse files
authored
[95476] Update angular to v15 (#133)
1 parent 82b1f70 commit 1b75ac8

File tree

177 files changed

+17260
-13342
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+17260
-13342
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ client/dist-server
3737
client/tmp
3838
client/out-tsc
3939
client/.npmrc
40+
client/.angular
4041

4142
# client unit tests reports
4243
client/reports
44+
client/coverage
4345

4446
# client dependencies
4547
client/node_modules

client/.eslintrc.json

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"root": true,
3+
"ignorePatterns": ["projects/**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts"],
7+
"parserOptions": {
8+
"project": ["tsconfig.json", "e2e/tsconfig.json"],
9+
"createDefaultProgram": true
10+
},
11+
"extends": [
12+
"plugin:@angular-eslint/ng-cli-compat",
13+
"plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
14+
"plugin:@angular-eslint/template/process-inline-templates",
15+
"prettier"
16+
],
17+
"plugins": ["prettier"],
18+
"rules": {
19+
"@angular-eslint/component-selector": [
20+
"error",
21+
{
22+
"type": "element",
23+
"prefix": "wb",
24+
"style": "kebab-case"
25+
}
26+
],
27+
"@angular-eslint/directive-selector": [
28+
"error",
29+
{
30+
"type": "attribute",
31+
"prefix": "wb",
32+
"style": "camelCase"
33+
}
34+
],
35+
"@typescript-eslint/consistent-type-definitions": "error",
36+
"@typescript-eslint/dot-notation": "off",
37+
"@typescript-eslint/explicit-member-accessibility": [
38+
"off",
39+
{
40+
"accessibility": "explicit"
41+
}
42+
],
43+
"@typescript-eslint/no-explicit-any": "error",
44+
"@typescript-eslint/quotes": [
45+
"error",
46+
"single",
47+
{
48+
"avoidEscape": true
49+
}
50+
],
51+
"arrow-parens": ["error", "always"],
52+
"brace-style": ["warn", "1tbs"],
53+
"id-blacklist": "off",
54+
"id-match": "off",
55+
"max-len": [
56+
"error",
57+
{
58+
"ignorePattern": "^import [^,]+ from",
59+
"code": 140
60+
}
61+
],
62+
"no-underscore-dangle": "off",
63+
"@typescript-eslint/naming-convention": [
64+
"warn",
65+
{
66+
"selector": "enumMember",
67+
"format": ["UPPER_CASE", "snake_case"]
68+
}
69+
],
70+
"@typescript-eslint/member-ordering": ["warn"],
71+
"arrow-body-style": ["warn"],
72+
"prefer-arrow/prefer-arrow-functions": ["warn"]
73+
}
74+
},
75+
{
76+
"files": ["*.html"],
77+
"extends": ["plugin:@angular-eslint/template/recommended", "prettier"],
78+
"rules": {
79+
"@angular-eslint/template/no-negated-async": "off"
80+
}
81+
}
82+
]
83+
}

client/angular.json

+11-8
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@
1414
"options": {
1515
"allowedCommonJsDependencies": [
1616
"@core/services/common/backend-feed.service",
17+
"@shared/constants",
1718
"chart.js",
1819
"dagre",
1920
"file-saver",
2021
"jwt-decode",
2122
"lodash",
23+
"papaparse",
2224
"rxjs/internal/operators/first",
2325
"rxjs/internal/operators/withLatestFrom",
2426
"socket.io-client",
@@ -102,6 +104,9 @@
102104
"polyfills": "src/polyfills.ts",
103105
"tsConfig": "src/tsconfig.spec.json",
104106
"scripts": [],
107+
"customWebpackConfig": {
108+
"path": "./extra-webpack.config.ts"
109+
},
105110
"codeCoverageExclude": [
106111
"e2e/**/*",
107112
"dist/**/*",
@@ -115,10 +120,9 @@
115120
}
116121
},
117122
"lint": {
118-
"builder": "@angular-devkit/build-angular:tslint",
123+
"builder": "@angular-eslint/builder:lint",
119124
"options": {
120-
"tsConfig": ["src/tsconfig.app.json", "src/tsconfig.spec.json"],
121-
"exclude": ["**/node_modules/**", "**/*.json"]
125+
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
122126
}
123127
}
124128
}
@@ -136,16 +140,14 @@
136140
}
137141
},
138142
"lint": {
139-
"builder": "@angular-devkit/build-angular:tslint",
143+
"builder": "@angular-eslint/builder:lint",
140144
"options": {
141-
"tsConfig": ["e2e/tsconfig.e2e.json"],
142-
"exclude": ["**/node_modules/**", "**/*.json"]
145+
"lintFilePatterns": ["e2e/**/*.ts", "e2e/**/*.html"]
143146
}
144147
}
145148
}
146149
}
147150
},
148-
"defaultProject": "client",
149151
"schematics": {
150152
"@schematics/angular:component": {
151153
"prefix": "wb",
@@ -157,6 +159,7 @@
157159
}
158160
},
159161
"cli": {
160-
"analytics": false
162+
"analytics": false,
163+
"schematicCollections": ["@angular-eslint/schematics"]
161164
}
162165
}

client/e2e/commands.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"mode": {
3-
"base": "./node_modules/@angular/cli/bin/ng e2e --base-url {mode} --dev-server-target= --webdriver-update false {suites}",
3+
"base": "npx ng e2e --base-url {mode} --dev-server-target= --webdriver-update false {suites}",
44
"local": "http://localhost:4200",
55
"ci": "$DL_PROFILER_DEPLOY_TARGET"
66
},

client/e2e/src/accuracy-report-classification.e2e-spec.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe('UI tests on Accuracy Reports with classification model: ', () => {
3838
await testUtils.openInt8Project(resourceModel, datasetFileImageNet);
3939
});
4040

41-
it(`Create accuracy report (basic accuracy config, annotated dataset) on model from resource`, async () => {
41+
it('Create accuracy report (basic accuracy config, annotated dataset) on model from resource', async () => {
4242
await testUtils.accuracyReport.createAccuracyReport(
4343
AccuracyReportType.DATASET_ANNOTATIONS,
4444
resourceModel,
@@ -49,7 +49,7 @@ describe('UI tests on Accuracy Reports with classification model: ', () => {
4949
await browser.wait(testUtils.until.presenceOf(accuracyTable));
5050
});
5151

52-
it(`Create Parent Model Predictions report (basic accuracy config, annotated dataset) on model from resource`, async () => {
52+
it('Create Parent Model Predictions report (basic accuracy config, annotated dataset) on model from resource', async () => {
5353
await testUtils.accuracyReport.createAccuracyReport(
5454
AccuracyReportType.PARENT_MODEL_PREDICTIONS,
5555
resourceModel,
@@ -60,7 +60,7 @@ describe('UI tests on Accuracy Reports with classification model: ', () => {
6060
await browser.wait(testUtils.until.presenceOf(accuracyTable));
6161
});
6262

63-
it(`Create Tensor Distance report (basic accuracy config, annotated dataset) on model from resource`, async () => {
63+
it('Create Tensor Distance report (basic accuracy config, annotated dataset) on model from resource', async () => {
6464
await testUtils.accuracyReport.createAccuracyReport(
6565
AccuracyReportType.PARENT_MODEL_PER_TENSOR,
6666
resourceModel,

client/e2e/src/create-na-dataset.e2e-spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ describe('UI tests on Creating Not Annotated Datasets', () => {
118118
await configurationWizard.importDataset(dataSet.name);
119119

120120
expect(await configurationWizard.checkImagesInDataset(dataSet.name, TransformationOptions.HORIZONTAL)).toBeTruthy(
121-
`Image not found in dataset`
121+
'Image not found in dataset'
122122
);
123123

124124
await configurationWizard.deleteUploadedFile(dataSet.name);
@@ -132,7 +132,7 @@ describe('UI tests on Creating Not Annotated Datasets', () => {
132132
await configurationWizard.importDataset(dataSet.name);
133133

134134
expect(await configurationWizard.checkImagesInDataset(dataSet.name, TransformationOptions.VERTICAL)).toBeTruthy(
135-
`Image not found in dataset`
135+
'Image not found in dataset'
136136
);
137137

138138
await configurationWizard.deleteUploadedFile(dataSet.name);

client/e2e/src/explainable-ai.e2e-spec.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { browser, protractor } from 'protractor';
22

33
import { Frameworks, TestUtils } from './pages/test-utils';
4-
import { VisualizeInferenceResultPage } from './pages/inference-test-image.po';
54
import {
5+
VisualizeInferenceResultPage,
66
VisualizationOptionsNamesMap,
77
VisualizationType,
8-
} from '../../src/app/modules/accuracy/components/visualization/network-output/original-image-controls/original-image-controls.component';
8+
} from './pages/inference-test-image.po';
9+
910
import { AnalyticsPopup } from './pages/analytics-popup.po';
1011
import { Helpers } from './pages/helpers';
1112

@@ -81,7 +82,7 @@ describe('E2E tests Explainable AI: ', () => {
8182
console.log('Progress is present');
8283

8384
await browser.sleep(1000);
84-
const reg = new RegExp(`[0-9]+`);
85+
const reg = new RegExp('[0-9]+');
8586
expect(reg.test(await visualizeInferenceResultPage.visualizationProgress.getText())).toBeTruthy(
8687
'Progress not displayed'
8788
);

client/e2e/src/large-dataset-uploading.e2e-spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { ConfigurationWizardPage } from './pages/configuration-wizard.po';
55
import { Helpers } from './pages/helpers';
66
import { TestUtils } from './pages/test-utils';
77

8-
describe('UI tests on Uploading Large Datasets', async () => {
8+
describe('UI tests on Uploading Large Datasets', () => {
99
let homePage: AppPage;
1010
let configurationWizard: ConfigurationWizardPage;
1111
let helpers: Helpers;

client/e2e/src/model-import-form.e2e-spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ describe('UI tests for model import form', () => {
1818
): Promise<void> => {
1919
await TestUtils.checkMatFormFieldState(field, 'valid', 'freeze-row');
2020
const input = field.element(by.tagName('input'));
21+
// eslint-disable-next-line @typescript-eslint/prefer-for-of
2122
for (let i = 0; i < testValues.length; i++) {
2223
const { value, expectedState } = testValues[i];
2324
await TestUtils.clearInput(input);

client/e2e/src/pages/advanced-accuracy-configuration.po.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ export class AdvancedAccuracyConfigurationPage {
3636
}
3737

3838
async isConfigurationValid(): Promise<boolean> {
39-
const isValidElement: Function = this.until.visibilityOf(this.elements.isConfigurationValidStatus);
40-
const isNotValidElement: Function = this.until.visibilityOf(this.elements.isConfigurationNotValidStatus);
39+
const isValidElement = this.until.visibilityOf(this.elements.isConfigurationValidStatus);
40+
const isNotValidElement = this.until.visibilityOf(this.elements.isConfigurationNotValidStatus);
4141

4242
await browser.wait(this.until.or(isNotValidElement, isValidElement), browser.params.defaultTimeout);
4343

@@ -156,6 +156,7 @@ export class AdvancedAccuracyConfigurationPage {
156156
const line: ElementFinder = await this.getEditorLineByIndex(index);
157157
await new TestUtils().clickElement(line);
158158
const activeField: WebdriverWebElement = await browser.driver.switchTo().activeElement();
159+
// eslint-disable-next-line @typescript-eslint/prefer-for-of
159160
for (let i = 0; i < REQUIRED_PLACEHOLDER.length; i++) {
160161
await activeField.sendKeys(protractor.Key.BACK_SPACE);
161162
}
@@ -167,6 +168,7 @@ export class AdvancedAccuracyConfigurationPage {
167168
await new TestUtils().clickElement(line);
168169
const activeField: WebdriverWebElement = await browser.driver.switchTo().activeElement();
169170
const text = await line.getText();
171+
// eslint-disable-next-line @typescript-eslint/prefer-for-of
170172
for (let i = 0; i < text.trim().length; i++) {
171173
await activeField.sendKeys(protractor.Key.BACK_SPACE);
172174
}

client/e2e/src/pages/calibration-utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class CalibrationUtils {
3030

3131
constructor(originTestUtils?) {
3232
this.until = protractor.ExpectedConditions;
33-
originTestUtils ? (this.testUtils = originTestUtils) : (this.testUtils = new TestUtils());
33+
this.testUtils = originTestUtils || new TestUtils();
3434
this.helpers = new Helpers();
3535
this.configurationWizard = new ConfigurationWizardPage();
3636
this.inferenceCard = new InferenceCardPage();

client/e2e/src/pages/configuration-wizard.po.ts

+8-6
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ export class ConfigurationWizardPage {
696696
const configParameters = await this.getConfigParameters(data);
697697

698698
if (!(await configParameters.length)) {
699-
throw new Error(`No config parameters found for calibration`);
699+
throw new Error('No config parameters found for calibration');
700700
}
701701

702702
for (const parameter of configParameters) {
@@ -821,7 +821,7 @@ export class ConfigurationWizardPage {
821821
}
822822

823823
async isUploadHasErrors(): Promise<boolean> {
824-
const errorContainer = await TestUtils.getElementByDataTestId(`message-box-error`);
824+
const errorContainer = await TestUtils.getElementByDataTestId('message-box-error');
825825
console.log('Wait error');
826826
await browser.wait(this.until.presenceOf(errorContainer), browser.params.defaultTimeout);
827827
return true;
@@ -919,7 +919,7 @@ export class ConfigurationWizardPage {
919919
resolve();
920920
return;
921921
} catch (e) {
922-
console.log(`received error for cancelling import row. try one more time.`);
922+
console.log('received error for cancelling import row. try one more time.');
923923
}
924924
} while (true);
925925
});
@@ -952,7 +952,7 @@ export class ConfigurationWizardPage {
952952
resolve(row);
953953
return;
954954
} catch (e) {
955-
console.log(`received error for selecting import row. try one more time.`);
955+
console.log('received error for selecting import row. try one more time.');
956956
}
957957
} while (true);
958958
});
@@ -1233,7 +1233,7 @@ export class ConfigurationWizardPage {
12331233
resolve(row);
12341234
return;
12351235
} catch (e) {
1236-
console.log(`received error for collecting model type. try one more time.`);
1236+
console.log('received error for collecting model type. try one more time.');
12371237
}
12381238
} while (true);
12391239
});
@@ -1301,6 +1301,7 @@ export class ConfigurationWizardPage {
13011301

13021302
async selectAllColorPresets(): Promise<void> {
13031303
const presets = await TestUtils.getAllElementsByDataTestId('transform-img');
1304+
// eslint-disable-next-line @typescript-eslint/prefer-for-of
13041305
for (let index = 0; index < presets.length; index++) {
13051306
const preset = presets[index];
13061307
await TestUtils.scrollToElement(preset);
@@ -1340,7 +1341,7 @@ export class ConfigurationWizardPage {
13401341
.getAttribute('data-test-dataset-id');
13411342
const dataSetPath = path.join(workbenchFolder, 'datasets', id.toString());
13421343
return {
1343-
dataSetPath: dataSetPath,
1344+
dataSetPath,
13441345
images: this.helper.getFilesFromFolder(dataSetPath, ['png', 'jpg']),
13451346
};
13461347
}
@@ -1349,6 +1350,7 @@ export class ConfigurationWizardPage {
13491350
await browser.sleep(1000);
13501351
const { dataSetPath, images } = await this.getImagesFromDataset(workbenchFolder, datasetName);
13511352
const result = [];
1353+
// eslint-disable-next-line @typescript-eslint/prefer-for-of
13521354
for (let index = 0; index < images.length; index++) {
13531355
const imagePath = path.join(dataSetPath, images[index]);
13541356
result.push(await this.helper.hashSum(imagePath));

client/e2e/src/pages/helpers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const crypto = require('crypto');
66

77
type JSONPrimitive = string | number | boolean | null;
88
type JSONValue = JSONObject | JSONArray | JSONPrimitive;
9-
interface JSONArray extends Array<JSONValue> {}
9+
type JSONArray = Array<JSONValue>;
1010
interface JSONObject {
1111
[member: string]: JSONValue;
1212
}

0 commit comments

Comments
 (0)