mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Merge pull request #2204 from atmire/Angular-15-upgrade
Angular 15 upgrade
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
|
||||
# For additional information regarding the format and rule options, please see:
|
||||
# https://github.com/browserslist/browserslist#queries
|
||||
|
||||
# For the full list of supported browsers by the Angular framework, please see:
|
||||
# https://angular.io/guide/browser-support
|
||||
|
||||
# You can see what browsers were selected by your queries by running:
|
||||
# npx browserslist
|
||||
|
||||
last 1 Chrome version
|
||||
last 1 Firefox version
|
||||
last 2 Edge major versions
|
||||
last 2 Safari major versions
|
||||
last 2 iOS major versions
|
||||
Firefox ESR
|
||||
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
|
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -31,6 +31,8 @@ jobs:
|
||||
# When Chrome version is specified, we pin to a specific version of Chrome
|
||||
# Comment this out to use the latest release
|
||||
#CHROME_VERSION: "90.0.4430.212-1"
|
||||
# Bump Node heap size (OOM in CI after upgrading to Angular 15)
|
||||
NODE_OPTIONS: '--max-old-space-size=4096'
|
||||
strategy:
|
||||
# Create a matrix of Node versions to test against (in parallel)
|
||||
matrix:
|
||||
|
13
angular.json
13
angular.json
@@ -274,9 +274,18 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"defaultProject": "dspace-angular",
|
||||
"cli": {
|
||||
"analytics": false,
|
||||
"defaultCollection": "@angular-eslint/schematics"
|
||||
"schematicCollections": [
|
||||
"@angular-eslint/schematics"
|
||||
]
|
||||
},
|
||||
"schematics": {
|
||||
"@angular-eslint/schematics:application": {
|
||||
"setParserOptionsProject": true
|
||||
},
|
||||
"@angular-eslint/schematics:library": {
|
||||
"setParserOptionsProject": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
164
package.json
164
package.json
@@ -17,9 +17,9 @@
|
||||
"build:stats": "ng build --stats-json",
|
||||
"build:prod": "yarn run build:ssr",
|
||||
"build:ssr": "ng build --configuration production && ng run dspace-angular:server:production",
|
||||
"test": "ng test --sourceMap=true --watch=false --configuration test",
|
||||
"test:watch": "nodemon --exec \"ng test --sourceMap=true --watch=true --configuration test\"",
|
||||
"test:headless": "ng test --sourceMap=true --watch=false --configuration test --browsers=ChromeHeadless --code-coverage",
|
||||
"test": "ng test --source-map=true --watch=false --configuration test",
|
||||
"test:watch": "nodemon --exec \"ng test --source-map=true --watch=true --configuration test\"",
|
||||
"test:headless": "ng test --source-map=true --watch=false --configuration test --browsers=ChromeHeadless --code-coverage",
|
||||
"lint": "ng lint",
|
||||
"lint-fix": "ng lint --fix=true",
|
||||
"e2e": "ng e2e",
|
||||
@@ -55,136 +55,136 @@
|
||||
"ts-node": "10.2.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@angular/animations": "~13.3.12",
|
||||
"@angular/cdk": "^13.2.6",
|
||||
"@angular/common": "~13.3.12",
|
||||
"@angular/compiler": "~13.3.12",
|
||||
"@angular/core": "~13.3.12",
|
||||
"@angular/forms": "~13.3.12",
|
||||
"@angular/localize": "13.3.12",
|
||||
"@angular/platform-browser": "~13.3.12",
|
||||
"@angular/platform-browser-dynamic": "~13.3.12",
|
||||
"@angular/platform-server": "~13.3.12",
|
||||
"@angular/router": "~13.3.12",
|
||||
"@babel/runtime": "7.17.2",
|
||||
"@angular/animations": "^15.2.8",
|
||||
"@angular/cdk": "^15.2.8",
|
||||
"@angular/common": "^15.2.8",
|
||||
"@angular/compiler": "^15.2.8",
|
||||
"@angular/core": "^15.2.8",
|
||||
"@angular/forms": "^15.2.8",
|
||||
"@angular/localize": "15.2.8",
|
||||
"@angular/platform-browser": "^15.2.8",
|
||||
"@angular/platform-browser-dynamic": "^15.2.8",
|
||||
"@angular/platform-server": "^15.2.8",
|
||||
"@angular/router": "^15.2.8",
|
||||
"@babel/runtime": "7.21.0",
|
||||
"@kolkov/ngx-gallery": "^2.0.1",
|
||||
"@material-ui/core": "^4.11.0",
|
||||
"@material-ui/icons": "^4.9.1",
|
||||
"@material-ui/icons": "^4.11.3",
|
||||
"@ng-bootstrap/ng-bootstrap": "^11.0.0",
|
||||
"@ng-dynamic-forms/core": "^15.0.0",
|
||||
"@ng-dynamic-forms/ui-ng-bootstrap": "^15.0.0",
|
||||
"@ngrx/effects": "^13.0.2",
|
||||
"@ngrx/router-store": "^13.0.2",
|
||||
"@ngrx/store": "^13.0.2",
|
||||
"@nguniversal/express-engine": "^13.0.2",
|
||||
"@ngx-translate/core": "^13.0.0",
|
||||
"@nicky-lenaers/ngx-scroll-to": "^13.0.0",
|
||||
"@ngrx/effects": "^15.4.0",
|
||||
"@ngrx/router-store": "^15.4.0",
|
||||
"@ngrx/store": "^15.4.0",
|
||||
"@nguniversal/express-engine": "^15.2.1",
|
||||
"@ngx-translate/core": "^14.0.0",
|
||||
"@nicky-lenaers/ngx-scroll-to": "^14.0.0",
|
||||
"@types/grecaptcha": "^3.0.4",
|
||||
"angular-idle-preload": "3.0.0",
|
||||
"angulartics2": "^12.0.0",
|
||||
"angulartics2": "^12.2.0",
|
||||
"axios": "^0.27.2",
|
||||
"bootstrap": "^4.6.1",
|
||||
"cerialize": "0.1.18",
|
||||
"cli-progress": "^3.8.0",
|
||||
"cli-progress": "^3.12.0",
|
||||
"colors": "^1.4.0",
|
||||
"compression": "^1.7.4",
|
||||
"cookie-parser": "1.4.5",
|
||||
"core-js": "^3.7.0",
|
||||
"cookie-parser": "1.4.6",
|
||||
"core-js": "^3.30.1",
|
||||
"date-fns": "^2.29.3",
|
||||
"date-fns-tz": "^1.3.7",
|
||||
"deepmerge": "^4.2.2",
|
||||
"ejs": "^3.1.8",
|
||||
"express": "^4.17.1",
|
||||
"deepmerge": "^4.3.1",
|
||||
"ejs": "^3.1.9",
|
||||
"express": "^4.18.2",
|
||||
"express-rate-limit": "^5.1.3",
|
||||
"fast-json-patch": "^3.0.0-1",
|
||||
"fast-json-patch": "^3.1.1",
|
||||
"filesize": "^6.1.0",
|
||||
"http-proxy-middleware": "^1.0.5",
|
||||
"isbot": "^3.6.5",
|
||||
"isbot": "^3.6.10",
|
||||
"js-cookie": "2.2.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"json5": "^2.2.2",
|
||||
"jsonschema": "1.4.0",
|
||||
"json5": "^2.2.3",
|
||||
"jsonschema": "1.4.1",
|
||||
"jwt-decode": "^3.1.2",
|
||||
"klaro": "^0.7.18",
|
||||
"lodash": "^4.17.21",
|
||||
"lru-cache": "^7.14.1",
|
||||
"markdown-it": "^13.0.1",
|
||||
"markdown-it-mathjax3": "^4.3.1",
|
||||
"markdown-it-mathjax3": "^4.3.2",
|
||||
"mirador": "^3.3.0",
|
||||
"mirador-dl-plugin": "^0.13.0",
|
||||
"mirador-share-plugin": "^0.11.0",
|
||||
"morgan": "^1.10.0",
|
||||
"ng-mocks": "^13.1.1",
|
||||
"ng-mocks": "^14.10.0",
|
||||
"ng2-file-upload": "1.4.0",
|
||||
"ng2-nouislider": "^1.8.3",
|
||||
"ngx-infinite-scroll": "^10.0.1",
|
||||
"ngx-pagination": "5.0.0",
|
||||
"ngx-infinite-scroll": "^15.0.0",
|
||||
"ngx-pagination": "6.0.3",
|
||||
"ngx-sortablejs": "^11.1.0",
|
||||
"ngx-ui-switch": "^13.0.2",
|
||||
"ngx-ui-switch": "^14.0.3",
|
||||
"nouislider": "^14.6.3",
|
||||
"pem": "1.14.4",
|
||||
"prop-types": "^15.7.2",
|
||||
"react-copy-to-clipboard": "^5.0.1",
|
||||
"pem": "1.14.7",
|
||||
"prop-types": "^15.8.1",
|
||||
"react-copy-to-clipboard": "^5.1.0",
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"rxjs": "^7.5.5",
|
||||
"sanitize-html": "^2.7.2",
|
||||
"sortablejs": "1.13.0",
|
||||
"rxjs": "^7.8.0",
|
||||
"sanitize-html": "^2.10.0",
|
||||
"sortablejs": "1.15.0",
|
||||
"uuid": "^8.3.2",
|
||||
"webfontloader": "1.6.28",
|
||||
"zone.js": "~0.11.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-builders/custom-webpack": "~13.1.0",
|
||||
"@angular-devkit/build-angular": "~13.3.10",
|
||||
"@angular-eslint/builder": "13.1.0",
|
||||
"@angular-eslint/eslint-plugin": "13.1.0",
|
||||
"@angular-eslint/eslint-plugin-template": "13.1.0",
|
||||
"@angular-eslint/schematics": "13.1.0",
|
||||
"@angular-eslint/template-parser": "13.1.0",
|
||||
"@angular/cli": "~13.3.10",
|
||||
"@angular/compiler-cli": "~13.3.12",
|
||||
"@angular/language-service": "~13.3.12",
|
||||
"@angular-builders/custom-webpack": "~15.0.0",
|
||||
"@angular-devkit/build-angular": "^15.2.6",
|
||||
"@angular-eslint/builder": "15.2.1",
|
||||
"@angular-eslint/eslint-plugin": "15.2.1",
|
||||
"@angular-eslint/eslint-plugin-template": "15.2.1",
|
||||
"@angular-eslint/schematics": "15.2.1",
|
||||
"@angular-eslint/template-parser": "15.2.1",
|
||||
"@angular/cli": "^15.2.6",
|
||||
"@angular/compiler-cli": "^15.2.8",
|
||||
"@angular/language-service": "^15.2.8",
|
||||
"@cypress/schematic": "^1.5.0",
|
||||
"@fortawesome/fontawesome-free": "^6.2.1",
|
||||
"@ngrx/store-devtools": "^13.0.2",
|
||||
"@ngtools/webpack": "^13.2.6",
|
||||
"@nguniversal/builders": "^13.1.1",
|
||||
"@fortawesome/fontawesome-free": "^6.4.0",
|
||||
"@ngrx/store-devtools": "^15.4.0",
|
||||
"@ngtools/webpack": "^15.2.6",
|
||||
"@nguniversal/builders": "^15.2.1",
|
||||
"@types/deep-freeze": "0.1.2",
|
||||
"@types/ejs": "^3.1.1",
|
||||
"@types/express": "^4.17.9",
|
||||
"@types/ejs": "^3.1.2",
|
||||
"@types/express": "^4.17.17",
|
||||
"@types/jasmine": "~3.6.0",
|
||||
"@types/js-cookie": "2.2.6",
|
||||
"@types/lodash": "^4.14.165",
|
||||
"@types/lodash": "^4.14.194",
|
||||
"@types/node": "^14.14.9",
|
||||
"@types/sanitize-html": "^2.6.2",
|
||||
"@typescript-eslint/eslint-plugin": "5.11.0",
|
||||
"@typescript-eslint/parser": "5.11.0",
|
||||
"axe-core": "^4.4.3",
|
||||
"@types/sanitize-html": "^2.9.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.59.1",
|
||||
"@typescript-eslint/parser": "^5.59.1",
|
||||
"axe-core": "^4.7.0",
|
||||
"compression-webpack-plugin": "^9.2.0",
|
||||
"copy-webpack-plugin": "^6.4.1",
|
||||
"cross-env": "^7.0.3",
|
||||
"cypress": "12.9.0",
|
||||
"cypress-axe": "^1.1.0",
|
||||
"cypress": "12.10.0",
|
||||
"cypress-axe": "^1.4.0",
|
||||
"deep-freeze": "0.0.1",
|
||||
"eslint": "^8.2.0",
|
||||
"eslint-plugin-deprecation": "^1.3.2",
|
||||
"eslint-plugin-import": "^2.25.4",
|
||||
"eslint": "^8.39.0",
|
||||
"eslint-plugin-deprecation": "^1.4.1",
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"eslint-plugin-jsdoc": "^39.6.4",
|
||||
"eslint-plugin-jsonc": "^2.6.0",
|
||||
"eslint-plugin-lodash": "^7.4.0",
|
||||
"eslint-plugin-unused-imports": "^2.0.0",
|
||||
"express-static-gzip": "^2.1.5",
|
||||
"express-static-gzip": "^2.1.7",
|
||||
"jasmine-core": "^3.8.0",
|
||||
"jasmine-marbles": "0.9.2",
|
||||
"karma": "^6.3.14",
|
||||
"karma-chrome-launcher": "~3.1.0",
|
||||
"karma-coverage-istanbul-reporter": "~3.0.2",
|
||||
"karma": "^6.4.2",
|
||||
"karma-chrome-launcher": "~3.2.0",
|
||||
"karma-coverage-istanbul-reporter": "~3.0.3",
|
||||
"karma-jasmine": "~4.0.0",
|
||||
"karma-jasmine-html-reporter": "^1.5.0",
|
||||
"karma-mocha-reporter": "2.2.5",
|
||||
"ngx-mask": "^13.1.7",
|
||||
"nodemon": "^2.0.20",
|
||||
"postcss": "^8.1",
|
||||
"nodemon": "^2.0.22",
|
||||
"postcss": "^8.4",
|
||||
"postcss-apply": "0.12.0",
|
||||
"postcss-import": "^14.0.0",
|
||||
"postcss-loader": "^4.0.3",
|
||||
@@ -194,14 +194,14 @@
|
||||
"react-dom": "^16.14.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"rxjs-spy": "^8.0.2",
|
||||
"sass": "~1.33.0",
|
||||
"sass": "~1.62.0",
|
||||
"sass-loader": "^12.6.0",
|
||||
"sass-resources-loader": "^2.1.1",
|
||||
"sass-resources-loader": "^2.2.5",
|
||||
"ts-node": "^8.10.2",
|
||||
"typescript": "~4.5.5",
|
||||
"webpack": "^5.76.0",
|
||||
"webpack-bundle-analyzer": "^4.4.0",
|
||||
"typescript": "~4.8.4",
|
||||
"webpack": "5.76.1",
|
||||
"webpack-bundle-analyzer": "^4.8.0",
|
||||
"webpack-cli": "^4.2.0",
|
||||
"webpack-dev-server": "^4.5.0"
|
||||
"webpack-dev-server": "^4.13.3"
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
import { UntypedFormBuilder } from '@angular/forms';
|
||||
import { Router } from '@angular/router';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { BehaviorSubject, combineLatest, Observable, Subscription } from 'rxjs';
|
||||
@@ -89,7 +89,7 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
|
||||
private translateService: TranslateService,
|
||||
private notificationsService: NotificationsService,
|
||||
private authorizationService: AuthorizationDataService,
|
||||
private formBuilder: FormBuilder,
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private router: Router,
|
||||
private modalService: NgbModal,
|
||||
private paginationService: PaginationService,
|
||||
|
@@ -2,7 +2,7 @@ import { Observable, of as observableOf } from 'rxjs';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { UntypedFormControl, UntypedFormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { BrowserModule, By } from '@angular/platform-browser';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
@@ -116,9 +116,9 @@ describe('EPersonFormComponent', () => {
|
||||
const controlModel = model;
|
||||
const controlState = { value: controlModel.value, disabled: controlModel.disabled };
|
||||
const controlOptions = this.createAbstractControlOptions(controlModel.validators, controlModel.asyncValidators, controlModel.updateOn);
|
||||
controls[model.id] = new FormControl(controlState, controlOptions);
|
||||
controls[model.id] = new UntypedFormControl(controlState, controlOptions);
|
||||
});
|
||||
return new FormGroup(controls, options);
|
||||
return new UntypedFormGroup(controls, options);
|
||||
},
|
||||
createAbstractControlOptions(validatorsConfig = null, asyncValidatorsConfig = null, updateOn = null) {
|
||||
return {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { ChangeDetectorRef, Component, EventEmitter, OnDestroy, OnInit, Output } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import {
|
||||
DynamicCheckboxModel,
|
||||
DynamicFormControlModel,
|
||||
@@ -108,7 +108,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
/**
|
||||
* A FormGroup that combines all inputs
|
||||
*/
|
||||
formGroup: FormGroup;
|
||||
formGroup: UntypedFormGroup;
|
||||
|
||||
/**
|
||||
* An EventEmitter that's fired whenever the form is being submitted
|
||||
|
@@ -2,7 +2,7 @@ import { CommonModule } from '@angular/common';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { UntypedFormControl, UntypedFormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { BrowserModule, By } from '@angular/platform-browser';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
@@ -130,9 +130,9 @@ describe('GroupFormComponent', () => {
|
||||
const controlModel = model;
|
||||
const controlState = { value: controlModel.value, disabled: controlModel.disabled };
|
||||
const controlOptions = this.createAbstractControlOptions(controlModel.validators, controlModel.asyncValidators, controlModel.updateOn);
|
||||
controls[model.id] = new FormControl(controlState, controlOptions);
|
||||
controls[model.id] = new UntypedFormControl(controlState, controlOptions);
|
||||
});
|
||||
return new FormGroup(controls, options);
|
||||
return new UntypedFormGroup(controls, options);
|
||||
},
|
||||
createAbstractControlOptions(validatorsConfig = null, asyncValidatorsConfig = null, updateOn = null) {
|
||||
return {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Component, EventEmitter, HostListener, OnDestroy, OnInit, Output, ChangeDetectorRef } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import {
|
||||
@@ -95,7 +95,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
||||
/**
|
||||
* A FormGroup that combines all inputs
|
||||
*/
|
||||
formGroup: FormGroup;
|
||||
formGroup: UntypedFormGroup;
|
||||
|
||||
/**
|
||||
* An EventEmitter that's fired whenever the form is being submitted
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
import { UntypedFormBuilder } from '@angular/forms';
|
||||
import { Router } from '@angular/router';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import {
|
||||
@@ -141,7 +141,7 @@ export class MembersListComponent implements OnInit, OnDestroy {
|
||||
public ePersonDataService: EPersonDataService,
|
||||
protected translateService: TranslateService,
|
||||
protected notificationsService: NotificationsService,
|
||||
protected formBuilder: FormBuilder,
|
||||
protected formBuilder: UntypedFormBuilder,
|
||||
protected paginationService: PaginationService,
|
||||
private router: Router
|
||||
) {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
import { UntypedFormBuilder } from '@angular/forms';
|
||||
import { Router } from '@angular/router';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { BehaviorSubject, Observable, of as observableOf, Subscription } from 'rxjs';
|
||||
@@ -86,7 +86,7 @@ export class SubgroupsListComponent implements OnInit, OnDestroy {
|
||||
constructor(public groupDataService: GroupDataService,
|
||||
private translateService: TranslateService,
|
||||
private notificationsService: NotificationsService,
|
||||
private formBuilder: FormBuilder,
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private paginationService: PaginationService,
|
||||
private router: Router) {
|
||||
this.currentSearchQuery = '';
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
import { UntypedFormBuilder } from '@angular/forms';
|
||||
import { Router } from '@angular/router';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import {
|
||||
@@ -99,7 +99,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {
|
||||
private dSpaceObjectDataService: DSpaceObjectDataService,
|
||||
private translateService: TranslateService,
|
||||
private notificationsService: NotificationsService,
|
||||
private formBuilder: FormBuilder,
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
protected routeService: RouteService,
|
||||
private router: Router,
|
||||
private authorizationService: AuthorizationDataService,
|
||||
|
@@ -5,7 +5,7 @@ import {
|
||||
DynamicFormLayout,
|
||||
DynamicInputModel
|
||||
} from '@ng-dynamic-forms/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import { RegistryService } from '../../../../core/registry/registry.service';
|
||||
import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service';
|
||||
import { take } from 'rxjs/operators';
|
||||
@@ -66,7 +66,7 @@ export class MetadataSchemaFormComponent implements OnInit, OnDestroy {
|
||||
/**
|
||||
* A FormGroup that combines all inputs
|
||||
*/
|
||||
formGroup: FormGroup;
|
||||
formGroup: UntypedFormGroup;
|
||||
|
||||
/**
|
||||
* An EventEmitter that's fired whenever the form is being submitted
|
||||
|
@@ -5,7 +5,7 @@ import {
|
||||
DynamicFormLayout,
|
||||
DynamicInputModel
|
||||
} from '@ng-dynamic-forms/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import { RegistryService } from '../../../../core/registry/registry.service';
|
||||
import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service';
|
||||
import { take } from 'rxjs/operators';
|
||||
@@ -82,7 +82,7 @@ export class MetadataFieldFormComponent implements OnInit, OnDestroy {
|
||||
/**
|
||||
* A FormGroup that combines all inputs
|
||||
*/
|
||||
formGroup: FormGroup;
|
||||
formGroup: UntypedFormGroup;
|
||||
|
||||
/**
|
||||
* An EventEmitter that's fired whenever the form is being submitted
|
||||
|
@@ -15,7 +15,7 @@ import { INotification, Notification } from '../../shared/notifications/models/n
|
||||
import { BitstreamFormat } from '../../core/shared/bitstream-format.model';
|
||||
import { BitstreamFormatSupportLevel } from '../../core/shared/bitstream-format-support-level';
|
||||
import { hasValue } from '../../shared/empty.util';
|
||||
import { FormControl, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
|
||||
import { FileSizePipe } from '../../shared/utils/file-size-pipe';
|
||||
import { VarDirective } from '../../shared/utils/var.directive';
|
||||
import { createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||
@@ -84,9 +84,9 @@ describe('EditBitstreamPageComponent', () => {
|
||||
const controls = {};
|
||||
if (hasValue(fModel)) {
|
||||
fModel.forEach((controlModel) => {
|
||||
controls[controlModel.id] = new FormControl((controlModel as any).value);
|
||||
controls[controlModel.id] = new UntypedFormControl((controlModel as any).value);
|
||||
});
|
||||
return new FormGroup(controls);
|
||||
return new UntypedFormGroup(controls);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ import {
|
||||
DynamicInputModel,
|
||||
DynamicSelectModel
|
||||
} from '@ng-dynamic-forms/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { DynamicCustomSwitchModel } from '../../shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.model';
|
||||
import cloneDeep from 'lodash/cloneDeep';
|
||||
@@ -359,7 +359,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
||||
/**
|
||||
* The form group of this form
|
||||
*/
|
||||
formGroup: FormGroup;
|
||||
formGroup: UntypedFormGroup;
|
||||
|
||||
/**
|
||||
* The ID of the item the bitstream originates from
|
||||
|
@@ -12,7 +12,7 @@ import { NotificationType } from '../../../shared/notifications/models/notificat
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { DynamicFormControlModel, DynamicFormService } from '@ng-dynamic-forms/core';
|
||||
import { hasValue } from '../../../shared/empty.util';
|
||||
import { FormControl, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
|
||||
import { RouterStub } from '../../../shared/testing/router.stub';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { Collection } from '../../../core/shared/collection.model';
|
||||
@@ -98,9 +98,9 @@ describe('CollectionSourceComponent', () => {
|
||||
const controls = {};
|
||||
if (hasValue(fModel)) {
|
||||
fModel.forEach((controlModel) => {
|
||||
controls[controlModel.id] = new FormControl((controlModel as any).value);
|
||||
controls[controlModel.id] = new UntypedFormControl((controlModel as any).value);
|
||||
});
|
||||
return new FormGroup(controls);
|
||||
return new UntypedFormGroup(controls);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ import { Location } from '@angular/common';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { ObjectUpdatesService } from '../../../core/data/object-updates/object-updates.service';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import { hasNoValue, hasValue, isNotEmpty } from '../../../shared/empty.util';
|
||||
import { ContentSource, ContentSourceHarvestType } from '../../../core/shared/content-source.model';
|
||||
import { Observable, Subscription } from 'rxjs';
|
||||
@@ -202,7 +202,7 @@ export class CollectionSourceComponent extends AbstractTrackableComponent implem
|
||||
/**
|
||||
* The form group of this form
|
||||
*/
|
||||
formGroup: FormGroup;
|
||||
formGroup: UntypedFormGroup;
|
||||
|
||||
/**
|
||||
* Subscription to update the current form
|
||||
|
6
src/app/core/cache/builders/link.service.ts
vendored
6
src/app/core/cache/builders/link.service.ts
vendored
@@ -60,7 +60,7 @@ export class LinkService {
|
||||
const provider = this.getDataServiceFor(matchingLinkDef.resourceType);
|
||||
|
||||
if (hasNoValue(provider)) {
|
||||
throw new Error(`The @link() for ${linkToFollow.name} on ${model.constructor.name} models uses the resource type ${matchingLinkDef.resourceType.value.toUpperCase()}, but there is no service with an @dataService(${matchingLinkDef.resourceType.value.toUpperCase()}) annotation in order to retrieve it`);
|
||||
throw new Error(`The @link() for ${String(linkToFollow.name)} on ${model.constructor.name} models uses the resource type ${matchingLinkDef.resourceType.value.toUpperCase()}, but there is no service with an @dataService(${matchingLinkDef.resourceType.value.toUpperCase()}) annotation in order to retrieve it`);
|
||||
}
|
||||
|
||||
const service: HALDataService<any> = Injector.create({
|
||||
@@ -79,12 +79,12 @@ export class LinkService {
|
||||
return service.findByHref(href, linkToFollow.useCachedVersionIfAvailable, linkToFollow.reRequestOnStale, ...linkToFollow.linksToFollow);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(`Something went wrong when using @dataService(${matchingLinkDef.resourceType.value}) ${hasValue(service) ? '' : '(undefined) '}to resolve link ${linkToFollow.name} at ${href}`);
|
||||
console.error(`Something went wrong when using @dataService(${matchingLinkDef.resourceType.value}) ${hasValue(service) ? '' : '(undefined) '}to resolve link ${String(linkToFollow.name)} at ${href}`);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
} else if (!linkToFollow.isOptional) {
|
||||
throw new Error(`followLink('${linkToFollow.name}') was used as a required link for a ${model.constructor.name}, but there is no property on ${model.constructor.name} models with an @link() for ${linkToFollow.name}`);
|
||||
throw new Error(`followLink('${String(linkToFollow.name)}') was used as a required link for a ${model.constructor.name}, but there is no property on ${model.constructor.name} models with an @link() for ${String(linkToFollow.name)}`);
|
||||
}
|
||||
|
||||
return EMPTY;
|
||||
|
@@ -73,7 +73,7 @@ export class RemoteDataBuildService {
|
||||
if (getResourceTypeValueFor((obj as any).type) === PAGINATED_LIST.value) {
|
||||
return this.buildPaginatedList<T>(obj, ...linksToFollow);
|
||||
} else if (isNotEmpty(linksToFollow)) {
|
||||
return [this.linkService.resolveLinks(obj, ...linksToFollow)];
|
||||
return [this.linkService.resolveLinks(obj as any, ...linksToFollow)];
|
||||
}
|
||||
}
|
||||
return [obj];
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { ChangeDetectorRef, Component, Input, OnInit } from '@angular/core';
|
||||
import { ScriptDataService } from '../core/data/processes/script-data.service';
|
||||
import { FormControl, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
|
||||
import { getFirstCompletedRemoteData } from '../core/shared/operators';
|
||||
import { find, map } from 'rxjs/operators';
|
||||
import { NotificationsService } from '../shared/notifications/notifications.service';
|
||||
@@ -28,7 +28,7 @@ export class CurationFormComponent implements OnInit {
|
||||
|
||||
config: Observable<RemoteData<ConfigurationProperty>>;
|
||||
tasks: string[];
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
|
||||
@Input()
|
||||
dsoHandle: string;
|
||||
@@ -46,9 +46,9 @@ export class CurationFormComponent implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.form = new FormGroup({
|
||||
task: new FormControl(''),
|
||||
handle: new FormControl('')
|
||||
this.form = new UntypedFormGroup({
|
||||
task: new UntypedFormControl(''),
|
||||
handle: new UntypedFormControl('')
|
||||
});
|
||||
|
||||
this.config = this.configurationDataService.findByPropertyName(CURATION_CFG);
|
||||
|
@@ -17,7 +17,7 @@ import {
|
||||
} from '../../../core/shared/operators';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { RegistryService } from '../../../core/registry/registry.service';
|
||||
import { FormControl } from '@angular/forms';
|
||||
import { UntypedFormControl } from '@angular/forms';
|
||||
import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject';
|
||||
import { hasValue } from '../../../shared/empty.util';
|
||||
import { Subscription } from 'rxjs/internal/Subscription';
|
||||
@@ -70,7 +70,7 @@ export class MetadataFieldSelectorComponent implements OnInit, OnDestroy, AfterV
|
||||
/**
|
||||
* FormControl for the input
|
||||
*/
|
||||
public input: FormControl = new FormControl();
|
||||
public input: UntypedFormControl = new UntypedFormControl();
|
||||
|
||||
/**
|
||||
* The current query to update mdFieldOptions$ for
|
||||
|
@@ -5,7 +5,7 @@ import { NotificationsServiceStub } from '../../shared/testing/notifications-ser
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { FormBuilder, ReactiveFormsModule } from '@angular/forms';
|
||||
import { UntypedFormBuilder, ReactiveFormsModule } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
||||
@@ -60,7 +60,7 @@ describe('ForgotPasswordFormComponent', () => {
|
||||
{provide: ActivatedRoute, useValue: route},
|
||||
{provide: Store, useValue: store},
|
||||
{provide: EPersonDataService, useValue: ePersonDataService},
|
||||
{provide: FormBuilder, useValue: new FormBuilder()},
|
||||
{provide: UntypedFormBuilder, useValue: new UntypedFormBuilder()},
|
||||
{provide: NotificationsService, useValue: notificationsService},
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
|
@@ -7,7 +7,7 @@ import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { RouteService } from '../../../core/services/route.service';
|
||||
import { routeServiceStub } from '../../../shared/testing/route-service.stub';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
import { UntypedFormBuilder } from '@angular/forms';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||
import { AuthService } from '../../../core/auth/auth.service';
|
||||
@@ -41,7 +41,7 @@ describe('FeedbackFormComponent', () => {
|
||||
declarations: [FeedbackFormComponent],
|
||||
providers: [
|
||||
{ provide: RouteService, useValue: routeServiceStub },
|
||||
{ provide: FormBuilder, useValue: new FormBuilder() },
|
||||
{ provide: UntypedFormBuilder, useValue: new UntypedFormBuilder() },
|
||||
{ provide: NotificationsService, useValue: notificationService },
|
||||
{ provide: FeedbackDataService, useValue: feedbackDataServiceStub },
|
||||
{ provide: AuthService, useValue: authService },
|
||||
|
@@ -3,7 +3,7 @@ import { NoContent } from '../../../core/shared/NoContent.model';
|
||||
import { FeedbackDataService } from '../../../core/feedback/feedback-data.service';
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { RouteService } from '../../../core/services/route.service';
|
||||
import { FormBuilder, Validators } from '@angular/forms';
|
||||
import { UntypedFormBuilder, Validators } from '@angular/forms';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { AuthService } from '../../../core/auth/auth.service';
|
||||
@@ -37,7 +37,7 @@ export class FeedbackFormComponent implements OnInit {
|
||||
constructor(
|
||||
@Inject(NativeWindowService) protected _window: NativeWindowRef,
|
||||
public routeService: RouteService,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
protected notificationsService: NotificationsService,
|
||||
protected translate: TranslateService,
|
||||
private feedbackDataService: FeedbackDataService,
|
||||
|
@@ -11,7 +11,7 @@ import { combineLatest as observableCombineLatest, Observable, of as observableO
|
||||
import { getBitstreamDownloadRoute, getForbiddenRoute } from '../../../app-routing-paths';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { EPerson } from '../../../core/eperson/models/eperson.model';
|
||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
|
||||
import { ItemRequestDataService } from '../../../core/data/item-request-data.service';
|
||||
import { ItemRequest } from '../../../core/shared/item-request.model';
|
||||
import { Item } from '../../../core/shared/item.model';
|
||||
@@ -34,7 +34,7 @@ export class BitstreamRequestACopyPageComponent implements OnInit, OnDestroy {
|
||||
|
||||
canDownload$: Observable<boolean>;
|
||||
private subs: Subscription[] = [];
|
||||
requestCopyForm: FormGroup;
|
||||
requestCopyForm: UntypedFormGroup;
|
||||
|
||||
item: Item;
|
||||
itemName: string;
|
||||
@@ -49,7 +49,7 @@ export class BitstreamRequestACopyPageComponent implements OnInit, OnDestroy {
|
||||
protected router: Router,
|
||||
private authorizationService: AuthorizationDataService,
|
||||
private auth: AuthService,
|
||||
private formBuilder: FormBuilder,
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private itemRequestDataService: ItemRequestDataService,
|
||||
private notificationsService: NotificationsService,
|
||||
private dsoNameService: DSONameService,
|
||||
@@ -59,15 +59,15 @@ export class BitstreamRequestACopyPageComponent implements OnInit, OnDestroy {
|
||||
|
||||
ngOnInit(): void {
|
||||
this.requestCopyForm = this.formBuilder.group({
|
||||
name: new FormControl('', {
|
||||
name: new UntypedFormControl('', {
|
||||
validators: [Validators.required],
|
||||
}),
|
||||
email: new FormControl('', {
|
||||
email: new UntypedFormControl('', {
|
||||
validators: [Validators.required,
|
||||
Validators.pattern('^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$')]
|
||||
}),
|
||||
allfiles: new FormControl(''),
|
||||
message: new FormControl(''),
|
||||
allfiles: new UntypedFormControl(''),
|
||||
message: new UntypedFormControl(''),
|
||||
});
|
||||
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { UntypedFormControl, UntypedFormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
|
||||
@@ -26,7 +26,7 @@ describe('OrcidSyncSettingsComponent test suite', () => {
|
||||
let scheduler: TestScheduler;
|
||||
let researcherProfileService: jasmine.SpyObj<ResearcherProfileDataService>;
|
||||
let notificationsService;
|
||||
let formGroup: FormGroup;
|
||||
let formGroup: UntypedFormGroup;
|
||||
|
||||
const mockResearcherProfile: ResearcherProfile = Object.assign(new ResearcherProfile(), {
|
||||
id: 'test-id',
|
||||
@@ -186,12 +186,12 @@ describe('OrcidSyncSettingsComponent test suite', () => {
|
||||
beforeEach(() => {
|
||||
scheduler = getTestScheduler();
|
||||
notificationsService = (comp as any).notificationsService;
|
||||
formGroup = new FormGroup({
|
||||
syncMode: new FormControl('MANUAL'),
|
||||
syncFundings: new FormControl('ALL'),
|
||||
syncPublications: new FormControl('ALL'),
|
||||
syncProfile_BIOGRAPHICAL: new FormControl(true),
|
||||
syncProfile_IDENTIFIERS: new FormControl(true),
|
||||
formGroup = new UntypedFormGroup({
|
||||
syncMode: new UntypedFormControl('MANUAL'),
|
||||
syncFundings: new UntypedFormControl('ALL'),
|
||||
syncPublications: new UntypedFormControl('ALL'),
|
||||
syncProfile_BIOGRAPHICAL: new UntypedFormControl(true),
|
||||
syncProfile_IDENTIFIERS: new UntypedFormControl(true),
|
||||
});
|
||||
spyOn(comp.settingsUpdated, 'emit');
|
||||
});
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { Operation } from 'fast-json-patch';
|
||||
@@ -127,7 +127,7 @@ export class OrcidSyncSettingsComponent implements OnInit {
|
||||
*
|
||||
* @param form The form group
|
||||
*/
|
||||
onSubmit(form: FormGroup): void {
|
||||
onSubmit(form: UntypedFormGroup): void {
|
||||
const operations: Operation[] = [];
|
||||
this.fillOperationsFor(operations, '/orcid/mode', form.value.syncMode);
|
||||
this.fillOperationsFor(operations, '/orcid/publications', form.value.syncPublications);
|
||||
|
@@ -18,7 +18,7 @@ import { PaginationServiceStub } from '../../shared/testing/pagination-service.s
|
||||
import { AuthService } from '../../core/auth/auth.service';
|
||||
import { VersionDataService } from '../../core/data/version-data.service';
|
||||
import { ItemDataService } from '../../core/data/item-data.service';
|
||||
import { FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { UntypedFormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
||||
@@ -140,7 +140,7 @@ describe('ItemVersionsComponent', () => {
|
||||
imports: [TranslateModule.forRoot(), CommonModule, FormsModule, ReactiveFormsModule, BrowserModule, ItemSharedModule],
|
||||
providers: [
|
||||
{provide: PaginationService, useValue: new PaginationServiceStub()},
|
||||
{provide: FormBuilder, useValue: new FormBuilder()},
|
||||
{provide: UntypedFormBuilder, useValue: new UntypedFormBuilder()},
|
||||
{provide: NotificationsService, useValue: new NotificationsServiceStub()},
|
||||
{provide: AuthService, useValue: authenticationServiceSpy},
|
||||
{provide: AuthorizationDataService, useValue: authorizationServiceSpy},
|
||||
|
@@ -32,7 +32,7 @@ import {
|
||||
getItemPageRoute,
|
||||
getItemVersionRoute
|
||||
} from '../item-page-routing-paths';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
import { UntypedFormBuilder } from '@angular/forms';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { ItemVersionsSummaryModalComponent } from './item-versions-summary-modal/item-versions-summary-modal.component';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
@@ -171,7 +171,7 @@ export class ItemVersionsComponent implements OnInit {
|
||||
private versionService: VersionDataService,
|
||||
private itemService: ItemDataService,
|
||||
private paginationService: PaginationService,
|
||||
private formBuilder: FormBuilder,
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private modalService: NgbModal,
|
||||
private notificationsService: NotificationsService,
|
||||
private translateService: TranslateService,
|
||||
|
@@ -5,7 +5,7 @@ import {
|
||||
DynamicInputModel,
|
||||
DynamicSelectModel
|
||||
} from '@ng-dynamic-forms/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import { EPerson } from '../../core/eperson/models/eperson.model';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { hasValue, isNotEmpty } from '../../shared/empty.util';
|
||||
@@ -80,7 +80,7 @@ export class ProfilePageMetadataFormComponent implements OnInit {
|
||||
/**
|
||||
* The form group of this form
|
||||
*/
|
||||
formGroup: FormGroup;
|
||||
formGroup: UntypedFormGroup;
|
||||
|
||||
/**
|
||||
* Prefix for the form's label messages of this component
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { DynamicFormControlModel, DynamicFormService, DynamicInputModel } from '@ng-dynamic-forms/core';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import { hasValue, isEmpty } from '../../shared/empty.util';
|
||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
@@ -51,7 +51,7 @@ export class ProfilePageSecurityFormComponent implements OnInit {
|
||||
/**
|
||||
* The form group of this form
|
||||
*/
|
||||
formGroup: FormGroup;
|
||||
formGroup: UntypedFormGroup;
|
||||
|
||||
/**
|
||||
* Indicates whether the "checkPasswordEmpty" needs to be added or not
|
||||
@@ -127,7 +127,7 @@ export class ProfilePageSecurityFormComponent implements OnInit {
|
||||
* Check if both password fields are filled in and equal
|
||||
* @param group The FormGroup to validate
|
||||
*/
|
||||
checkPasswordsEqual(group: FormGroup) {
|
||||
checkPasswordsEqual(group: UntypedFormGroup) {
|
||||
const pass = group.get('password').value;
|
||||
const repeatPass = group.get('passwordrepeat').value;
|
||||
|
||||
@@ -138,7 +138,7 @@ export class ProfilePageSecurityFormComponent implements OnInit {
|
||||
* Checks if the password is empty
|
||||
* @param group The FormGroup to validate
|
||||
*/
|
||||
checkPasswordEmpty(group: FormGroup) {
|
||||
checkPasswordEmpty(group: UntypedFormGroup) {
|
||||
const pass = group.get('password').value;
|
||||
return isEmpty(pass) ? { emptyPassword: true } : null;
|
||||
}
|
||||
|
@@ -4,7 +4,7 @@ import { RestResponse } from '../core/cache/response.models';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { FormBuilder, ReactiveFormsModule } from '@angular/forms';
|
||||
import { UntypedFormBuilder, ReactiveFormsModule } from '@angular/forms';
|
||||
import { Router } from '@angular/router';
|
||||
import { NotificationsService } from '../shared/notifications/notifications.service';
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
@@ -67,7 +67,7 @@ describe('RegisterEmailFormComponent', () => {
|
||||
{provide: Router, useValue: router},
|
||||
{provide: EpersonRegistrationService, useValue: epersonRegistrationService},
|
||||
{provide: ConfigurationDataService, useValue: configurationDataService},
|
||||
{provide: FormBuilder, useValue: new FormBuilder()},
|
||||
{provide: UntypedFormBuilder, useValue: new UntypedFormBuilder()},
|
||||
{provide: NotificationsService, useValue: notificationsService},
|
||||
{provide: CookieService, useValue: new CookieServiceMock()},
|
||||
{provide: GoogleRecaptchaService, useValue: googleRecaptchaService},
|
||||
|
@@ -3,7 +3,7 @@ import {EpersonRegistrationService} from '../core/data/eperson-registration.serv
|
||||
import {NotificationsService} from '../shared/notifications/notifications.service';
|
||||
import {TranslateService} from '@ngx-translate/core';
|
||||
import {Router} from '@angular/router';
|
||||
import { FormBuilder, FormControl, FormGroup, Validators, ValidatorFn } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators, ValidatorFn } from '@angular/forms';
|
||||
import {Registration} from '../core/shared/registration.model';
|
||||
import {RemoteData} from '../core/data/remote-data';
|
||||
import {ConfigurationDataService} from '../core/data/configuration-data.service';
|
||||
@@ -33,7 +33,7 @@ export class RegisterEmailFormComponent implements OnDestroy, OnInit {
|
||||
/**
|
||||
* The form containing the mail address
|
||||
*/
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
|
||||
/**
|
||||
* The message prefix
|
||||
@@ -79,7 +79,7 @@ export class RegisterEmailFormComponent implements OnDestroy, OnInit {
|
||||
private notificationService: NotificationsService,
|
||||
private translateService: TranslateService,
|
||||
private router: Router,
|
||||
private formBuilder: FormBuilder,
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private configService: ConfigurationDataService,
|
||||
public googleRecaptchaService: GoogleRecaptchaService,
|
||||
public cookieService: CookieService,
|
||||
@@ -102,7 +102,7 @@ export class RegisterEmailFormComponent implements OnDestroy, OnInit {
|
||||
Validators.pattern('^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$')
|
||||
];
|
||||
this.form = this.formBuilder.group({
|
||||
email: new FormControl('', {
|
||||
email: new UntypedFormControl('', {
|
||||
validators: validators,
|
||||
})
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { FormBuilder, FormControl } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormControl } from '@angular/forms';
|
||||
import { fakeAsync, waitForAsync } from '@angular/core/testing';
|
||||
import { ConfirmedValidator } from './confirmed.validator';
|
||||
|
||||
@@ -7,9 +7,9 @@ describe('ConfirmedValidator', () => {
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
|
||||
passwordForm = (new FormBuilder()).group({
|
||||
password: new FormControl('', {}),
|
||||
confirmPassword: new FormControl('', {})
|
||||
passwordForm = (new UntypedFormBuilder()).group({
|
||||
password: new UntypedFormControl('', {}),
|
||||
confirmPassword: new UntypedFormControl('', {})
|
||||
}, {
|
||||
validator: ConfirmedValidator('password', 'confirmPassword')
|
||||
});
|
||||
|
@@ -1,10 +1,10 @@
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
|
||||
/**
|
||||
* Validator used to confirm that the password and confirmed password value are the same
|
||||
*/
|
||||
export function ConfirmedValidator(controlName: string, matchingControlName: string) {
|
||||
return (formGroup: FormGroup) => {
|
||||
return (formGroup: UntypedFormGroup) => {
|
||||
const control = formGroup.controls[controlName];
|
||||
const matchingControl = formGroup.controls[matchingControlName];
|
||||
if (matchingControl.errors && !matchingControl.errors.confirmedValidator) {
|
||||
|
@@ -7,7 +7,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { FormBuilder, ReactiveFormsModule } from '@angular/forms';
|
||||
import { UntypedFormBuilder, ReactiveFormsModule } from '@angular/forms';
|
||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
@@ -135,7 +135,7 @@ describe('CreateProfileComponent', () => {
|
||||
{provide: ActivatedRoute, useValue: route},
|
||||
{provide: Store, useValue: store},
|
||||
{provide: EPersonDataService, useValue: ePersonDataService},
|
||||
{provide: FormBuilder, useValue: new FormBuilder()},
|
||||
{provide: UntypedFormBuilder, useValue: new UntypedFormBuilder()},
|
||||
{provide: NotificationsService, useValue: notificationsService},
|
||||
{provide: EndUserAgreementService, useValue: endUserAgreementService},
|
||||
],
|
||||
|
@@ -3,7 +3,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { Registration } from '../../core/shared/registration.model';
|
||||
import { Observable } from 'rxjs';
|
||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
||||
import { EPerson } from '../../core/eperson/models/eperson.model';
|
||||
@@ -38,7 +38,7 @@ export class CreateProfileComponent implements OnInit {
|
||||
isInValidPassword = true;
|
||||
password: string;
|
||||
|
||||
userInfoForm: FormGroup;
|
||||
userInfoForm: UntypedFormGroup;
|
||||
activeLangs: LangConfig[];
|
||||
|
||||
/**
|
||||
@@ -52,7 +52,7 @@ export class CreateProfileComponent implements OnInit {
|
||||
private store: Store<CoreState>,
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private formBuilder: FormBuilder,
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private notificationsService: NotificationsService,
|
||||
private endUserAgreementService: EndUserAgreementService
|
||||
) {
|
||||
@@ -71,14 +71,14 @@ export class CreateProfileComponent implements OnInit {
|
||||
this.activeLangs = environment.languages.filter((MyLangConfig) => MyLangConfig.active === true);
|
||||
|
||||
this.userInfoForm = this.formBuilder.group({
|
||||
firstName: new FormControl('', {
|
||||
firstName: new UntypedFormControl('', {
|
||||
validators: [Validators.required],
|
||||
}),
|
||||
lastName: new FormControl('', {
|
||||
lastName: new UntypedFormControl('', {
|
||||
validators: [Validators.required],
|
||||
}),
|
||||
contactPhone: new FormControl(''),
|
||||
language: new FormControl(''),
|
||||
contactPhone: new UntypedFormControl(''),
|
||||
language: new UntypedFormControl(''),
|
||||
});
|
||||
|
||||
}
|
||||
|
@@ -19,6 +19,7 @@ import { environment } from '../../environments/environment';
|
||||
import { slideSidebarPadding } from '../shared/animations/slide';
|
||||
import { MenuID } from '../shared/menu/menu-id.model';
|
||||
import { getPageInternalServerErrorRoute } from '../app-routing-paths';
|
||||
import { hasValueOperator } from '../shared/empty.util';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-root',
|
||||
@@ -63,8 +64,8 @@ export class RootComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
this.sidebarVisible = this.menuService.isMenuVisibleWithVisibleSections(MenuID.ADMIN);
|
||||
|
||||
this.collapsedSidebarWidth = this.cssService.getVariable('--ds-collapsed-sidebar-width');
|
||||
this.totalSidebarWidth = this.cssService.getVariable('--ds-total-sidebar-width');
|
||||
this.collapsedSidebarWidth = this.cssService.getVariable('--ds-collapsed-sidebar-width').pipe(hasValueOperator());
|
||||
this.totalSidebarWidth = this.cssService.getVariable('--ds-total-sidebar-width').pipe(hasValueOperator());
|
||||
|
||||
const sidebarCollapsed = this.menuService.isMenuCollapsed(MenuID.ADMIN);
|
||||
this.slideSidebarOver = combineLatestObservable([sidebarCollapsed, this.windowService.isXsOrSm()])
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Component, ElementRef, ViewChild } from '@angular/core';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
import { UntypedFormBuilder } from '@angular/forms';
|
||||
import { Router } from '@angular/router';
|
||||
import { SearchService } from '../core/shared/search/search.service';
|
||||
import { expandSearchInput } from '../shared/animations/slide';
|
||||
@@ -24,7 +24,7 @@ export class SearchNavbarComponent {
|
||||
// Search input field
|
||||
@ViewChild('searchInput') searchField: ElementRef;
|
||||
|
||||
constructor(private formBuilder: FormBuilder, private router: Router, private searchService: SearchService) {
|
||||
constructor(private formBuilder: UntypedFormBuilder, private router: Router, private searchService: SearchService) {
|
||||
this.searchForm = this.formBuilder.group(({
|
||||
query: '',
|
||||
}));
|
||||
|
@@ -9,7 +9,7 @@ import {
|
||||
OnInit,
|
||||
Output
|
||||
} from '@angular/core';
|
||||
import { FormControl } from '@angular/forms';
|
||||
import { UntypedFormControl } from '@angular/forms';
|
||||
|
||||
import { BehaviorSubject, from as observableFrom, Observable, of as observableOf, Subscription } from 'rxjs';
|
||||
import { debounceTime, distinctUntilChanged, map, mergeMap, reduce, startWith, switchMap, take } from 'rxjs/operators';
|
||||
@@ -54,7 +54,7 @@ export class CollectionDropdownComponent implements OnInit, OnDestroy {
|
||||
* The search form control
|
||||
* @type {FormControl}
|
||||
*/
|
||||
public searchField: FormControl = new FormControl();
|
||||
public searchField: UntypedFormControl = new UntypedFormControl();
|
||||
|
||||
/**
|
||||
* The collection list obtained from a search
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { Location } from '@angular/common';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { FormControl, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { DynamicFormControlModel, DynamicFormService, DynamicInputModel } from '@ng-dynamic-forms/core';
|
||||
@@ -30,9 +30,9 @@ describe('ComColFormComponent', () => {
|
||||
const controls = {};
|
||||
if (hasValue(fModel)) {
|
||||
fModel.forEach((controlModel) => {
|
||||
controls[controlModel.id] = new FormControl((controlModel as any).value);
|
||||
controls[controlModel.id] = new UntypedFormControl((controlModel as any).value);
|
||||
});
|
||||
return new FormGroup(controls);
|
||||
return new UntypedFormGroup(controls);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import { DynamicFormControlModel, DynamicFormService, DynamicInputModel } from '@ng-dynamic-forms/core';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { FileUploader } from 'ng2-file-upload';
|
||||
@@ -66,7 +66,7 @@ export class ComColFormComponent<T extends Collection | Community> implements On
|
||||
/**
|
||||
* The form group of this form
|
||||
*/
|
||||
formGroup: FormGroup;
|
||||
formGroup: UntypedFormGroup;
|
||||
|
||||
/**
|
||||
* The uploader configuration options
|
||||
|
@@ -9,7 +9,7 @@ import {
|
||||
QueryList,
|
||||
ViewChildren
|
||||
} from '@angular/core';
|
||||
import { FormControl } from '@angular/forms';
|
||||
import { UntypedFormControl } from '@angular/forms';
|
||||
|
||||
import {
|
||||
BehaviorSubject,
|
||||
@@ -86,7 +86,7 @@ export class DSOSelectorComponent implements OnInit, OnDestroy {
|
||||
/**
|
||||
* Input form control to query the list
|
||||
*/
|
||||
public input: FormControl = new FormControl();
|
||||
public input: UntypedFormControl = new UntypedFormControl();
|
||||
|
||||
/**
|
||||
* Default pagination for this feature
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { Component, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { UntypedFormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
@@ -13,7 +13,7 @@ describe('EpersonSearchBoxComponent test suite', () => {
|
||||
let compAsAny: any;
|
||||
let fixture: ComponentFixture<EpersonSearchBoxComponent>;
|
||||
let de;
|
||||
let formBuilder: FormBuilder;
|
||||
let formBuilder: UntypedFormBuilder;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
@@ -27,7 +27,7 @@ describe('EpersonSearchBoxComponent test suite', () => {
|
||||
TestComponent
|
||||
],
|
||||
providers: [
|
||||
FormBuilder,
|
||||
UntypedFormBuilder,
|
||||
EpersonSearchBoxComponent
|
||||
],
|
||||
schemas: [
|
||||
@@ -64,7 +64,7 @@ describe('EpersonSearchBoxComponent test suite', () => {
|
||||
beforeEach(() => {
|
||||
// initTestScheduler();
|
||||
fixture = TestBed.createComponent(EpersonSearchBoxComponent);
|
||||
formBuilder = TestBed.inject(FormBuilder);
|
||||
formBuilder = TestBed.inject(UntypedFormBuilder);
|
||||
comp = fixture.componentInstance;
|
||||
compAsAny = fixture.componentInstance;
|
||||
});
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Component, EventEmitter, Output } from '@angular/core';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
import { UntypedFormBuilder } from '@angular/forms';
|
||||
|
||||
import { Subscription } from 'rxjs';
|
||||
|
||||
@@ -33,7 +33,7 @@ export class EpersonSearchBoxComponent {
|
||||
*/
|
||||
@Output() search: EventEmitter<SearchEvent> = new EventEmitter<SearchEvent>();
|
||||
|
||||
constructor(private formBuilder: FormBuilder) {
|
||||
constructor(private formBuilder: UntypedFormBuilder) {
|
||||
this.searchForm = this.formBuilder.group(({
|
||||
scope: 'metadata',
|
||||
query: '',
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { Component, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { UntypedFormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
@@ -13,7 +13,7 @@ describe('GroupSearchBoxComponent test suite', () => {
|
||||
let compAsAny: any;
|
||||
let fixture: ComponentFixture<GroupSearchBoxComponent>;
|
||||
let de;
|
||||
let formBuilder: FormBuilder;
|
||||
let formBuilder: UntypedFormBuilder;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
@@ -27,7 +27,7 @@ describe('GroupSearchBoxComponent test suite', () => {
|
||||
TestComponent
|
||||
],
|
||||
providers: [
|
||||
FormBuilder,
|
||||
UntypedFormBuilder,
|
||||
GroupSearchBoxComponent
|
||||
],
|
||||
schemas: [
|
||||
@@ -64,7 +64,7 @@ describe('GroupSearchBoxComponent test suite', () => {
|
||||
beforeEach(() => {
|
||||
// initTestScheduler();
|
||||
fixture = TestBed.createComponent(GroupSearchBoxComponent);
|
||||
formBuilder = TestBed.inject(FormBuilder);
|
||||
formBuilder = TestBed.inject(UntypedFormBuilder);
|
||||
comp = fixture.componentInstance;
|
||||
compAsAny = fixture.componentInstance;
|
||||
});
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Component, EventEmitter, Output } from '@angular/core';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
import { UntypedFormBuilder } from '@angular/forms';
|
||||
|
||||
import { Subscription } from 'rxjs';
|
||||
|
||||
@@ -33,7 +33,7 @@ export class GroupSearchBoxComponent {
|
||||
*/
|
||||
@Output() search: EventEmitter<SearchEvent> = new EventEmitter<SearchEvent>();
|
||||
|
||||
constructor(private formBuilder: FormBuilder) {
|
||||
constructor(private formBuilder: UntypedFormBuilder) {
|
||||
this.searchForm = this.formBuilder.group(({
|
||||
query: '',
|
||||
}));
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { CUSTOM_ELEMENTS_SCHEMA, DebugElement, NgZone, SimpleChange } from '@angular/core';
|
||||
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { UntypedFormControl, UntypedFormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
|
||||
@@ -187,7 +187,7 @@ describe('DsDynamicFormControlContainerComponent test suite', () => {
|
||||
new DynamicQualdropModel({ id: 'combobox', readOnly: false, required: false })
|
||||
];
|
||||
const testModel = formModel[8];
|
||||
let formGroup: FormGroup;
|
||||
let formGroup: UntypedFormGroup;
|
||||
let fixture: ComponentFixture<DsDynamicFormControlContainerComponent>;
|
||||
let component: DsDynamicFormControlContainerComponent;
|
||||
let debugElement: DebugElement;
|
||||
@@ -270,8 +270,8 @@ describe('DsDynamicFormControlContainerComponent test suite', () => {
|
||||
|
||||
it('should initialize correctly', () => {
|
||||
expect(component.context).toBeNull();
|
||||
expect(component.control instanceof FormControl).toBe(true);
|
||||
expect(component.group instanceof FormGroup).toBe(true);
|
||||
expect(component.control instanceof UntypedFormControl).toBe(true);
|
||||
expect(component.group instanceof UntypedFormGroup).toBe(true);
|
||||
expect(component.model instanceof DynamicFormControlModel).toBe(true);
|
||||
expect(component.hasErrorMessaging).toBe(false);
|
||||
|
||||
|
@@ -17,7 +17,7 @@ import {
|
||||
ViewChild,
|
||||
ViewContainerRef
|
||||
} from '@angular/core';
|
||||
import { FormArray, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormArray, UntypedFormGroup } from '@angular/forms';
|
||||
|
||||
import {
|
||||
DYNAMIC_FORM_CONTROL_TYPE_ARRAY,
|
||||
@@ -199,12 +199,12 @@ export class DsDynamicFormControlContainerComponent extends DynamicFormControlCo
|
||||
@Input('templates') inputTemplateList: QueryList<DynamicTemplateDirective>;
|
||||
@Input() hasMetadataModel: any;
|
||||
@Input() formId: string;
|
||||
@Input() formGroup: FormGroup;
|
||||
@Input() formGroup: UntypedFormGroup;
|
||||
@Input() formModel: DynamicFormControlModel[];
|
||||
@Input() asBootstrapFormGroup = false;
|
||||
@Input() bindId = true;
|
||||
@Input() context: any | null = null;
|
||||
@Input() group: FormGroup;
|
||||
@Input() group: UntypedFormGroup;
|
||||
@Input() hostClass: string[];
|
||||
@Input() hasErrorMessaging = false;
|
||||
@Input() layout = null as DynamicFormLayout;
|
||||
@@ -475,7 +475,7 @@ export class DsDynamicFormControlContainerComponent extends DynamicFormControlCo
|
||||
onRemove(): void {
|
||||
const arrayContext: DynamicFormArrayModel = (this.context as DynamicFormArrayGroupModel).context;
|
||||
const path = this.formBuilderService.getPath(arrayContext);
|
||||
const formArrayControl = this.group.root.get(path) as FormArray;
|
||||
const formArrayControl = this.group.root.get(path) as UntypedFormArray;
|
||||
this.formBuilderService.removeFormArrayGroup(this.context.index, formArrayControl, arrayContext);
|
||||
if (this.model.parent.context.groups.length === 0) {
|
||||
this.formBuilderService.addFormArrayGroup(formArrayControl, arrayContext);
|
||||
|
@@ -8,7 +8,7 @@ import {
|
||||
QueryList,
|
||||
ViewChildren
|
||||
} from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import {
|
||||
DynamicFormComponent,
|
||||
DynamicFormControlContainerComponent,
|
||||
@@ -27,7 +27,7 @@ import { DsDynamicFormControlContainerComponent } from './ds-dynamic-form-contro
|
||||
export class DsDynamicFormComponent extends DynamicFormComponent {
|
||||
|
||||
@Input() formId: string;
|
||||
@Input() formGroup: FormGroup;
|
||||
@Input() formGroup: UntypedFormGroup;
|
||||
@Input() formModel: DynamicFormControlModel[];
|
||||
@Input() formLayout: DynamicFormLayout;
|
||||
|
||||
|
@@ -14,7 +14,7 @@ import {
|
||||
} from '../../../mocks/form-models.mock';
|
||||
import {DsDynamicTypeBindRelationService} from './ds-dynamic-type-bind-relation.service';
|
||||
import {FormFieldMetadataValueObject} from '../models/form-field-metadata-value.model';
|
||||
import {FormControl, ReactiveFormsModule} from '@angular/forms';
|
||||
import {UntypedFormControl, ReactiveFormsModule} from '@angular/forms';
|
||||
import {FormBuilderService} from '../form-builder.service';
|
||||
import {getMockFormBuilderService} from '../../../mocks/form-builder-service.mock';
|
||||
import {Injector} from '@angular/core';
|
||||
@@ -87,7 +87,7 @@ describe('DSDynamicTypeBindRelationService test suite', () => {
|
||||
it('Should receive one subscription to dc.type type binding"', () => {
|
||||
const testModel = mockInputWithTypeBindModel;
|
||||
testModel.typeBindRelations = getTypeBindRelations(['boundType']);
|
||||
const dcTypeControl = new FormControl();
|
||||
const dcTypeControl = new UntypedFormControl();
|
||||
dcTypeControl.setValue('boundType');
|
||||
let subscriptions = service.subscribeRelations(testModel, dcTypeControl);
|
||||
expect(subscriptions).toHaveSize(1);
|
||||
@@ -96,7 +96,7 @@ describe('DSDynamicTypeBindRelationService test suite', () => {
|
||||
it('Expect hasMatch to be true (ie. this should be hidden)', () => {
|
||||
const testModel = mockInputWithTypeBindModel;
|
||||
testModel.typeBindRelations = getTypeBindRelations(['boundType']);
|
||||
const dcTypeControl = new FormControl();
|
||||
const dcTypeControl = new UntypedFormControl();
|
||||
dcTypeControl.setValue('boundType');
|
||||
testModel.typeBindRelations[0].when[0].value = 'anotherType';
|
||||
const relation = dynamicFormRelationService.findRelationByMatcher((testModel as any).typeBindRelations, HIDDEN_MATCHER);
|
||||
@@ -111,7 +111,7 @@ describe('DSDynamicTypeBindRelationService test suite', () => {
|
||||
it('Expect hasMatch to be false (ie. this should NOT be hidden)', () => {
|
||||
const testModel = mockInputWithTypeBindModel;
|
||||
testModel.typeBindRelations = getTypeBindRelations(['boundType']);
|
||||
const dcTypeControl = new FormControl();
|
||||
const dcTypeControl = new UntypedFormControl();
|
||||
dcTypeControl.setValue('boundType');
|
||||
testModel.typeBindRelations[0].when[0].value = 'boundType';
|
||||
const relation = dynamicFormRelationService.findRelationByMatcher((testModel as any).typeBindRelations, HIDDEN_MATCHER);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Inject, Injectable, Injector, Optional } from '@angular/core';
|
||||
import { FormControl } from '@angular/forms';
|
||||
import { UntypedFormControl } from '@angular/forms';
|
||||
|
||||
import { Subscription } from 'rxjs';
|
||||
import { startWith } from 'rxjs/operators';
|
||||
@@ -172,7 +172,7 @@ export class DsDynamicTypeBindRelationService {
|
||||
* @param model
|
||||
* @param control
|
||||
*/
|
||||
subscribeRelations(model: DynamicFormControlModel, control: FormControl): Subscription[] {
|
||||
subscribeRelations(model: DynamicFormControlModel, control: UntypedFormControl): Subscription[] {
|
||||
|
||||
const relatedModels = this.getRelatedFormModel(model);
|
||||
const subscriptions: Subscription[] = [];
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable max-classes-per-file */
|
||||
import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output } from '@angular/core';
|
||||
import { FormControl } from '@angular/forms';
|
||||
import { UntypedFormControl } from '@angular/forms';
|
||||
import { DynamicFormArrayGroupModel } from '@ng-dynamic-forms/core';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { BehaviorSubject, Subscription } from 'rxjs';
|
||||
@@ -64,7 +64,7 @@ export class ReorderableFormFieldMetadataValue extends Reorderable {
|
||||
constructor(
|
||||
public metadataValue: FormFieldMetadataValueObject,
|
||||
public model: DynamicConcatModel,
|
||||
public control: FormControl,
|
||||
public control: UntypedFormControl,
|
||||
public group: DynamicFormArrayGroupModel,
|
||||
oldIndex?: number,
|
||||
newIndex?: number
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { CdkDragDrop } from '@angular/cdk/drag-drop';
|
||||
import { Component, EventEmitter, Input, Output, QueryList } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import {
|
||||
DynamicFormArrayComponent,
|
||||
DynamicFormControlCustomEvent,
|
||||
@@ -26,7 +26,7 @@ export class DsDynamicFormArrayComponent extends DynamicFormArrayComponent {
|
||||
@Input() bindId = true;
|
||||
@Input() formModel: DynamicFormControlModel[];
|
||||
@Input() formLayout: DynamicFormLayout;
|
||||
@Input() group: FormGroup;
|
||||
@Input() group: UntypedFormGroup;
|
||||
@Input() layout: DynamicFormControlLayout;
|
||||
@Input() model: DynamicRowArrayModel;// DynamicRow?
|
||||
@Input() templates: QueryList<DynamicTemplateDirective> | undefined;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { DynamicFormsCoreModule, DynamicFormService } from '@ng-dynamic-forms/core';
|
||||
import { FormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { UntypedFormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { DebugElement } from '@angular/core';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
@@ -11,7 +11,7 @@ describe('CustomSwitchComponent', () => {
|
||||
|
||||
const testModel = new DynamicCustomSwitchModel({ id: 'switch' });
|
||||
const formModel = [testModel];
|
||||
let formGroup: FormGroup;
|
||||
let formGroup: UntypedFormGroup;
|
||||
let fixture: ComponentFixture<CustomSwitchComponent>;
|
||||
let component: CustomSwitchComponent;
|
||||
let debugElement: DebugElement;
|
||||
@@ -47,7 +47,7 @@ describe('CustomSwitchComponent', () => {
|
||||
|
||||
it('should initialize correctly', () => {
|
||||
expect(component.bindId).toBe(true);
|
||||
expect(component.group instanceof FormGroup).toBe(true);
|
||||
expect(component.group instanceof UntypedFormGroup).toBe(true);
|
||||
expect(component.model instanceof DynamicCustomSwitchModel).toBe(true);
|
||||
|
||||
expect(component.blur).toBeDefined();
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
|
||||
import { DynamicNGBootstrapCheckboxComponent } from '@ng-dynamic-forms/ui-ng-bootstrap';
|
||||
import { DynamicFormLayoutService, DynamicFormValidationService } from '@ng-dynamic-forms/core';
|
||||
@@ -24,7 +24,7 @@ export class CustomSwitchComponent extends DynamicNGBootstrapCheckboxComponent {
|
||||
/**
|
||||
* The formgroup containing this component
|
||||
*/
|
||||
@Input() group: FormGroup;
|
||||
@Input() group: UntypedFormGroup;
|
||||
|
||||
/**
|
||||
* The model used for displaying the switch
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { DebugElement } from '@angular/core';
|
||||
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { UntypedFormControl, UntypedFormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { NgbDatepickerModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
@@ -11,7 +11,7 @@ describe('DsDatePickerInlineComponent test suite', () => {
|
||||
|
||||
const testModel = new DynamicDatePickerModel({ id: 'datepicker' });
|
||||
const formModel = [testModel];
|
||||
let formGroup: FormGroup;
|
||||
let formGroup: UntypedFormGroup;
|
||||
let fixture: ComponentFixture<DsDatePickerInlineComponent>;
|
||||
let component: DsDatePickerInlineComponent;
|
||||
let debugElement: DebugElement;
|
||||
@@ -53,8 +53,8 @@ describe('DsDatePickerInlineComponent test suite', () => {
|
||||
it('should initialize correctly', () => {
|
||||
|
||||
expect(component.bindId).toBe(true);
|
||||
expect(component.control instanceof FormControl).toBe(true);
|
||||
expect(component.group instanceof FormGroup).toBe(true);
|
||||
expect(component.control instanceof UntypedFormControl).toBe(true);
|
||||
expect(component.group instanceof UntypedFormGroup).toBe(true);
|
||||
expect(component.model instanceof DynamicDatePickerModel).toBe(true);
|
||||
|
||||
expect(component.blur).toBeDefined();
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import { NgbDatepicker, NgbDatepickerConfig } from '@ng-bootstrap/ng-bootstrap';
|
||||
import {
|
||||
DynamicDatePickerModel,
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
export class DsDatePickerInlineComponent extends DynamicFormControlComponent {
|
||||
|
||||
@Input() bindId = true;
|
||||
@Input() group: FormGroup;
|
||||
@Input() group: UntypedFormGroup;
|
||||
@Input() layout: DynamicFormControlLayout;
|
||||
@Input() model: DynamicDatePickerModel;
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
// Load the implementations that should be tested
|
||||
import { ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing';
|
||||
import { FormControl, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
|
||||
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { DynamicFormLayoutService, DynamicFormValidationService } from '@ng-dynamic-forms/core';
|
||||
@@ -15,8 +15,8 @@ import {
|
||||
} from '../../../../../testing/dynamic-form-mock-services';
|
||||
|
||||
|
||||
export const DATE_TEST_GROUP = new FormGroup({
|
||||
date: new FormControl()
|
||||
export const DATE_TEST_GROUP = new UntypedFormGroup({
|
||||
date: new UntypedFormControl()
|
||||
});
|
||||
|
||||
export const DATE_TEST_MODEL_CONFIG = {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import { DynamicDsDatePickerModel } from './date-picker.model';
|
||||
import { hasValue } from '../../../../../empty.util';
|
||||
import {
|
||||
@@ -18,7 +18,7 @@ export const DS_DATE_PICKER_SEPARATOR = '-';
|
||||
|
||||
export class DsDatePickerComponent extends DynamicFormControlComponent implements OnInit {
|
||||
@Input() bindId = true;
|
||||
@Input() group: FormGroup;
|
||||
@Input() group: UntypedFormGroup;
|
||||
@Input() model: DynamicDsDatePickerModel;
|
||||
@Input() legend: string;
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { FormControl, FormGroup, FormsModule } from '@angular/forms';
|
||||
import { UntypedFormControl, UntypedFormGroup, FormsModule } from '@angular/forms';
|
||||
import { By } from '@angular/platform-browser';
|
||||
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -31,8 +31,8 @@ describe('DsDynamicDisabledComponent', () => {
|
||||
name: 'disabledInput',
|
||||
hasSelectableMetadata: false
|
||||
});
|
||||
group = new FormGroup({
|
||||
disabledInput: new FormControl(),
|
||||
group = new UntypedFormGroup({
|
||||
disabledInput: new UntypedFormControl(),
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
|
||||
import { DynamicFormControlComponent, DynamicFormLayoutService, DynamicFormValidationService } from '@ng-dynamic-forms/core';
|
||||
|
||||
@@ -18,7 +18,7 @@ import { DynamicDisabledModel } from './dynamic-disabled.model';
|
||||
export class DsDynamicDisabledComponent extends DynamicFormControlComponent {
|
||||
|
||||
@Input() formId: string;
|
||||
@Input() group: FormGroup;
|
||||
@Input() group: UntypedFormGroup;
|
||||
@Input() model: DynamicDisabledModel;
|
||||
modelValuesString = '';
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
|
||||
import {
|
||||
DynamicFormControlComponent,
|
||||
@@ -25,7 +25,7 @@ import { PageInfo } from '../../../../../core/shared/page-info.model';
|
||||
})
|
||||
export abstract class DsDynamicVocabularyComponent extends DynamicFormControlComponent {
|
||||
|
||||
@Input() abstract group: FormGroup;
|
||||
@Input() abstract group: UntypedFormGroup;
|
||||
@Input() abstract model: DsDynamicInputModel;
|
||||
|
||||
@Output() abstract blur: EventEmitter<any>;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, QueryList } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import {
|
||||
DynamicFormControlComponent,
|
||||
DynamicFormControlCustomEvent,
|
||||
@@ -22,7 +22,7 @@ export class DsDynamicFormGroupComponent extends DynamicFormControlComponent {
|
||||
|
||||
@Input() formModel: DynamicFormControlModel[];
|
||||
@Input() formLayout: DynamicFormLayout;
|
||||
@Input() group: FormGroup;
|
||||
@Input() group: UntypedFormGroup;
|
||||
@Input() layout: DynamicFormControlLayout;
|
||||
@Input() model: DynamicFormGroupModel;
|
||||
@Input() templates: QueryList<DynamicTemplateDirective> | DynamicTemplateDirective[] | undefined;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Load the implementations that should be tested
|
||||
import { ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { UntypedFormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
|
||||
@@ -136,9 +136,9 @@ describe('DsDynamicListComponent test suite', () => {
|
||||
|
||||
listFixture = TestBed.createComponent(DsDynamicListComponent);
|
||||
listComp = listFixture.componentInstance; // FormComponent test instance
|
||||
listComp.group = new FormGroup({
|
||||
listCheckbox: new FormGroup({}),
|
||||
listRadio: new FormGroup({})
|
||||
listComp.group = new UntypedFormGroup({
|
||||
listCheckbox: new UntypedFormGroup({}),
|
||||
listRadio: new UntypedFormGroup({})
|
||||
});
|
||||
listComp.model = new DynamicListCheckboxGroupModel(LIST_CHECKBOX_TEST_MODEL_CONFIG, LAYOUT_TEST);
|
||||
listFixture.detectChanges();
|
||||
@@ -184,9 +184,9 @@ describe('DsDynamicListComponent test suite', () => {
|
||||
|
||||
listFixture = TestBed.createComponent(DsDynamicListComponent);
|
||||
listComp = listFixture.componentInstance; // FormComponent test instance
|
||||
listComp.group = new FormGroup({
|
||||
listCheckbox: new FormGroup({}),
|
||||
listRadio: new FormGroup({})
|
||||
listComp.group = new UntypedFormGroup({
|
||||
listCheckbox: new UntypedFormGroup({}),
|
||||
listRadio: new UntypedFormGroup({})
|
||||
});
|
||||
listComp.model = new DynamicListCheckboxGroupModel(LIST_CHECKBOX_TEST_MODEL_CONFIG, LAYOUT_TEST);
|
||||
modelValue = [Object.assign(new VocabularyEntry(), { authority: 1, display: 'one', value: 1 })];
|
||||
@@ -224,9 +224,9 @@ describe('DsDynamicListComponent test suite', () => {
|
||||
|
||||
listFixture = TestBed.createComponent(DsDynamicListComponent);
|
||||
listComp = listFixture.componentInstance; // FormComponent test instance
|
||||
listComp.group = new FormGroup({
|
||||
listCheckbox: new FormGroup({}),
|
||||
listRadio: new FormGroup({})
|
||||
listComp.group = new UntypedFormGroup({
|
||||
listCheckbox: new UntypedFormGroup({}),
|
||||
listRadio: new UntypedFormGroup({})
|
||||
});
|
||||
listComp.model = new DynamicListRadioGroupModel(LIST_RADIO_TEST_MODEL_CONFIG, LAYOUT_TEST);
|
||||
listFixture.detectChanges();
|
||||
@@ -260,9 +260,9 @@ describe('DsDynamicListComponent test suite', () => {
|
||||
|
||||
listFixture = TestBed.createComponent(DsDynamicListComponent);
|
||||
listComp = listFixture.componentInstance; // FormComponent test instance
|
||||
listComp.group = new FormGroup({
|
||||
listCheckbox: new FormGroup({}),
|
||||
listRadio: new FormGroup({})
|
||||
listComp.group = new UntypedFormGroup({
|
||||
listCheckbox: new UntypedFormGroup({}),
|
||||
listRadio: new UntypedFormGroup({})
|
||||
});
|
||||
listComp.model = new DynamicListRadioGroupModel(LIST_RADIO_TEST_MODEL_CONFIG, LAYOUT_TEST);
|
||||
modelValue = Object.assign(new VocabularyEntry(), { authority: 1, display: 'one', value: 1 });
|
||||
@@ -291,9 +291,9 @@ describe('DsDynamicListComponent test suite', () => {
|
||||
})
|
||||
class TestComponent {
|
||||
|
||||
group: FormGroup = new FormGroup({
|
||||
listCheckbox: new FormGroup({}),
|
||||
listRadio: new FormGroup({})
|
||||
group: UntypedFormGroup = new UntypedFormGroup({
|
||||
listCheckbox: new UntypedFormGroup({}),
|
||||
listRadio: new UntypedFormGroup({})
|
||||
});
|
||||
|
||||
model = new DynamicListCheckboxGroupModel(LIST_CHECKBOX_TEST_MODEL_CONFIG, LAYOUT_TEST);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { FormGroup, ValidatorFn, ValidationErrors, AbstractControl } from '@angular/forms';
|
||||
import { UntypedFormGroup, ValidatorFn, ValidationErrors, AbstractControl } from '@angular/forms';
|
||||
import {
|
||||
DynamicCheckboxModel,
|
||||
DynamicFormControlComponent,
|
||||
@@ -35,7 +35,7 @@ export interface ListItem {
|
||||
})
|
||||
export class DsDynamicListComponent extends DynamicFormControlComponent implements OnInit {
|
||||
|
||||
@Input() group: FormGroup;
|
||||
@Input() group: UntypedFormGroup;
|
||||
@Input() model: any;
|
||||
|
||||
@Output() blur: EventEmitter<any> = new EventEmitter<any>();
|
||||
@@ -108,7 +108,7 @@ export class DsDynamicListComponent extends DynamicFormControlComponent implemen
|
||||
*/
|
||||
protected setOptionsFromVocabulary() {
|
||||
if (this.model.vocabularyOptions.name && this.model.vocabularyOptions.name.length > 0) {
|
||||
const listGroup = this.group.controls[this.model.id] as FormGroup;
|
||||
const listGroup = this.group.controls[this.model.id] as UntypedFormGroup;
|
||||
if (this.model.repeatable && this.model.required) {
|
||||
listGroup.addValidators(this.hasAtLeastOneVocabularyEntry());
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Load the implementations that should be tested
|
||||
import { ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { UntypedFormControl, UntypedFormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { ComponentFixture, fakeAsync, inject, TestBed, tick, waitForAsync, } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
|
||||
@@ -71,9 +71,9 @@ let LOOKUP_NAME_TEST_MODEL_CONFIG = {
|
||||
hasSelectableMetadata: false
|
||||
};
|
||||
|
||||
let LOOKUP_TEST_GROUP = new FormGroup({
|
||||
lookup: new FormControl(),
|
||||
lookupName: new FormControl()
|
||||
let LOOKUP_TEST_GROUP = new UntypedFormGroup({
|
||||
lookup: new UntypedFormControl(),
|
||||
lookupName: new UntypedFormControl()
|
||||
});
|
||||
|
||||
describe('Dynamic Lookup component', () => {
|
||||
@@ -122,9 +122,9 @@ describe('Dynamic Lookup component', () => {
|
||||
hasSelectableMetadata: false
|
||||
};
|
||||
|
||||
LOOKUP_TEST_GROUP = new FormGroup({
|
||||
lookup: new FormControl(),
|
||||
lookupName: new FormControl()
|
||||
LOOKUP_TEST_GROUP = new UntypedFormGroup({
|
||||
lookup: new UntypedFormControl(),
|
||||
lookupName: new UntypedFormControl()
|
||||
});
|
||||
|
||||
}
|
||||
@@ -564,7 +564,7 @@ describe('Dynamic Lookup component', () => {
|
||||
})
|
||||
class TestComponent {
|
||||
|
||||
group: FormGroup = LOOKUP_TEST_GROUP;
|
||||
group: UntypedFormGroup = LOOKUP_TEST_GROUP;
|
||||
|
||||
inputLookupModelConfig = LOOKUP_TEST_MODEL_CONFIG;
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { ChangeDetectorRef, Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
|
||||
import { of as observableOf, Subscription } from 'rxjs';
|
||||
import { catchError, distinctUntilChanged } from 'rxjs/operators';
|
||||
@@ -30,7 +30,7 @@ import { DsDynamicVocabularyComponent } from '../dynamic-vocabulary.component';
|
||||
})
|
||||
export class DsDynamicLookupComponent extends DsDynamicVocabularyComponent implements OnDestroy, OnInit {
|
||||
|
||||
@Input() group: FormGroup;
|
||||
@Input() group: UntypedFormGroup;
|
||||
@Input() model: any;
|
||||
|
||||
@Output() blur: EventEmitter<any> = new EventEmitter<any>();
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/* eslint-disable max-classes-per-file */
|
||||
// Load the implementations that should be tested
|
||||
import { ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { UntypedFormControl, UntypedFormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { ComponentFixture, fakeAsync, inject, TestBed, tick, } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { CdkTreeModule } from '@angular/cdk/tree';
|
||||
@@ -47,8 +47,8 @@ export class MockNgbModalRef {
|
||||
}
|
||||
|
||||
function init() {
|
||||
ONEBOX_TEST_GROUP = new FormGroup({
|
||||
onebox: new FormControl(),
|
||||
ONEBOX_TEST_GROUP = new UntypedFormGroup({
|
||||
onebox: new UntypedFormControl(),
|
||||
});
|
||||
|
||||
ONEBOX_TEST_MODEL_CONFIG = {
|
||||
@@ -457,7 +457,7 @@ describe('DsDynamicOneboxComponent test suite', () => {
|
||||
})
|
||||
class TestComponent {
|
||||
|
||||
group: FormGroup = ONEBOX_TEST_GROUP;
|
||||
group: UntypedFormGroup = ONEBOX_TEST_GROUP;
|
||||
|
||||
model = new DynamicOneboxModel(ONEBOX_TEST_MODEL_CONFIG);
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
|
||||
import { DynamicFormLayoutService, DynamicFormValidationService } from '@ng-dynamic-forms/core';
|
||||
import {
|
||||
@@ -44,7 +44,7 @@ import { VocabularyEntryDetail } from '../../../../../../core/submission/vocabul
|
||||
})
|
||||
export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent implements OnInit {
|
||||
|
||||
@Input() group: FormGroup;
|
||||
@Input() group: UntypedFormGroup;
|
||||
@Input() model: DynamicOneboxModel;
|
||||
|
||||
@Output() blur: EventEmitter<any> = new EventEmitter<any>();
|
||||
|
@@ -1,7 +1,7 @@
|
||||
// Load the implementations that should be tested
|
||||
import { ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing';
|
||||
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { UntypedFormControl, UntypedFormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
|
||||
import { Store, StoreModule } from '@ngrx/store';
|
||||
@@ -83,8 +83,8 @@ function init() {
|
||||
hasSelectableMetadata: false
|
||||
} as DynamicRelationGroupModelConfig;
|
||||
|
||||
FORM_GROUP_TEST_GROUP = new FormGroup({
|
||||
dc_contributor_author: new FormControl(),
|
||||
FORM_GROUP_TEST_GROUP = new UntypedFormGroup({
|
||||
dc_contributor_author: new UntypedFormControl(),
|
||||
});
|
||||
|
||||
}
|
||||
@@ -96,9 +96,9 @@ describe('DsDynamicRelationGroupComponent test suite', () => {
|
||||
let groupFixture: ComponentFixture<DsDynamicRelationGroupComponent>;
|
||||
let modelValue: any;
|
||||
let html;
|
||||
let control1: FormControl;
|
||||
let control1: UntypedFormControl;
|
||||
let model1: DsDynamicInputModel;
|
||||
let control2: FormControl;
|
||||
let control2: UntypedFormControl;
|
||||
let model2: DsDynamicInputModel;
|
||||
|
||||
// waitForAsync beforeEach
|
||||
@@ -170,9 +170,9 @@ describe('DsDynamicRelationGroupComponent test suite', () => {
|
||||
groupComp.group = FORM_GROUP_TEST_GROUP;
|
||||
groupComp.model = new DynamicRelationGroupModel(FORM_GROUP_TEST_MODEL_CONFIG);
|
||||
groupFixture.detectChanges();
|
||||
control1 = service.getFormControlById('dc_contributor_author', (groupComp as any).formRef.formGroup, groupComp.formModel) as FormControl;
|
||||
control1 = service.getFormControlById('dc_contributor_author', (groupComp as any).formRef.formGroup, groupComp.formModel) as UntypedFormControl;
|
||||
model1 = service.findById('dc_contributor_author', groupComp.formModel) as DsDynamicInputModel;
|
||||
control2 = service.getFormControlById('local_contributor_affiliation', (groupComp as any).formRef.formGroup, groupComp.formModel) as FormControl;
|
||||
control2 = service.getFormControlById('local_contributor_affiliation', (groupComp as any).formRef.formGroup, groupComp.formModel) as UntypedFormControl;
|
||||
model2 = service.findById('local_contributor_affiliation', groupComp.formModel) as DsDynamicInputModel;
|
||||
|
||||
// spyOn(store, 'dispatch');
|
||||
@@ -272,7 +272,7 @@ describe('DsDynamicRelationGroupComponent test suite', () => {
|
||||
groupComp.onChipSelected(0);
|
||||
groupFixture.detectChanges();
|
||||
|
||||
control1 = service.getFormControlById('dc_contributor_author', (groupComp as any).formRef.formGroup, groupComp.formModel) as FormControl;
|
||||
control1 = service.getFormControlById('dc_contributor_author', (groupComp as any).formRef.formGroup, groupComp.formModel) as UntypedFormControl;
|
||||
model1 = service.findById('dc_contributor_author', groupComp.formModel) as DsDynamicInputModel;
|
||||
|
||||
control1.setValue('test author modify');
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { ChangeDetectorRef, Component, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
|
||||
import { combineLatest, Observable, of as observableOf, Subscription } from 'rxjs';
|
||||
import { filter, map, mergeMap, scan } from 'rxjs/operators';
|
||||
@@ -43,7 +43,7 @@ import { VocabularyEntryDetail } from '../../../../../../core/submission/vocabul
|
||||
export class DsDynamicRelationGroupComponent extends DynamicFormControlComponent implements OnDestroy, OnInit {
|
||||
|
||||
@Input() formId: string;
|
||||
@Input() group: FormGroup;
|
||||
@Input() group: UntypedFormGroup;
|
||||
@Input() model: DynamicRelationGroupModel;
|
||||
|
||||
@Output() blur: EventEmitter<any> = new EventEmitter<any>();
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Load the implementations that should be tested
|
||||
import { ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { UntypedFormControl, UntypedFormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { ComponentFixture, fakeAsync, inject, TestBed, tick, waitForAsync, } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
@@ -21,8 +21,8 @@ import {
|
||||
mockDynamicFormValidationService
|
||||
} from '../../../../../testing/dynamic-form-mock-services';
|
||||
|
||||
export const SD_TEST_GROUP = new FormGroup({
|
||||
dropdown: new FormControl(),
|
||||
export const SD_TEST_GROUP = new UntypedFormGroup({
|
||||
dropdown: new UntypedFormControl(),
|
||||
});
|
||||
|
||||
export const SD_TEST_MODEL_CONFIG = {
|
||||
@@ -219,7 +219,7 @@ describe('Dynamic Dynamic Scrollable Dropdown component', () => {
|
||||
})
|
||||
class TestComponent {
|
||||
|
||||
group: FormGroup = SD_TEST_GROUP;
|
||||
group: UntypedFormGroup = SD_TEST_GROUP;
|
||||
|
||||
model = new DynamicScrollableDropdownModel(SD_TEST_MODEL_CONFIG);
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
import { catchError, distinctUntilChanged, map, tap } from 'rxjs/operators';
|
||||
@@ -29,7 +29,7 @@ import { FormFieldMetadataValueObject } from '../../../models/form-field-metadat
|
||||
})
|
||||
export class DsDynamicScrollableDropdownComponent extends DsDynamicVocabularyComponent implements OnInit {
|
||||
@Input() bindId = true;
|
||||
@Input() group: FormGroup;
|
||||
@Input() group: UntypedFormGroup;
|
||||
@Input() model: DynamicScrollableDropdownModel;
|
||||
|
||||
@Output() blur: EventEmitter<any> = new EventEmitter<any>();
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Load the implementations that should be tested
|
||||
import { ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { UntypedFormControl, UntypedFormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { ComponentFixture, fakeAsync, flush, inject, TestBed, waitForAsync, } from '@angular/core/testing';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
|
||||
@@ -39,8 +39,8 @@ let TAG_TEST_GROUP;
|
||||
let TAG_TEST_MODEL_CONFIG;
|
||||
|
||||
function init() {
|
||||
TAG_TEST_GROUP = new FormGroup({
|
||||
tag: new FormControl(),
|
||||
TAG_TEST_GROUP = new UntypedFormGroup({
|
||||
tag: new UntypedFormControl(),
|
||||
});
|
||||
|
||||
TAG_TEST_MODEL_CONFIG = {
|
||||
@@ -291,7 +291,7 @@ describe('DsDynamicTagComponent test suite', () => {
|
||||
})
|
||||
class TestComponent {
|
||||
|
||||
group: FormGroup = TAG_TEST_GROUP;
|
||||
group: UntypedFormGroup = TAG_TEST_GROUP;
|
||||
|
||||
model = new DynamicTagModel(TAG_TEST_MODEL_CONFIG);
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
|
||||
import { DynamicFormLayoutService, DynamicFormValidationService } from '@ng-dynamic-forms/core';
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
@@ -32,7 +32,7 @@ import { DsDynamicVocabularyComponent } from '../dynamic-vocabulary.component';
|
||||
export class DsDynamicTagComponent extends DsDynamicVocabularyComponent implements OnInit {
|
||||
|
||||
@Input() bindId = true;
|
||||
@Input() group: FormGroup;
|
||||
@Input() group: UntypedFormGroup;
|
||||
@Input() model: DynamicTagModel;
|
||||
|
||||
@Output() blur: EventEmitter<any> = new EventEmitter<any>();
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import { inject, TestBed } from '@angular/core/testing';
|
||||
import {
|
||||
FormArray,
|
||||
FormControl,
|
||||
FormGroup,
|
||||
UntypedFormArray,
|
||||
UntypedFormControl,
|
||||
UntypedFormGroup,
|
||||
NG_ASYNC_VALIDATORS,
|
||||
NG_VALIDATORS,
|
||||
ReactiveFormsModule
|
||||
@@ -683,21 +683,21 @@ describe('FormBuilderService test suite', () => {
|
||||
|
||||
const formGroup = service.createFormGroup(testModel);
|
||||
|
||||
expect(formGroup instanceof FormGroup).toBe(true);
|
||||
expect(formGroup instanceof UntypedFormGroup).toBe(true);
|
||||
|
||||
expect(formGroup.get('testCheckbox') instanceof FormControl).toBe(true);
|
||||
expect(formGroup.get('testCheckboxGroup') instanceof FormGroup).toBe(true);
|
||||
expect(formGroup.get('testDatepicker') instanceof FormControl).toBe(true);
|
||||
expect(formGroup.get('testFormArray') instanceof FormArray).toBe(true);
|
||||
expect(formGroup.get('testInput') instanceof FormControl).toBe(true);
|
||||
expect(formGroup.get('testRadioGroup') instanceof FormControl).toBe(true);
|
||||
expect(formGroup.get('testSelect') instanceof FormControl).toBe(true);
|
||||
expect(formGroup.get('testTextArea') instanceof FormControl).toBe(true);
|
||||
expect(formGroup.get('testFileUpload') instanceof FormControl).toBe(true);
|
||||
expect(formGroup.get('testEditor') instanceof FormControl).toBe(true);
|
||||
expect(formGroup.get('testTimePicker') instanceof FormControl).toBe(true);
|
||||
expect(formGroup.get('testRating') instanceof FormControl).toBe(true);
|
||||
expect(formGroup.get('testColorPicker') instanceof FormControl).toBe(true);
|
||||
expect(formGroup.get('testCheckbox') instanceof UntypedFormControl).toBe(true);
|
||||
expect(formGroup.get('testCheckboxGroup') instanceof UntypedFormGroup).toBe(true);
|
||||
expect(formGroup.get('testDatepicker') instanceof UntypedFormControl).toBe(true);
|
||||
expect(formGroup.get('testFormArray') instanceof UntypedFormArray).toBe(true);
|
||||
expect(formGroup.get('testInput') instanceof UntypedFormControl).toBe(true);
|
||||
expect(formGroup.get('testRadioGroup') instanceof UntypedFormControl).toBe(true);
|
||||
expect(formGroup.get('testSelect') instanceof UntypedFormControl).toBe(true);
|
||||
expect(formGroup.get('testTextArea') instanceof UntypedFormControl).toBe(true);
|
||||
expect(formGroup.get('testFileUpload') instanceof UntypedFormControl).toBe(true);
|
||||
expect(formGroup.get('testEditor') instanceof UntypedFormControl).toBe(true);
|
||||
expect(formGroup.get('testTimePicker') instanceof UntypedFormControl).toBe(true);
|
||||
expect(formGroup.get('testRating') instanceof UntypedFormControl).toBe(true);
|
||||
expect(formGroup.get('testColorPicker') instanceof UntypedFormControl).toBe(true);
|
||||
});
|
||||
|
||||
it('should throw when unknown DynamicFormControlModel id is specified in JSON', () => {
|
||||
@@ -720,7 +720,7 @@ describe('FormBuilderService test suite', () => {
|
||||
it('should add a form control to an existing form group', () => {
|
||||
|
||||
const formGroup = service.createFormGroup(testModel);
|
||||
const nestedFormGroup = formGroup.controls.testFormGroup as FormGroup;
|
||||
const nestedFormGroup = formGroup.controls.testFormGroup as UntypedFormGroup;
|
||||
const nestedFormGroupModel = testModel[7] as DynamicFormGroupModel;
|
||||
const newModel1 = new DynamicInputModel({ id: 'newInput1' });
|
||||
const newModel2 = new DynamicInputModel({ id: 'newInput2' });
|
||||
@@ -731,14 +731,14 @@ describe('FormBuilderService test suite', () => {
|
||||
expect(formGroup.controls[newModel1.id]).toBeTruthy();
|
||||
expect(testModel[testModel.length - 1] === newModel1).toBe(true);
|
||||
|
||||
expect((formGroup.controls.testFormGroup as FormGroup).controls[newModel2.id]).toBeTruthy();
|
||||
expect((formGroup.controls.testFormGroup as UntypedFormGroup).controls[newModel2.id]).toBeTruthy();
|
||||
expect(nestedFormGroupModel.get(nestedFormGroupModel.group.length - 1) === newModel2).toBe(true);
|
||||
});
|
||||
|
||||
it('should insert a form control to an existing form group', () => {
|
||||
|
||||
const formGroup = service.createFormGroup(testModel);
|
||||
const nestedFormGroup = formGroup.controls.testFormGroup as FormGroup;
|
||||
const nestedFormGroup = formGroup.controls.testFormGroup as UntypedFormGroup;
|
||||
const nestedFormGroupModel = testModel[7] as DynamicFormGroupModel;
|
||||
const newModel1 = new DynamicInputModel({ id: 'newInput1' });
|
||||
const newModel2 = new DynamicInputModel({ id: 'newInput2' });
|
||||
@@ -750,7 +750,7 @@ describe('FormBuilderService test suite', () => {
|
||||
expect(testModel[4] === newModel1).toBe(true);
|
||||
expect(service.getPath(testModel[4])).toEqual(['newInput1']);
|
||||
|
||||
expect((formGroup.controls.testFormGroup as FormGroup).controls[newModel2.id]).toBeTruthy();
|
||||
expect((formGroup.controls.testFormGroup as UntypedFormGroup).controls[newModel2.id]).toBeTruthy();
|
||||
expect(nestedFormGroupModel.get(0) === newModel2).toBe(true);
|
||||
expect(service.getPath(nestedFormGroupModel.get(0))).toEqual(['testFormGroup', 'newInput2']);
|
||||
});
|
||||
@@ -769,14 +769,14 @@ describe('FormBuilderService test suite', () => {
|
||||
|
||||
service.moveFormGroupControl(0, 1, nestedFormGroupModel);
|
||||
|
||||
expect((formGroup.controls.testFormGroup as FormGroup).controls[model2.id]).toBeTruthy();
|
||||
expect((formGroup.controls.testFormGroup as UntypedFormGroup).controls[model2.id]).toBeTruthy();
|
||||
expect(nestedFormGroupModel.get(1) === model2).toBe(true);
|
||||
});
|
||||
|
||||
it('should remove a form control from an existing form group', () => {
|
||||
|
||||
const formGroup = service.createFormGroup(testModel);
|
||||
const nestedFormGroup = formGroup.controls.testFormGroup as FormGroup;
|
||||
const nestedFormGroup = formGroup.controls.testFormGroup as UntypedFormGroup;
|
||||
const nestedFormGroupModel = testModel[7] as DynamicFormGroupModel;
|
||||
const length = testModel.length;
|
||||
const size = nestedFormGroupModel.size();
|
||||
@@ -810,7 +810,7 @@ describe('FormBuilderService test suite', () => {
|
||||
|
||||
formArray = service.createFormArray(model);
|
||||
|
||||
expect(formArray instanceof FormArray).toBe(true);
|
||||
expect(formArray instanceof UntypedFormArray).toBe(true);
|
||||
expect(formArray.length).toBe(model.initialCount);
|
||||
});
|
||||
|
||||
@@ -841,8 +841,8 @@ describe('FormBuilderService test suite', () => {
|
||||
const index = 3;
|
||||
const step = 1;
|
||||
|
||||
(formArray.at(index) as FormGroup).controls.testFormArrayGroupInput.setValue('next test value 1');
|
||||
(formArray.at(index + step) as FormGroup).controls.testFormArrayGroupInput.setValue('next test value 2');
|
||||
(formArray.at(index) as UntypedFormGroup).controls.testFormArrayGroupInput.setValue('next test value 1');
|
||||
(formArray.at(index + step) as UntypedFormGroup).controls.testFormArrayGroupInput.setValue('next test value 2');
|
||||
|
||||
(model.get(index).get(0) as DynamicFormValueControlModel<any>).value = 'next test value 1';
|
||||
(model.get(index + step).get(0) as DynamicFormValueControlModel<any>).value = 'next test value 2';
|
||||
@@ -851,8 +851,8 @@ describe('FormBuilderService test suite', () => {
|
||||
|
||||
expect(formArray.length).toBe(model.initialCount);
|
||||
|
||||
expect((formArray.at(index) as FormGroup).controls.testFormArrayGroupInput.value).toEqual('next test value 2');
|
||||
expect((formArray.at(index + step) as FormGroup).controls.testFormArrayGroupInput.value).toEqual('next test value 1');
|
||||
expect((formArray.at(index) as UntypedFormGroup).controls.testFormArrayGroupInput.value).toEqual('next test value 2');
|
||||
expect((formArray.at(index + step) as UntypedFormGroup).controls.testFormArrayGroupInput.value).toEqual('next test value 1');
|
||||
|
||||
expect((model.get(index).get(0) as DynamicFormValueControlModel<any>).value).toEqual('next test value 2');
|
||||
expect((model.get(index + step).get(0) as DynamicFormValueControlModel<any>).value).toEqual('next test value 1');
|
||||
@@ -865,8 +865,8 @@ describe('FormBuilderService test suite', () => {
|
||||
const index = 3;
|
||||
const step = -1;
|
||||
|
||||
(formArray.at(index) as FormGroup).controls.testFormArrayGroupInput.setValue('next test value 1');
|
||||
(formArray.at(index + step) as FormGroup).controls.testFormArrayGroupInput.setValue('next test value 2');
|
||||
(formArray.at(index) as UntypedFormGroup).controls.testFormArrayGroupInput.setValue('next test value 1');
|
||||
(formArray.at(index + step) as UntypedFormGroup).controls.testFormArrayGroupInput.setValue('next test value 2');
|
||||
|
||||
(model.get(index).get(0) as DynamicFormValueControlModel<any>).value = 'next test value 1';
|
||||
(model.get(index + step).get(0) as DynamicFormValueControlModel<any>).value = 'next test value 2';
|
||||
@@ -875,8 +875,8 @@ describe('FormBuilderService test suite', () => {
|
||||
|
||||
expect(formArray.length).toBe(model.initialCount);
|
||||
|
||||
expect((formArray.at(index) as FormGroup).controls.testFormArrayGroupInput.value).toEqual('next test value 2');
|
||||
expect((formArray.at(index + step) as FormGroup).controls.testFormArrayGroupInput.value).toEqual('next test value 1');
|
||||
expect((formArray.at(index) as UntypedFormGroup).controls.testFormArrayGroupInput.value).toEqual('next test value 2');
|
||||
expect((formArray.at(index + step) as UntypedFormGroup).controls.testFormArrayGroupInput.value).toEqual('next test value 1');
|
||||
|
||||
expect((model.get(index).get(0) as DynamicFormValueControlModel<any>).value).toEqual('next test value 2');
|
||||
expect((model.get(index + step).get(0) as DynamicFormValueControlModel<any>).value).toEqual('next test value 1');
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import {Injectable, Optional} from '@angular/core';
|
||||
import { AbstractControl, FormControl, FormGroup } from '@angular/forms';
|
||||
import { AbstractControl, UntypedFormControl, UntypedFormGroup } from '@angular/forms';
|
||||
|
||||
import {
|
||||
DYNAMIC_FORM_CONTROL_TYPE_ARRAY,
|
||||
@@ -59,7 +59,7 @@ export class FormBuilderService extends DynamicFormService {
|
||||
/**
|
||||
* This map contains the active forms control groups
|
||||
*/
|
||||
private formGroups: Map<string, FormGroup>;
|
||||
private formGroups: Map<string, UntypedFormGroup>;
|
||||
|
||||
/**
|
||||
* This is the field to use for type binding
|
||||
@@ -83,7 +83,7 @@ export class FormBuilderService extends DynamicFormService {
|
||||
|
||||
}
|
||||
|
||||
createDynamicFormControlEvent(control: FormControl, group: FormGroup, model: DynamicFormControlModel, type: string): DynamicFormControlEvent {
|
||||
createDynamicFormControlEvent(control: UntypedFormControl, group: UntypedFormGroup, model: DynamicFormControlModel, type: string): DynamicFormControlEvent {
|
||||
const $event = {
|
||||
value: (model as any).value,
|
||||
autoSave: false
|
||||
@@ -369,12 +369,12 @@ export class FormBuilderService extends DynamicFormService {
|
||||
return model.type === DYNAMIC_FORM_CONTROL_TYPE_INPUT;
|
||||
}
|
||||
|
||||
getFormControlById(id: string, formGroup: FormGroup, groupModel: DynamicFormControlModel[], index = 0): AbstractControl {
|
||||
getFormControlById(id: string, formGroup: UntypedFormGroup, groupModel: DynamicFormControlModel[], index = 0): AbstractControl {
|
||||
const fieldModel = this.findById(id, groupModel, index);
|
||||
return isNotEmpty(fieldModel) ? formGroup.get(this.getPath(fieldModel)) : null;
|
||||
}
|
||||
|
||||
getFormControlByModel(formGroup: FormGroup, fieldModel: DynamicFormControlModel): AbstractControl {
|
||||
getFormControlByModel(formGroup: UntypedFormGroup, fieldModel: DynamicFormControlModel): AbstractControl {
|
||||
return isNotEmpty(fieldModel) ? formGroup.get(this.getPath(fieldModel)) : null;
|
||||
}
|
||||
|
||||
@@ -412,7 +412,7 @@ export class FormBuilderService extends DynamicFormService {
|
||||
* @param id id of model
|
||||
* @param formGroup FormGroup
|
||||
*/
|
||||
addFormGroups(id: string, formGroup: FormGroup): void {
|
||||
addFormGroups(id: string, formGroup: UntypedFormGroup): void {
|
||||
this.formGroups.set(id, formGroup);
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { distinctUntilChanged, filter, map } from 'rxjs/operators';
|
||||
import { ChangeDetectorRef, Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
|
||||
import { AbstractControl, FormArray, FormControl, FormGroup } from '@angular/forms';
|
||||
import { AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms';
|
||||
|
||||
import { Observable, Subscription } from 'rxjs';
|
||||
import {
|
||||
@@ -68,7 +68,7 @@ export class FormComponent implements OnDestroy, OnInit {
|
||||
*/
|
||||
@Input() formModel: DynamicFormControlModel[];
|
||||
@Input() parentFormModel: DynamicFormGroupModel | DynamicFormGroupModel[];
|
||||
@Input() formGroup: FormGroup;
|
||||
@Input() formGroup: UntypedFormGroup;
|
||||
@Input() formLayout = null as DynamicFormLayout;
|
||||
|
||||
/* eslint-disable @angular-eslint/no-output-rename */
|
||||
@@ -122,9 +122,9 @@ export class FormComponent implements OnDestroy, OnInit {
|
||||
}));
|
||||
}*/
|
||||
|
||||
private getFormGroup(): FormGroup {
|
||||
private getFormGroup(): UntypedFormGroup {
|
||||
if (!!this.parentFormModel) {
|
||||
return this.formGroup.parent as FormGroup;
|
||||
return this.formGroup.parent as UntypedFormGroup;
|
||||
}
|
||||
|
||||
return this.formGroup;
|
||||
@@ -184,7 +184,7 @@ export class FormComponent implements OnDestroy, OnInit {
|
||||
const { fieldIndex } = error;
|
||||
let field: AbstractControl;
|
||||
if (!!this.parentFormModel) {
|
||||
field = this.formBuilderService.getFormControlById(fieldId, formGroup.parent as FormGroup, formModel, fieldIndex);
|
||||
field = this.formBuilderService.getFormControlById(fieldId, formGroup.parent as UntypedFormGroup, formModel, fieldIndex);
|
||||
} else {
|
||||
field = this.formBuilderService.getFormControlById(fieldId, formGroup, formModel, fieldIndex);
|
||||
}
|
||||
@@ -207,7 +207,7 @@ export class FormComponent implements OnDestroy, OnInit {
|
||||
const { fieldIndex } = error;
|
||||
let field: AbstractControl;
|
||||
if (!!this.parentFormModel) {
|
||||
field = this.formBuilderService.getFormControlById(fieldId, formGroup.parent as FormGroup, formModel, fieldIndex);
|
||||
field = this.formBuilderService.getFormControlById(fieldId, formGroup.parent as UntypedFormGroup, formModel, fieldIndex);
|
||||
} else {
|
||||
field = this.formBuilderService.getFormControlById(fieldId, formGroup, formModel, fieldIndex);
|
||||
}
|
||||
@@ -254,7 +254,7 @@ export class FormComponent implements OnDestroy, OnInit {
|
||||
|
||||
onBlur(event: DynamicFormControlEvent): void {
|
||||
this.blur.emit(event);
|
||||
const control: FormControl = event.control;
|
||||
const control: UntypedFormControl = event.control;
|
||||
const fieldIndex: number = (event.context && event.context.index) ? event.context.index : 0;
|
||||
if (control.valid) {
|
||||
this.formService.removeError(this.formId, event.model.name, fieldIndex);
|
||||
@@ -280,7 +280,7 @@ export class FormComponent implements OnDestroy, OnInit {
|
||||
this.change.emit(event);
|
||||
}
|
||||
|
||||
const control: FormControl = event.control;
|
||||
const control: UntypedFormControl = event.control;
|
||||
const fieldIndex: number = (event.context && event.context.index) ? event.context.index : 0;
|
||||
if (control.valid) {
|
||||
this.formService.removeError(this.formId, event.model.id, fieldIndex);
|
||||
@@ -314,7 +314,7 @@ export class FormComponent implements OnDestroy, OnInit {
|
||||
}
|
||||
|
||||
removeItem($event, arrayContext: DynamicFormArrayModel, index: number): void {
|
||||
const formArrayControl = this.formGroup.get(this.formBuilderService.getPath(arrayContext)) as FormArray;
|
||||
const formArrayControl = this.formGroup.get(this.formBuilderService.getPath(arrayContext)) as UntypedFormArray;
|
||||
const event = this.getEvent($event, arrayContext, index, 'remove');
|
||||
if (this.formBuilderService.isQualdropGroup(event.model as DynamicFormControlModel)) {
|
||||
// In case of qualdrop value remove event must be dispatched before removing the control from array
|
||||
@@ -329,7 +329,7 @@ export class FormComponent implements OnDestroy, OnInit {
|
||||
}
|
||||
|
||||
insertItem($event, arrayContext: DynamicFormArrayModel, index: number): void {
|
||||
const formArrayControl = this.formGroup.get(this.formBuilderService.getPath(arrayContext)) as FormArray;
|
||||
const formArrayControl = this.formGroup.get(this.formBuilderService.getPath(arrayContext)) as UntypedFormArray;
|
||||
this.formBuilderService.insertFormArrayGroup(index, formArrayControl, arrayContext);
|
||||
this.addArrayItem.emit(this.getEvent($event, arrayContext, index, 'add'));
|
||||
this.formService.changeForm(this.formId, this.formModel);
|
||||
@@ -344,17 +344,17 @@ export class FormComponent implements OnDestroy, OnInit {
|
||||
protected getEvent($event: any, arrayContext: DynamicFormArrayModel, index: number, type: string): DynamicFormControlEvent {
|
||||
const context = arrayContext.groups[index];
|
||||
const itemGroupModel = context.context;
|
||||
let group = this.formGroup.get(itemGroupModel.id) as FormGroup;
|
||||
let group = this.formGroup.get(itemGroupModel.id) as UntypedFormGroup;
|
||||
if (isNull(group)) {
|
||||
for (const key of Object.keys(this.formGroup.controls)) {
|
||||
group = this.formGroup.controls[key].get(itemGroupModel.id) as FormGroup;
|
||||
group = this.formGroup.controls[key].get(itemGroupModel.id) as UntypedFormGroup;
|
||||
if (isNotNull(group)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
const model = context.group[0] as DynamicFormControlModel;
|
||||
const control = group.controls[index] as FormControl;
|
||||
const control = group.controls[index] as UntypedFormControl;
|
||||
return { $event, context, control, group, model, type };
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { Store, StoreModule } from '@ngrx/store';
|
||||
import { inject, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { AbstractControl, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { AbstractControl, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
|
||||
|
||||
import { DynamicFormControlModel, DynamicFormGroupModel, DynamicInputModel } from '@ng-dynamic-forms/core';
|
||||
|
||||
@@ -22,7 +22,7 @@ describe('FormService test suite', () => {
|
||||
const formId = 'testForm';
|
||||
let service: FormService;
|
||||
let builderService: FormBuilderService;
|
||||
let formGroup: FormGroup;
|
||||
let formGroup: UntypedFormGroup;
|
||||
|
||||
const formModel: DynamicFormControlModel[] = [
|
||||
new DynamicInputModel({ id: 'author', value: 'test' }),
|
||||
@@ -104,18 +104,18 @@ describe('FormService test suite', () => {
|
||||
.subscribe((state) => {
|
||||
state.forms = formState;
|
||||
});
|
||||
const author: AbstractControl = new FormControl('test');
|
||||
const title: AbstractControl = new FormControl(undefined, Validators.required);
|
||||
const date: AbstractControl = new FormControl(undefined);
|
||||
const description: AbstractControl = new FormControl(undefined);
|
||||
const author: AbstractControl = new UntypedFormControl('test');
|
||||
const title: AbstractControl = new UntypedFormControl(undefined, Validators.required);
|
||||
const date: AbstractControl = new UntypedFormControl(undefined);
|
||||
const description: AbstractControl = new UntypedFormControl(undefined);
|
||||
|
||||
const addressLocation: FormGroup = new FormGroup({
|
||||
zipCode: new FormControl(undefined),
|
||||
state: new FormControl(undefined),
|
||||
city: new FormControl(undefined),
|
||||
const addressLocation: UntypedFormGroup = new UntypedFormGroup({
|
||||
zipCode: new UntypedFormControl(undefined),
|
||||
state: new UntypedFormControl(undefined),
|
||||
city: new UntypedFormControl(undefined),
|
||||
});
|
||||
|
||||
formGroup = new FormGroup({ author, title, date, description, addressLocation });
|
||||
formGroup = new UntypedFormGroup({ author, title, date, description, addressLocation });
|
||||
controls = { author, title, date, description , addressLocation };
|
||||
service = new FormService(builderService, store);
|
||||
})
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { distinctUntilChanged, filter, map } from 'rxjs/operators';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { AbstractControl, FormArray, FormControl, FormGroup } from '@angular/forms';
|
||||
import { AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms';
|
||||
import { Observable } from 'rxjs';
|
||||
import { select, Store } from '@ngrx/store';
|
||||
|
||||
@@ -96,13 +96,13 @@ export class FormService {
|
||||
/**
|
||||
* Method to validate form's fields
|
||||
*/
|
||||
public validateAllFormFields(formGroup: FormGroup | FormArray) {
|
||||
public validateAllFormFields(formGroup: UntypedFormGroup | UntypedFormArray) {
|
||||
Object.keys(formGroup.controls).forEach((field) => {
|
||||
const control = formGroup.get(field);
|
||||
if (control instanceof FormControl) {
|
||||
if (control instanceof UntypedFormControl) {
|
||||
control.markAsTouched({ onlySelf: true });
|
||||
control.markAsDirty({ onlySelf: true });
|
||||
} else if (control instanceof FormGroup || control instanceof FormArray) {
|
||||
} else if (control instanceof UntypedFormGroup || control instanceof UntypedFormArray) {
|
||||
this.validateAllFormFields(control);
|
||||
}
|
||||
});
|
||||
@@ -112,14 +112,14 @@ export class FormService {
|
||||
* Check if form group has an invalid form control
|
||||
* @param formGroup The form group to check
|
||||
*/
|
||||
public hasValidationErrors(formGroup: FormGroup | FormArray): boolean {
|
||||
public hasValidationErrors(formGroup: UntypedFormGroup | UntypedFormArray): boolean {
|
||||
let hasErrors = false;
|
||||
const fields: string[] = Object.keys(formGroup.controls);
|
||||
for (const field of fields) {
|
||||
const control = formGroup.get(field);
|
||||
if (control instanceof FormControl) {
|
||||
if (control instanceof UntypedFormControl) {
|
||||
hasErrors = !control.valid && control.touched;
|
||||
} else if (control instanceof FormGroup || control instanceof FormArray) {
|
||||
} else if (control instanceof UntypedFormGroup || control instanceof UntypedFormArray) {
|
||||
hasErrors = this.hasValidationErrors(control);
|
||||
}
|
||||
if (hasErrors) {
|
||||
@@ -162,7 +162,7 @@ export class FormService {
|
||||
}
|
||||
|
||||
// if the field in question is a concat group, pass down the error to its fields
|
||||
if (field instanceof FormGroup && model instanceof DynamicFormGroupModel && this.formBuilderService.isConcatGroup(model)) {
|
||||
if (field instanceof UntypedFormGroup && model instanceof DynamicFormGroupModel && this.formBuilderService.isConcatGroup(model)) {
|
||||
model.group.forEach((subModel) => {
|
||||
const subField = field.controls[subModel.id];
|
||||
|
||||
@@ -183,7 +183,7 @@ export class FormService {
|
||||
}
|
||||
|
||||
// if the field in question is a concat group, clear the error from its fields
|
||||
if (field instanceof FormGroup && model instanceof DynamicFormGroupModel && this.formBuilderService.isConcatGroup(model)) {
|
||||
if (field instanceof UntypedFormGroup && model instanceof DynamicFormGroupModel && this.formBuilderService.isConcatGroup(model)) {
|
||||
model.group.forEach((subModel) => {
|
||||
const subField = field.controls[subModel.id];
|
||||
|
||||
@@ -194,7 +194,7 @@ export class FormService {
|
||||
field.markAsUntouched();
|
||||
}
|
||||
|
||||
public resetForm(formGroup: FormGroup, groupModel: DynamicFormControlModel[], formId: string) {
|
||||
public resetForm(formGroup: UntypedFormGroup, groupModel: DynamicFormControlModel[], formId: string) {
|
||||
this.formBuilderService.clearAllModelsValue(groupModel);
|
||||
formGroup.reset();
|
||||
this.store.dispatch(new FormChangeAction(formId, formGroup.value));
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, SimpleChanges, } from '@angular/core';
|
||||
import { ControlValueAccessor, FormBuilder, NG_VALUE_ACCESSOR } from '@angular/forms';
|
||||
import { ControlValueAccessor, UntypedFormBuilder, NG_VALUE_ACCESSOR } from '@angular/forms';
|
||||
import { isEmpty } from '../../empty.util';
|
||||
|
||||
@Component({
|
||||
@@ -31,7 +31,7 @@ export class NumberPickerComponent implements OnInit, ControlValueAccessor {
|
||||
|
||||
startValue: number;
|
||||
|
||||
constructor(private fb: FormBuilder, private cd: ChangeDetectorRef) {
|
||||
constructor(private fb: UntypedFormBuilder, private cd: ChangeDetectorRef) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Component, forwardRef, Input, OnInit } from '@angular/core';
|
||||
import { FormControl, FormGroup, NG_VALUE_ACCESSOR, Validators } from '@angular/forms';
|
||||
import { UntypedFormControl, UntypedFormGroup, NG_VALUE_ACCESSOR, Validators } from '@angular/forms';
|
||||
import { ObjectUpdatesService } from '../../../core/data/object-updates/object-updates.service';
|
||||
import { MetadatumViewModel } from '../../../core/shared/metadata.models';
|
||||
import { MetadataFieldValidator } from '../../utils/metadatafield-validator.directive';
|
||||
@@ -26,7 +26,7 @@ import { InputSuggestion } from '../input-suggestions.model';
|
||||
*/
|
||||
export class ValidationSuggestionsComponent extends InputSuggestionsComponent implements OnInit {
|
||||
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
|
||||
/**
|
||||
* The current url of this page
|
||||
@@ -52,8 +52,8 @@ export class ValidationSuggestionsComponent extends InputSuggestionsComponent im
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.form = new FormGroup({
|
||||
metadataNameField: new FormControl(this._value, {
|
||||
this.form = new UntypedFormGroup({
|
||||
metadataNameField: new UntypedFormControl(this._value, {
|
||||
asyncValidators: [this.metadataFieldValidator.validate.bind(this.metadataFieldValidator)],
|
||||
validators: [Validators.required]
|
||||
})
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { UntypedFormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { By } from '@angular/platform-browser';
|
||||
|
||||
import { provideMockStore } from '@ngrx/store/testing';
|
||||
@@ -95,7 +95,7 @@ describe('LogInPasswordComponent', () => {
|
||||
|
||||
it('should create a FormGroup comprised of FormControls', () => {
|
||||
fixture.detectChanges();
|
||||
expect(component.form instanceof FormGroup).toBe(true);
|
||||
expect(component.form instanceof UntypedFormGroup).toBe(true);
|
||||
});
|
||||
|
||||
it('should authenticate', () => {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { map } from 'rxjs/operators';
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
|
||||
|
||||
import { select, Store } from '@ngrx/store';
|
||||
import { Observable } from 'rxjs';
|
||||
@@ -63,7 +63,7 @@ export class LogInPasswordComponent implements OnInit {
|
||||
* The authentication form.
|
||||
* @type {FormGroup}
|
||||
*/
|
||||
public form: FormGroup;
|
||||
public form: UntypedFormGroup;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
@@ -79,7 +79,7 @@ export class LogInPasswordComponent implements OnInit {
|
||||
@Inject('isStandalonePage') public isStandalonePage: boolean,
|
||||
private authService: AuthService,
|
||||
private hardRedirectService: HardRedirectService,
|
||||
private formBuilder: FormBuilder,
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private store: Store<CoreState>
|
||||
) {
|
||||
this.authMethod = injectedAuthMethodModel;
|
||||
|
@@ -1,14 +1,14 @@
|
||||
import { FormBuilderService } from '../form/builder/form-builder.service';
|
||||
import { FormControl, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
|
||||
import {DsDynamicInputModel} from '../form/builder/ds-dynamic-form-ui/models/ds-dynamic-input.model';
|
||||
|
||||
export function getMockFormBuilderService(): FormBuilderService {
|
||||
|
||||
return jasmine.createSpyObj('FormBuilderService', {
|
||||
modelFromConfiguration: [],
|
||||
createFormGroup: new FormGroup({}),
|
||||
createFormGroup: new UntypedFormGroup({}),
|
||||
getValueFromModel: {},
|
||||
getFormControlById: new FormControl(),
|
||||
getFormControlById: new UntypedFormControl(),
|
||||
hasMappedGroupValue: false,
|
||||
findById: {},
|
||||
getPath: ['test', 'path'],
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { ChangeDetectionStrategy, Injector, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { By } from '@angular/platform-browser';
|
||||
|
||||
import { NgbModal, NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
@@ -25,7 +25,7 @@ import { ClaimedDeclinedTaskSearchResult } from '../../../object-collection/shar
|
||||
|
||||
let component: ClaimedTaskActionsRejectComponent;
|
||||
let fixture: ComponentFixture<ClaimedTaskActionsRejectComponent>;
|
||||
let formBuilder: FormBuilder;
|
||||
let formBuilder: UntypedFormBuilder;
|
||||
let modalService: NgbModal;
|
||||
|
||||
const searchService = getMockSearchService();
|
||||
@@ -63,7 +63,7 @@ describe('ClaimedTaskActionsRejectComponent', () => {
|
||||
{ provide: SearchService, useValue: searchService },
|
||||
{ provide: RequestService, useValue: requestService },
|
||||
{ provide: PoolTaskDataService, useValue: mockPoolTaskDataService },
|
||||
FormBuilder,
|
||||
UntypedFormBuilder,
|
||||
NgbModal,
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
@@ -72,7 +72,7 @@ describe('ClaimedTaskActionsRejectComponent', () => {
|
||||
}).compileComponents();
|
||||
fixture = TestBed.createComponent(ClaimedTaskActionsRejectComponent);
|
||||
component = fixture.componentInstance;
|
||||
formBuilder = TestBed.inject(FormBuilder);
|
||||
formBuilder = TestBed.inject(UntypedFormBuilder);
|
||||
modalService = TestBed.inject(NgbModal);
|
||||
component.object = object;
|
||||
component.modalRef = modalService.open('ok');
|
||||
@@ -82,7 +82,7 @@ describe('ClaimedTaskActionsRejectComponent', () => {
|
||||
|
||||
it('should init reject form properly', () => {
|
||||
expect(component.rejectForm).toBeDefined();
|
||||
expect(component.rejectForm instanceof FormGroup).toBeTruthy();
|
||||
expect(component.rejectForm instanceof UntypedFormGroup).toBeTruthy();
|
||||
expect(component.rejectForm.controls.reason).toBeDefined();
|
||||
});
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Component, Injector, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
|
||||
|
||||
import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { ClaimedTaskActionsAbstractComponent } from '../abstract/claimed-task-actions-abstract.component';
|
||||
@@ -34,7 +34,7 @@ export class ClaimedTaskActionsRejectComponent extends ClaimedTaskActionsAbstrac
|
||||
/**
|
||||
* The reject form group
|
||||
*/
|
||||
public rejectForm: FormGroup;
|
||||
public rejectForm: UntypedFormGroup;
|
||||
|
||||
/**
|
||||
* Reference to NgbModal
|
||||
@@ -47,7 +47,7 @@ export class ClaimedTaskActionsRejectComponent extends ClaimedTaskActionsAbstrac
|
||||
protected translate: TranslateService,
|
||||
protected searchService: SearchService,
|
||||
protected requestService: RequestService,
|
||||
private formBuilder: FormBuilder,
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private modalService: NgbModal) {
|
||||
super(injector, router, notificationsService, translate, searchService, requestService);
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { Component, Inject, OnDestroy, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { FormControl, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
|
||||
import { hasValue } from '../empty.util';
|
||||
import { PaginationService } from '../../core/pagination/pagination.service';
|
||||
|
||||
@@ -21,7 +21,7 @@ export abstract class StartsWithAbstractComponent implements OnInit, OnDestroy {
|
||||
/**
|
||||
* The formdata controlling the StartsWith input
|
||||
*/
|
||||
formData: FormGroup;
|
||||
formData: UntypedFormGroup;
|
||||
|
||||
/**
|
||||
* List of subscriptions
|
||||
@@ -43,8 +43,8 @@ export abstract class StartsWithAbstractComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
})
|
||||
);
|
||||
this.formData = new FormGroup({
|
||||
startsWith: new FormControl()
|
||||
this.formData = new UntypedFormGroup({
|
||||
startsWith: new UntypedFormControl()
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { UntypedFormControl, UntypedFormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { NgbActiveModal, NgbModalModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
@@ -120,13 +120,13 @@ describe('SubscriptionModalComponent', () => {
|
||||
});
|
||||
|
||||
it('should edit an existing subscription', () => {
|
||||
component.subscriptionForm = new FormGroup({});
|
||||
component.subscriptionForm = new UntypedFormGroup({});
|
||||
for (let t of testTypes) {
|
||||
const formGroup = new FormGroup({
|
||||
subscriptionId: new FormControl(testSubscriptionId),
|
||||
frequencies: new FormGroup({
|
||||
f: new FormControl(false),
|
||||
g: new FormControl(true),
|
||||
const formGroup = new UntypedFormGroup({
|
||||
subscriptionId: new UntypedFormControl(testSubscriptionId),
|
||||
frequencies: new UntypedFormGroup({
|
||||
f: new UntypedFormControl(false),
|
||||
g: new UntypedFormControl(true),
|
||||
})
|
||||
});
|
||||
component.subscriptionForm.addControl(t, formGroup);
|
||||
@@ -143,13 +143,13 @@ describe('SubscriptionModalComponent', () => {
|
||||
});
|
||||
|
||||
it('should create a new subscription', () => {
|
||||
component.subscriptionForm = new FormGroup({});
|
||||
component.subscriptionForm = new UntypedFormGroup({});
|
||||
for (let t of testTypes) {
|
||||
const formGroup = new FormGroup({
|
||||
subscriptionId: new FormControl(undefined),
|
||||
frequencies: new FormGroup({
|
||||
f: new FormControl(false),
|
||||
g: new FormControl(true),
|
||||
const formGroup = new UntypedFormGroup({
|
||||
subscriptionId: new UntypedFormControl(undefined),
|
||||
frequencies: new UntypedFormGroup({
|
||||
f: new UntypedFormControl(false),
|
||||
g: new UntypedFormControl(true),
|
||||
})
|
||||
});
|
||||
component.subscriptionForm.addControl(t, formGroup);
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
|
||||
|
||||
import { BehaviorSubject, combineLatest, from, shareReplay } from 'rxjs';
|
||||
import { map, mergeMap, take, tap } from 'rxjs/operators';
|
||||
@@ -57,7 +57,7 @@ export class SubscriptionModalComponent implements OnInit {
|
||||
/**
|
||||
* Reactive form group that will be used to add/edit subscriptions
|
||||
*/
|
||||
subscriptionForm: FormGroup;
|
||||
subscriptionForm: UntypedFormGroup;
|
||||
|
||||
/**
|
||||
* Used to show validation errors when user submits
|
||||
@@ -84,7 +84,7 @@ export class SubscriptionModalComponent implements OnInit {
|
||||
@Output() updateSubscription: EventEmitter<Subscription> = new EventEmitter<Subscription>();
|
||||
|
||||
constructor(
|
||||
private formBuilder: FormBuilder,
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private modalService: NgbModal,
|
||||
private notificationsService: NotificationsService,
|
||||
private subscriptionService: SubscriptionsDataService,
|
||||
@@ -121,13 +121,13 @@ export class SubscriptionModalComponent implements OnInit {
|
||||
}
|
||||
|
||||
initFormByAllSubscriptions(): void {
|
||||
this.subscriptionForm = new FormGroup({});
|
||||
this.subscriptionForm = new UntypedFormGroup({});
|
||||
for (let t of this.subscriptionDefaultTypes) {
|
||||
const formGroup = new FormGroup({});
|
||||
const formGroup = new UntypedFormGroup({});
|
||||
formGroup.addControl('subscriptionId', this.formBuilder.control(''));
|
||||
formGroup.addControl('frequencies', this.formBuilder.group({}));
|
||||
for (let f of this.frequencyDefaultValues) {
|
||||
(formGroup.controls.frequencies as FormGroup).addControl(f, this.formBuilder.control(false));
|
||||
(formGroup.controls.frequencies as UntypedFormGroup).addControl(f, this.formBuilder.control(false));
|
||||
}
|
||||
this.subscriptionForm.addControl(t, formGroup);
|
||||
}
|
||||
@@ -139,13 +139,13 @@ export class SubscriptionModalComponent implements OnInit {
|
||||
* If the subscription is passed start the form with the information of subscription
|
||||
*/
|
||||
initFormByGivenSubscription(): void {
|
||||
const formGroup = new FormGroup({});
|
||||
const formGroup = new UntypedFormGroup({});
|
||||
formGroup.addControl('subscriptionId', this.formBuilder.control(this.subscription.id));
|
||||
formGroup.addControl('frequencies', this.formBuilder.group({}));
|
||||
(formGroup.get('frequencies') as FormGroup).addValidators(Validators.required);
|
||||
(formGroup.get('frequencies') as UntypedFormGroup).addValidators(Validators.required);
|
||||
for (let f of this.frequencyDefaultValues) {
|
||||
const value = findIndex(this.subscription.subscriptionParameterList, ['value', f]) !== -1;
|
||||
(formGroup.controls.frequencies as FormGroup).addControl(f, this.formBuilder.control(value));
|
||||
(formGroup.controls.frequencies as UntypedFormGroup).addControl(f, this.formBuilder.control(value));
|
||||
}
|
||||
|
||||
this.subscriptionForm = this.formBuilder.group({
|
||||
@@ -167,11 +167,11 @@ export class SubscriptionModalComponent implements OnInit {
|
||||
this.showDeleteInfo$.next(true);
|
||||
for (let subscription of res.page) {
|
||||
const type = subscription.subscriptionType;
|
||||
const subscriptionGroup: FormGroup = this.subscriptionForm.get(type) as FormGroup;
|
||||
const subscriptionGroup: UntypedFormGroup = this.subscriptionForm.get(type) as UntypedFormGroup;
|
||||
if (isNotEmpty(subscriptionGroup)) {
|
||||
subscriptionGroup.controls.subscriptionId.setValue(subscription.id);
|
||||
for (let parameter of subscription.subscriptionParameterList.filter((p) => p.name === 'frequency')) {
|
||||
(subscriptionGroup.controls.frequencies as FormGroup).controls[parameter.value]?.setValue(true);
|
||||
(subscriptionGroup.controls.frequencies as UntypedFormGroup).controls[parameter.value]?.setValue(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -194,12 +194,12 @@ export class SubscriptionModalComponent implements OnInit {
|
||||
const subscriptionsToBeUpdated = [];
|
||||
|
||||
subscriptionTypes.forEach((subscriptionType: string) => {
|
||||
const subscriptionGroup: FormGroup = this.subscriptionForm.controls[subscriptionType] as FormGroup;
|
||||
const subscriptionGroup: UntypedFormGroup = this.subscriptionForm.controls[subscriptionType] as UntypedFormGroup;
|
||||
if (subscriptionGroup.touched && subscriptionGroup.dirty) {
|
||||
const body = this.createBody(
|
||||
subscriptionGroup.controls.subscriptionId.value,
|
||||
subscriptionType,
|
||||
subscriptionGroup.controls.frequencies as FormGroup
|
||||
subscriptionGroup.controls.frequencies as UntypedFormGroup
|
||||
);
|
||||
|
||||
if (isNotEmpty(body.id)) {
|
||||
@@ -257,7 +257,7 @@ export class SubscriptionModalComponent implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
private createBody(subscriptionId: string, subscriptionType: string, frequencies: FormGroup): Partial<any> {
|
||||
private createBody(subscriptionId: string, subscriptionType: string, frequencies: UntypedFormGroup): Partial<any> {
|
||||
const body = {
|
||||
id: (isNotEmpty(subscriptionId) ? subscriptionId : null),
|
||||
subscriptionType: subscriptionType,
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { FormControl, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
|
||||
import { DynamicCheckboxModel, DynamicSelectModel } from '@ng-dynamic-forms/core';
|
||||
|
||||
export const accessConditionChangeEvent = {
|
||||
@@ -16,7 +16,7 @@ export const accessConditionChangeEvent = {
|
||||
type: 'change',
|
||||
},
|
||||
context: null,
|
||||
control: new FormControl({
|
||||
control: new UntypedFormControl({
|
||||
errors: null,
|
||||
pristine: false,
|
||||
status: 'VALID',
|
||||
@@ -26,7 +26,7 @@ export const accessConditionChangeEvent = {
|
||||
valueChanges: { _isScalar: false, observers: [], closed: false, isStopped: false, hasError: false },
|
||||
_updateOn: 'change',
|
||||
}),
|
||||
group: new FormGroup({}),
|
||||
group: new UntypedFormGroup({}),
|
||||
model: new DynamicSelectModel({
|
||||
additional: null,
|
||||
asyncValidators: null,
|
||||
@@ -66,7 +66,7 @@ export const checkboxChangeEvent = {
|
||||
type: 'change',
|
||||
},
|
||||
context: null,
|
||||
control: new FormControl({
|
||||
control: new UntypedFormControl({
|
||||
errors: null,
|
||||
pristine: false,
|
||||
status: 'VALID',
|
||||
@@ -76,7 +76,7 @@ export const checkboxChangeEvent = {
|
||||
valueChanges: { _isScalar: false, observers: [], closed: false, isStopped: false, hasError: false },
|
||||
_updateOn: 'change',
|
||||
}),
|
||||
group: new FormGroup({}),
|
||||
group: new UntypedFormGroup({}),
|
||||
model: new DynamicCheckboxModel({
|
||||
additional: null,
|
||||
asyncValidators: null,
|
||||
|
@@ -72,7 +72,7 @@ export function createPaginatedList<T>(objects?: T[]): PaginatedList<T> {
|
||||
* @param prop The property/function to spy on
|
||||
*/
|
||||
export function spyOnExported<T>(target: T, prop: keyof T): jasmine.Spy {
|
||||
const spy = jasmine.createSpy(`${prop}Spy`);
|
||||
const spy = jasmine.createSpy(`${String(prop)}Spy`);
|
||||
spyOnProperty(target, prop).and.returnValue(spy);
|
||||
return spy;
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Directive, Input } from '@angular/core';
|
||||
import { FormControl, NG_VALIDATORS, ValidationErrors, Validator } from '@angular/forms';
|
||||
import { UntypedFormControl, NG_VALIDATORS, ValidationErrors, Validator } from '@angular/forms';
|
||||
import { inListValidator } from './validator.functions';
|
||||
|
||||
/**
|
||||
@@ -23,7 +23,7 @@ export class InListValidator implements Validator {
|
||||
* The function that checks if the form control's value is currently valid
|
||||
* @param c The FormControl
|
||||
*/
|
||||
validate(c: FormControl): ValidationErrors | null {
|
||||
validate(c: UntypedFormControl): ValidationErrors | null {
|
||||
return inListValidator(this.dsInListValidator)(c);
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import {Directive} from '@angular/core';
|
||||
import {NG_VALIDATORS, Validator, FormControl} from '@angular/forms';
|
||||
import {NG_VALIDATORS, Validator, UntypedFormControl} from '@angular/forms';
|
||||
|
||||
@Directive({
|
||||
// eslint-disable-next-line @angular-eslint/directive-selector
|
||||
@@ -12,11 +12,11 @@ import {NG_VALIDATORS, Validator, FormControl} from '@angular/forms';
|
||||
* Validator directive to validate if a file is selected
|
||||
*/
|
||||
export class FileValidator implements Validator {
|
||||
static validate(c: FormControl): {[key: string]: any} {
|
||||
static validate(c: UntypedFormControl): {[key: string]: any} {
|
||||
return c.value == null || c.value.length === 0 ? { required : true } : null;
|
||||
}
|
||||
|
||||
validate(c: FormControl): {[key: string]: any} {
|
||||
validate(c: UntypedFormControl): {[key: string]: any} {
|
||||
return FileValidator.validate(c);
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { SectionAccessesService } from './section-accesses.service';
|
||||
import { Component, Inject, ViewChild } from '@angular/core';
|
||||
import { FormControl } from '@angular/forms';
|
||||
import { UntypedFormControl } from '@angular/forms';
|
||||
|
||||
import { filter, map, mergeMap, take } from 'rxjs/operators';
|
||||
import { combineLatest, Observable, of, Subscription } from 'rxjs';
|
||||
@@ -186,8 +186,8 @@ export class SubmissionSectionAccessesComponent extends SectionModelComponent {
|
||||
if (event.model.id === FORM_ACCESS_CONDITION_TYPE_CONFIG.id) {
|
||||
// Clear previous state when switching through different access conditions
|
||||
|
||||
const startDateControl: FormControl = event.control.parent.get('startDate') as FormControl;
|
||||
const endDateControl: FormControl = event.control.parent.get('endDate') as FormControl;
|
||||
const startDateControl: UntypedFormControl = event.control.parent.get('startDate') as UntypedFormControl;
|
||||
const endDateControl: UntypedFormControl = event.control.parent.get('endDate') as UntypedFormControl;
|
||||
|
||||
startDateControl?.markAsUntouched();
|
||||
endDateControl?.markAsUntouched();
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormControl } from '@angular/forms';
|
||||
import { UntypedFormControl } from '@angular/forms';
|
||||
|
||||
import {
|
||||
DYNAMIC_FORM_CONTROL_TYPE_DATEPICKER,
|
||||
@@ -240,13 +240,13 @@ export class SubmissionSectionUploadFileEditComponent implements OnInit {
|
||||
* @param control
|
||||
* The [[FormControl]] object
|
||||
*/
|
||||
public setOptions(model: DynamicFormControlModel, control: FormControl) {
|
||||
public setOptions(model: DynamicFormControlModel, control: UntypedFormControl) {
|
||||
let accessCondition: AccessConditionOption = null;
|
||||
this.availableAccessConditionOptions.filter((element) => element.name === control.value)
|
||||
.forEach((element) => accessCondition = element );
|
||||
if (isNotEmpty(accessCondition)) {
|
||||
const startDateControl: FormControl = control.parent.get('startDate') as FormControl;
|
||||
const endDateControl: FormControl = control.parent.get('endDate') as FormControl;
|
||||
const startDateControl: UntypedFormControl = control.parent.get('startDate') as UntypedFormControl;
|
||||
const endDateControl: UntypedFormControl = control.parent.get('endDate') as UntypedFormControl;
|
||||
|
||||
// Clear previous state
|
||||
startDateControl?.markAsUntouched();
|
||||
|
@@ -6,7 +6,7 @@ import { PaginatedList } from '../../core/data/paginated-list.model';
|
||||
import { SystemWideAlert } from '../system-wide-alert.model';
|
||||
import { hasValue, isNotEmpty } from '../../shared/empty.util';
|
||||
import { BehaviorSubject, Observable } from 'rxjs';
|
||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
|
||||
import { NgbDateStruct } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { utcToZonedTime, zonedTimeToUtc } from 'date-fns-tz';
|
||||
import { RemoteData } from '../../core/data/remote-data';
|
||||
@@ -39,7 +39,7 @@ export class SystemWideAlertFormComponent implements OnInit {
|
||||
/**
|
||||
* The form group representing the system-wide alert
|
||||
*/
|
||||
alertForm: FormGroup;
|
||||
alertForm: UntypedFormGroup;
|
||||
|
||||
/**
|
||||
* Date object to store the countdown date part
|
||||
@@ -116,11 +116,11 @@ export class SystemWideAlertFormComponent implements OnInit {
|
||||
* Creates the form with empty values
|
||||
*/
|
||||
createForm() {
|
||||
this.alertForm = new FormBuilder().group({
|
||||
formMessage: new FormControl('', {
|
||||
this.alertForm = new UntypedFormBuilder().group({
|
||||
formMessage: new UntypedFormControl('', {
|
||||
validators: [Validators.required],
|
||||
}),
|
||||
formActive: new FormControl(false),
|
||||
formActive: new UntypedFormControl(false),
|
||||
}
|
||||
);
|
||||
this.setDateTime(new Date());
|
||||
|
@@ -3,7 +3,7 @@ import {
|
||||
rendersAdvancedWorkflowTaskOption
|
||||
} from '../../../shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-decorator';
|
||||
import { AdvancedWorkflowActionComponent } from '../advanced-workflow-action/advanced-workflow-action.component';
|
||||
import { FormGroup, FormControl, Validators } from '@angular/forms';
|
||||
import { UntypedFormGroup, UntypedFormControl, Validators } from '@angular/forms';
|
||||
import { WorkflowAction } from '../../../core/tasks/models/workflow-action-object.model';
|
||||
import { RatingAdvancedWorkflowInfo } from '../../../core/tasks/models/rating-advanced-workflow-info.model';
|
||||
|
||||
@@ -22,13 +22,13 @@ export const ADVANCED_WORKFLOW_ACTION_RATING = 'scorereviewaction';
|
||||
})
|
||||
export class AdvancedWorkflowActionRatingComponent extends AdvancedWorkflowActionComponent implements OnInit {
|
||||
|
||||
ratingForm: FormGroup;
|
||||
ratingForm: UntypedFormGroup;
|
||||
|
||||
ngOnInit(): void {
|
||||
super.ngOnInit();
|
||||
this.ratingForm = new FormGroup({
|
||||
review: new FormControl(''),
|
||||
rating: new FormControl(0, Validators.min(1)),
|
||||
this.ratingForm = new UntypedFormGroup({
|
||||
review: new UntypedFormControl(''),
|
||||
rating: new UntypedFormControl(0, Validators.min(1)),
|
||||
});
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user