Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • anis/anis-next
1 result
Show changes
Commits on Source (7)
Showing
with 145 additions and 143 deletions
......@@ -54,7 +54,7 @@ sonar_scanner:
-Dsonar.host.url=$SONARQUBE_URL
-Dsonar.login=$SONAR_TOKEN_CLIENT
-Dsonar.exclusions=**.spec.ts,**/assets/**
-Dsonar.typescript.lcov.reportPaths=./coverage/anis-client/lcov.info
-Dsonar.javascript.lcov.reportPaths=./coverage/anis-client/lcov.info
build:
image: node:16-slim
......
......@@ -97,5 +97,7 @@
}
}
},
"defaultProject": "client"
"cli": {
"analytics": false
}
}
import 'jest-preset-angular/setup-jest';
Object.defineProperty(window, 'CSS', { value: null });
Object.defineProperty(document, 'doctype', {
value: '<!DOCTYPE html>',
});
Object.defineProperty(window, 'getComputedStyle', {
value: () => {
return {
......@@ -9,10 +10,10 @@ Object.defineProperty(window, 'getComputedStyle', {
};
},
});
Object.defineProperty(document, 'doctype', {
value: '<!DOCTYPE html>',
});
/**
* ISSUE: https://github.com/angular/material2/issues/7101
* Workaround for JSDOM missing transform property
*/
Object.defineProperty(document.body.style, 'transform', {
value: () => {
return {
......
const { pathsToModuleNameMapper } = require('ts-jest/utils');
const { compilerOptions } = require('./tsconfig');
// jest.config.js
module.exports = {
preset: 'jest-preset-angular',
testMatch: ['**/+(*.)+(spec).+(ts|js)'],
setupFilesAfterEnv: ['<rootDir>/src/test.ts'],
setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
globalSetup: 'jest-preset-angular/global-setup',
moduleDirectories: ['node_modules', '<rootDir>'],
collectCoverage: false,
collectCoverageFrom: ['src/**/*.ts'],
coverageReporters: ['html'],
coverageDirectory: 'coverage/anis-client',
moduleDirectories: ["node_modules", "./"],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths || {}, {
prefix: '<rootDir>/',
}),
coverageDirectory: 'coverage/anis-client'
};
......@@ -9,48 +9,48 @@
},
"private": true,
"dependencies": {
"@angular/animations": "~13.2.2",
"@angular/common": "~13.2.2",
"@angular/compiler": "~13.2.2",
"@angular/core": "~13.2.2",
"@angular/forms": "~13.2.2",
"@angular/platform-browser": "~13.2.2",
"@angular/platform-browser-dynamic": "~13.2.2",
"@angular/router": "~13.2.2",
"@fortawesome/fontawesome-free": "^6.0.0",
"@ng-select/ng-select": "^8.1.1",
"@ngrx/effects": "13.0.2",
"@ngrx/entity": "13.0.2",
"@ngrx/router-store": "13.0.2",
"@ngrx/store": "13.0.2",
"@ngrx/store-devtools": "13.0.2",
"bootstrap": "4.6.1",
"@angular/animations": "^14.2.0",
"@angular/common": "^14.2.0",
"@angular/compiler": "^14.2.0",
"@angular/core": "^14.2.0",
"@angular/forms": "^14.2.0",
"@angular/platform-browser": "^14.2.0",
"@angular/platform-browser-dynamic": "^14.2.0",
"@angular/router": "^14.2.0",
"@fortawesome/fontawesome-free": "^6.2.0",
"@ng-select/ng-select": "^9.0.2",
"@ngrx/effects": "14.3.0",
"@ngrx/entity": "14.3.0",
"@ngrx/router-store": "14.3.0",
"@ngrx/store": "14.3.0",
"@ngrx/store-devtools": "14.3.0",
"bootstrap": "4.6.2",
"d3": "^5.15.1",
"file-saver": "^2.0.5",
"keycloak-angular": "^9.1.0",
"keycloak-js": "^16.1.1",
"ngx-bootstrap": "^8.0.0",
"keycloak-angular": "^12.1.0",
"keycloak-js": "^19.0.1",
"ngx-bootstrap": "^9.0.0",
"ngx-dynamic-hooks": "^2.0.3",
"ngx-json-viewer": "^3.0.2",
"ngx-toastr": "^14.2.1",
"prismjs": "^1.28.0",
"ngx-json-viewer": "^3.1.0",
"ngx-toastr": "^15.0.0",
"prismjs": "^1.29.0",
"rxjs": "~7.5.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~13.2.3",
"@angular/cli": "~13.2.3",
"@angular/compiler-cli": "~13.2.2",
"@angular-devkit/build-angular": "^14.2.1",
"@angular/cli": "^14.2.1",
"@angular/compiler-cli": "^14.2.0",
"@types/d3": "^5.7.2",
"@types/file-saver": "^2.0.5",
"@types/jasmine": "~3.10.0",
"@types/jest": "^27.4.0",
"@types/jasmine": "~4.0.0",
"@types/node": "^12.11.1",
"jasmine-core": "~4.0.0",
"@types/jest": "^29.0.0",
"jasmine-core": "~4.3.0",
"jasmine-marbles": "^0.9.1",
"jest": "^27.5.1",
"jest-preset-angular": "^11.1.0",
"typescript": "~4.5.5"
"jest": "^28.1.0",
"jest-preset-angular": "^12.2.2",
"typescript": "~4.8.2"
}
}
}
\ No newline at end of file
import 'jest-preset-angular/setup-jest';
import './jest-global-mocks';
......@@ -8,7 +8,7 @@
*/
import { Component, Input, Output, TemplateRef, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { BsModalService } from 'ngx-bootstrap/modal';
import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
......@@ -20,7 +20,7 @@ import { FileInfo } from 'src/app/admin/store/models';
templateUrl: 'path-select-form-control.component.html'
})
export class PathSelectFormControlComponent implements OnChanges {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
@Input() disabled: boolean = false;
@Input() controlName: string;
@Input() controlLabel: string;
......
import { AfterViewChecked, AfterViewInit, Component, ElementRef, Input, OnDestroy, OnInit, Renderer2, ViewChild } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { fromEvent, Subscription } from 'rxjs';
......@@ -11,7 +11,7 @@ import { PrismService } from '../services/prism.service';
styleUrls: ['webpage-form-content.component.scss']
})
export class WebpageFormContentComponent implements OnInit, AfterViewChecked, AfterViewInit, OnDestroy {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
@Input() controlName: string;
@Input() controlLabel: string;
......
......@@ -8,7 +8,7 @@
*/
import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms';
import { UntypedFormGroup, UntypedFormControl, Validators } from '@angular/forms';
import { Database } from 'src/app/metamodel/models';
......@@ -20,14 +20,14 @@ export class DatabaseFormComponent implements OnInit {
@Input() database: Database;
@Output() onSubmit: EventEmitter<Database> = new EventEmitter();
public form = new FormGroup({
label: new FormControl('', [Validators.required]),
dbname: new FormControl('', [Validators.required]),
dbtype: new FormControl('', [Validators.required]),
dbhost: new FormControl('', [Validators.required]),
dbport: new FormControl('', [Validators.required]),
dblogin: new FormControl('', [Validators.required]),
dbpassword: new FormControl('', [Validators.required])
public form = new UntypedFormGroup({
label: new UntypedFormControl('', [Validators.required]),
dbname: new UntypedFormControl('', [Validators.required]),
dbtype: new UntypedFormControl('', [Validators.required]),
dbhost: new UntypedFormControl('', [Validators.required]),
dbport: new UntypedFormControl('', [Validators.required]),
dblogin: new UntypedFormControl('', [Validators.required]),
dbpassword: new UntypedFormControl('', [Validators.required])
});
ngOnInit() {
......
......@@ -8,7 +8,7 @@
*/
import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms';
import { UntypedFormGroup, UntypedFormControl, Validators } from '@angular/forms';
import { Instance } from 'src/app/metamodel/models';
import { FileInfo } from 'src/app/admin/store/models';
......@@ -25,31 +25,31 @@ export class InstanceFormComponent implements OnInit {
@Output() loadRootDirectory: EventEmitter<string> = new EventEmitter();
@Output() onSubmit: EventEmitter<Instance> = new EventEmitter();
public form = new FormGroup({
name: new FormControl('', [Validators.required]),
label: new FormControl('', [Validators.required]),
description: new FormControl('', [Validators.required]),
scientific_manager: new FormControl('', [Validators.required]),
instrument: new FormControl('', [Validators.required]),
wavelength_domain: new FormControl('', [Validators.required]),
display: new FormControl('', [Validators.required]),
data_path: new FormControl(''),
files_path: new FormControl(''),
public: new FormControl(true, [Validators.required]),
portal_logo: new FormControl(''),
design_color: new FormControl('#7AC29A', [Validators.required]),
design_background_color: new FormControl('#FFFFFF', [Validators.required]),
design_logo: new FormControl(''),
design_favicon: new FormControl(''),
samp_enabled: new FormControl(true),
back_to_portal: new FormControl(true),
search_by_criteria_allowed: new FormControl(true),
search_by_criteria_label: new FormControl({value: 'Search', disabled: false}),
search_multiple_allowed: new FormControl(false),
search_multiple_label: new FormControl({value: 'Search multiple', disabled: true}),
search_multiple_all_datasets_selected: new FormControl({value: false, disabled: true}),
documentation_allowed: new FormControl(false),
documentation_label: new FormControl({value: 'Documentation', disabled: true})
public form = new UntypedFormGroup({
name: new UntypedFormControl('', [Validators.required]),
label: new UntypedFormControl('', [Validators.required]),
description: new UntypedFormControl('', [Validators.required]),
scientific_manager: new UntypedFormControl('', [Validators.required]),
instrument: new UntypedFormControl('', [Validators.required]),
wavelength_domain: new UntypedFormControl('', [Validators.required]),
display: new UntypedFormControl('', [Validators.required]),
data_path: new UntypedFormControl(''),
files_path: new UntypedFormControl(''),
public: new UntypedFormControl(true, [Validators.required]),
portal_logo: new UntypedFormControl(''),
design_color: new UntypedFormControl('#7AC29A', [Validators.required]),
design_background_color: new UntypedFormControl('#FFFFFF', [Validators.required]),
design_logo: new UntypedFormControl(''),
design_favicon: new UntypedFormControl(''),
samp_enabled: new UntypedFormControl(true),
back_to_portal: new UntypedFormControl(true),
search_by_criteria_allowed: new UntypedFormControl(true),
search_by_criteria_label: new UntypedFormControl({value: 'Search', disabled: false}),
search_multiple_allowed: new UntypedFormControl(false),
search_multiple_label: new UntypedFormControl({value: 'Search multiple', disabled: true}),
search_multiple_all_datasets_selected: new UntypedFormControl({value: false, disabled: true}),
documentation_allowed: new UntypedFormControl(false),
documentation_label: new UntypedFormControl({value: 'Documentation', disabled: true})
});
ngOnInit() {
......@@ -86,7 +86,7 @@ export class InstanceFormComponent implements OnInit {
}
getHomeConfigFormGroup() {
return this.form.controls.home_component_config as FormGroup;
return this.form.controls.home_component_config as UntypedFormGroup;
}
checkDisableSearchByCriteriaAllowed() {
......
......@@ -8,7 +8,7 @@
*/
import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms';
import { UntypedFormGroup, UntypedFormControl, Validators } from '@angular/forms';
import { InstanceGroup, Instance } from 'src/app/metamodel/models';
......@@ -22,8 +22,8 @@ export class InstanceGroupFormComponent implements OnInit {
@Output() onSubmit: EventEmitter<InstanceGroup> = new EventEmitter();
public instanceGroupInstances = [];
public form = new FormGroup({
role: new FormControl('', [Validators.required])
public form = new UntypedFormGroup({
role: new UntypedFormControl('', [Validators.required])
});
ngOnInit() {
......
......@@ -8,7 +8,7 @@
*/
import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms';
import { UntypedFormGroup, UntypedFormControl, Validators } from '@angular/forms';
import { DatasetGroup, Dataset } from 'src/app/metamodel/models';
......@@ -22,8 +22,8 @@ export class DatasetGroupFormComponent implements OnInit {
@Output() onSubmit: EventEmitter<DatasetGroup> = new EventEmitter();
public groupDatasets = [];
public form = new FormGroup({
role: new FormControl('', [Validators.required])
public form = new UntypedFormGroup({
role: new UntypedFormControl('', [Validators.required])
});
ngOnInit() {
......
......@@ -8,7 +8,7 @@
*/
import { Component, Input, ChangeDetectionStrategy } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
@Component({
selector: 'app-option-form',
......@@ -17,5 +17,5 @@ import { FormGroup } from '@angular/forms';
changeDetection: ChangeDetectionStrategy.OnPush
})
export class OptionFormComponent {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
}
......@@ -8,7 +8,7 @@
*/
import { Component, Input, OnInit, Output, EventEmitter } from '@angular/core';
import { FormArray, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormArray, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { Option } from 'src/app/metamodel/models';
......@@ -17,14 +17,14 @@ import { Option } from 'src/app/metamodel/models';
templateUrl: 'option-list.component.html'
})
export class OptionListComponent implements OnInit {
@Input() form: FormArray;
@Input() form: UntypedFormArray;
@Input() optionList: Option[];
@Input() attributeDistinctList: string[];
@Input() attributeDistinctListIsLoading: boolean;
@Input() attributeDistinctListIsLoaded: boolean;
@Output() loadAttributeDistinctList: EventEmitter<{}> = new EventEmitter();
newOptionFormGroup: FormGroup;
newOptionFormGroup: UntypedFormGroup;
ngOnInit() {
if (this.optionList && this.optionList.length > 0) {
......@@ -38,15 +38,15 @@ export class OptionListComponent implements OnInit {
}
buildFormGroup() {
return new FormGroup({
label: new FormControl('', [Validators.required]),
value: new FormControl('', [Validators.required]),
display: new FormControl('', [Validators.required]),
return new UntypedFormGroup({
label: new UntypedFormControl('', [Validators.required]),
value: new UntypedFormControl('', [Validators.required]),
display: new UntypedFormControl('', [Validators.required]),
});
}
getOptionFormGroup(option) {
return option as FormGroup;
return option as UntypedFormGroup;
}
addOption() {
......
......@@ -8,7 +8,7 @@
*/
import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy, OnInit } from '@angular/core';
import { FormArray, FormControl, FormGroup } from '@angular/forms';
import { UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import { Attribute, CriteriaFamily } from 'src/app/metamodel/models';
import { searchTypeOperators } from 'src/app/shared/utils';
......@@ -31,22 +31,22 @@ export class TrCriteriaComponent implements OnInit {
searchTypeList = searchTypeList;
optionsFormArray = new FormArray([]);
optionsFormArray = new UntypedFormArray([]);
operatorList = searchTypeOperators;
public form = new FormGroup({
name: new FormControl({ value: '', disabled: true }),
type: new FormControl({ value: '', disabled: true }),
id_criteria_family: new FormControl(),
search_type: new FormControl(),
operator: new FormControl(),
dynamic_operator: new FormControl(),
min: new FormControl(),
max: new FormControl(),
public form = new UntypedFormGroup({
name: new UntypedFormControl({ value: '', disabled: true }),
type: new UntypedFormControl({ value: '', disabled: true }),
id_criteria_family: new UntypedFormControl(),
search_type: new UntypedFormControl(),
operator: new UntypedFormControl(),
dynamic_operator: new UntypedFormControl(),
min: new UntypedFormControl(),
max: new UntypedFormControl(),
options: this.optionsFormArray,
placeholder_min: new FormControl(),
placeholder_max: new FormControl(),
criteria_display: new FormControl()
placeholder_min: new UntypedFormControl(),
placeholder_max: new UntypedFormControl(),
criteria_display: new UntypedFormControl()
});
ngOnInit() {
......
......@@ -8,7 +8,7 @@
*/
import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy, OnInit } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import { Attribute, OutputCategory } from 'src/app/metamodel/models';
......@@ -23,10 +23,10 @@ export class TrDetailComponent implements OnInit {
@Input() outputCategoryList: OutputCategory[];
@Output() save: EventEmitter<Attribute> = new EventEmitter();
public form = new FormGroup({
name: new FormControl({ value: '', disabled: true }),
id_detail_output_category: new FormControl(),
detail_display: new FormControl()
public form = new UntypedFormGroup({
name: new UntypedFormControl({ value: '', disabled: true }),
id_detail_output_category: new UntypedFormControl(),
detail_display: new UntypedFormControl()
});
ngOnInit() {
......
......@@ -8,7 +8,7 @@
*/
import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy, OnInit } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { Attribute } from 'src/app/metamodel/models';
......@@ -23,13 +23,13 @@ export class TrGeneralComponent implements OnInit {
@Output() save: EventEmitter<Attribute> = new EventEmitter();
@Output() delete: EventEmitter<Attribute> = new EventEmitter();
public form = new FormGroup({
id: new FormControl({value: '', disabled: true}),
name: new FormControl('', [Validators.required]),
label: new FormControl('', [Validators.required]),
form_label: new FormControl('', [Validators.required]),
description: new FormControl(),
primary_key: new FormControl()
public form = new UntypedFormGroup({
id: new UntypedFormControl({value: '', disabled: true}),
name: new UntypedFormControl('', [Validators.required]),
label: new UntypedFormControl('', [Validators.required]),
form_label: new UntypedFormControl('', [Validators.required]),
description: new UntypedFormControl(),
primary_key: new UntypedFormControl()
});
ngOnInit() {
......
......@@ -8,7 +8,7 @@
*/
import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy, OnInit } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import { Attribute, OutputCategory } from 'src/app/metamodel/models';
......@@ -23,11 +23,11 @@ export class TrOutputComponent implements OnInit {
@Input() outputCategoryList: OutputCategory[];
@Output() save: EventEmitter<Attribute> = new EventEmitter();
public form = new FormGroup({
name: new FormControl({ value: '', disabled: true }),
output_display: new FormControl(),
id_output_category: new FormControl(),
selected: new FormControl()
public form = new UntypedFormGroup({
name: new UntypedFormControl({ value: '', disabled: true }),
output_display: new UntypedFormControl(),
id_output_category: new UntypedFormControl(),
selected: new UntypedFormControl()
});
ngOnInit() {
......
......@@ -8,7 +8,7 @@
*/
import { Component, Input, ChangeDetectionStrategy } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
@Component({
selector: 'app-detail-link-renderer',
......@@ -17,5 +17,5 @@ import { FormGroup } from '@angular/forms';
})
export class DetailLinkRendererComponent {
@Input() id: number;
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
}
......@@ -8,7 +8,7 @@
*/
import { Component, Input, ChangeDetectionStrategy } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
@Component({
selector: 'app-download-renderer',
......@@ -17,5 +17,5 @@ import { FormGroup } from '@angular/forms';
})
export class DownloadRendererComponent {
@Input() id: number;
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
}