diff --git a/package.json b/package.json index ebf1a19df..bbb080e19 100644 --- a/package.json +++ b/package.json @@ -34,24 +34,25 @@ }, "private": true, "dependencies": { - "@angular/animations": "13.2.1", - "@angular/cdk": "13.2.1", - "@angular/common": "13.2.1", - "@angular/compiler": "13.2.1", - "@angular/core": "13.2.1", - "@angular/forms": "13.2.1", - "@angular/material": "13.2.1", - "@angular/platform-browser": "13.2.1", - "@angular/platform-browser-dynamic": "13.2.1", - "@angular/platform-server": "13.2.1", - "@angular/router": "13.2.1", - "@nguniversal/express-engine": "13.0.2", + "@angular/animations": "14.3.0", + "@angular/cdk": "^14.2.7", + "@angular/common": "14.3.0", + "@angular/compiler": "14.3.0", + "@angular/core": "14.3.0", + "@angular/forms": "14.3.0", + "@angular/material": "^14.2.7", + "@angular/platform-browser": "14.3.0", + "@angular/platform-browser-dynamic": "14.3.0", + "@angular/platform-server": "14.3.0", + "@angular/router": "14.3.0", + "@nguniversal/express-engine": "^14.2.3", "@types/hammerjs": "2.0.36", "@types/node": "18.15.3", "classlist.js": "1.1.20150312", "compression": "1.7.3", "core-js": "2.5.4", "cronstrue": "1.94.0", + "date-fns": "^4.1.0", "defiant.js": "2.2.6", "dom-to-image": "^2.6.0", "hammerjs": "2.0.8", @@ -68,10 +69,10 @@ "ng-multiselect-dropdown": "0.2.10", "ngx-json-viewer": "2.4.0", "ngx-moment": "3.5.0", - "ngx-schema-form": "2.7.0", - "primeng": "^13.2.0", + "ngx-schema-form": "2.8.4", + "primeng": "^14.2.3", "reflect-metadata": "0.1.13", - "rxjs": "7.5.4", + "rxjs": "7.4.0", "ts-loader": "4.5.0", "util": "0.12.4", "web-animations-js": "2.3.2", @@ -80,15 +81,15 @@ "zone.js": "0.11.4" }, "devDependencies": { - "@angular-devkit/build-angular": "13.2.1", - "@angular-eslint/builder": "13.0.1", - "@angular-eslint/eslint-plugin": "13.0.1", - "@angular-eslint/eslint-plugin-template": "13.0.1", - "@angular-eslint/schematics": "13.0.1", - "@angular-eslint/template-parser": "13.0.1", - "@angular/cli": "13.2.1", - "@angular/compiler-cli": "13.2.1", - "@angular/language-service": "13.2.1", + "@angular-devkit/build-angular": "^14.2.13", + "@angular-eslint/builder": "^14.4.0", + "@angular-eslint/eslint-plugin": "^14.4.0", + "@angular-eslint/eslint-plugin-template": "^14.4.0", + "@angular-eslint/schematics": "^14.4.0", + "@angular-eslint/template-parser": "^14.4.0", + "@angular/cli": "^14.2.13", + "@angular/compiler-cli": "^14.3.0", + "@angular/language-service": "^14.3.0", "@types/estree": "0.0.51", "@types/jasmine": "3.10.3", "@types/jasminewd2": "2.0.10", @@ -112,7 +113,7 @@ "karma-jasmine": "4.0.1", "karma-jasmine-html-reporter": "1.7.0", "mkdirp": "1.0.4", - "ng-packagr": "13.2.1", + "ng-packagr": "14.2.2", "protractor": "7.0.0", "raw-loader": "4.0.2", "rimraf": "3.0.2", @@ -120,7 +121,7 @@ "ts-node": "10.5.0", "tslib": "2.3.1", "tslint": "5.20.1", - "typescript": "4.5.5" + "typescript": "4.8.4" }, "husky": { "hooks": { diff --git a/src/app/core/admin/admin.module.ts b/src/app/core/admin/admin.module.ts index 0eb649a91..eb25f55a5 100644 --- a/src/app/core/admin/admin.module.ts +++ b/src/app/core/admin/admin.module.ts @@ -23,7 +23,6 @@ import { AdminComponent } from '@gsrs-core/admin/admin.component'; import { CvTermDialogComponent } from '@gsrs-core/admin/cv-management/cv-term-dialog/cv-term-dialog.component'; import { ScheduledJobsComponent } from '@gsrs-core/admin/scheduled-jobs/scheduled-jobs.component'; import { ScheduledJobComponent } from '@gsrs-core/admin/scheduled-jobs/scheduled-job/scheduled-job.component'; -import { MomentModule } from 'ngx-moment'; import { UserManagementComponent } from '@gsrs-core/admin/user-management/user-management.component'; import { UserEditDialogComponent } from '@gsrs-core/admin/user-management/user-edit-dialog/user-edit-dialog.component'; import { CacheSummaryComponent } from '@gsrs-core/admin/cache-summary/cache-summary.component'; @@ -77,7 +76,6 @@ import { TakeImportPipe } from '@gsrs-core/admin/import-browse/take-import.pipe' MatTooltipModule, MatProgressSpinnerModule, MatDialogModule, - MomentModule, MatPaginatorModule, MatIconModule, MatRadioModule, diff --git a/src/app/core/config/config.factory.ts b/src/app/core/config/config.factory.ts index c19dc2af8..ece887dcd 100644 --- a/src/app/core/config/config.factory.ts +++ b/src/app/core/config/config.factory.ts @@ -2,6 +2,6 @@ import { ConfigService } from './config.service'; import { environment } from '../../../environments/environment'; // eslint-disable-next-line ban-types -export function configServiceFactory(startupService: ConfigService): Function { - return () => startupService.load(environment); -} +export function configServiceFactory(configService: ConfigService): () => Promise { + return () => configService.load(environment); + } diff --git a/src/app/core/sequence-search/sequence-search.component.ts b/src/app/core/sequence-search/sequence-search.component.ts index 673e0a342..5c7751951 100644 --- a/src/app/core/sequence-search/sequence-search.component.ts +++ b/src/app/core/sequence-search/sequence-search.component.ts @@ -50,7 +50,7 @@ export class SequenceSearchComponent implements OnInit, OnDestroy { this.sequenceSearchForm.controls.type.setValue(params.get('type')); } if (params.has('cutoff')) { - this.sequenceSearchForm.controls.cutoff.setValue(params.get('cutoff')); + this.sequenceSearchForm.controls.cutoff.setValue(parseInt(params.get('cutoff'))); } if (params.has('seq_type')) { const type = params.get('seq_type'); @@ -173,7 +173,7 @@ export class SequenceSearchComponent implements OnInit, OnDestroy { } }, error => { console.log(error); - if (this.sequenceSearchForm.value.sequence > 50000 ) { + if (parseInt(this.sequenceSearchForm.value.sequence) > 50000 ) { this.errorMessage = 'Cannot process searches for sequences with more than 50,000 sites'; } else { this.errorMessage = 'There was a problem processing your sequence search request'; diff --git a/src/app/core/substance-form/amount-form/amount-form.component.ts b/src/app/core/substance-form/amount-form/amount-form.component.ts index 253ef3d1c..bb9e12e02 100644 --- a/src/app/core/substance-form/amount-form/amount-form.component.ts +++ b/src/app/core/substance-form/amount-form/amount-form.component.ts @@ -48,7 +48,7 @@ export class AmountFormComponent implements OnInit { this.typeControl.valueChanges.subscribe(value => { this.privateSubstanceAmount.type = value; }); - this.averageControl.setValue(this.privateSubstanceAmount.average); + this.averageControl.setValue(this.privateSubstanceAmount.average.toString()); this.averageControl.valueChanges.subscribe(value => { if(value === null) { this.averageControl.setValue(''); @@ -58,9 +58,9 @@ export class AmountFormComponent implements OnInit { } else { this.averageControl.setValue(''); } - this.privateSubstanceAmount.average = value; + this.privateSubstanceAmount.average = parseInt(value); }); - this.lowControl.setValue(this.privateSubstanceAmount.low); + this.lowControl.setValue(this.privateSubstanceAmount.low.toString()); this.lowControl.valueChanges.subscribe(value => { if(value === null) { @@ -71,9 +71,9 @@ export class AmountFormComponent implements OnInit { } else { this.lowControl.setValue(''); } - this.privateSubstanceAmount.low = value; + this.privateSubstanceAmount.low = parseInt(value); }); - this.highControl.setValue(this.privateSubstanceAmount.high); + this.highControl.setValue(this.privateSubstanceAmount.high.toString()); this.highControl.valueChanges.subscribe(value => { if(value === null) { @@ -84,9 +84,9 @@ export class AmountFormComponent implements OnInit { } else { this.highControl.setValue(''); } - this.privateSubstanceAmount.high = value; + this.privateSubstanceAmount.high = parseInt(value); }); - this.lowLimitControl.setValue(this.privateSubstanceAmount.lowLimit); + this.lowLimitControl.setValue(this.privateSubstanceAmount.lowLimit.toString()); this.lowLimitControl.valueChanges.subscribe(value => { if(value === null) { this.lowLimitControl.setValue(''); @@ -96,9 +96,9 @@ export class AmountFormComponent implements OnInit { } else { this.lowLimitControl.setValue(''); } - this.privateSubstanceAmount.lowLimit = value; + this.privateSubstanceAmount.lowLimit = parseInt(value); }); - this.highLimitControl.setValue(this.privateSubstanceAmount.highLimit); + this.highLimitControl.setValue(this.privateSubstanceAmount.highLimit.toString()); this.highLimitControl.valueChanges.subscribe(value => { if(value === null) { this.highLimitControl.setValue(''); @@ -108,7 +108,7 @@ export class AmountFormComponent implements OnInit { } else { this.highLimitControl.setValue(''); } - this.privateSubstanceAmount.highLimit = value; + this.privateSubstanceAmount.highLimit = parseInt(value); }); this.unitsControl.setValue(this.privateSubstanceAmount.units); this.unitsControl.valueChanges.subscribe(value => { diff --git a/src/app/core/substance-form/disulfide-links/disulfide-links-form.component.ts b/src/app/core/substance-form/disulfide-links/disulfide-links-form.component.ts index 1c904746a..f0f094940 100644 --- a/src/app/core/substance-form/disulfide-links/disulfide-links-form.component.ts +++ b/src/app/core/substance-form/disulfide-links/disulfide-links-form.component.ts @@ -43,8 +43,8 @@ export class DisulfideLinksFormComponent implements OnInit, AfterViewInit, OnDes ngOnInit() { if (this.privateLink.sites) { - this.testForm.controls['site0'].setValue(this.privateLink.sites[0]); - this.testForm.controls['site1'].setValue(this.privateLink.sites[1]); + this.testForm.controls['site0'].setValue(this.privateLink.sites[0].toString()); + this.testForm.controls['site1'].setValue(this.privateLink.sites[1].toString()); } else { this.privateLink.sites = [{}, {}]; } @@ -128,14 +128,14 @@ export class DisulfideLinksFormComponent implements OnInit, AfterViewInit, OnDes if (newLinks) { if (newLinks[0] && newLinks[0].subunitIndex) { this.privateLink.sites[0] = newLinks[0]; - this.testForm.controls['site0'].setValue(this.privateLink.sites[0]); + this.testForm.controls['site0'].setValue(this.privateLink.sites[0].toString()); } else { this.privateLink.sites[0] = {}; this.testForm.controls['site0'].reset(); } if (newLinks[1] && newLinks[1].subunitIndex) { this.privateLink.sites[1] = newLinks[1]; - this.testForm.controls['site1'].setValue(this.privateLink.sites[1]); + this.testForm.controls['site1'].setValue(this.privateLink.sites[1].toString()); } else { this.privateLink.sites[1] = {}; this.testForm.controls['site1'].reset(); diff --git a/src/app/core/substance-form/references/references-dialogs/refernce-form-dialog.component.ts b/src/app/core/substance-form/references/references-dialogs/refernce-form-dialog.component.ts index 3778610a0..741a71451 100644 --- a/src/app/core/substance-form/references/references-dialogs/refernce-form-dialog.component.ts +++ b/src/app/core/substance-form/references/references-dialogs/refernce-form-dialog.component.ts @@ -3,7 +3,6 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { SubstanceReference } from '../../../substance/substance.model'; import { SubstanceService } from '@gsrs-core/substance/substance.service'; import { AuthService } from '@gsrs-core/auth'; -import { Content } from '@angular/compiler/src/render3/r3_ast'; @Component({ selector: 'app-refernce-form-dialog', diff --git a/src/app/core/substance-form/structurally-diverse/substance-form-structurally-diverse-source/substance-form-structurally-diverse-source.component.ts b/src/app/core/substance-form/structurally-diverse/substance-form-structurally-diverse-source/substance-form-structurally-diverse-source.component.ts index 7e2bf0fe8..0ae089b35 100644 --- a/src/app/core/substance-form/structurally-diverse/substance-form-structurally-diverse-source/substance-form-structurally-diverse-source.component.ts +++ b/src/app/core/substance-form/structurally-diverse/substance-form-structurally-diverse-source/substance-form-structurally-diverse-source.component.ts @@ -107,8 +107,7 @@ export class SubstanceFormStructurallyDiverseSourceComponent extends SubstanceF let found = true; check.forEach( field => { if (this.structurallyDiverse[field] && this.structurallyDiverse[field] !== null && - this.structurallyDiverse[field] !== '' && - this.structurallyDiverse[field] !== {} ) { + this.structurallyDiverse[field] !== '' && Object.keys(this.structurallyDiverse[field]).length > 0 ) { found = false; } }); diff --git a/src/app/core/substance-form/substance-form.service.ts b/src/app/core/substance-form/substance-form.service.ts index dbe7051eb..cbc2b6548 100644 --- a/src/app/core/substance-form/substance-form.service.ts +++ b/src/app/core/substance-form/substance-form.service.ts @@ -1307,7 +1307,7 @@ export class SubstanceFormService implements OnDestroy { if (substanceCopy.polymer && substanceCopy.polymer.monomers) { for (let i = 0; i < substanceCopy.polymer.monomers.length; i++) { const prop = substanceCopy.polymer.monomers[i]; - if (!prop.monomerSubstance || prop.monomerSubstance == {}) { + if (!prop.monomerSubstance || Object.keys(prop.monomerSubstance).length === 0) { const invalidPropertyMessage: ValidationMessage = { actionType: 'frontEnd', appliedChange: false, diff --git a/src/app/core/substance-ssg2/substance-ssg2-form.service.ts b/src/app/core/substance-ssg2/substance-ssg2-form.service.ts index 4f385016b..ea9ad613e 100644 --- a/src/app/core/substance-ssg2/substance-ssg2-form.service.ts +++ b/src/app/core/substance-ssg2/substance-ssg2-form.service.ts @@ -1276,7 +1276,7 @@ export class SubstanceSsg2FormService implements OnDestroy { if (substanceCopy.polymer && substanceCopy.polymer.monomers) { for (let i = 0; i < substanceCopy.polymer.monomers.length; i++) { const prop = substanceCopy.polymer.monomers[i]; - if (!prop.monomerSubstance || prop.monomerSubstance === {}) { + if (!prop.monomerSubstance || Object.keys(prop.monomerSubstance).length === 0) { const invalidPropertyMessage: ValidationMessage = { actionType: 'frontEnd', appliedChange: false, diff --git a/src/app/core/substance-ssg4m/ssg4m-critical-parameter/ssg4m-critical-parameter-form.component.ts b/src/app/core/substance-ssg4m/ssg4m-critical-parameter/ssg4m-critical-parameter-form.component.ts index 1e94eb040..981ef9fa4 100644 --- a/src/app/core/substance-ssg4m/ssg4m-critical-parameter/ssg4m-critical-parameter-form.component.ts +++ b/src/app/core/substance-ssg4m/ssg4m-critical-parameter/ssg4m-critical-parameter-form.component.ts @@ -221,50 +221,50 @@ export class Ssg4mCriticalParameterFormComponent implements OnInit, OnDestroy { this.typeControl.valueChanges.subscribe(value => { this.privateSubstanceAmount.type = value; }); - this.averageControl.setValue(this.privateSubstanceAmount.average); + this.averageControl.setValue(this.privateSubstanceAmount.average.toString()); this.averageControl.valueChanges.subscribe(value => { if (value === null) { this.averageControl.setValue(''); } else if (value.length === 1 && value.match(/[a-z]/i)) { this.averageControl.setValue(''); } - this.privateSubstanceAmount.average = value; + this.privateSubstanceAmount.average = parseInt(value); }); - this.lowControl.setValue(this.privateSubstanceAmount.low); + this.lowControl.setValue(this.privateSubstanceAmount.low.toString()); this.lowControl.valueChanges.subscribe(value => { if (value === null) { this.lowControl.setValue(''); } else if (value.length === 1 && value.match(/[a-z]/i)) { this.lowControl.setValue(''); } - this.privateSubstanceAmount.low = value; + this.privateSubstanceAmount.low = parseInt(value); }); - this.highControl.setValue(this.privateSubstanceAmount.high); + this.highControl.setValue(this.privateSubstanceAmount.high.toString()); this.highControl.valueChanges.subscribe(value => { if (value === null) { this.highControl.setValue(''); } else if (value.length === 1 && value.match(/[a-z]/i)) { this.highControl.setValue(''); } - this.privateSubstanceAmount.high = value; + this.privateSubstanceAmount.high = parseInt(value); }); - this.lowLimitControl.setValue(this.privateSubstanceAmount.lowLimit); + this.lowLimitControl.setValue(this.privateSubstanceAmount.lowLimit.toString()); this.lowLimitControl.valueChanges.subscribe(value => { if (value === null) { this.lowLimitControl.setValue(''); } else if (value.length === 1 && value.match(/[a-z]/i)) { this.lowLimitControl.setValue(''); } - this.privateSubstanceAmount.lowLimit = value; + this.privateSubstanceAmount.lowLimit = parseInt(value); }); - this.highLimitControl.setValue(this.privateSubstanceAmount.highLimit); + this.highLimitControl.setValue(this.privateSubstanceAmount.highLimit.toString()); this.highLimitControl.valueChanges.subscribe(value => { if (value === null) { this.highLimitControl.setValue(''); } else if (value.length === 1 && value.match(/[a-z]/i)) { this.highLimitControl.setValue(''); } - this.privateSubstanceAmount.highLimit = value; + this.privateSubstanceAmount.highLimit = parseInt(value); }); this.unitsControl.setValue(this.privateSubstanceAmount.units); this.unitsControl.valueChanges.subscribe(value => { diff --git a/src/app/core/substance-ssg4m/substance-ssg4m-form.component.ts b/src/app/core/substance-ssg4m/substance-ssg4m-form.component.ts index 070477b57..b0d3c676d 100644 --- a/src/app/core/substance-ssg4m/substance-ssg4m-form.component.ts +++ b/src/app/core/substance-ssg4m/substance-ssg4m-form.component.ts @@ -933,7 +933,7 @@ export class SubstanceSsg4ManufactureFormComponent implements OnInit, AfterViewI if (substanceCopy.polymer && substanceCopy.polymer.monomers) { for (let i = 0; i < substanceCopy.polymer.monomers.length; i++) { const prop = substanceCopy.polymer.monomers[i]; - if (!prop.monomerSubstance || prop.monomerSubstance === {}) { + if (!prop.monomerSubstance || Object.keys(prop.monomerSubstance).length === 0) { const invalidPropertyMessage: ValidationMessage = { actionType: 'frontEnd', appliedChange: false,