From 203ee4fb29a67c141b50d0d87767337c4bf12c2f Mon Sep 17 00:00:00 2001 From: Diamantis Tziotzios Date: Thu, 5 Oct 2023 16:39:17 +0300 Subject: [PATCH 1/4] update to angular 14 --- dmp-frontend/.gitignore | 1 + dmp-frontend/angular.json | 26 +--- dmp-frontend/package.json | 35 +++-- .../src/app/core/model/base-form-model.ts | 4 +- .../model/contact/contact-email-form-model.ts | 6 +- .../core/model/dataset/dataset-id.model.ts | 6 +- .../dmp-create-wizard-form.model.ts | 6 +- ...dmp-dataset-profile-sections-form.model.ts | 6 +- .../dmp/invitation/dmp-invitation-user.ts | 6 +- .../model/dmp/invitation/dmp-invitation.ts | 6 +- .../app/core/pipes/dataset-in-section.pipe.ts | 4 +- .../export-method-dialog.module.ts | 7 +- .../library/guided-tour/guided-tour.module.ts | 9 +- .../notification/notification.module.ts | 26 ++-- .../rich-text-editor.component.ts | 4 +- .../admin/default-value-editor-model.ts | 4 +- .../auto-complete-field-data-editor-model.ts | 8 +- .../field-data/auto-complete-single-data.ts | 4 +- ...oolean-decision-field-data-editor-model.ts | 4 +- .../check-box-field-data-editor-model.ts | 4 +- .../field-data/currency-data-editor-models.ts | 4 +- .../data-repositories-data-editor-models.ts | 4 +- .../dataset-identifier-data-editor-models.ts | 4 +- ...ets-autocomplete-field-data-editor-mode.ts | 4 +- .../date-picker-data-editor-models.ts | 4 +- ...ps-autocomplete-field-data-editor-model.ts | 4 +- .../external-datasets-data-editor-models.ts | 4 +- .../field-data/field-data-editor-model.ts | 4 +- .../field-data-option-editor-model.ts | 6 +- .../free-text-field-data-editor-model.ts | 4 +- .../field-data/licenses-data-editor-models.ts | 4 +- .../organizations-data-editor-models.ts | 4 +- .../publications-data-editor-models.ts | 4 +- .../radio-box-field-data-editor-model.ts | 8 +- .../registries-data-editor-models.ts | 4 +- ...s-auto-complete-field-data-editor-model.ts | 4 +- .../researchers-data-editor-models.ts | 4 +- .../rich-text-area-field-data-editor-model.ts | 4 +- .../field-data/services-data-editor-models.ts | 4 +- .../field-data/tags-data-editor-models.ts | 4 +- .../taxonomies-data-editor-models.ts | 4 +- .../text-area-field-data-editor-model.ts | 4 +- .../upload-field-data-editor-model.ts | 8 +- .../validation-data-editor-models.ts | 4 +- .../word-list-field-data-editor-model.ts | 8 +- .../admin/field-editor-model.ts | 6 +- .../admin/field-set-editor-model.ts | 8 +- .../admin/multiplicity-editor-model.ts | 4 +- .../admin/page-editor-model.ts | 4 +- .../admin/rule-editor-model.ts | 4 +- .../admin/section-editor-model.ts | 14 +- .../admin/view-style-editor-model.ts | 4 +- .../admin/visibility-editor-model.ts | 8 +- .../dataset-profile/dataset-profile.module.ts | 135 +++++++++--------- ...rofile-editor-composite-field.component.ts | 54 +++---- ...-profile-editor-default-value.component.ts | 6 +- ...le-editor-auto-complete-field.component.ts | 12 +- ...editor-boolean-decision-field.component.ts | 4 +- ...profile-editor-checkbox-field.component.ts | 4 +- ...rofile-editor-combo-box-field.component.ts | 4 +- ...profile-editor-currency-field.component.ts | 4 +- ...ditor-data-repositories-field.component.ts | 4 +- ...itor-dataset-identifier-field.component.ts | 4 +- ...r-datasets-autocomplete-field.component.ts | 4 +- ...file-editor-date-picker-field.component.ts | 4 +- ...ditor-dmps-autocomplete-field.component.ts | 4 +- ...ditor-external-datasets-field.component.ts | 4 +- ...rofile-editor-free-text-field.component.ts | 4 +- ...r-internal-dmp-entities-field.component.ts | 4 +- ...or-journal-repositories-field.component.ts | 4 +- ...profile-editor-licenses-field.component.ts | 4 +- ...le-editor-organizations-field.component.ts | 4 +- ...editor-pub-repositories-field.component.ts | 4 +- ...ile-editor-publications-field.component.ts | 4 +- ...rofile-editor-radio-box-field.component.ts | 10 +- ...ofile-editor-registries-field.component.ts | 4 +- ...searchers-auto-complete-field.component.ts | 4 +- ...file-editor-researchers-field.component.ts | 4 +- ...e-editor-rich-text-area-field.component.ts | 4 +- ...profile-editor-services-field.component.ts | 4 +- ...set-profile-editor-tags-field.component.ts | 4 +- ...ofile-editor-taxonomies-field.component.ts | 4 +- ...rofile-editor-text-area-field.component.ts | 4 +- ...t-profile-editor-upload-field.component.ts | 12 +- ...rofile-editor-validator-field.component.ts | 4 +- ...rofile-editor-word-list-field.component.ts | 8 +- .../dataset-profile-editor-field.component.ts | 16 +-- .../dataset-profile-editor-page.component.ts | 6 +- .../dataset-profile-editor-rule.component.ts | 30 ++-- ...ofile-editor-section-fieldset.component.ts | 18 +-- ...ataset-profile-editor-section.component.ts | 16 +-- .../editor-custom-validators.ts | 12 +- .../editor/dataset-profile-editor-model.ts | 14 +- .../dataset-profile-editor.component.ts | 116 +++++++-------- .../table-of-contents-internal-section.ts | 18 +-- .../table-of-contents/table-of-contents.ts | 20 +-- .../description-type-editor.component.ts | 8 +- .../admin/dmp-profile/dmp-profile.module.ts | 37 +++-- .../editor/dmp-blueprint-editor.model.ts | 36 ++--- .../editor/dmp-profile-editor.component.ts | 38 ++--- .../editor/dmp-profile-editor.model.ts | 18 +-- ...nal-autocomplete-field-editor.component.ts | 4 +- ...xternal-autocomplete-field-editor.model.ts | 6 +- .../criteria/user-criteria.component.ts | 6 +- .../role-editor/user-role-editor.component.ts | 22 +-- .../email-confirmation.component.ts | 4 +- .../src/app/ui/auth/login/login.component.ts | 4 +- .../merge-email-confirmation.component.ts | 4 +- .../orcid-login/orcid-login.component.ts | 4 +- .../twitter-login/twitter-login.component.ts | 4 +- .../zenodo-login/zenodo-login.component.ts | 4 +- .../contact-content.component.ts | 6 +- .../src/app/ui/contact/contact.module.ts | 28 ++-- .../app/ui/dashboard/dashboard.component.ts | 6 +- .../src/app/ui/dashboard/dashboard.module.ts | 53 ++++--- .../dataset-info-counter.component.spec.ts | 5 +- .../ui/dashboard/drafts/drafts.component.ts | 12 +- .../recent-edited-activity.component.ts | 12 +- ...ecent-edited-dataset-activity.component.ts | 10 +- .../recent-edited-dmp-activity.component.ts | 10 +- .../dataset-create-wizard.component.ts | 16 +-- .../dataset-create-wizard.model.ts | 6 +- .../dataset-create-wizard.module.ts | 41 +++--- .../dataset-dmp-selector.component.ts | 10 +- .../dataset-copy-dialogue.module.ts | 19 ++- .../dataset-editor.component.ts | 4 +- .../dataset-wizard-editor.model.ts | 34 ++--- .../dataset-wizard.component.ts | 16 +-- ...et-external-references-editor.component.ts | 32 ++--- ...data-repository-dialog-editor.component.ts | 4 +- ...xternal-dataset-dialog-editor.component.ts | 4 +- ...ternal-registry-dialog-editor.component.ts | 4 +- ...xternal-service-dialog-editor.component.ts | 4 +- .../prefill-dataset.component.ts | 6 +- .../src/app/ui/dataset/dataset.module.ts | 95 ++++++------ .../dataset-criteria-dialog.component.ts | 4 +- .../criteria/dataset-criteria.component.ts | 32 ++--- .../listing/dataset-listing.component.ts | 10 +- .../dataset-listing-item.component.ts | 4 +- .../overview/dataset-overview.component.ts | 4 +- .../clone-dialog/clone-dialog.component.ts | 6 +- .../clone/clone-dialog/clone-dialog.module.ts | 7 +- .../app/ui/dmp/clone/dmp-clone.component.ts | 12 +- .../dataset-preview-dialog.component.ts | 4 +- .../dmp-editor-blueprint.component.ts | 30 ++-- dmp-frontend/src/app/ui/dmp/dmp.module.ts | 124 +++++++--------- .../add-organization.component.ts | 6 +- .../add-organization.model.ts | 6 +- .../add-researcher.component.ts | 6 +- .../add-researcher/add-researcher.model.ts | 6 +- .../available-profiles.component.ts | 4 +- .../add-cost/add-cost.component.ts | 4 +- .../cost-editor/add-cost/add-cost.model.ts | 6 +- .../cost-listing/cost-listing.component.ts | 4 +- .../dataset-editor-details.component.ts | 10 +- .../dataset-editor-details.module.ts | 50 +++---- .../dataset-info/dataset-info.component.ts | 6 +- .../app/ui/dmp/editor/dmp-editor.component.ts | 34 ++--- .../src/app/ui/dmp/editor/dmp-editor.model.ts | 34 ++--- .../dynamic-dmp-field-resolver.component.ts | 10 +- .../dynamic-field-grant.component.ts | 6 +- .../dynamic-fields-grant.component.ts | 14 +- .../funding-info/funding-info.component.ts | 10 +- .../extra-properties-form.model.ts | 10 +- .../general-tab/general-tab.component.ts | 6 +- .../dmp/editor/grant-tab/funder-form-model.ts | 6 +- .../dmp/editor/grant-tab/grant-tab-model.ts | 6 +- .../editor/grant-tab/grant-tab.component.ts | 8 +- .../editor/grant-tab/project-form-model.ts | 6 +- .../license-info/license-info.component.ts | 8 +- .../editor/main-info/main-info.component.ts | 6 +- .../editor/people-tab/people-tab.component.ts | 4 +- .../dmp-invitation-dialog.component.ts | 4 +- .../criteria/dmp-criteria-dialog.component.ts | 4 +- .../criteria/dmp-criteria.component.ts | 24 ++-- .../ui/dmp/listing/dmp-listing.component.ts | 12 +- .../dmp-listing-item.component.ts | 4 +- .../ui/dmp/overview/dmp-overview.component.ts | 4 +- .../start-new-dataset-dialog.component.ts | 4 +- .../ui/dmp/wizard/dmp-wizard-editor.model.ts | 22 +-- .../app/ui/dmp/wizard/dmp-wizard.component.ts | 4 +- .../editor/dmp-wizard-editor.component.ts | 4 +- .../dmp-wizard-dataset-listing.component.ts | 10 +- dmp-frontend/src/app/ui/faq/faq.module.ts | 26 ++-- .../src/app/ui/glossary/glossary.module.ts | 26 ++-- .../app/ui/grant/editor/grant-editor.model.ts | 8 +- .../language-editor.component.ts | 12 +- .../src/app/ui/language/language.module.ts | 26 ++-- .../misc/criteria/base-criteria.component.ts | 16 +-- .../form-composite-field.component.ts | 20 +-- .../form-composite-title.component.ts | 6 +- .../form-field/form-field.component.ts | 8 +- .../form-progress-indication.component.ts | 52 +++---- .../form-section-inner.component.ts | 12 +- .../form-section/form-section.component.ts | 18 +-- .../dataset-description-form.component.ts | 4 +- .../dataset-description-form.model.ts | 64 ++++----- .../dataset-description.component.ts | 26 ++-- .../table-of-contents-internal.ts | 4 +- .../table-of-contents.module.ts | 9 +- .../table-of-contents.ts | 22 +-- .../visibility-rules.service.ts | 22 +-- .../external-item-listing.component.ts | 6 +- .../misc/navigation/navigation.component.scss | 2 +- .../misc/navigation/navigation.component.ts | 4 +- .../ui/misc/navigation/navigation.module.ts | 21 ++- .../user-dialog/user-dialog.component.ts | 4 +- .../ui/misc/search/search.component.spec.ts | 5 +- .../app/ui/misc/search/search.component.ts | 4 +- .../src/app/ui/navbar/navbar.module.ts | 25 ++-- .../dataset-editor-wizard-model.ts | 10 +- .../dataset-editor-wizard.component.ts | 12 +- .../quick-wizard-dataset-description-model.ts | 10 +- .../dmp-editor/dmp-editor-wizard-model.ts | 6 +- .../dmp-editor/dmp-editor-wizard.component.ts | 8 +- .../funder-editor-wizard.component.ts | 4 +- .../grant-editor/grant-editor-wizard-model.ts | 6 +- .../grant-editor-wizard.component.ts | 6 +- .../project-editor-wizard.component.ts | 4 +- .../quick-wizard-editor.component.ts | 14 +- .../quick-wizard-editor.model.ts | 6 +- .../sidebar-footer.component.ts | 4 +- .../src/app/ui/sidebar/sidebar.module.ts | 31 ++-- .../user-guide-editor.component.ts | 8 +- .../app/ui/user-guide/user-guide.module.ts | 26 ++-- .../add-account-dialog.component.ts | 4 +- .../user-profile/user-profile-editor.model.ts | 20 +-- .../ui/user-profile/user-profile.component.ts | 14 +- .../ui/user-profile/user-profile.module.ts | 27 ++-- .../src/app/utilities/enhancers/utils.ts | 14 +- dmp-frontend/src/assets/scss/blue-theme.scss | 4 +- dmp-frontend/src/assets/scss/green-theme.scss | 4 +- .../src/assets/scss/material-dashboard.scss | 6 +- dmp-frontend/src/common/forms/form-service.ts | 22 +-- ...form-validation-errors-dialog.component.ts | 12 +- .../form-validation-errors-dialog.module.ts | 31 ++-- .../confirmation-dialog.module.ts | 7 +- .../multiple-choice-dialog.module.ts | 7 +- dmp-frontend/src/polyfills.ts | 10 -- dmp-frontend/src/styles.scss | 4 +- dmp-frontend/tsconfig.json | 2 +- 241 files changed, 1435 insertions(+), 1554 deletions(-) diff --git a/dmp-frontend/.gitignore b/dmp-frontend/.gitignore index eabf65e51..1383cfc5b 100644 --- a/dmp-frontend/.gitignore +++ b/dmp-frontend/.gitignore @@ -26,6 +26,7 @@ !.vscode/extensions.json # misc +/.angular/cache /.sass-cache /connect.lock /coverage diff --git a/dmp-frontend/angular.json b/dmp-frontend/angular.json index 4c12d5745..e2dba7c01 100644 --- a/dmp-frontend/angular.json +++ b/dmp-frontend/angular.json @@ -123,18 +123,6 @@ { "glob": "**/*", "input": "node_modules/tinymce/plugins", "output": "/tinymce/plugins/" } ] } - }, - "lint": { - "builder": "@angular-devkit/build-angular:tslint", - "options": { - "tsConfig": [ - "src/tsconfig.app.json", - "src/tsconfig.spec.json" - ], - "exclude": [ - "**/node_modules/**" - ] - } } } }, @@ -149,22 +137,10 @@ "protractorConfig": "./protractor.conf.js", "devServerTarget": "dmp-frontend:serve" } - }, - "lint": { - "builder": "@angular-devkit/build-angular:tslint", - "options": { - "tsConfig": [ - "e2e/tsconfig.e2e.json" - ], - "exclude": [ - "**/node_modules/**" - ] - } } } } - }, - "defaultProject": "dmp-frontend", + }, "schematics": { "@schematics/angular:component": { "prefix": "app", diff --git a/dmp-frontend/package.json b/dmp-frontend/package.json index d8e1bcbf9..1cb946f13 100644 --- a/dmp-frontend/package.json +++ b/dmp-frontend/package.json @@ -12,13 +12,13 @@ }, "private": true, "dependencies": { - "@angular/animations": "^12.2.7", - "@angular/common": "^12.2.7", - "@angular/compiler": "^12.2.7", - "@angular/core": "^12.2.7", - "@angular/forms": "^12.2.7", - "@angular/material-moment-adapter": "^12.2.7", - "@angular/platform-browser": "^12.2.7", + "@angular/animations": "^14.3.0", + "@angular/common": "^14.3.0", + "@angular/compiler": "^14.3.0", + "@angular/core": "^14.3.0", + "@angular/forms": "^14.3.0", + "@angular/material-moment-adapter": "^14.2.7", + "@angular/platform-browser": "^14.3.0", "@kolkov/angular-editor": "^1.2.0", "@ngx-translate/core": "^13.0.0", "@ngx-translate/http-loader": "^6.0.0", @@ -43,18 +43,17 @@ "tinymce": "^5.9.2", "ts-simple-nameof": "^1.3.1", "tslib": "^2.0.0", - "web-animations-js": "^2.3.2", "zone.js": "~0.11.4" }, "devDependencies": { - "@angular-devkit/build-angular": "~12.2.7", - "@angular/cdk": "^12.2.7", - "@angular/cli": "12.2.7", - "@angular/compiler-cli": "^12.2.7", - "@angular/language-service": "^12.2.7", - "@angular/material": "^12.2.7", - "@angular/platform-browser-dynamic": "^12.2.7", - "@angular/router": "^12.2.7", + "@angular-devkit/build-angular": "^14.2.12", + "@angular/cdk": "^14.2.7", + "@angular/cli": "14.2.12", + "@angular/compiler-cli": "^14.3.0", + "@angular/language-service": "^14.3.0", + "@angular/material": "^14.2.7", + "@angular/platform-browser-dynamic": "^14.3.0", + "@angular/router": "^14.3.0", "@types/facebook-js-sdk": "^3.3.5", "@types/file-saver": "^2.0.3", "@types/gapi": "^0.0.41", @@ -67,6 +66,6 @@ "codelyzer": "^6.0.2", "ts-node": "~10.2.1", "tslint": "~6.1.0", - "typescript": "4.3.5" + "typescript": "4.6.4" } -} +} \ No newline at end of file diff --git a/dmp-frontend/src/app/core/model/base-form-model.ts b/dmp-frontend/src/app/core/model/base-form-model.ts index 2f13a1609..d16130d72 100644 --- a/dmp-frontend/src/app/core/model/base-form-model.ts +++ b/dmp-frontend/src/app/core/model/base-form-model.ts @@ -1,4 +1,4 @@ -import { FormBuilder } from '@angular/forms'; +import { UntypedFormBuilder } from '@angular/forms'; export abstract class BaseFormModel { - public formBuilder: FormBuilder = new FormBuilder(); + public formBuilder: UntypedFormBuilder = new UntypedFormBuilder(); } diff --git a/dmp-frontend/src/app/core/model/contact/contact-email-form-model.ts b/dmp-frontend/src/app/core/model/contact/contact-email-form-model.ts index 9a2df910e..00cace99b 100644 --- a/dmp-frontend/src/app/core/model/contact/contact-email-form-model.ts +++ b/dmp-frontend/src/app/core/model/contact/contact-email-form-model.ts @@ -1,4 +1,4 @@ -import { FormBuilder, FormGroup, Validators } from "@angular/forms"; +import { UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms"; import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model'; export interface ContactEmail { @@ -17,8 +17,8 @@ export class ContactEmailFormModel { return this; } - buildForm(): FormGroup { - const formGroup = new FormBuilder().group({ + buildForm(): UntypedFormGroup { + const formGroup = new UntypedFormBuilder().group({ subject: [this.subject, [Validators.required]], description: [this.description, [Validators.required]] }); diff --git a/dmp-frontend/src/app/core/model/dataset/dataset-id.model.ts b/dmp-frontend/src/app/core/model/dataset/dataset-id.model.ts index 5cac63659..3396be391 100644 --- a/dmp-frontend/src/app/core/model/dataset/dataset-id.model.ts +++ b/dmp-frontend/src/app/core/model/dataset/dataset-id.model.ts @@ -1,4 +1,4 @@ -import { FormGroup, FormBuilder } from '@angular/forms'; +import { UntypedFormGroup, UntypedFormBuilder } from '@angular/forms'; import { isNullOrUndefined } from '@app/utilities/enhancers/utils'; export class DatasetIdModel { @@ -25,8 +25,8 @@ export class DatasetIdModel { } } - buildForm(): FormGroup { - return new FormBuilder().group({ + buildForm(): UntypedFormGroup { + return new UntypedFormBuilder().group({ identifier: [this.identifier], type: [this.type] }); diff --git a/dmp-frontend/src/app/core/model/dmp/dmp-create-wizard/dmp-create-wizard-form.model.ts b/dmp-frontend/src/app/core/model/dmp/dmp-create-wizard/dmp-create-wizard-form.model.ts index f12e350cb..22e5dcba0 100644 --- a/dmp-frontend/src/app/core/model/dmp/dmp-create-wizard/dmp-create-wizard-form.model.ts +++ b/dmp-frontend/src/app/core/model/dmp/dmp-create-wizard/dmp-create-wizard-form.model.ts @@ -1,4 +1,4 @@ -import { FormBuilder, FormGroup, Validators } from "@angular/forms"; +import { UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms"; import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; import { DmpModel } from '@app/core/model/dmp/dmp'; import { BackendErrorValidator } from '@common/forms/validation/custom-validator'; @@ -17,9 +17,9 @@ export class DmpCreateWizardFormModel { return this; } - buildForm(context: ValidationContext = null): FormGroup { + buildForm(context: ValidationContext = null): UntypedFormGroup { if (context == null) { context = this.createValidationContext(); } - const formBuilder = new FormBuilder(); + const formBuilder = new UntypedFormBuilder(); const formGroup = formBuilder.group({ dmp: [this.dmp, context.getValidation('dmp').validators], datasetProfile: [this.datasetProfile, context.getValidation('datasetProfile').validators], diff --git a/dmp-frontend/src/app/core/model/dmp/dmp-dataset-profile/dmp-dataset-profile-sections-form.model.ts b/dmp-frontend/src/app/core/model/dmp/dmp-dataset-profile/dmp-dataset-profile-sections-form.model.ts index 8f0745359..9e5f9a355 100644 --- a/dmp-frontend/src/app/core/model/dmp/dmp-dataset-profile/dmp-dataset-profile-sections-form.model.ts +++ b/dmp-frontend/src/app/core/model/dmp/dmp-dataset-profile/dmp-dataset-profile-sections-form.model.ts @@ -1,4 +1,4 @@ -import { FormGroup, FormBuilder } from "@angular/forms"; +import { UntypedFormGroup, UntypedFormBuilder } from "@angular/forms"; import { BackendErrorValidator } from "@common/forms/validation/custom-validator"; import { ValidationErrorModel } from "@common/forms/validation/error-model/validation-error-model"; import { ValidationContext } from "@common/forms/validation/validation-context"; @@ -12,9 +12,9 @@ export class DmpDatasetProfileSectionsFormModel { return this; } - buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { + buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup { if (context == null) { context = this.createValidationContext(); } - const formGroup = new FormBuilder().group({ + const formGroup = new UntypedFormBuilder().group({ language: [{ value: this.dmpSectionIndex, disabled: disabled }, context.getValidation('dmpSectionIndex').validators], }); return formGroup; diff --git a/dmp-frontend/src/app/core/model/dmp/invitation/dmp-invitation-user.ts b/dmp-frontend/src/app/core/model/dmp/invitation/dmp-invitation-user.ts index 7c1163475..8a261b428 100644 --- a/dmp-frontend/src/app/core/model/dmp/invitation/dmp-invitation-user.ts +++ b/dmp-frontend/src/app/core/model/dmp/invitation/dmp-invitation-user.ts @@ -1,4 +1,4 @@ -import { FormBuilder, FormGroup } from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { Serializable } from '@common/types/json/serializable'; export class DmpInvitationUser implements Serializable { @@ -14,8 +14,8 @@ export class DmpInvitationUser implements Serializable { return this; } - buildForm(): FormGroup { - return new FormBuilder().group({ + buildForm(): UntypedFormGroup { + return new UntypedFormBuilder().group({ id: [this.id], email: [this.email], name: [this.name] diff --git a/dmp-frontend/src/app/core/model/dmp/invitation/dmp-invitation.ts b/dmp-frontend/src/app/core/model/dmp/invitation/dmp-invitation.ts index 3e0854a30..02bda1e75 100644 --- a/dmp-frontend/src/app/core/model/dmp/invitation/dmp-invitation.ts +++ b/dmp-frontend/src/app/core/model/dmp/invitation/dmp-invitation.ts @@ -1,4 +1,4 @@ -import { FormBuilder, FormGroup } from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { DmpInvitationUser } from './dmp-invitation-user'; export class DmpInvitation { @@ -7,8 +7,8 @@ export class DmpInvitation { public users = new Array(); public role: number; - buildForm(): FormGroup { - const formGroup = new FormBuilder().group({ + buildForm(): UntypedFormGroup { + const formGroup = new UntypedFormBuilder().group({ dataManagementPlan: [this.dataManagementPlan], users: [this.users], role: [this.role] diff --git a/dmp-frontend/src/app/core/pipes/dataset-in-section.pipe.ts b/dmp-frontend/src/app/core/pipes/dataset-in-section.pipe.ts index 7d0e12f6d..fd9e2e4f2 100644 --- a/dmp-frontend/src/app/core/pipes/dataset-in-section.pipe.ts +++ b/dmp-frontend/src/app/core/pipes/dataset-in-section.pipe.ts @@ -1,12 +1,12 @@ import { Pipe, PipeTransform } from "@angular/core"; -import { FormGroup } from "@angular/forms"; +import { UntypedFormGroup } from "@angular/forms"; @Pipe({ name: 'datasetInSection' }) export class DatasetInSectioPipe implements PipeTransform{ - transform(datasets: FormGroup[], args: string): FormGroup[] { + transform(datasets: UntypedFormGroup[], args: string): UntypedFormGroup[] { let values = []; for(var dataset of datasets){ if(dataset.get('dmpSectionIndex').value == args){ diff --git a/dmp-frontend/src/app/library/export-method-dialog/export-method-dialog.module.ts b/dmp-frontend/src/app/library/export-method-dialog/export-method-dialog.module.ts index b72241c53..51f8dedcc 100644 --- a/dmp-frontend/src/app/library/export-method-dialog/export-method-dialog.module.ts +++ b/dmp-frontend/src/app/library/export-method-dialog/export-method-dialog.module.ts @@ -3,10 +3,9 @@ import { ExportMethodDialogComponent } from '@app/library/export-method-dialog/e import { CommonUiModule } from '@common/ui/common-ui.module'; @NgModule({ - imports: [CommonUiModule], - declarations: [ExportMethodDialogComponent], - exports: [ExportMethodDialogComponent], - entryComponents: [ExportMethodDialogComponent] + imports: [CommonUiModule], + declarations: [ExportMethodDialogComponent], + exports: [ExportMethodDialogComponent] }) export class ExportMethodDialogModule { constructor() { } diff --git a/dmp-frontend/src/app/library/guided-tour/guided-tour.module.ts b/dmp-frontend/src/app/library/guided-tour/guided-tour.module.ts index 6bcb422ab..1053ee324 100644 --- a/dmp-frontend/src/app/library/guided-tour/guided-tour.module.ts +++ b/dmp-frontend/src/app/library/guided-tour/guided-tour.module.ts @@ -5,11 +5,10 @@ import { CommonModule } from '@angular/common'; import { WindowRefService } from './windowref.service'; @NgModule({ - declarations: [GuidedTourComponent], - imports: [CommonModule], - providers: [WindowRefService], - exports: [GuidedTourComponent], - entryComponents: [GuidedTourComponent], + declarations: [GuidedTourComponent], + imports: [CommonModule], + providers: [WindowRefService], + exports: [GuidedTourComponent] }) export class GuidedTourModule { public static forRoot(): ModuleWithProviders { diff --git a/dmp-frontend/src/app/library/notification/notification.module.ts b/dmp-frontend/src/app/library/notification/notification.module.ts index 2abf82c9d..46fbef540 100644 --- a/dmp-frontend/src/app/library/notification/notification.module.ts +++ b/dmp-frontend/src/app/library/notification/notification.module.ts @@ -5,21 +5,17 @@ import { SnackBarNotificationComponent } from '@app/library/notification/snack-b import { CommonUiModule } from '@common/ui/common-ui.module'; @NgModule({ - imports: [ - CommonUiModule - ], - declarations: [ - NotificationComponent, - SnackBarNotificationComponent, - PopupNotificationDialogComponent, - ], - exports: [ - NotificationComponent - ], - entryComponents: [ - SnackBarNotificationComponent, - PopupNotificationDialogComponent, - ] + imports: [ + CommonUiModule + ], + declarations: [ + NotificationComponent, + SnackBarNotificationComponent, + PopupNotificationDialogComponent, + ], + exports: [ + NotificationComponent + ] }) export class NotificationModule { constructor() { } diff --git a/dmp-frontend/src/app/library/rich-text-editor/rich-text-editor.component.ts b/dmp-frontend/src/app/library/rich-text-editor/rich-text-editor.component.ts index 5453a6404..4168ab651 100644 --- a/dmp-frontend/src/app/library/rich-text-editor/rich-text-editor.component.ts +++ b/dmp-frontend/src/app/library/rich-text-editor/rich-text-editor.component.ts @@ -1,6 +1,6 @@ import {Component, Input} from "@angular/core"; import {AngularEditorConfig} from "@kolkov/angular-editor"; -import {FormControl} from "@angular/forms"; +import {UntypedFormControl} from "@angular/forms"; @Component({ selector: 'rich-text-editor-component', @@ -66,7 +66,7 @@ export class RichTextEditorComponent { ] }; - get formInput(): FormControl { + get formInput(): UntypedFormControl { return this.parentFormGroup.get(this.controlName); } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/default-value-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/default-value-editor-model.ts index a2ea403ce..58e01114a 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/default-value-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/default-value-editor-model.ts @@ -1,4 +1,4 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { DefaultValue } from '../../../../core/model/admin/dataset-profile/dataset-profile'; import { BaseFormModel } from '../../../../core/model/base-form-model'; @@ -12,7 +12,7 @@ export class DefaultValueEditorModel extends BaseFormModel { return this; } - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('DefaultValueEditorModel.type')) }], value: [{ value: this.value, disabled: (disabled && !skipDisable.includes('DefaultValueEditorModel.value')) }] diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/auto-complete-field-data-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/auto-complete-field-data-editor-model.ts index 8e9ac3cc8..ecf09ebce 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/auto-complete-field-data-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/auto-complete-field-data-editor-model.ts @@ -1,4 +1,4 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { DatasetProfileComboBoxType } from '../../../../../core/common/enum/dataset-profile-combo-box-type'; import { AutoCompleteFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { FieldDataEditorModel } from './field-data-editor-model'; @@ -12,17 +12,17 @@ export class AutoCompleteFieldDataEditorModel extends FieldDataEditorModel = new Array(); //public multiAutoCompleteOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel(); - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('AutoCompleteFieldDataEditorModel.label')) }], type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('AutoCompleteFieldDataEditorModel.type')) }], multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('AutoCompleteFieldDataEditorModel.multiAutoComplete')) }] }); - const autocompleteFormArray = new Array(); + const autocompleteFormArray = new Array(); if (this.autoCompleteSingleDataList) { this.autoCompleteSingleDataList.forEach(item => { - const form: FormGroup = item.buildForm(disabled, skipDisable); + const form: UntypedFormGroup = item.buildForm(disabled, skipDisable); autocompleteFormArray.push(form); }); } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/auto-complete-single-data.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/auto-complete-single-data.ts index 3bffd86d1..7875dacfe 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/auto-complete-single-data.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/auto-complete-single-data.ts @@ -1,7 +1,7 @@ import { FieldDataEditorModel } from './field-data-editor-model'; import { DatasetProfileComboBoxType } from '@app/core/common/enum/dataset-profile-combo-box-type'; import { FieldDataOptionEditorModel } from './field-data-option-editor-model'; -import { FormGroup, Validators } from '@angular/forms'; +import { UntypedFormGroup, Validators } from '@angular/forms'; import { AutoCompleteFieldData, AutoCompleteSingleData } from '@app/core/model/dataset-profile-definition/field-data/field-data'; export class AutoCompleteSingleDataEditorModel extends FieldDataEditorModel { @@ -13,7 +13,7 @@ export class AutoCompleteSingleDataEditorModel extends FieldDataEditorModel = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('AutoCompleteSingleDataEditorModel.label')) }], url: [{ value: this.url, disabled: (disabled && !skipDisable.includes('AutoCompleteSingleDataEditorModel.url')) },[Validators.required]], diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/boolean-decision-field-data-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/boolean-decision-field-data-editor-model.ts index 4cb82ad5f..ca0332c32 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/boolean-decision-field-data-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/boolean-decision-field-data-editor-model.ts @@ -1,10 +1,10 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { BooleanDecisionFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { FieldDataEditorModel } from './field-data-editor-model'; export class BooleanDecisionFieldDataEditorModel extends FieldDataEditorModel { - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('BooleanDecisionFieldDataEditorModel.label')) }] }); diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/check-box-field-data-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/check-box-field-data-editor-model.ts index 009a1a6b3..996ad10b3 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/check-box-field-data-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/check-box-field-data-editor-model.ts @@ -1,10 +1,10 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { CheckBoxFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { FieldDataEditorModel } from './field-data-editor-model'; export class CheckBoxFieldDataEditorModel extends FieldDataEditorModel { - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('CheckBoxFieldDataEditorModel.label')) }] }); diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/currency-data-editor-models.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/currency-data-editor-models.ts index 07b1c67c0..c4f2d35e0 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/currency-data-editor-models.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/currency-data-editor-models.ts @@ -1,11 +1,11 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { FieldDataEditorModel } from './field-data-editor-model'; import { CurrencyFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; export class CurrencyDataEditorModel extends FieldDataEditorModel { public label: string; - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('CurrencyDataEditorModel.label')) }] }); diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models.ts index c337a5311..45b23fcb2 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models.ts @@ -1,4 +1,4 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { FieldDataEditorModel } from './field-data-editor-model'; import { DataRepositoriesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; @@ -6,7 +6,7 @@ export class DataRepositoriesDataEditorModel extends FieldDataEditorModel = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }], multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }] diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/dataset-identifier-data-editor-models.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/dataset-identifier-data-editor-models.ts index 42492776b..414526181 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/dataset-identifier-data-editor-models.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/dataset-identifier-data-editor-models.ts @@ -1,11 +1,11 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { FieldDataEditorModel } from './field-data-editor-model'; import { DatasetIdentifierFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; export class DatasetIdentifierDataEditorModel extends FieldDataEditorModel { public label: string; - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DatasetIdentifierDataEditorModel.label')) }] }); diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/datasets-autocomplete-field-data-editor-mode.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/datasets-autocomplete-field-data-editor-mode.ts index f91a66617..8ea85c261 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/datasets-autocomplete-field-data-editor-mode.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/datasets-autocomplete-field-data-editor-mode.ts @@ -2,7 +2,7 @@ import { FieldDataEditorModel } from "./field-data-editor-model"; import { DatasetProfileInternalDmpEntitiesType } from "../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type"; import { FieldDataOptionEditorModel } from "./field-data-option-editor-model"; import { DatasetsAutoCompleteFieldData } from "../../../../../core/model/dataset-profile-definition/field-data/field-data"; -import { FormGroup } from "@angular/forms"; +import { UntypedFormGroup } from "@angular/forms"; export class DatasetsAutoCompleteFieldDataEditorModel extends FieldDataEditorModel { public type: DatasetProfileInternalDmpEntitiesType = DatasetProfileInternalDmpEntitiesType.Datasets; @@ -10,7 +10,7 @@ export class DatasetsAutoCompleteFieldDataEditorModel extends FieldDataEditorMod public autoCompleteOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel(); public autoCompleteType: number; - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DatasetsAutoCompleteFieldDataEditorModel.label')) }], type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('DatasetsAutoCompleteFieldDataEditorModel.type')) }], diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/date-picker-data-editor-models.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/date-picker-data-editor-models.ts index 1d913a6e4..7101a775a 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/date-picker-data-editor-models.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/date-picker-data-editor-models.ts @@ -1,11 +1,11 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { FieldDataEditorModel } from './field-data-editor-model'; import { DatePickerFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; export class DatePickerDataEditorModel extends FieldDataEditorModel { public label: string; - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DatePickerDataEditorModel.label')) }] }); diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/dmps-autocomplete-field-data-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/dmps-autocomplete-field-data-editor-model.ts index fd7a89a6e..42f310438 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/dmps-autocomplete-field-data-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/dmps-autocomplete-field-data-editor-model.ts @@ -2,14 +2,14 @@ import { FieldDataEditorModel } from "./field-data-editor-model"; import { DatasetProfileInternalDmpEntitiesType } from "../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type"; import { FieldDataOptionEditorModel } from "./field-data-option-editor-model"; import { DmpsAutoCompleteFieldData } from "../../../../../core/model/dataset-profile-definition/field-data/field-data"; -import { FormGroup } from "@angular/forms"; +import { UntypedFormGroup } from "@angular/forms"; export class DmpsAutoCompleteFieldDataEditorModel extends FieldDataEditorModel { public type: DatasetProfileInternalDmpEntitiesType = DatasetProfileInternalDmpEntitiesType.Dmps; public multiAutoComplete: boolean = false; public autoCompleteOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel(); - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DmpsAutoCompleteFieldDataEditorModel.label')) }], type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('DmpsAutoCompleteFieldDataEditorModel.type')) }], diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/external-datasets-data-editor-models.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/external-datasets-data-editor-models.ts index 473c4a822..447c8bb90 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/external-datasets-data-editor-models.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/external-datasets-data-editor-models.ts @@ -1,4 +1,4 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { FieldDataEditorModel } from './field-data-editor-model'; import { ExternalDatasetsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { ExternalDatasetTypeEnum } from '@app/core/common/enum/external-dataset-type-enum'; @@ -8,7 +8,7 @@ export class ExternalDatasetsDataEditorModel extends FieldDataEditorModel = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ExternalDatasetsDataEditorModel.label')) }], multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ExternalDatasetsDataEditorModel.multiAutoComplete')) }], diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/field-data-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/field-data-editor-model.ts index 8eda12048..78f15c0d8 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/field-data-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/field-data-editor-model.ts @@ -1,11 +1,11 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { BaseFormModel } from '../../../../../core/model/base-form-model'; export abstract class FieldDataEditorModel extends BaseFormModel { public label: string; - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { throw new Error('Build Form Is not not correctly overriden'); } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/field-data-option-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/field-data-option-editor-model.ts index d13491cd1..8296ba864 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/field-data-option-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/field-data-option-editor-model.ts @@ -1,4 +1,4 @@ -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; import { FieldDataOption } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { FieldDataEditorModel } from './field-data-editor-model'; @@ -7,8 +7,8 @@ export class FieldDataOptionEditorModel extends FieldDataEditorModel = []): FormGroup { - return new FormBuilder().group({ + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { + return new UntypedFormBuilder().group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('FieldDataOptionEditorModel.label')) },[Validators.required]], value: [{ value: this.value, disabled: (disabled && !skipDisable.includes('FieldDataOptionEditorModel.value')) },[Validators.required]], source: [{ value: this.source, disabled: (disabled && !skipDisable.includes('FieldDataOptionEditorModel.source')) }] diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/free-text-field-data-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/free-text-field-data-editor-model.ts index 5a2733543..bf5c11038 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/free-text-field-data-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/free-text-field-data-editor-model.ts @@ -1,10 +1,10 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { FreeTextFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { FieldDataEditorModel } from './field-data-editor-model'; export class FreeTextFieldDataEditorModel extends FieldDataEditorModel { - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('FreeTextFieldDataEditorModel.label')) }] }); diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/licenses-data-editor-models.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/licenses-data-editor-models.ts index 42c57b4c4..56427d988 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/licenses-data-editor-models.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/licenses-data-editor-models.ts @@ -1,11 +1,11 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { FieldDataEditorModel } from './field-data-editor-model'; import { LicensesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; export class LicensesDataEditorModel extends FieldDataEditorModel { public label: string; public multiAutoComplete: boolean; - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }], multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }] diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/organizations-data-editor-models.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/organizations-data-editor-models.ts index 92090f3fd..2efa6c160 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/organizations-data-editor-models.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/organizations-data-editor-models.ts @@ -1,4 +1,4 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { FieldDataEditorModel } from './field-data-editor-model'; import { OrganizationsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; @@ -6,7 +6,7 @@ export class OrganizationsDataEditorModel extends FieldDataEditorModel = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('OrganizationsDataEditorModel.label')) }], multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('OrganizationsDataEditorModel.multiAutoComplete')) }] diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/publications-data-editor-models.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/publications-data-editor-models.ts index af2c2ebdc..233d18e1d 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/publications-data-editor-models.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/publications-data-editor-models.ts @@ -1,11 +1,11 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { FieldDataEditorModel } from './field-data-editor-model'; import { PublicationsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; export class PublicationsDataEditorModel extends FieldDataEditorModel { public label: string; public multiAutoComplete: boolean; - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }], multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }] diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/radio-box-field-data-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/radio-box-field-data-editor-model.ts index 22752fb05..a7f8ba191 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/radio-box-field-data-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/radio-box-field-data-editor-model.ts @@ -1,4 +1,4 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { RadioBoxFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { FieldDataEditorModel } from './field-data-editor-model'; import { FieldDataOptionEditorModel } from './field-data-option-editor-model'; @@ -7,14 +7,14 @@ export class RadioBoxFieldDataEditorModel extends FieldDataEditorModel = []; - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('RadioBoxFieldDataEditorModel.label')) }] }); - const optionsFormArray = new Array(); + const optionsFormArray = new Array(); if (this.options) { this.options.forEach(item => { - const form: FormGroup = item.buildForm(disabled, skipDisable); + const form: UntypedFormGroup = item.buildForm(disabled, skipDisable); optionsFormArray.push(form); }); } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/registries-data-editor-models.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/registries-data-editor-models.ts index f0128ea45..6f996564e 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/registries-data-editor-models.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/registries-data-editor-models.ts @@ -1,4 +1,4 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { FieldDataEditorModel } from './field-data-editor-model'; import { RegistriesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; @@ -6,7 +6,7 @@ export class RegistriesDataEditorModel extends FieldDataEditorModel = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('RegistriesDataEditorModel.label')) }], multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('RegistriesDataEditorModel.multiAutoComplete')) }] diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/researchers-auto-complete-field-data-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/researchers-auto-complete-field-data-editor-model.ts index 2ceeb4b41..83821c02b 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/researchers-auto-complete-field-data-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/researchers-auto-complete-field-data-editor-model.ts @@ -1,7 +1,7 @@ import { FieldDataEditorModel } from "./field-data-editor-model"; import { DatasetProfileInternalDmpEntitiesType } from "../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type"; import { FieldDataOptionEditorModel } from "./field-data-option-editor-model"; -import { FormGroup } from "@angular/forms"; +import { UntypedFormGroup } from "@angular/forms"; import { ResearchersAutoCompleteFieldData } from "../../../../../core/model/dataset-profile-definition/field-data/field-data"; export class ResearchersAutoCompleteFieldDataEditorModel extends FieldDataEditorModel { @@ -10,7 +10,7 @@ export class ResearchersAutoCompleteFieldDataEditorModel extends FieldDataEditor public multiAutoComplete: boolean = false; public autoCompleteOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel(); - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ResearchersAutoCompleteFieldDataEditorModel.label')) }], type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('ResearchersAutoCompleteFieldDataEditorModel.type')) }], diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/researchers-data-editor-models.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/researchers-data-editor-models.ts index 6141a88f2..7966ef9ec 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/researchers-data-editor-models.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/researchers-data-editor-models.ts @@ -1,11 +1,11 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { FieldDataEditorModel } from './field-data-editor-model'; import { ResearchersFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; export class ResearchersDataEditorModel extends FieldDataEditorModel { public label: string; - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ResearchersDataEditorModel.label')) }] }); diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/rich-text-area-field-data-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/rich-text-area-field-data-editor-model.ts index 9ba1e2389..cbc8e5ffc 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/rich-text-area-field-data-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/rich-text-area-field-data-editor-model.ts @@ -1,10 +1,10 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { RichTextAreaFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { FieldDataEditorModel } from './field-data-editor-model'; export class RichTextAreaFieldDataEditorModel extends FieldDataEditorModel { - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('RichTextAreaFieldDataEditorModel.label')) }] }); diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/services-data-editor-models.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/services-data-editor-models.ts index 033868e4f..4c738bbbc 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/services-data-editor-models.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/services-data-editor-models.ts @@ -1,4 +1,4 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { FieldDataEditorModel } from './field-data-editor-model'; import { ServicesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; @@ -6,7 +6,7 @@ export class ServicesDataEditorModel extends FieldDataEditorModel = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }], multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }] diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/tags-data-editor-models.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/tags-data-editor-models.ts index 7cbbf0662..b5c20ff22 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/tags-data-editor-models.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/tags-data-editor-models.ts @@ -1,11 +1,11 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { FieldDataEditorModel } from './field-data-editor-model'; import { TagsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; export class TagsDataEditorModel extends FieldDataEditorModel { public label: string; - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('TagsDataEditorModel.label')) }] }); diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/taxonomies-data-editor-models.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/taxonomies-data-editor-models.ts index 31a8eef97..0f7f0c4d3 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/taxonomies-data-editor-models.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/taxonomies-data-editor-models.ts @@ -1,4 +1,4 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { FieldDataEditorModel } from './field-data-editor-model'; import {TaxonomiesFieldData} from "@app/core/model/dataset-profile-definition/field-data/field-data"; @@ -6,7 +6,7 @@ export class TaxonomiesDataEditorModel extends FieldDataEditorModel = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }], multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }] diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/text-area-field-data-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/text-area-field-data-editor-model.ts index 6d9fefdc2..7c9d9f34b 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/text-area-field-data-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/text-area-field-data-editor-model.ts @@ -1,10 +1,10 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { TextAreaFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { FieldDataEditorModel } from './field-data-editor-model'; export class TextAreaFieldDataEditorModel extends FieldDataEditorModel { - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('TextAreaFieldDataEditorModel.label')) }] }); diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/upload-field-data-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/upload-field-data-editor-model.ts index f69247add..950f7e364 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/upload-field-data-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/upload-field-data-editor-model.ts @@ -1,4 +1,4 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { FieldDataOption, UploadFieldData @@ -10,16 +10,16 @@ export class UploadFieldDataEditorModel extends FieldDataEditorModel = []; public maxFileSizeInMB: number; - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('UploadFieldDataEditorModel.label')) }], maxFileSizeInMB: [{ value: this.maxFileSizeInMB, disabled: (disabled && !skipDisable.includes('UploadFieldDataEditorModel.maxFileSizeInMB')) }], // types: [{ value: this.types, disabled: (disabled && !skipDisable.includes('UploadFieldDataEditorModel.types')) }] }); - const optionsFormArray = new Array(); + const optionsFormArray = new Array(); if (this.types) { this.types.forEach(item => { - const form: FormGroup = item.buildForm(disabled, skipDisable); + const form: UntypedFormGroup = item.buildForm(disabled, skipDisable); optionsFormArray.push(form); }); } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/validation-data-editor-models.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/validation-data-editor-models.ts index 7fafc1486..e67cd93dc 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/validation-data-editor-models.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/validation-data-editor-models.ts @@ -1,11 +1,11 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { FieldDataEditorModel } from './field-data-editor-model'; import { ValidationFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; export class ValidationDataEditorModel extends FieldDataEditorModel { public label: string; - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ValidationDataEditorModel.label')) }] }); diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/word-list-field-data-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/word-list-field-data-editor-model.ts index 2022da566..82e2497ba 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/word-list-field-data-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/word-list-field-data-editor-model.ts @@ -1,4 +1,4 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { DatasetProfileComboBoxType } from '../../../../../core/common/enum/dataset-profile-combo-box-type'; import { WordListFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { FieldDataEditorModel } from './field-data-editor-model'; @@ -9,16 +9,16 @@ export class WordListFieldDataEditorModel extends FieldDataEditorModel; public multipleList: boolean; - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('WordListFieldDataEditorModel.type')) }], label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('WordListFieldDataEditorModel.label')) }], multiList: [{ value: this.multipleList, disabled: (disabled && !skipDisable.includes('WordListFieldDataEditorModel.multipleList'))}] }); - const optionsFormArray = new Array(); + const optionsFormArray = new Array(); if (this.options) { this.options.forEach(item => { - const form: FormGroup = item.buildForm(disabled, skipDisable); + const form: UntypedFormGroup = item.buildForm(disabled, skipDisable); optionsFormArray.push(form); }); } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-editor-model.ts index 2ef81df2e..b4a09b98f 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-editor-model.ts @@ -1,4 +1,4 @@ -import { FormArray, FormControl, FormGroup, Validators } from '@angular/forms'; +import { FormArray, FormControl, UntypedFormGroup, Validators } from '@angular/forms'; import { ValidationType } from '../../../../core/common/enum/validation-type'; import { Field } from '../../../../core/model/admin/dataset-profile/dataset-profile'; import { BaseFormModel } from '../../../../core/model/base-form-model'; @@ -98,7 +98,7 @@ export class FieldEditorModel extends BaseFormModel { return this; } - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ id: [{ value: this.id, disabled: (disabled && !skipDisable.includes('FieldEditorModel.id')) }, [Validators.required, Validators.pattern('^[^<_>]+$')]], // title: [this.title], @@ -134,7 +134,7 @@ export class FieldEditorModel extends BaseFormModel { } - private _appendCustomValidators(formGroup: FormGroup){ + private _appendCustomValidators(formGroup: UntypedFormGroup){ const renderStyleValue = formGroup.get('viewStyle').get('renderStyle').value; if(renderStyleValue === 'checkBox'){ formGroup.get('defaultValue').get('value').setValidators(Validators.required); diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-set-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-set-editor-model.ts index 052bd353b..56884bc71 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-set-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-set-editor-model.ts @@ -1,5 +1,5 @@  -import { FormGroup, Validators } from '@angular/forms'; +import { UntypedFormGroup, Validators } from '@angular/forms'; import { FieldSet } from '../../../../core/model/admin/dataset-profile/dataset-profile'; import { BaseFormModel } from '../../../../core/model/base-form-model'; import { FieldEditorModel } from './field-editor-model'; @@ -31,7 +31,7 @@ export class FieldSetEditorModel extends BaseFormModel { return this; } - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ id: [{ value: this.id, disabled: (disabled && !skipDisable.includes('FieldSetEditorModel.id')) }, [Validators.required, Validators.pattern('^[^<_>]+$')]], ordinal: [{ value: this.ordinal, disabled: (disabled && !skipDisable.includes('FieldSetEditorModel.ordinal')) }], @@ -41,9 +41,9 @@ export class FieldSetEditorModel extends BaseFormModel { additionalInformation: [{ value: this.additionalInformation, disabled: (disabled && !skipDisable.includes('FieldSetEditorModel.additionalInformation')) }], hasCommentField: [{ value: this.hasCommentField, disabled: (disabled && !skipDisable.includes('FieldSetEditorModel.hasCommentField')) }] }); - const fieldsFormArray = new Array(); + const fieldsFormArray = new Array(); this.fields.forEach(item => { - const form: FormGroup = item.buildForm(disabled, skipDisable); + const form: UntypedFormGroup = item.buildForm(disabled, skipDisable); fieldsFormArray.push(form); }); formGroup.addControl('fields', this.formBuilder.array(fieldsFormArray)); diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/multiplicity-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/multiplicity-editor-model.ts index 5f219c713..6efbd8bf1 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/multiplicity-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/multiplicity-editor-model.ts @@ -1,4 +1,4 @@ -import {FormGroup} from '@angular/forms'; +import {UntypedFormGroup} from '@angular/forms'; import {Multiplicity} from '../../../../core/model/admin/dataset-profile/dataset-profile'; import {BaseFormModel} from '../../../../core/model/base-form-model'; @@ -16,7 +16,7 @@ export class MultiplicityEditorModel extends BaseFormModel { return this; } - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { return this.formBuilder.group({ min: [{value: this.min, disabled: (disabled && !skipDisable.includes('MultiplicityEditorModel.min'))}], max: [{value: this.max, disabled: (disabled && !skipDisable.includes('MultiplicityEditorModel.max'))}], diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/page-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/page-editor-model.ts index 6f16b2c02..1fc8fc536 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/page-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/page-editor-model.ts @@ -1,4 +1,4 @@ -import { FormGroup, Validators } from '@angular/forms'; +import { UntypedFormGroup, Validators } from '@angular/forms'; import { Page } from '@app/core/model/admin/dataset-profile/dataset-profile'; import { BaseFormModel } from '@app/core/model/base-form-model'; import { Guid } from '@common/types/guid'; @@ -21,7 +21,7 @@ export class PageEditorModel extends BaseFormModel { return this; } - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ title: [{ value: this.title, disabled: (disabled && !skipDisable.includes('PageEditorModel.title')) }, [Validators.required]], id: [{ value: this.id, disabled: (disabled && !skipDisable.includes('PageEditorModel.id')) }, [Validators.required]], diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/rule-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/rule-editor-model.ts index 6e878666c..9f3cdc5a6 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/rule-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/rule-editor-model.ts @@ -1,4 +1,4 @@ -import { FormGroup, Validators } from "@angular/forms"; +import { UntypedFormGroup, Validators } from "@angular/forms"; import { Rule } from "../../../../core/model/admin/dataset-profile/dataset-profile"; import { BaseFormModel } from "../../../../core/model/base-form-model"; @@ -18,7 +18,7 @@ export class RuleEditorModel extends BaseFormModel { return this; } - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ // sourceField: [this.sourceField], target: [{ value: this.target, disabled: (disabled && !skipDisable.includes('RuleEditorModel.target')) }, [Validators.required]], diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/section-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/section-editor-model.ts index 9d7c7825b..42e5b286f 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/section-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/section-editor-model.ts @@ -1,4 +1,4 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { UntypedFormBuilder, FormControl, UntypedFormGroup, Validators } from '@angular/forms'; import { Section } from '../../../../core/model/admin/dataset-profile/dataset-profile'; import { BaseFormModel } from '../../../../core/model/base-form-model'; import { EditorCustomValidators } from '../editor/custom-validators/editor-custom-validators'; @@ -26,8 +26,8 @@ export class SectionEditorModel extends BaseFormModel { return this; } - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { - const formGroup: FormGroup = new FormBuilder().group({ + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { + const formGroup: UntypedFormGroup = new UntypedFormBuilder().group({ id: [{ value: this.id, disabled: (disabled && !skipDisable.includes('SectionEditorModel.id')) }, [Validators.required, Validators.pattern('^[^<_>]+$')]], page: [{ value: this.page, disabled: (disabled && !skipDisable.includes('SectionEditorModel.page')) }, [Validators.required]], title: [{ value: this.title, disabled: (disabled && !skipDisable.includes('SectionEditorModel.title')) } , [Validators.required]], @@ -35,17 +35,17 @@ export class SectionEditorModel extends BaseFormModel { ordinal: [{ value: this.ordinal, disabled: (disabled && !skipDisable.includes('SectionEditorModel.ordinal')) }, [Validators.required]], defaultVisibility: [{ value: this.defaultVisibility, disabled: (disabled && !skipDisable.includes('SectionEditorModel.defaultVisibility')) }] }); - const sectionsFormArray = new Array(); + const sectionsFormArray = new Array(); if (this.sections) { this.sections.forEach(item => { - const form: FormGroup = item.buildForm(disabled, skipDisable); + const form: UntypedFormGroup = item.buildForm(disabled, skipDisable); sectionsFormArray.push(form); }); } - const compositeFieldsFormArray = new Array(); + const compositeFieldsFormArray = new Array(); if (this.fieldSets) { this.fieldSets.forEach(item => { - const form: FormGroup = item.buildForm(disabled, skipDisable); + const form: UntypedFormGroup = item.buildForm(disabled, skipDisable); compositeFieldsFormArray.push(form); }); } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/view-style-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/view-style-editor-model.ts index 586d603f8..19c8853b3 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/view-style-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/view-style-editor-model.ts @@ -1,4 +1,4 @@ -import { FormGroup, Validators } from "@angular/forms"; +import { UntypedFormGroup, Validators } from "@angular/forms"; import { ViewStyle } from "../../../../core/model/admin/dataset-profile/dataset-profile"; import { BaseFormModel } from "../../../../core/model/base-form-model"; @@ -12,7 +12,7 @@ export class ViewStyleEditorModel extends BaseFormModel { return this; } - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ cssClass: [{ value: this.cssClass, disabled: (disabled && !skipDisable.includes('ViewStyleEditorModel.cssClass')) }], renderStyle: [{ value: this.renderStyle, disabled: (disabled && !skipDisable.includes('ViewStyleEditorModel.renderStyle')) }, Validators.required] diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/visibility-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/visibility-editor-model.ts index 806b09b68..d3b77e405 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/visibility-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/visibility-editor-model.ts @@ -1,4 +1,4 @@ -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { Visibility } from '../../../../core/model/admin/dataset-profile/dataset-profile'; import { BaseFormModel } from '../../../../core/model/base-form-model'; import { RuleEditorModel } from './rule-editor-model'; @@ -15,15 +15,15 @@ export class VisibilityEditorModel extends BaseFormModel { return this; } - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { const formGroup = this.formBuilder.group({ style: [{ value: this.style, disabled: (disabled && !skipDisable.includes('VisibilityEditorModel.style')) }] }); - const rulesFormArray = new Array(); + const rulesFormArray = new Array(); if (this.rules) { this.rules.forEach(rule => { - const form: FormGroup = rule.buildForm(disabled, skipDisable); + const form: UntypedFormGroup = rule.buildForm(disabled, skipDisable); rulesFormArray.push(form); }); } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/dataset-profile.module.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/dataset-profile.module.ts index 162bccf7f..66dcb4cc6 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/dataset-profile.module.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/dataset-profile.module.ts @@ -66,75 +66,72 @@ import {DatasetProfileEditorUploadFieldComponent} from "@app/ui/admin/dataset-pr @NgModule({ - imports: [ - CommonUiModule, - CommonFormsModule, - FormattingModule, - DatasetProfileRoutingModule, - ConfirmationDialogModule, - NgxDropzoneModule, - FormProgressIndicationModule, - DatasetModule, - AngularStickyThingsModule, - DragDropModule, - MatBadgeModule, - DragulaModule, - AutoCompleteModule, - TransitionGroupModule, - RichTextEditorModule, - // TableEditorModule - ], - declarations: [ - DatasetProfileListingComponent, - DatasetProfileCriteriaComponent, - DatasetProfileEditorComponent, - DatasetProfileEditorSectionComponent, - DatasetProfileEditorCompositeFieldComponent, - DatasetProfileEditorFieldComponent, - DatasetProfileEditorPageComponent, - DatasetProfileEditorRuleComponent, - DatasetProfileEditorAutoCompleteFieldComponent, - DatasetProfileEditorBooleanDecisionFieldComponent, - DatasetProfileEditorCheckboxFieldComponent, - DatasetProfileEditorComboBoxFieldComponent, - DatasetProfileEditorFreeTextFieldComponent, - DatasetProfileEditorRadioBoxFieldComponent, - DatasetProfileEditorTextAreaFieldComponent, - DatasetProfileEditorRichTextAreaFieldComponent, - DatasetProfileEditorUploadFieldComponent, - // DatasetProfileEditorTableFieldComponent, - DatasetProfileEditorDatePickerFieldComponent, - DatasetProfileEditorWordListFieldComponent, - DatasetProfileEditorDefaultValueComponent, - DialogConfirmationUploadDatasetProfiles, - DatasetProfileEditorInternalDmpEntitiesFieldComponent, - DatasetProfileEditorResearchersAutoCompleteFieldComponent, - DatasetProfileEditorDatasetsAutoCompleteFieldComponent, - DatasetProfileEditorDmpsAutoCompleteFieldComponent, - ParseStatus, - DatasetProfileEditorExternalDatasetsFieldComponent, - DatasetProfileEditorDataRepositoriesFieldComponent, - DatasetProfileEditorPubRepositoriesFieldComponent, - DatasetProfileEditorJournalRepositoriesFieldComponent, - DatasetProfileEditorTaxonomiesFieldComponent, - DatasetProfileEditorLicensesFieldComponent, - DatasetProfileEditorPublicationsFieldComponent, - DatasetProfileEditorRegistriesFieldComponent, - DatasetProfileEditorServicesFieldComponent, - DatasetProfileEditorTagsFieldComponent, - DatasetProfileEditorResearchersFieldComponent, - DatasetProfileEditorOrganizationsFieldComponent, - DatasetProfileEditorDatasetIdentifierFieldComponent, - DatasetProfileEditorCurrencyFieldComponent, - DatasetProfileEditorValidatorFieldComponent, - DatasetProfileTableOfContents, - DatasetProfileTableOfContentsInternalSection, - DatasetProfileEditorSectionFieldSetComponent, - FinalPreviewComponent - ], - entryComponents: [ - DialogConfirmationUploadDatasetProfiles - ] + imports: [ + CommonUiModule, + CommonFormsModule, + FormattingModule, + DatasetProfileRoutingModule, + ConfirmationDialogModule, + NgxDropzoneModule, + FormProgressIndicationModule, + DatasetModule, + AngularStickyThingsModule, + DragDropModule, + MatBadgeModule, + DragulaModule, + AutoCompleteModule, + TransitionGroupModule, + RichTextEditorModule, + // TableEditorModule + ], + declarations: [ + DatasetProfileListingComponent, + DatasetProfileCriteriaComponent, + DatasetProfileEditorComponent, + DatasetProfileEditorSectionComponent, + DatasetProfileEditorCompositeFieldComponent, + DatasetProfileEditorFieldComponent, + DatasetProfileEditorPageComponent, + DatasetProfileEditorRuleComponent, + DatasetProfileEditorAutoCompleteFieldComponent, + DatasetProfileEditorBooleanDecisionFieldComponent, + DatasetProfileEditorCheckboxFieldComponent, + DatasetProfileEditorComboBoxFieldComponent, + DatasetProfileEditorFreeTextFieldComponent, + DatasetProfileEditorRadioBoxFieldComponent, + DatasetProfileEditorTextAreaFieldComponent, + DatasetProfileEditorRichTextAreaFieldComponent, + DatasetProfileEditorUploadFieldComponent, + // DatasetProfileEditorTableFieldComponent, + DatasetProfileEditorDatePickerFieldComponent, + DatasetProfileEditorWordListFieldComponent, + DatasetProfileEditorDefaultValueComponent, + DialogConfirmationUploadDatasetProfiles, + DatasetProfileEditorInternalDmpEntitiesFieldComponent, + DatasetProfileEditorResearchersAutoCompleteFieldComponent, + DatasetProfileEditorDatasetsAutoCompleteFieldComponent, + DatasetProfileEditorDmpsAutoCompleteFieldComponent, + ParseStatus, + DatasetProfileEditorExternalDatasetsFieldComponent, + DatasetProfileEditorDataRepositoriesFieldComponent, + DatasetProfileEditorPubRepositoriesFieldComponent, + DatasetProfileEditorJournalRepositoriesFieldComponent, + DatasetProfileEditorTaxonomiesFieldComponent, + DatasetProfileEditorLicensesFieldComponent, + DatasetProfileEditorPublicationsFieldComponent, + DatasetProfileEditorRegistriesFieldComponent, + DatasetProfileEditorServicesFieldComponent, + DatasetProfileEditorTagsFieldComponent, + DatasetProfileEditorResearchersFieldComponent, + DatasetProfileEditorOrganizationsFieldComponent, + DatasetProfileEditorDatasetIdentifierFieldComponent, + DatasetProfileEditorCurrencyFieldComponent, + DatasetProfileEditorValidatorFieldComponent, + DatasetProfileTableOfContents, + DatasetProfileTableOfContentsInternalSection, + DatasetProfileEditorSectionFieldSetComponent, + FinalPreviewComponent + ] }) export class DatasetProfileModule { } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts index 12c3754f6..44c95cfd4 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts @@ -1,5 +1,5 @@ import {Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild} from '@angular/core'; -import {AbstractControl, FormArray, FormControl, FormGroup} from '@angular/forms'; +import {AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup} from '@angular/forms'; import {FieldEditorModel} from '../../../admin/field-editor-model'; import {Guid} from '@common/types/guid'; import {RuleEditorModel} from '../../../admin/rule-editor-model'; @@ -65,7 +65,7 @@ import {ConfigurationService} from "@app/core/services/configuration/configurati }) export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent implements OnInit, OnChanges { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; @Input() indexPath: string; @Input() viewOnly: boolean; @@ -83,7 +83,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i showAdditionalInfo: boolean = false; showExtendedDescription: boolean = false; - previewForm: FormGroup = null; + previewForm: UntypedFormGroup = null; // isComposite = false; // isMultiplicityEnabled = false; viewStyleEnum = DatasetProfileFieldViewStyle; @@ -122,7 +122,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i get firstField(){ try{ - return (this.form.get('fields') as FormArray).at(0); + return (this.form.get('fields') as UntypedFormArray).at(0); }catch{ return null; } @@ -209,7 +209,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i if(this.previewDirty) return ''; else return 'updated'; } - private reloadPreview(updatedForm: FormGroup){ + private reloadPreview(updatedForm: UntypedFormGroup){ setTimeout(() => { const previewContainer = document.getElementById('preview_container'+ this.form.get('id').value); @@ -345,20 +345,20 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i // } onIsCompositeChange(isComposite: boolean) { - if (!isComposite && (this.form.get('fields')).length > 1) { - for (let i = 0; i < (this.form.get('fields')).length - 1; i++) { - (this.form.get('fields')).removeAt(1); + if (!isComposite && (this.form.get('fields')).length > 1) { + for (let i = 0; i < (this.form.get('fields')).length - 1; i++) { + (this.form.get('fields')).removeAt(1); } - (this.form.get('fields') as FormArray).controls.splice(1); + (this.form.get('fields') as UntypedFormArray).controls.splice(1); } - if ((this.form.get('fields')).length === 0) { + if ((this.form.get('fields')).length === 0) { const field: FieldEditorModel = new FieldEditorModel(); - (this.form.get('fields')).push(field.buildForm()); + (this.form.get('fields')).push(field.buildForm()); } } onIsMultiplicityEnabledChange(isMultiplicityEnabled: MatCheckboxChange) { - const multiplicity = this.form.get('multiplicity') as FormGroup; + const multiplicity = this.form.get('multiplicity') as UntypedFormGroup; const minControl = multiplicity.get('min'); const maxControl = multiplicity.get('max'); @@ -387,14 +387,14 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i const field: FieldEditorModel = new FieldEditorModel(); field.id=Guid.create().toString(); - field.ordinal = (this.form.get('fields') as FormArray).length; + field.ordinal = (this.form.get('fields') as UntypedFormArray).length; const fieldForm = field.buildForm(); // fieldForm.setValidators(this.customFieldValidator()); // fieldForm.get('viewStyle').get('renderStyle').setValidators(Validators.required); - (this.form.get('fields')).push(fieldForm); + (this.form.get('fields')).push(fieldForm); this.setTargetField(fieldForm); fieldForm.updateValueAndValidity(); @@ -402,7 +402,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i DeleteField(index) { - const fieldsForm = this.form.get('fields'); + const fieldsForm = this.form.get('fields'); fieldsForm.removeAt(index); this.inputs.init(); // calculate ordinals @@ -413,23 +413,23 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i this.form.markAsDirty();//deactivate guard } - getFieldTile(formGroup: FormGroup, index: number) { + getFieldTile(formGroup: UntypedFormGroup, index: number) { if (formGroup.get('title') && formGroup.get('title').value && formGroup.get('title').value.length > 0) { return formGroup.get('title').value; } return "Field " + (index + 1); } - targetField:FormGroup; + targetField:UntypedFormGroup; validationTypeEnum = ValidationType; - addVisibilityRule(targetField: FormGroup){ + addVisibilityRule(targetField: UntypedFormGroup){ const rule: RuleEditorModel = new RuleEditorModel(); - (targetField.get('visible').get('rules')).push(rule.buildForm()); + (targetField.get('visible').get('rules')).push(rule.buildForm()); } - toggleRequired(targetField: FormGroup, event:MatCheckboxChange){ + toggleRequired(targetField: UntypedFormGroup, event:MatCheckboxChange){ - let validationsControl = targetField.get('validations') as FormControl; + let validationsControl = targetField.get('validations') as UntypedFormControl; let validations: Array = validationsControl.value; if(event.checked){ @@ -458,7 +458,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i // } } setTargetField(field:AbstractControl){ - this.targetField = field; + this.targetField = field; } @@ -487,7 +487,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i let index = -1; - const fields = this.form.get('fields') as FormArray; + const fields = this.form.get('fields') as UntypedFormArray; for(let i=0;i< fields.length; i++){ let field = fields.at(i); @@ -528,7 +528,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i addNewInput(type: ViewStyleType){ - const fieldsArray = this.form.get('fields') as FormArray; + const fieldsArray = this.form.get('fields') as UntypedFormArray; let targetOrdinal = fieldsArray.length; try{ @@ -974,7 +974,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i } } - (this.form.get('fields')).push(new FieldEditorModel().fromModel(field).buildForm()); + (this.form.get('fields')).push(new FieldEditorModel().fromModel(field).buildForm()); this.inputs.init(); // fieldForm.get('viewStyle').get('renderStyle').updateValueAndValidity(); // fieldForm.get('data').updateValueAndValidity(); @@ -1051,9 +1051,9 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i return {'width':width+'em'} } - get fieldsArray(): FormArray { + get fieldsArray(): UntypedFormArray { if(this.form && this.form.get('fields')) { - return this.form.get('fields') as FormArray; + return this.form.get('fields') as UntypedFormArray; } return null; } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-profile-editor-default-value/component-profile-editor-default-value.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-profile-editor-default-value/component-profile-editor-default-value.component.ts index a62bc0cb4..e1b13e149 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-profile-editor-default-value/component-profile-editor-default-value.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-profile-editor-default-value/component-profile-editor-default-value.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormArray, FormControl } from '@angular/forms'; +import { UntypedFormArray, UntypedFormControl } from '@angular/forms'; import { DatasetProfileComboBoxType } from '../../../../../../core/common/enum/dataset-profile-combo-box-type'; import { DatasetProfileFieldViewStyle } from '../../../../../../core/common/enum/dataset-profile-field-view-style'; import { DatasetProfileInternalDmpEntitiesType } from '../../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type'; @@ -12,8 +12,8 @@ import { DatasetProfileInternalDmpEntitiesType } from '../../../../../../core/co export class DatasetProfileEditorDefaultValueComponent implements OnInit { @Input() viewStyle: DatasetProfileFieldViewStyle; - @Input() form: FormControl; - @Input() formArrayOptions: FormArray; + @Input() form: UntypedFormControl; + @Input() formArrayOptions: UntypedFormArray; @Input() comboBoxType: DatasetProfileComboBoxType; @Input() internalDmpEntitiesType: DatasetProfileInternalDmpEntitiesType; @Input() placeHolder: String; diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/auto-complete/dataset-profile-editor-auto-complete-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/auto-complete/dataset-profile-editor-auto-complete-field.component.ts index 06224ee6f..77ea2202c 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/auto-complete/dataset-profile-editor-auto-complete-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/auto-complete/dataset-profile-editor-auto-complete-field.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup, FormArray, AbstractControl } from '@angular/forms'; +import { UntypedFormGroup, UntypedFormArray, AbstractControl } from '@angular/forms'; import { DatasetProfileComboBoxType } from '../../../../../../../core/common/enum/dataset-profile-combo-box-type'; import { AutoCompleteFieldDataEditorModel } from '../../../../admin/field-data/auto-complete-field-data-editor-model'; import { AutoCompleteSingleDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/auto-complete-single-data'; @@ -11,20 +11,20 @@ import { AutoCompleteSingleDataEditorModel } from '@app/ui/admin/dataset-profile }) export class DatasetProfileEditorAutoCompleteFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: AutoCompleteFieldDataEditorModel = new AutoCompleteFieldDataEditorModel(); - multiForm: FormArray; + multiForm: UntypedFormArray; ngOnInit() { - this.multiForm = (this.form.get('data').get('autoCompleteSingleDataList')); + this.multiForm = (this.form.get('data').get('autoCompleteSingleDataList')); this.data.type = DatasetProfileComboBoxType.Autocomplete; } addSource() { - (this.multiForm).push(new AutoCompleteSingleDataEditorModel().buildForm()); + (this.multiForm).push(new AutoCompleteSingleDataEditorModel().buildForm()); } removeSource(index: number) { - (this.multiForm).removeAt(index); + (this.multiForm).removeAt(index); } } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/boolean-decision/dataset-profile-editor-boolean-decision-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/boolean-decision/dataset-profile-editor-boolean-decision-field.component.ts index 826f46f69..cb7f31d47 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/boolean-decision/dataset-profile-editor-boolean-decision-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/boolean-decision/dataset-profile-editor-boolean-decision-field.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { BooleanDecisionFieldDataEditorModel } from '../../../../admin/field-data/boolean-decision-field-data-editor-model'; @Component({ @@ -10,7 +10,7 @@ import { BooleanDecisionFieldDataEditorModel } from '../../../../admin/field-dat }) export class DatasetProfileEditorBooleanDecisionFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: BooleanDecisionFieldDataEditorModel = new BooleanDecisionFieldDataEditorModel(); ngOnInit() { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/checkbox/dataset-profile-editor-checkbox-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/checkbox/dataset-profile-editor-checkbox-field.component.ts index 2cc7d6c30..8d0e6c756 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/checkbox/dataset-profile-editor-checkbox-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/checkbox/dataset-profile-editor-checkbox-field.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { CheckBoxFieldDataEditorModel } from '../../../../admin/field-data/check-box-field-data-editor-model'; @Component({ @@ -9,7 +9,7 @@ import { CheckBoxFieldDataEditorModel } from '../../../../admin/field-data/check }) export class DatasetProfileEditorCheckboxFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: CheckBoxFieldDataEditorModel = new CheckBoxFieldDataEditorModel(); ngOnInit() { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/combo-box/dataset-profile-editor-combo-box-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/combo-box/dataset-profile-editor-combo-box-field.component.ts index 862cb61f9..9fc577234 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/combo-box/dataset-profile-editor-combo-box-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/combo-box/dataset-profile-editor-combo-box-field.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { DatasetProfileComboBoxType } from '@app/core/common/enum/dataset-profile-combo-box-type'; import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; import { AutoCompleteFieldDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/auto-complete-field-data-editor-model'; @@ -14,7 +14,7 @@ import { takeUntil } from 'rxjs/operators'; }) export class DatasetProfileEditorComboBoxFieldComponent extends BaseComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; options = DatasetProfileComboBoxType; constructor( diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/currency/dataset-profile-editor-currency-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/currency/dataset-profile-editor-currency-field.component.ts index 899757bdf..474ffa93f 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/currency/dataset-profile-editor-currency-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/currency/dataset-profile-editor-currency-field.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models'; @Component({ @@ -9,7 +9,7 @@ import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/a }) export class DatasetProfileEditorCurrencyFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel(); ngOnInit() { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/data-repositories/dataset-profile-editor-data-repositories-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/data-repositories/dataset-profile-editor-data-repositories-field.component.ts index 9f083e640..5bf8fd251 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/data-repositories/dataset-profile-editor-data-repositories-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/data-repositories/dataset-profile-editor-data-repositories-field.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { DatePickerDataEditorModel } from '../../../../admin/field-data/date-picker-data-editor-models'; import { ExternalDatasetsDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/external-datasets-data-editor-models'; import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models'; @@ -11,7 +11,7 @@ import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/a }) export class DatasetProfileEditorDataRepositoriesFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel(); ngOnInit() { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/dataset-identifier/dataset-profile-editor-dataset-identifier-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/dataset-identifier/dataset-profile-editor-dataset-identifier-field.component.ts index 74e0e9c12..d9ecf05e1 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/dataset-identifier/dataset-profile-editor-dataset-identifier-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/dataset-identifier/dataset-profile-editor-dataset-identifier-field.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { Router } from '@angular/router'; import { DatasetIdentifierDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/dataset-identifier-data-editor-models'; @@ -10,7 +10,7 @@ import { DatasetIdentifierDataEditorModel } from '@app/ui/admin/dataset-profile/ }) export class DatasetProfileEditorDatasetIdentifierFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: DatasetIdentifierDataEditorModel = new DatasetIdentifierDataEditorModel(); constructor(private router: Router) {} diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/datasets-auto-complete/dataset-profile-editor-datasets-autocomplete-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/datasets-auto-complete/dataset-profile-editor-datasets-autocomplete-field.component.ts index cf55e55c2..ec9c22260 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/datasets-auto-complete/dataset-profile-editor-datasets-autocomplete-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/datasets-auto-complete/dataset-profile-editor-datasets-autocomplete-field.component.ts @@ -1,5 +1,5 @@ import { OnInit, Input, Component } from "@angular/core"; -import { FormGroup } from "@angular/forms"; +import { UntypedFormGroup } from "@angular/forms"; import { DatasetProfileInternalDmpEntitiesType } from "../../../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type"; import { DatasetsAutoCompleteFieldDataEditorModel } from "../../../../admin/field-data/datasets-autocomplete-field-data-editor-mode"; @@ -10,7 +10,7 @@ import { DatasetsAutoCompleteFieldDataEditorModel } from "../../../../admin/fiel }) export class DatasetProfileEditorDatasetsAutoCompleteFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: DatasetsAutoCompleteFieldDataEditorModel = new DatasetsAutoCompleteFieldDataEditorModel(); ngOnInit() { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/datepicker/dataset-profile-editor-date-picker-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/datepicker/dataset-profile-editor-date-picker-field.component.ts index 483284331..a0d6bbb3b 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/datepicker/dataset-profile-editor-date-picker-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/datepicker/dataset-profile-editor-date-picker-field.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { DatePickerDataEditorModel } from '../../../../admin/field-data/date-picker-data-editor-models'; @Component({ @@ -9,7 +9,7 @@ import { DatePickerDataEditorModel } from '../../../../admin/field-data/date-pic }) export class DatasetProfileEditorDatePickerFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: DatePickerDataEditorModel = new DatePickerDataEditorModel(); ngOnInit() { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/dmps-auto-complete/dataset-profile-editor-dmps-autocomplete-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/dmps-auto-complete/dataset-profile-editor-dmps-autocomplete-field.component.ts index 8a88bce12..a7ec9d4fb 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/dmps-auto-complete/dataset-profile-editor-dmps-autocomplete-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/dmps-auto-complete/dataset-profile-editor-dmps-autocomplete-field.component.ts @@ -1,5 +1,5 @@ import { OnInit, Input, Component } from "@angular/core"; -import { FormGroup } from "@angular/forms"; +import { UntypedFormGroup } from "@angular/forms"; import { DatasetProfileInternalDmpEntitiesType } from "../../../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type"; import { DatasetsAutoCompleteFieldDataEditorModel } from "../../../../admin/field-data/datasets-autocomplete-field-data-editor-mode"; import { DmpsAutoCompleteFieldDataEditorModel } from "../../../../admin/field-data/dmps-autocomplete-field-data-editor-model"; @@ -11,7 +11,7 @@ import { DmpsAutoCompleteFieldDataEditorModel } from "../../../../admin/field-da }) export class DatasetProfileEditorDmpsAutoCompleteFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: DmpsAutoCompleteFieldDataEditorModel = new DatasetsAutoCompleteFieldDataEditorModel(); ngOnInit() { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/external-datasets/dataset-profile-editor-external-datasets-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/external-datasets/dataset-profile-editor-external-datasets-field.component.ts index e7d31f1d5..dbd2e951e 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/external-datasets/dataset-profile-editor-external-datasets-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/external-datasets/dataset-profile-editor-external-datasets-field.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { DatePickerDataEditorModel } from '../../../../admin/field-data/date-picker-data-editor-models'; import { ExternalDatasetsDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/external-datasets-data-editor-models'; import { ExternalDatasetTypeEnum } from '@app/core/common/enum/external-dataset-type-enum'; @@ -11,7 +11,7 @@ import { ExternalDatasetTypeEnum } from '@app/core/common/enum/external-dataset- }) export class DatasetProfileEditorExternalDatasetsFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: ExternalDatasetsDataEditorModel = new ExternalDatasetsDataEditorModel(); externalDatasetTypes = [ diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/free-text/dataset-profile-editor-free-text-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/free-text/dataset-profile-editor-free-text-field.component.ts index 1d6e752c4..b0471954e 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/free-text/dataset-profile-editor-free-text-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/free-text/dataset-profile-editor-free-text-field.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { FreeTextFieldDataEditorModel } from '../../../../admin/field-data/free-text-field-data-editor-model'; @Component({ @@ -9,7 +9,7 @@ import { FreeTextFieldDataEditorModel } from '../../../../admin/field-data/free- }) export class DatasetProfileEditorFreeTextFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: FreeTextFieldDataEditorModel = new FreeTextFieldDataEditorModel(); ngOnInit() { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/internal-dmp-entities/dataset-profile-editor-internal-dmp-entities-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/internal-dmp-entities/dataset-profile-editor-internal-dmp-entities-field.component.ts index 2c7163000..63c74dd1e 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/internal-dmp-entities/dataset-profile-editor-internal-dmp-entities-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/internal-dmp-entities/dataset-profile-editor-internal-dmp-entities-field.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { DatasetProfileInternalDmpEntitiesType } from '@app/core/common/enum/dataset-profile-internal-dmp-entities-type'; import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; import { DatasetsAutoCompleteFieldDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/datasets-autocomplete-field-data-editor-mode'; @@ -14,7 +14,7 @@ import { takeUntil } from 'rxjs/operators'; templateUrl: './dataset-profile-editor-internal-dmp-entities-field.component.html' }) export class DatasetProfileEditorInternalDmpEntitiesFieldComponent extends BaseComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; options = DatasetProfileInternalDmpEntitiesType; constructor( diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/journal-repositories/dataset-profile-editor-journal-repositories-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/journal-repositories/dataset-profile-editor-journal-repositories-field.component.ts index dbb08b677..272b4f55b 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/journal-repositories/dataset-profile-editor-journal-repositories-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/journal-repositories/dataset-profile-editor-journal-repositories-field.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models'; import { FormControl } from '@angular/forms'; @@ -10,7 +10,7 @@ import { FormControl } from '@angular/forms'; }) export class DatasetProfileEditorJournalRepositoriesFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel(); ngOnInit() { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/licenses/dataset-profile-editor-licenses-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/licenses/dataset-profile-editor-licenses-field.component.ts index b46c2a901..aac88601b 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/licenses/dataset-profile-editor-licenses-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/licenses/dataset-profile-editor-licenses-field.component.ts @@ -1,5 +1,5 @@ import {Component, Input, OnInit} from '@angular/core'; -import {FormGroup} from '@angular/forms'; +import {UntypedFormGroup} from '@angular/forms'; import {LicensesDataEditorModel} from "@app/ui/admin/dataset-profile/admin/field-data/licenses-data-editor-models"; @Component({ @@ -9,7 +9,7 @@ import {LicensesDataEditorModel} from "@app/ui/admin/dataset-profile/admin/field }) export class DatasetProfileEditorLicensesFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: LicensesDataEditorModel = new LicensesDataEditorModel(); ngOnInit() { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/organizations/dataset-profile-editor-organizations-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/organizations/dataset-profile-editor-organizations-field.component.ts index 2d7b7c470..8dfb885ae 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/organizations/dataset-profile-editor-organizations-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/organizations/dataset-profile-editor-organizations-field.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { DatePickerDataEditorModel } from '../../../../admin/field-data/date-picker-data-editor-models'; import { ExternalDatasetsDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/external-datasets-data-editor-models'; import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models'; @@ -16,7 +16,7 @@ import { OrganizationsDataEditorModel } from '@app/ui/admin/dataset-profile/admi }) export class DatasetProfileEditorOrganizationsFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: OrganizationsDataEditorModel = new OrganizationsDataEditorModel(); ngOnInit() { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/pub-repositories/dataset-profile-editor-pub-repositories-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/pub-repositories/dataset-profile-editor-pub-repositories-field.component.ts index 7166f893e..f4940251e 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/pub-repositories/dataset-profile-editor-pub-repositories-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/pub-repositories/dataset-profile-editor-pub-repositories-field.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { DatePickerDataEditorModel } from '../../../../admin/field-data/date-picker-data-editor-models'; import { ExternalDatasetsDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/external-datasets-data-editor-models'; import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models'; @@ -11,7 +11,7 @@ import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/a }) export class DatasetProfileEditorPubRepositoriesFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel(); ngOnInit() { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/publications/dataset-profile-editor-publications-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/publications/dataset-profile-editor-publications-field.component.ts index 8082b5355..56dc16378 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/publications/dataset-profile-editor-publications-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/publications/dataset-profile-editor-publications-field.component.ts @@ -1,5 +1,5 @@ import {Component, Input, OnInit} from '@angular/core'; -import {FormGroup} from '@angular/forms'; +import {UntypedFormGroup} from '@angular/forms'; import {PublicationsDataEditorModel} from "@app/ui/admin/dataset-profile/admin/field-data/publications-data-editor-models"; @Component({ @@ -9,7 +9,7 @@ import {PublicationsDataEditorModel} from "@app/ui/admin/dataset-profile/admin/f }) export class DatasetProfileEditorPublicationsFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: PublicationsDataEditorModel = new PublicationsDataEditorModel(); ngOnInit() { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/radio-box/dataset-profile-editor-radio-box-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/radio-box/dataset-profile-editor-radio-box-field.component.ts index 3f9c8176d..6c2d2ce36 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/radio-box/dataset-profile-editor-radio-box-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/radio-box/dataset-profile-editor-radio-box-field.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormArray, FormBuilder, FormGroup } from '@angular/forms'; +import { UntypedFormArray, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { FieldDataOptionEditorModel } from '../../../../admin/field-data/field-data-option-editor-model'; import { RadioBoxFieldDataEditorModel } from '../../../../admin/field-data/radio-box-field-data-editor-model'; @@ -10,7 +10,7 @@ import { RadioBoxFieldDataEditorModel } from '../../../../admin/field-data/radio }) export class DatasetProfileEditorRadioBoxFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: RadioBoxFieldDataEditorModel = new RadioBoxFieldDataEditorModel(); ngOnInit() { @@ -19,11 +19,11 @@ export class DatasetProfileEditorRadioBoxFieldComponent implements OnInit { addNewRow() { const radioListOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel(); - if (!this.form.get('data').get('options')) { (this.form.get('data')).addControl('options', new FormBuilder().array([])); } - (this.form.get('data').get('options')).push(radioListOptions.buildForm()); + if (!this.form.get('data').get('options')) { (this.form.get('data')).addControl('options', new UntypedFormBuilder().array([])); } + (this.form.get('data').get('options')).push(radioListOptions.buildForm()); } deleteRow(intex: number) { - if (this.form.get('data').get('options')) { (this.form.get('data').get('options')).removeAt(intex); } + if (this.form.get('data').get('options')) { (this.form.get('data').get('options')).removeAt(intex); } } } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/registries/dataset-profile-editor-registries-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/registries/dataset-profile-editor-registries-field.component.ts index 46ef255c4..c6f4a3955 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/registries/dataset-profile-editor-registries-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/registries/dataset-profile-editor-registries-field.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { DatePickerDataEditorModel } from '../../../../admin/field-data/date-picker-data-editor-models'; import { ExternalDatasetsDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/external-datasets-data-editor-models'; import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models'; @@ -12,7 +12,7 @@ import { RegistriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/f }) export class DatasetProfileEditorRegistriesFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: RegistriesDataEditorModel = new RegistriesDataEditorModel(); ngOnInit() { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/researchers-auto-complete/dataset-profile-editor-researchers-auto-complete-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/researchers-auto-complete/dataset-profile-editor-researchers-auto-complete-field.component.ts index 304fc137e..723f776d4 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/researchers-auto-complete/dataset-profile-editor-researchers-auto-complete-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/researchers-auto-complete/dataset-profile-editor-researchers-auto-complete-field.component.ts @@ -1,5 +1,5 @@ import { ResearchersAutoCompleteFieldDataEditorModel } from "../../../../admin/field-data/researchers-auto-complete-field-data-editor-model"; -import { FormGroup } from "@angular/forms"; +import { UntypedFormGroup } from "@angular/forms"; import { Input, Component, OnInit } from "@angular/core"; import { DatasetProfileInternalDmpEntitiesType } from "../../../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type"; @@ -10,7 +10,7 @@ import { DatasetProfileInternalDmpEntitiesType } from "../../../../../../../core }) export class DatasetProfileEditorResearchersAutoCompleteFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: ResearchersAutoCompleteFieldDataEditorModel = new ResearchersAutoCompleteFieldDataEditorModel(); ngOnInit() { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/researchers/dataset-profile-editor-researchers-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/researchers/dataset-profile-editor-researchers-field.component.ts index 3e63c3ca6..b7ecb9364 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/researchers/dataset-profile-editor-researchers-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/researchers/dataset-profile-editor-researchers-field.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { DatePickerDataEditorModel } from '../../../../admin/field-data/date-picker-data-editor-models'; import { ExternalDatasetsDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/external-datasets-data-editor-models'; import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models'; @@ -16,7 +16,7 @@ import { Router } from '@angular/router'; }) export class DatasetProfileEditorResearchersFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: ResearchersDataEditorModel = new ResearchersDataEditorModel(); constructor(private router: Router) {} diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/rich-textarea/dataset-profile-editor-rich-text-area-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/rich-textarea/dataset-profile-editor-rich-text-area-field.component.ts index 8b286cfe8..a1d74a86c 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/rich-textarea/dataset-profile-editor-rich-text-area-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/rich-textarea/dataset-profile-editor-rich-text-area-field.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { RichTextAreaFieldDataEditorModel } from '../../../../admin/field-data/rich-text-area-field-data-editor-model'; @Component({ @@ -9,7 +9,7 @@ import { RichTextAreaFieldDataEditorModel } from '../../../../admin/field-data/r }) export class DatasetProfileEditorRichTextAreaFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: RichTextAreaFieldDataEditorModel = new RichTextAreaFieldDataEditorModel(); ngOnInit() { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/services/dataset-profile-editor-services-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/services/dataset-profile-editor-services-field.component.ts index 51b12192b..bf87cfd08 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/services/dataset-profile-editor-services-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/services/dataset-profile-editor-services-field.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { DatePickerDataEditorModel } from '../../../../admin/field-data/date-picker-data-editor-models'; import { ExternalDatasetsDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/external-datasets-data-editor-models'; import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models'; @@ -13,7 +13,7 @@ import { ServicesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/fie }) export class DatasetProfileEditorServicesFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: ServicesDataEditorModel = new ServicesDataEditorModel(); ngOnInit() { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/tags/dataset-profile-editor-tags-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/tags/dataset-profile-editor-tags-field.component.ts index a7b34aebf..350809a8b 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/tags/dataset-profile-editor-tags-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/tags/dataset-profile-editor-tags-field.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { DatePickerDataEditorModel } from '../../../../admin/field-data/date-picker-data-editor-models'; import { ExternalDatasetsDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/external-datasets-data-editor-models'; import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models'; @@ -15,7 +15,7 @@ import { Router } from '@angular/router'; }) export class DatasetProfileEditorTagsFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: TagsDataEditorModel = new TagsDataEditorModel(); constructor(private router: Router) {} diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/taxonomies/dataset-profile-editor-taxonomies-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/taxonomies/dataset-profile-editor-taxonomies-field.component.ts index 4a3f3c442..3a1033397 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/taxonomies/dataset-profile-editor-taxonomies-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/taxonomies/dataset-profile-editor-taxonomies-field.component.ts @@ -1,5 +1,5 @@ import {Component, Input, OnInit} from '@angular/core'; -import {FormGroup} from '@angular/forms'; +import {UntypedFormGroup} from '@angular/forms'; import {TaxonomiesDataEditorModel} from "@app/ui/admin/dataset-profile/admin/field-data/taxonomies-data-editor-models"; @Component({ @@ -9,7 +9,7 @@ import {TaxonomiesDataEditorModel} from "@app/ui/admin/dataset-profile/admin/fie }) export class DatasetProfileEditorTaxonomiesFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: TaxonomiesDataEditorModel = new TaxonomiesDataEditorModel(); ngOnInit() { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/textarea/dataset-profile-editor-text-area-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/textarea/dataset-profile-editor-text-area-field.component.ts index d59b9b977..8daf1e271 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/textarea/dataset-profile-editor-text-area-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/textarea/dataset-profile-editor-text-area-field.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { TextAreaFieldDataEditorModel } from '../../../../admin/field-data/text-area-field-data-editor-model'; @Component({ @@ -9,7 +9,7 @@ import { TextAreaFieldDataEditorModel } from '../../../../admin/field-data/text- }) export class DatasetProfileEditorTextAreaFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: TextAreaFieldDataEditorModel = new TextAreaFieldDataEditorModel(); ngOnInit() { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/upload/dataset-profile-editor-upload-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/upload/dataset-profile-editor-upload-field.component.ts index 1fa913e25..3c0ed1769 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/upload/dataset-profile-editor-upload-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/upload/dataset-profile-editor-upload-field.component.ts @@ -1,5 +1,5 @@ import {Component, Input, OnInit, ViewChild} from '@angular/core'; -import {FormArray, FormBuilder, FormControl, FormGroup, Validators} from '@angular/forms'; +import {UntypedFormArray, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators} from '@angular/forms'; import { UploadFieldDataEditorModel } from '../../../../admin/field-data/upload-field-data-editor-model'; import {FieldDataOption} from "@app/core/model/dataset-profile-definition/field-data/field-data"; import {FieldDataOptionEditorModel} from "@app/ui/admin/dataset-profile/admin/field-data/field-data-option-editor-model"; @@ -44,9 +44,9 @@ export class DatasetProfileEditorUploadFieldComponent implements OnInit { ]; selected: string[] = []; - public typesFormControl = new FormControl(); + public typesFormControl = new UntypedFormControl(); - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: UploadFieldDataEditorModel = new UploadFieldDataEditorModel(); constructor(private configurationService: ConfigurationService) {} @@ -89,12 +89,12 @@ export class DatasetProfileEditorUploadFieldComponent implements OnInit { if(type != null) { typeListOptions.fromModel(type); } - (this.form.get('data')).addControl('types', new FormBuilder().array([])); - (this.form.get('data').get('types')).push(typeListOptions.buildForm()); + (this.form.get('data')).addControl('types', new UntypedFormBuilder().array([])); + (this.form.get('data').get('types')).push(typeListOptions.buildForm()); } deleteRow(index: number) { - if (this.form.get('data').get('types')) { (this.form.get('data').get('types')).removeAt(index); } + if (this.form.get('data').get('types')) { (this.form.get('data').get('types')).removeAt(index); } } public getConfiguration() { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/validator/dataset-profile-editor-validator-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/validator/dataset-profile-editor-validator-field.component.ts index 021fa2633..b3ec7f309 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/validator/dataset-profile-editor-validator-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/validator/dataset-profile-editor-validator-field.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models'; @Component({ @@ -9,7 +9,7 @@ import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/a }) export class DatasetProfileEditorValidatorFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel(); ngOnInit() { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/word-list/dataset-profile-editor-word-list-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/word-list/dataset-profile-editor-word-list-field.component.ts index e9bee35d2..b7f78262c 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/word-list/dataset-profile-editor-word-list-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/word-list/dataset-profile-editor-word-list-field.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormArray, FormGroup } from '@angular/forms'; +import { UntypedFormArray, UntypedFormGroup } from '@angular/forms'; import { DatasetProfileComboBoxType } from '../../../../../../../core/common/enum/dataset-profile-combo-box-type'; import { FieldDataOptionEditorModel } from '../../../../admin/field-data/field-data-option-editor-model'; import { WordListFieldDataEditorModel } from '../../../../admin/field-data/word-list-field-data-editor-model'; @@ -11,7 +11,7 @@ import { WordListFieldDataEditorModel } from '../../../../admin/field-data/word- }) export class DatasetProfileEditorWordListFieldComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private data: WordListFieldDataEditorModel = new WordListFieldDataEditorModel(); ngOnInit() { @@ -20,10 +20,10 @@ export class DatasetProfileEditorWordListFieldComponent implements OnInit { addNewRow() { const wordListOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel(); - (this.form.get('data').get('options')).push(wordListOptions.buildForm()); + (this.form.get('data').get('options')).push(wordListOptions.buildForm()); } deleteRow(intex: number) { - if (this.form.get('data').get('options')) { (this.form.get('data').get('options')).removeAt(intex); } + if (this.form.get('data').get('options')) { (this.form.get('data').get('options')).removeAt(intex); } } } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts index b6ae07746..d4312892f 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts @@ -1,5 +1,5 @@ import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; -import {FormArray, FormControl, FormGroup, FormGroupDirective, NgForm,} from '@angular/forms'; +import {UntypedFormArray, UntypedFormControl, UntypedFormGroup, FormGroupDirective, NgForm,} from '@angular/forms'; import {DatasetProfileFieldViewStyle} from '@app/core/common/enum/dataset-profile-field-view-style'; import {ValidationType} from '@app/core/common/enum/validation-type'; import {DatasetProfileService} from '@app/core/services/dataset-profile/dataset-profile.service'; @@ -55,7 +55,7 @@ import { COMMA, ENTER } from '@angular/cdk/keycodes'; }) export class DatasetProfileEditorFieldComponent extends BaseComponent implements OnInit, ErrorStateMatcher { @Input() viewOnly: boolean; - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; @Input() showOrdinal = true; @Input() indexPath: string; validationTypeEnum = ValidationType; @@ -96,7 +96,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements } - isErrorState(control: FormControl, form: FormGroupDirective | NgForm): boolean { + isErrorState(control: UntypedFormControl, form: FormGroupDirective | NgForm): boolean { if(this.form.get('viewStyle').untouched) return false; @@ -336,7 +336,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements addNewRule() { const rule: RuleEditorModel = new RuleEditorModel(); - (this.form.get('visible').get('rules')).push(rule.buildForm()); + (this.form.get('visible').get('rules')).push(rule.buildForm()); } @@ -922,7 +922,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements const form = (new FieldEditorModel).fromModel(field).buildForm(); - const fields = this.form.parent as FormArray; + const fields = this.form.parent as UntypedFormArray; let index = -1; fields.controls.forEach((control,i)=>{ @@ -953,7 +953,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements } private setValidator(validationType: ValidationType, add: boolean) { - let validationsControl = this.form.get('validations') as FormControl; + let validationsControl = this.form.get('validations') as UntypedFormControl; let validations: Array = validationsControl.value; if(add){ @@ -969,13 +969,13 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements } get isRequired(){ - let validationsControl = this.form.get('validations') as FormControl; + let validationsControl = this.form.get('validations') as UntypedFormControl; let validations: Array = validationsControl.value; return validations.includes(ValidationType.Required); } get isURL(){ - let validationsControl = this.form.get('validations') as FormControl; + let validationsControl = this.form.get('validations') as UntypedFormControl; let validations: Array = validationsControl.value; return validations.includes(ValidationType.URL); } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/page/dataset-profile-editor-page.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/page/dataset-profile-editor-page.component.ts index ad52d3acc..8ef8a40f2 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/page/dataset-profile-editor-page.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/page/dataset-profile-editor-page.component.ts @@ -1,5 +1,5 @@ import { Component, Input } from '@angular/core'; -import { FormArray } from '@angular/forms'; +import { UntypedFormArray } from '@angular/forms'; @Component({ selector: 'app-dataset-profile-editor-page-component', @@ -8,10 +8,10 @@ import { FormArray } from '@angular/forms'; }) export class DatasetProfileEditorPageComponent { - @Input() form: FormArray; + @Input() form: UntypedFormArray; @Input() viewOnly: boolean; removePage(index) { - (this.form).removeAt(index); + (this.form).removeAt(index); } } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/rule/dataset-profile-editor-rule.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/rule/dataset-profile-editor-rule.component.ts index 150d58c69..645853d74 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/rule/dataset-profile-editor-rule.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/rule/dataset-profile-editor-rule.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'; -import { FormArray, FormControl, FormGroup } from '@angular/forms'; +import { UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; import { DatasetProfileFieldViewStyle } from '../../../../../../core/common/enum/dataset-profile-field-view-style'; import { DatasetProfileComboBoxType } from '../../../../../../core/common/enum/dataset-profile-combo-box-type'; import { ToCEntryType } from '../../../table-of-contents/table-of-contents-entry'; @@ -15,11 +15,11 @@ import { TranslateService } from '@ngx-translate/core'; export class DatasetProfileEditorRuleComponent implements OnInit { - @Input() form: FormArray; + @Input() form: UntypedFormArray; @Input() viewStyleForCheck: DatasetProfileFieldViewStyle; - @Input() formControlForCheck: FormControl; - @Input() formArrayOptionsForCheck: FormArray; + @Input() formControlForCheck: UntypedFormControl; + @Input() formArrayOptionsForCheck: UntypedFormArray; @Input() comboBoxTypeForCheck: DatasetProfileComboBoxType; @Input() viewOnly: boolean; @@ -89,7 +89,7 @@ export class DatasetProfileEditorRuleComponent implements OnInit { private _buildHiddenBy(fo:OptionItem){ try{ this.fieldOptions.forEach(foption=>{ - const rules = (foption.form.get('visible').get('rules') as FormArray).controls.map(c=>(c as FormGroup).getRawValue()) as Rule[] + const rules = (foption.form.get('visible').get('rules') as UntypedFormArray).controls.map(c=>(c as UntypedFormGroup).getRawValue()) as Rule[] const targets = rules.map(rule=>rule.target); targets.forEach(target=>{ if(fo.parentsIds.includes(target) && !fo.hiddenBy.includes(foption.id)){ @@ -114,11 +114,11 @@ export class DatasetProfileEditorRuleComponent implements OnInit { const result:OptionItem[] =[]; - const sections = rootForm.get('sections') as FormArray; + const sections = rootForm.get('sections') as UntypedFormArray; if(sections){ sections.controls.forEach(section=>{ - const subResult = this.buildOptions(section as FormGroup, ToCEntryType.Section,[]); + const subResult = this.buildOptions(section as UntypedFormGroup, ToCEntryType.Section,[]); result.push(...subResult); }); } @@ -131,11 +131,11 @@ export class DatasetProfileEditorRuleComponent implements OnInit { return []; } - private buildOptions(form: FormGroup, type: ToCEntryType, parentIds:string[]):OptionItem[]{ + private buildOptions(form: UntypedFormGroup, type: ToCEntryType, parentIds:string[]):OptionItem[]{ - const sections = form.get('sections') as FormArray; - const fieldSets = form.get('fieldSets') as FormArray; - const fields = form.get('fields') as FormArray; + const sections = form.get('sections') as UntypedFormArray; + const fieldSets = form.get('fieldSets') as UntypedFormArray; + const fields = form.get('fields') as UntypedFormArray; const result:OptionItem[] = []; @@ -153,17 +153,17 @@ export class DatasetProfileEditorRuleComponent implements OnInit { if(sections){ sections.controls.forEach(section=>{ - result.push( ...this.buildOptions(section as FormGroup, ToCEntryType.Section, currentOptionItem.parentsIds) ); + result.push( ...this.buildOptions(section as UntypedFormGroup, ToCEntryType.Section, currentOptionItem.parentsIds) ); }); } if(fieldSets){ fieldSets.controls.forEach(fieldset=>{ - result.push( ...this.buildOptions(fieldset as FormGroup, ToCEntryType.FieldSet, currentOptionItem.parentsIds) ); + result.push( ...this.buildOptions(fieldset as UntypedFormGroup, ToCEntryType.FieldSet, currentOptionItem.parentsIds) ); }); } if(fields){ fields.controls.forEach(field=>{ - result.push( ...this.buildOptions(field as FormGroup, ToCEntryType.Field, currentOptionItem.parentsIds) ); //TODO NA TO DOUME + result.push( ...this.buildOptions(field as UntypedFormGroup, ToCEntryType.Field, currentOptionItem.parentsIds) ); //TODO NA TO DOUME }); } @@ -218,6 +218,6 @@ interface OptionItem{ label: string, type: ToCEntryType, parentsIds: string[], - form:FormGroup, + form:UntypedFormGroup, hiddenBy:string[] } \ No newline at end of file diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section-fieldset/dataset-profile-editor-section-fieldset.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section-fieldset/dataset-profile-editor-section-fieldset.component.ts index 82c46659a..3e45e2c28 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section-fieldset/dataset-profile-editor-section-fieldset.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section-fieldset/dataset-profile-editor-section-fieldset.component.ts @@ -1,6 +1,6 @@ import { OnDestroy } from '@angular/core'; import { Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core'; -import { FormArray, FormGroup } from '@angular/forms'; +import { UntypedFormArray, UntypedFormGroup } from '@angular/forms'; import { Guid } from '@common/types/guid'; import { isNullOrUndefined } from '@swimlane/ngx-datatable'; import { DragulaService } from 'ng2-dragula'; @@ -31,8 +31,8 @@ export class DatasetProfileEditorSectionFieldSetComponent implements OnInit, OnC @Output() selectedEntryId = new EventEmitter(); @Output() dataNeedsRefresh = new EventEmitter (); @Output() removeFieldSet = new EventEmitter(); - @Output() addNewFieldSet = new EventEmitter(); - @Output() cloneFieldSet = new EventEmitter(); + @Output() addNewFieldSet = new EventEmitter(); + @Output() cloneFieldSet = new EventEmitter(); // FIELDSET_PREFIX_ID="FIELDSET_PREFIX_ID"; @@ -67,7 +67,7 @@ export class DatasetProfileEditorSectionFieldSetComponent implements OnInit, OnC this.subs.add(this.dragulaService.drop(this.FIELDSETS).subscribe(obs=>{ - (this.form.get('fieldSets') as FormArray).controls.forEach((e,i)=>{ + (this.form.get('fieldSets') as UntypedFormArray).controls.forEach((e,i)=>{ e.get('ordinal').setValue(i); }); @@ -193,19 +193,19 @@ export class DatasetProfileEditorSectionFieldSetComponent implements OnInit, OnC this.removeFieldSet.emit(fieldsetId); } - onCloneFieldSet(fieldset: FormGroup){ + onCloneFieldSet(fieldset: UntypedFormGroup){ this.cloneFieldSet.emit(fieldset); } onAddFieldSet(){ // this.addNewFieldSet.emit(this.form); try{ - const length = (this.form.get('fieldSets') as FormArray).length; + const length = (this.form.get('fieldSets') as UntypedFormArray).length; if(length === 0){ this.addFieldSetAfter(-9999, 0); return; } else{ - const lastElement = (this.form.get('fieldSets') as FormArray).at(length -1); + const lastElement = (this.form.get('fieldSets') as UntypedFormArray).at(length -1); this.addFieldSetAfter(lastElement.get('ordinal').value, length-1); } } catch {} @@ -223,7 +223,7 @@ export class DatasetProfileEditorSectionFieldSetComponent implements OnInit, OnC fieldSet.id = fieldSetId; fieldSet.ordinal = afterOrdinal < 0? 0 :afterOrdinal; - const parentArray = this.form.get('fieldSets') as FormArray; + const parentArray = this.form.get('fieldSets') as UntypedFormArray; parentArray.controls.forEach(fieldset=>{ const ordinalControl = fieldset.get('ordinal'); @@ -233,7 +233,7 @@ export class DatasetProfileEditorSectionFieldSetComponent implements OnInit, OnC } }); const fieldsetForm = fieldSet.buildForm(); - (fieldsetForm.get('fields') as FormArray).push(fieldForm); + (fieldsetForm.get('fields') as UntypedFormArray).push(fieldForm); const index = afterOrdinal < 0 ? 0: afterIndex +1; parentArray.insert(index, fieldsetForm); diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component.ts index 2adc791e7..c608c731b 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component.ts @@ -1,5 +1,5 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { FormArray, FormGroup } from '@angular/forms'; +import { UntypedFormArray, UntypedFormGroup } from '@angular/forms'; import { FieldEditorModel } from '@app/ui/admin/dataset-profile/admin/field-editor-model'; import { FieldSetEditorModel } from '@app/ui/admin/dataset-profile/admin/field-set-editor-model'; import { SectionEditorModel } from '@app/ui/admin/dataset-profile/admin/section-editor-model'; @@ -15,7 +15,7 @@ import { takeUntil } from 'rxjs/operators'; export class DatasetProfileEditorSectionComponent extends BaseComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; //@Input() dataModel: SectionEditorModel; @Input() indexPath: string; @Input() viewOnly: boolean; @@ -35,7 +35,7 @@ export class DatasetProfileEditorSectionComponent extends BaseComponent implemen addField() { const fieldSet: FieldSetEditorModel = new FieldSetEditorModel(); - fieldSet.ordinal = (this.form.get('fieldSets') as FormArray).length; + fieldSet.ordinal = (this.form.get('fieldSets') as UntypedFormArray).length; const field: FieldEditorModel = new FieldEditorModel(); field.id = Guid.create().toString(); @@ -45,7 +45,7 @@ export class DatasetProfileEditorSectionComponent extends BaseComponent implemen fieldSet.id = Guid.create().toString(); //this.dataModel.fieldSets.push(fieldSet); //} - const fieldsetsArray = this.form.get('fieldSets') as FormArray; + const fieldsetsArray = this.form.get('fieldSets') as UntypedFormArray; fieldsetsArray.push(fieldSet.buildForm()); const fieldSetForm = fieldsetsArray.at(fieldsetsArray.length-1); @@ -59,17 +59,17 @@ export class DatasetProfileEditorSectionComponent extends BaseComponent implemen addSectioninSection() { const section: SectionEditorModel = new SectionEditorModel(); //this.dataModel.sections.push(section); - (this.form.get('sections')).push(section.buildForm()); + (this.form.get('sections')).push(section.buildForm()); } DeleteSectionInSection(index) { //this.dataModel.sections.splice(index, 1); - (this.form.get('sections')).removeAt(index); + (this.form.get('sections')).removeAt(index); } deleteFieldSet(index) { //this.dataModel.fieldSets.splice(index, 1); - (this.form.get('fieldSets')).removeAt(index); + (this.form.get('fieldSets')).removeAt(index); } keepPageSelectionValid(pagesJson: Array) { @@ -80,7 +80,7 @@ export class DatasetProfileEditorSectionComponent extends BaseComponent implemen } } - getFieldTile(formGroup: FormGroup, index: number) { + getFieldTile(formGroup: UntypedFormGroup, index: number) { if (formGroup.get('title') && formGroup.get('title').value && formGroup.get('title').value.length > 0) { return formGroup.get('title').value; } return "Field " + (index + 1); } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/custom-validators/editor-custom-validators.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/custom-validators/editor-custom-validators.ts index f23d30d9f..94649b0bc 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/custom-validators/editor-custom-validators.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/custom-validators/editor-custom-validators.ts @@ -1,5 +1,5 @@ import { Inject, Injectable } from "@angular/core"; -import { AbstractControl, FormArray, ValidationErrors, ValidatorFn } from "@angular/forms"; +import { AbstractControl, UntypedFormArray, ValidationErrors, ValidatorFn } from "@angular/forms"; export class EditorCustomValidators{ @@ -7,7 +7,7 @@ export class EditorCustomValidators{ static atLeastOneElementListValidator(arrayToCheck): ValidatorFn{ return (control: AbstractControl): ValidationErrors | null=>{ - const fa = control.get(arrayToCheck) as FormArray; + const fa = control.get(arrayToCheck) as UntypedFormArray; if(!fa || fa.length === 0){ return {[EditorCustomValidatorsEnum.emptyArray]: true}; @@ -19,8 +19,8 @@ export class EditorCustomValidators{ return (control: AbstractControl): ValidationErrors | null=>{ - const pages = control.get(pagesArrayName) as FormArray; - const sections = control.get(sectionsArrayName) as FormArray; + const pages = control.get(pagesArrayName) as UntypedFormArray; + const sections = control.get(sectionsArrayName) as UntypedFormArray; const pageIdsArray = pages.controls.map(page=>page.get('id').value); @@ -42,8 +42,8 @@ export class EditorCustomValidators{ return (control: AbstractControl): ValidationErrors | null=>{ - const fieldsets = control.get(fieldsetsArrayName) as FormArray; - const sections = control.get(sectionsArrayName) as FormArray; + const fieldsets = control.get(fieldsetsArrayName) as UntypedFormArray; + const sections = control.get(sectionsArrayName) as UntypedFormArray; if((fieldsets && fieldsets.length) || (sections && sections.length)){ diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor-model.ts index 059a1feb0..4cd0066cf 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor-model.ts @@ -1,4 +1,4 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { UntypedFormBuilder, FormControl, UntypedFormGroup, Validators } from '@angular/forms'; import { UserInfoListingModel } from '@app/core/model/user/user-info-listing'; import { DatasetProfile } from '../../../../core/model/admin/dataset-profile/dataset-profile'; import { BaseFormModel } from '../../../../core/model/base-form-model'; @@ -32,8 +32,8 @@ export class DatasetProfileEditorModel extends BaseFormModel { return this; } - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { - const formGroup: FormGroup = new FormBuilder().group({ + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { + const formGroup: UntypedFormGroup = new UntypedFormBuilder().group({ label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DatasetProfileEditorModel.label')) }, [Validators.required]], description: [{ value: this.description, disabled: (disabled && !skipDisable.includes('DatasetProfileEditorModel.description')) }, [Validators.required]], type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('DatasetProfileEditorModel.type')) }, [Validators.required]], @@ -43,16 +43,16 @@ export class DatasetProfileEditorModel extends BaseFormModel { users: [{ value: this.users, disabled: (disabled && !skipDisable.includes('DatasetProfileEditorModel.users')) }] }); - const sectionsFormArray = new Array(); + const sectionsFormArray = new Array(); this.sections.forEach(item => { - const form: FormGroup = item.buildForm(disabled, skipDisable); + const form: UntypedFormGroup = item.buildForm(disabled, skipDisable); sectionsFormArray.push(form); }); formGroup.addControl('sections', this.formBuilder.array(sectionsFormArray)); - const pagesFormArray = new Array(); + const pagesFormArray = new Array(); this.pages.forEach(item => { - const form: FormGroup = item.buildForm(disabled, skipDisable); + const form: UntypedFormGroup = item.buildForm(disabled, skipDisable); pagesFormArray.push(form); }); formGroup.addControl('pages', this.formBuilder.array(pagesFormArray)); diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts index d3ffca7d0..17ae8c8c0 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts @@ -2,7 +2,7 @@ import { of as observableOf, Observable, combineLatest, BehaviorSubject,of } from 'rxjs'; import { HttpClient, HttpErrorResponse } from '@angular/common/http'; import { Component, OnInit, QueryList, ViewChild } from '@angular/core'; -import { AbstractControl, FormArray, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { AbstractControl, UntypedFormArray, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { MatHorizontalStepper} from '@angular/material/stepper'; import { ActivatedRoute, ParamMap, Router } from '@angular/router'; @@ -71,8 +71,8 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent isClone = false; isDeleted = false; dataModel: DatasetProfileEditorModel; - form: FormGroup; - previewerFormGroup: FormGroup; + form: UntypedFormGroup; + previewerFormGroup: UntypedFormGroup; private datasetProfileId: string; newVersionId: string; dataWizardModel: DatasetWizardModel; @@ -116,7 +116,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent private enumUtils: EnumUtils, private datasetWizardService: DatasetWizardService, private visibilityRulesService: VisibilityRulesService, - private fb: FormBuilder, + private fb: UntypedFormBuilder, private sidenavService: SideNavService, private userService: UserService, private descriptionTemplateTypeService: DescriptionTemplateTypeService @@ -289,8 +289,8 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent const fieldSetHavingInvalidVisibilityRules:ToCEntry[] = fieldsetEntries .filter(entry=>{ const fieldsFormGroup = entry.form.get('fields'); - const invalid = (fieldsFormGroup as FormArray).controls.filter(field=>{ - return this.hasInvalidVisibilityRule(field as FormGroup); + const invalid = (fieldsFormGroup as UntypedFormArray).controls.filter(field=>{ + return this.hasInvalidVisibilityRule(field as UntypedFormGroup); }); if(invalid && invalid.length){ @@ -333,12 +333,12 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent if(fieldset.type != ToCEntryType.FieldSet){ return; } - const fields = fieldset.form.get('fields') as FormArray; + const fields = fieldset.form.get('fields') as UntypedFormArray; fields.controls.forEach(fieldControl=>{ - if(this.hasInvalidVisibilityRule(fieldControl as FormGroup)){ + if(this.hasInvalidVisibilityRule(fieldControl as UntypedFormGroup)){ try{ - (fieldControl.get('visible').get('rules') as FormArray).clear(); + (fieldControl.get('visible').get('rules') as UntypedFormArray).clear(); }catch{} } }) @@ -347,7 +347,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent } - private hasInvalidVisibilityRule(field: FormGroup):boolean{ + private hasInvalidVisibilityRule(field: UntypedFormGroup):boolean{ const renderStyle = field.get('viewStyle').get('renderStyle').value; if(renderStyle && ![ DatasetProfileFieldViewStyle.TextArea, @@ -410,8 +410,8 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent onIsMultiplicityEnabledChange(isMultiplicityEnabled: boolean) { if (!isMultiplicityEnabled) { - (this.form.get('multiplicity').get('min')).setValue(0); - (this.form.get('multiplicity').get('max')).setValue(0); + (this.form.get('multiplicity').get('min')).setValue(0); + (this.form.get('multiplicity').get('max')).setValue(0); } } @@ -711,7 +711,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent datasetWizardModel: DatasetWizardEditorModel; - formGroup: FormGroup; + formGroup: UntypedFormGroup; getPreview() { let data = this.form.getRawValue(); this.datasetProfileService.preview(data).subscribe(x => { @@ -719,7 +719,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent datasetProfileDefinition: x }); this.updateVisibilityRules(); - this.formGroup = this.datasetWizardModel.buildForm().get('datasetProfileDefinition'); + this.formGroup = this.datasetWizardModel.buildForm().get('datasetProfileDefinition'); }); //this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue())); @@ -844,7 +844,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent const result: ToCEntry[] = []; //build parent pages - (this.form.get('pages') as FormArray).controls.forEach((pageElement, i) => { + (this.form.get('pages') as UntypedFormArray).controls.forEach((pageElement, i) => { result.push({ id: pageElement.get('id').value, label: pageElement.get('title').value, @@ -856,7 +856,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent }); // build first level sections - (this.form.get('sections') as FormArray).controls.forEach((sectionElement, i) => { + (this.form.get('sections') as UntypedFormArray).controls.forEach((sectionElement, i) => { const currentSectionPageId = sectionElement.get('page').value; const pageToAdd = result.filter(x => x.id == currentSectionPageId)[0]; if (pageToAdd.subEntries == null) pageToAdd.subEntries = []; @@ -868,8 +868,8 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent form: sectionElement, numbering: pageToAdd.numbering + '.' + (pageToAdd.subEntries.length +1) } as ToCEntry; - const sectionItems = this.populateSections(sectionElement.get('sections') as FormArray, item.numbering); - const fieldSetItems = this.populateFieldSets(sectionElement.get('fieldSets') as FormArray, item.numbering); + const sectionItems = this.populateSections(sectionElement.get('sections') as UntypedFormArray, item.numbering); + const fieldSetItems = this.populateFieldSets(sectionElement.get('fieldSets') as UntypedFormArray, item.numbering); if (sectionItems != null) { item.subEntries = sectionItems; item.subEntriesType = ToCEntryType.Section; @@ -891,7 +891,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent return result; } - private populateSections(sections: FormArray, existingNumbering: string): ToCEntry[] { + private populateSections(sections: UntypedFormArray, existingNumbering: string): ToCEntry[] { if (sections == null || sections.controls == null || sections.controls.length == 0) { return null; } const result: ToCEntry[] = []; @@ -904,8 +904,8 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent form: sectionElement, numbering: existingNumbering + '.' + (i + 1) } as ToCEntry; - const sectionItems = this.populateSections(sectionElement.get('sections') as FormArray, item.numbering); - const fieldSetItems = this.populateFieldSets(sectionElement.get('fieldSets') as FormArray, item.numbering); + const sectionItems = this.populateSections(sectionElement.get('sections') as UntypedFormArray, item.numbering); + const fieldSetItems = this.populateFieldSets(sectionElement.get('fieldSets') as UntypedFormArray, item.numbering); if (sectionItems != null) { item.subEntries = sectionItems; item.subEntriesType = ToCEntryType.Section; @@ -924,7 +924,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent return result; } - private populateFieldSets(fieldSets: FormArray, existingNumbering: string): ToCEntry[] { + private populateFieldSets(fieldSets: UntypedFormArray, existingNumbering: string): ToCEntry[] { if (fieldSets == null || fieldSets.controls == null || fieldSets.controls.length == 0) { return null; } const result: ToCEntry[] = []; @@ -974,7 +974,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent //define entry type switch (tce.childType) { case ToCEntryType.Page: - const pagesArray = (this.form.get('pages') as FormArray); + const pagesArray = (this.form.get('pages') as UntypedFormArray); const page: PageEditorModel = new PageEditorModel(pagesArray.length); const pageForm = page.buildForm(); @@ -990,10 +990,10 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent const section: SectionEditorModel = new SectionEditorModel(); section.id = Guid.create().toString(); - let sectionsArray:FormArray; + let sectionsArray:UntypedFormArray; if (parent.type === ToCEntryType.Page) {//FIRST LEVEL SECTION - sectionsArray = this.form.get('sections') as FormArray; + sectionsArray = this.form.get('sections') as UntypedFormArray; section.page = parent.id; @@ -1011,7 +1011,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent // this.form.updateValueAndValidity(); } else if( parent.type == ToCEntryType.Section) { //SUBSECTION OF SECTION - sectionsArray = parent.form.get('sections') as FormArray; + sectionsArray = parent.form.get('sections') as UntypedFormArray; //adding page parent MAYBE NOT NEEDED section.page = parent.form.get('page').value; @@ -1030,7 +1030,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent } - const sectionAdded = sectionsArray.at(sectionsArray.length -1) as FormGroup; + const sectionAdded = sectionsArray.at(sectionsArray.length -1) as UntypedFormGroup; // sectionAdded.setValidators(this.customEditorValidators.sectionHasAtLeastOneChildOf('fieldSets','sections')); // sectionAdded.updateValueAndValidity(); @@ -1052,7 +1052,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent // fieldSet.fields.push(field); // field.ordinal = fieldSet.fields.length-1; - const fieldSetsArray = parent.form.get('fieldSets') as FormArray + const fieldSetsArray = parent.form.get('fieldSets') as UntypedFormArray //give fieldset id and ordinal const fieldSet: FieldSetEditorModel = new FieldSetEditorModel(); @@ -1069,7 +1069,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent - (fieldsetForm.get('fields') as FormArray).push(fieldForm); + (fieldsetForm.get('fields') as UntypedFormArray).push(fieldForm); fieldSetsArray.push(fieldsetForm); this.refreshToCEntries(); @@ -1110,12 +1110,12 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent //define entry type switch (tce.type) { case ToCEntryType.Page: - const pages = this.form.get('pages') as FormArray; + const pages = this.form.get('pages') as UntypedFormArray; let pageIndex = -1; //get the index for (let i = 0; i < pages.length; i++) { - let page = pages.at(i) as FormGroup; + let page = pages.at(i) as UntypedFormGroup; if (page.controls.id.value === tce.id) { pageIndex = i; @@ -1129,7 +1129,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent pages.removeAt(pageIndex); //clean up sections of removed page - const sections = (this.form.get('sections') as FormArray); + const sections = (this.form.get('sections') as UntypedFormArray); const sectionsIndexToBeRemoved = []; @@ -1161,7 +1161,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent let index = -1; - const sections = (this.form.get('sections') as FormArray); + const sections = (this.form.get('sections') as UntypedFormArray); for (let i = 0; i < sections.length; i++) { @@ -1177,7 +1177,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent if (index >= 0) { //section found - const sections = (this.form.get('sections') as FormArray); + const sections = (this.form.get('sections') as UntypedFormArray); //remove section this._updateSelectedItem(tce); @@ -1190,7 +1190,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent } else {//NOT FOUND IN FIRST LEVEL CASE //LOOK FOR SUBSECTION CASE - let parentFormArray = tce.form.parent as FormArray; + let parentFormArray = tce.form.parent as UntypedFormArray; for (let i = 0; i < parentFormArray.length; i++) { let section = parentFormArray.at(i); @@ -1215,7 +1215,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent break; case ToCEntryType.FieldSet: - const parentFormArray = tce.form.parent as FormArray; + const parentFormArray = tce.form.parent as UntypedFormArray; let idx = -1; @@ -1263,7 +1263,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent }else{ //if first level section - const firstLevelSections = (this.form.get('sections') as FormArray); + const firstLevelSections = (this.form.get('sections') as UntypedFormArray); let isFirstLevel: boolean = false; firstLevelSections.controls.forEach(section=>{ if(section.get('id').value === tce.id){ @@ -1323,7 +1323,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent } get numOfPages(){ - return (this.form.get('pages')).length; + return (this.form.get('pages')).length; } // getSectionIndex(): number{ @@ -1353,12 +1353,12 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent // return subForm; // } - getFieldTile(formGroup: FormGroup, index: number) { + getFieldTile(formGroup: UntypedFormGroup, index: number) { if (formGroup.get('title') && formGroup.get('title').value && formGroup.get('title').value.length > 0) { return formGroup.get('title').value; } return "Field " + (index + 1); } - deleteFieldSet(formArray: FormArray, index: number) { + deleteFieldSet(formArray: UntypedFormArray, index: number) { formArray.removeAt(index); } @@ -1475,7 +1475,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent const fieldSets = this._getFieldSets(this.getTocEntries()); fieldSets.forEach(fs=>{ - const fields = fs.form.get('fields') as FormArray; + const fields = fs.form.get('fields') as UntypedFormArray; if(fields){ fields.controls.forEach(field=>{ const rulesArray = field.get('visible').get('rules').value; @@ -1549,15 +1549,15 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent fieldset.hasCommentField = fs.form.get('hasCommentField').value; fieldset.title = fs.label; // fieldset.fields = (fs.form.get('fields') as FormArray).getRawValue(); - fieldset.fields = (fs.form.get('fields') as FormArray).controls.map(field=>{ + fieldset.fields = (fs.form.get('fields') as UntypedFormArray).controls.map(field=>{ const fieldModel = new DatasetDescriptionFieldEditorModel(); - fieldModel.data = (field.get('data') as FormGroup).getRawValue(); + fieldModel.data = (field.get('data') as UntypedFormGroup).getRawValue(); fieldModel.id = field.get('id').value; - fieldModel.viewStyle = (field.get('viewStyle') as FormGroup).getRawValue(); + fieldModel.viewStyle = (field.get('viewStyle') as UntypedFormGroup).getRawValue(); // fieldModel.defaultValue = (field.get('defaultValue') as FormGroup).getRawValue(); - fieldModel.value = (field.get('defaultValue') as FormGroup).get('value').value; + fieldModel.value = (field.get('defaultValue') as UntypedFormGroup).get('value').value; fieldModel.defaultValue = fieldModel.value; fieldModel.page = field.get('page').value; fieldModel.validations = field.get('validations').value; @@ -1639,9 +1639,9 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent this.form.markAsDirty(); } - cloneFieldSet(fieldset: FormGroup){ + cloneFieldSet(fieldset: UntypedFormGroup){ const values = fieldset.getRawValue(); - const parentArray = fieldset.parent as FormArray; + const parentArray = fieldset.parent as UntypedFormArray; values.id = Guid.create().toString(); values.ordinal = parentArray.length; @@ -1813,7 +1813,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent result.forEach((err,i)=>{ fieldsets.filter(fs=>{ let fieldFound = false; - (fs.form.get('fields') as FormArray).controls.forEach(field=>{ + (fs.form.get('fields') as UntypedFormArray).controls.forEach(field=>{ if(field.get('id').value === err.id){ fieldFound = true; indexes.push(i); @@ -1886,9 +1886,9 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent let controlType = 'control'; - if(aControl instanceof FormGroup) controlType="fg" - if(aControl instanceof FormControl) controlType="fc"; - if(aControl instanceof FormArray) controlType="fa"; + if(aControl instanceof UntypedFormGroup) controlType="fg" + if(aControl instanceof UntypedFormControl) controlType="fc"; + if(aControl instanceof UntypedFormArray) controlType="fa"; const invalidControls:InvalidControl[] = []; @@ -1896,14 +1896,14 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent switch (controlType){ case 'fg': - const controls = (aControl as FormGroup).controls; + const controls = (aControl as UntypedFormGroup).controls; const keys = Object.keys(controls); keys.forEach(key=>{ const control = controls[key]; if(!control.invalid) return; //// !!!!! Important to be !invalid. (In case the template is finalized) - if(control instanceof FormControl){ - const ctrl = control as FormControl; + if(control instanceof UntypedFormControl){ + const ctrl = control as UntypedFormControl; invalidControls.push({ errors:ctrl.errors, @@ -1957,15 +1957,15 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent break; case 'fa': // const fa = (aControl as FormArray); - const ctrls = (aControl as FormArray).controls; + const ctrls = (aControl as UntypedFormArray).controls; const keys_ = Object.keys(ctrls); keys_.forEach(key=>{ const control = ctrls[key]; if(control.valid) return; - if(control instanceof FormControl){ //for completion purposes. should never run this case - const ctrl = control as FormControl; + if(control instanceof UntypedFormControl){ //for completion purposes. should never run this case + const ctrl = control as UntypedFormControl; invalidControls.push({ errors:ctrl.errors, id: ctrl.get('id')? ctrl.get('id').value: null, @@ -2056,7 +2056,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent try{ fieldsets.forEach(fs=>{ fs.form.get('title').setValidators(Validators.required); - const fieldsF = fs.form.get('fields') as FormArray; + const fieldsF = fs.form.get('fields') as UntypedFormArray; if(fieldsF){ fieldsF.controls.forEach(field=>{ const renderStyleValue = field.get('viewStyle').get('renderStyle').value; diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents-internal-section/table-of-contents-internal-section.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents-internal-section/table-of-contents-internal-section.ts index 922f1d050..a7098cd0b 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents-internal-section/table-of-contents-internal-section.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents-internal-section/table-of-contents-internal-section.ts @@ -1,7 +1,7 @@ import { CdkDrag, CdkDragDrop, CdkDropList, moveItemInArray } from '@angular/cdk/drag-drop'; import { DOCUMENT } from '@angular/common'; import { Component, EventEmitter, Inject, Input, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core'; -import { AbstractControl, FormArray, FormControl, FormGroup } from '@angular/forms'; +import { AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; import { BaseComponent } from '@common/base/base.component'; import { NewEntryType, ToCEntry, ToCEntryType } from '../table-of-contents-entry'; @@ -216,7 +216,7 @@ export class DatasetProfileTableOfContentsInternalSection extends BaseComponent if(this.parentLink.type === this.tocEntryType.Page && allFieldsAreTouched){ const rootForm = form.root; if(rootForm){ - const sections = rootForm.get('sections') as FormArray; + const sections = rootForm.get('sections') as UntypedFormArray; if(!sections.controls.find(section=>section.get('page').value === this.parentLink.id)){ return true; } @@ -227,8 +227,8 @@ export class DatasetProfileTableOfContentsInternalSection extends BaseComponent //checking first child form controls if have errors let hasErrors = false; if(allFieldsAreTouched){ - if(form instanceof FormGroup){ - const formGroup = form as FormGroup; + if(form instanceof UntypedFormGroup){ + const formGroup = form as UntypedFormGroup; const controls = Object.keys(formGroup.controls); @@ -249,10 +249,10 @@ export class DatasetProfileTableOfContentsInternalSection extends BaseComponent if(!aControl|| aControl.untouched) return false; - if(aControl instanceof FormControl){ + if(aControl instanceof UntypedFormControl){ return aControl.touched; - }else if(aControl instanceof FormGroup){ - const controlKeys = Object.keys((aControl as FormGroup).controls); + }else if(aControl instanceof UntypedFormGroup){ + const controlKeys = Object.keys((aControl as UntypedFormGroup).controls); let areAllTouched = true; controlKeys.forEach(key=>{ if(!this.allFieldsAreTouched(aControl.get(key))){ @@ -262,8 +262,8 @@ export class DatasetProfileTableOfContentsInternalSection extends BaseComponent // const areAllTouched = controlKeys.reduce((acc, key)=>acc && this._allFieldsAreTouched(aControl.get(key)), true); return areAllTouched; - }else if(aControl instanceof FormArray){ - const controls = (aControl as FormArray).controls; + }else if(aControl instanceof UntypedFormArray){ + const controls = (aControl as UntypedFormArray).controls; // const areAllTouched = controls.reduce((acc, control)=>acc && this._allFieldsAreTouched(control), true); let areAllTouched = true; // controls.reduce((acc, control)=>acc && this._allFieldsAreTouched(control), true); diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents.ts index 2705c912d..31d8b6ac9 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents.ts @@ -7,7 +7,7 @@ import { type } from 'os'; import { SimpleChanges } from '@angular/core'; import { NewEntryType, TableUpdateInfo, ToCEntry, ToCEntryType } from './table-of-contents-entry'; import { DragulaService } from 'ng2-dragula'; -import { FormArray } from '@angular/forms'; +import { UntypedFormArray } from '@angular/forms'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { TranslateService } from '@ngx-translate/core'; import { ContentObserver } from '@angular/cdk/observers'; @@ -119,7 +119,7 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn } //check if target container has no sections - if((targetContainer.form.get('sections') as FormArray).length){ + if((targetContainer.form.get('sections') as UntypedFormArray).length){ // const message = 'Cannot have inputs and sections on the same level'; const message = this.language.instant('DATASET-PROFILE-EDITOR.STEPS.FORM.TABLE-OF-CONTENTS.ERROR-MESSAGES.INPUT-SECTION-SAME-LEVEL'); this.notifyUser(message); @@ -129,8 +129,8 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn } const fieldsetForm = element.form; - const targetFieldsets = targetContainer.form.get('fieldSets') as FormArray; - const sourceFieldsets = sourceContainer.form.get('fieldSets') as FormArray; + const targetFieldsets = targetContainer.form.get('fieldSets') as UntypedFormArray; + const sourceFieldsets = sourceContainer.form.get('fieldSets') as UntypedFormArray; if(!targetFieldsets){ console.info('Not target fieldsets container found'); @@ -197,7 +197,7 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn case ToCEntryType.Section:{ if(targetContainer.type == ToCEntryType.Section){ - if((targetContainer.form.get('fieldSets')as FormArray).length){ + if((targetContainer.form.get('fieldSets')as UntypedFormArray).length){ // const message = 'Cannot have inputs and sections on the same level'; const message = this.language.instant('DATASET-PROFILE-EDITOR.STEPS.FORM.TABLE-OF-CONTENTS.ERROR-MESSAGES.INPUT-SECTION-SAME-LEVEL');; this.notifyUser(message); @@ -206,9 +206,9 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn return; } - const targetSections = targetContainer.form.get('sections') as FormArray; + const targetSections = targetContainer.form.get('sections') as UntypedFormArray; const elementSectionForm = element.form; - const sourceSections = elementSectionForm.parent as FormArray; + const sourceSections = elementSectionForm.parent as UntypedFormArray; if(!(targetSections && sourceSections && elementSectionForm)){ console.info('Could not load sections'); @@ -269,7 +269,7 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn const rootform = targetContainer.form.root; const sectionForm = element.form; - const parentSections = sectionForm.parent as FormArray; + const parentSections = sectionForm.parent as UntypedFormArray; let parentIndex = -1; parentSections.controls.forEach((section,i )=>{ @@ -301,7 +301,7 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn position = targetContainer.subEntries.length; } //populate sections - const targetSectionsArray = rootform.get('sections') as FormArray; + const targetSectionsArray = rootform.get('sections') as UntypedFormArray; if(sibling && sibling.id){ @@ -364,7 +364,7 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn } - const pages = rootForm.get('pages') as FormArray; + const pages = rootForm.get('pages') as UntypedFormArray; const pageForm = element.form; let index = -1; diff --git a/dmp-frontend/src/app/ui/admin/description-types/editor/description-type-editor.component.ts b/dmp-frontend/src/app/ui/admin/description-types/editor/description-type-editor.component.ts index b7f045d96..7709061c9 100644 --- a/dmp-frontend/src/app/ui/admin/description-types/editor/description-type-editor.component.ts +++ b/dmp-frontend/src/app/ui/admin/description-types/editor/description-type-editor.component.ts @@ -1,5 +1,5 @@ import { AfterViewInit, Component, OnInit } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; import { ActivatedRoute, ParamMap, Router } from '@angular/router'; import { DescriptionTemplateTypeStatus } from '@app/core/common/enum/description-template-type-status'; import { DescriptionTemplateType } from '@app/core/model/description-template-type/description-template-type'; @@ -20,7 +20,7 @@ import { takeUntil } from 'rxjs/operators'; }) export class DescriptionTypeEditorComponent extends BaseComponent implements OnInit { - formGroup: FormGroup = null; + formGroup: UntypedFormGroup = null; descriptionTypeModel: DescriptionTypeEditorModel; isNew = true; @@ -142,9 +142,9 @@ export class DescriptionTypeEditorModel { return this; } - buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { + buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup { if (context == null) { context = this.createValidationContext(); } - const formGroup = new FormBuilder().group({ + const formGroup = new UntypedFormBuilder().group({ id: [this.id], name: [{ value: this.name, disabled: disabled }, context.getValidation('name').validators], status: [{ value: this.status, disabled: disabled }, context.getValidation('status').validators] diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/dmp-profile.module.ts b/dmp-frontend/src/app/ui/admin/dmp-profile/dmp-profile.module.ts index b4b9496af..565095377 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/dmp-profile.module.ts +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/dmp-profile.module.ts @@ -14,25 +14,22 @@ import { DragDropModule } from '@angular/cdk/drag-drop'; import { AutoCompleteModule } from "@app/library/auto-complete/auto-complete.module"; @NgModule({ - imports: [ - CommonUiModule, - CommonFormsModule, - UrlListingModule, - ConfirmationDialogModule, - DmpProfileRoutingModule, - NgxDropzoneModule, - DragDropModule, - AutoCompleteModule - ], - declarations: [ - DmpProfileEditorComponent, - DmpProfileListingComponent, - DmpProfileCriteriaComponent, - DialodConfirmationUploadDmpProfiles, - DmpProfileExternalAutocompleteFieldEditorComponent - ], - entryComponents: [ - DialodConfirmationUploadDmpProfiles - ] + imports: [ + CommonUiModule, + CommonFormsModule, + UrlListingModule, + ConfirmationDialogModule, + DmpProfileRoutingModule, + NgxDropzoneModule, + DragDropModule, + AutoCompleteModule + ], + declarations: [ + DmpProfileEditorComponent, + DmpProfileListingComponent, + DmpProfileCriteriaComponent, + DialodConfirmationUploadDmpProfiles, + DmpProfileExternalAutocompleteFieldEditorComponent + ] }) export class DmpProfileModule { } diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-blueprint-editor.model.ts b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-blueprint-editor.model.ts index bda17b1b1..7ceef0376 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-blueprint-editor.model.ts +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-blueprint-editor.model.ts @@ -1,4 +1,4 @@ -import { FormBuilder, FormGroup, Validators } from "@angular/forms"; +import { UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms"; import { DescriptionTemplatesInSection, DmpBlueprint, DmpBlueprintDefinition, FieldCategory, FieldInSection, SectionDmpBlueprint } from "@app/core/model/dmp/dmp-blueprint/dmp-blueprint"; import { BackendErrorValidator } from "@common/forms/validation/custom-validator"; import { ValidationErrorModel } from "@common/forms/validation/error-model/validation-error-model"; @@ -23,9 +23,9 @@ export class DmpBlueprintEditor { return this; } - buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { + buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup { if (context == null) { context = this.createValidationContext(); } - const formGroup = new FormBuilder().group({ + const formGroup = new UntypedFormBuilder().group({ id: [{ value: this.id, disabled: disabled }, context.getValidation('id')], label: [{ value: this.label, disabled: disabled }, context.getValidation('label')], status: [{ value: this.status, disabled: disabled }, context.getValidation('status')], @@ -58,12 +58,12 @@ export class DmpBlueprintDefinitionEditor { return this; } - buildForm(): FormGroup { - const formBuilder = new FormBuilder(); + buildForm(): UntypedFormGroup { + const formBuilder = new UntypedFormBuilder(); const formGroup = formBuilder.group({}); - const sectionsFormArray = new Array(); + const sectionsFormArray = new Array(); this.sections.forEach(item => { - const form: FormGroup = item.buildForm(); + const form: UntypedFormGroup = item.buildForm(); sectionsFormArray.push(form); }); formGroup.addControl('sections', formBuilder.array(sectionsFormArray)); @@ -92,25 +92,25 @@ export class SectionDmpBlueprintEditor { return this; } - buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { + buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup { if (context == null) { context = this.createValidationContext(); } - const formGroup = new FormBuilder().group({ + const formGroup = new UntypedFormBuilder().group({ id: [{ value: this.id, disabled: disabled }, context.getValidation('id')], label: [{ value: this.label, disabled: disabled }, context.getValidation('label')], description: [{ value: this.description, disabled: disabled }, context.getValidation('description')], ordinal: [{ value: this.ordinal, disabled: disabled }, context.getValidation('ordinal')], hasTemplates: [{ value: this.hasTemplates, disabled: disabled }, context.getValidation('hasTemplates')] }); - const formBuilder = new FormBuilder(); - const fieldsFormArray = new Array(); + const formBuilder = new UntypedFormBuilder(); + const fieldsFormArray = new Array(); this.fields.forEach(item => { - const form: FormGroup = item.buildForm(); + const form: UntypedFormGroup = item.buildForm(); fieldsFormArray.push(form); }); formGroup.addControl('fields', formBuilder.array(fieldsFormArray)); - const descriptionTemplatesFormArray = new Array(); + const descriptionTemplatesFormArray = new Array(); this.descriptionTemplates.forEach(item => { - const form: FormGroup = item.buildForm(); + const form: UntypedFormGroup = item.buildForm(); descriptionTemplatesFormArray.push(form); }); formGroup.addControl('descriptionTemplates', formBuilder.array(descriptionTemplatesFormArray)); @@ -152,9 +152,9 @@ export class FieldInSectionEditor { return this; } - buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { + buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup { if (context == null) { context = this.createValidationContext(); } - const formGroup = new FormBuilder().group({ + const formGroup = new UntypedFormBuilder().group({ id: [{ value: this.id, disabled: disabled }, context.getValidation('id')], category: [{ value: this.category, disabled: disabled }, context.getValidation('category')], type: [{ value: this.type, disabled: disabled }, context.getValidation('type')], @@ -198,9 +198,9 @@ export class DescriptionTemplatesInSectionEditor { return this; } - buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { + buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup { if (context == null) { context = this.createValidationContext(); } - const formGroup = new FormBuilder().group({ + const formGroup = new UntypedFormBuilder().group({ id: [{ value: this.id, disabled: disabled }, context.getValidation('id')], descriptionTemplateId: [{ value: this.descriptionTemplateId, disabled: disabled }, context.getValidation('descriptionTemplateId')], label: [{ value: this.label, disabled: disabled }, context.getValidation('label')], diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.ts b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.ts index 8b9261578..bb0a2d8a0 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.ts +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.ts @@ -1,6 +1,6 @@ import { AfterViewInit, Component, ViewChild } from '@angular/core'; -import { FormArray, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { UntypedFormArray, UntypedFormBuilder, FormControl, UntypedFormGroup, Validators } from '@angular/forms'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { DmpProfileFieldDataType } from '@app/core/common/enum/dmp-profile-field-type'; import { DmpProfileStatus } from '@app/core/common/enum/dmp-profile-status'; @@ -53,12 +53,12 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie viewOnly = false; dmpProfileModel: DmpProfileEditorModel; dmpBlueprintModel: DmpBlueprintEditor; - formGroup: FormGroup = null; + formGroup: UntypedFormGroup = null; host: string; dmpProfileId: string; breadCrumbs: Observable; - dmpBlueprintsFormGroup: FormGroup = null; + dmpBlueprintsFormGroup: UntypedFormGroup = null; profilesAutoCompleteConfiguration: MultipleAutoCompleteConfiguration; @@ -87,7 +87,7 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie private enumUtils: EnumUtils, private uiNotificationService: UiNotificationService, private formService: FormService, - private fb: FormBuilder, + private fb: UntypedFormBuilder, private configurationService: ConfigurationService, private httpClient: HttpClient, private matomoService: MatomoService, @@ -206,9 +206,9 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie return this._service.searchDMPProfiles(request); } - sectionsArray(): FormArray { + sectionsArray(): UntypedFormArray { //return this.dmpBlueprintsFormGroup.get('sections') as FormArray; - return this.formGroup.get('definition').get('sections') as FormArray; + return this.formGroup.get('definition').get('sections') as UntypedFormArray; } addSection(): void { @@ -228,8 +228,8 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie }); } - fieldsArray(sectionIndex: number): FormArray { - return this.sectionsArray().at(sectionIndex).get('fields') as FormArray; + fieldsArray(sectionIndex: number): UntypedFormArray { + return this.sectionsArray().at(sectionIndex).get('fields') as UntypedFormArray; } addField(sectionIndex: number, fieldCategory: FieldCategory, fieldType?: number): void { @@ -248,11 +248,11 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie this.fieldsArray(sectionIndex).removeAt(fieldIndex); } - systemFieldsArray(sectionIndex: number): FormArray { - return this.sectionsArray().at(sectionIndex).get('systemFields') as FormArray; + systemFieldsArray(sectionIndex: number): UntypedFormArray { + return this.sectionsArray().at(sectionIndex).get('systemFields') as UntypedFormArray; } - initSystemField(systemField?: SystemFieldType): FormGroup { + initSystemField(systemField?: SystemFieldType): UntypedFormGroup { return this.fb.group({ id: this.fb.control(Guid.create().toString()), type: this.fb.control(systemField), @@ -317,8 +317,8 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie } } - descriptionTemplatesArray(sectionIndex: number): FormArray { - return this.sectionsArray().at(sectionIndex).get('descriptionTemplates') as FormArray; + descriptionTemplatesArray(sectionIndex: number): UntypedFormArray { + return this.sectionsArray().at(sectionIndex).get('descriptionTemplates') as UntypedFormArray; } addDescriptionTemplate(descriptionTemplate, sectionIndex: number): void { @@ -331,8 +331,8 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie this.descriptionTemplatesArray(sectionIndex).removeAt(templateIndex); } - extraFieldsArray(sectionIndex: number): FormArray { - return this.sectionsArray().at(sectionIndex).get('extraFields') as FormArray; + extraFieldsArray(sectionIndex: number): UntypedFormArray { + return this.sectionsArray().at(sectionIndex).get('extraFields') as UntypedFormArray; } addExtraField(sectionIndex: number): void { @@ -372,7 +372,7 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie }); } - moveItemInFormArray(formArray: FormArray, fromIndex: number, toIndex: number): void { + moveItemInFormArray(formArray: UntypedFormArray, fromIndex: number, toIndex: number): void { const dir = toIndex > fromIndex ? 1 : -1; const item = formArray.at(fromIndex); @@ -638,7 +638,7 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie return filename; } - isExternalAutocomplete(formGroup: FormGroup) { + isExternalAutocomplete(formGroup: UntypedFormGroup) { if (formGroup.get('dataType').value == DmpProfileFieldDataType.ExternalAutocomplete) { this.addControl(formGroup); return true; @@ -648,12 +648,12 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie } } - addControl(formGroup: FormGroup) { + addControl(formGroup: UntypedFormGroup) { if (formGroup.get('dataType').value == 3) formGroup.addControl('externalAutocomplete', new DmpProfileExternalAutoCompleteFieldDataEditorModel().buildForm()); } - removeControl(formGroup: FormGroup) { + removeControl(formGroup: UntypedFormGroup) { if (formGroup.get('dataType').value != 3) formGroup.removeControl('externalAutocomplete'); } diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.model.ts b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.model.ts index aa8b71b81..8270f7e89 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.model.ts +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.model.ts @@ -1,4 +1,4 @@ -import { FormBuilder, FormGroup } from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { DmpProfileFieldDataType } from '@app/core/common/enum/dmp-profile-field-type'; import { DmpProfileType } from '@app/core/common/enum/dmp-profile-type'; import { DmpProfile, DmpProfileDefinition } from '@app/core/model/dmp-profile/dmp-profile'; @@ -26,8 +26,8 @@ export class DmpProfileEditorModel { return this; } - buildForm(): FormGroup { - const formGroup = new FormBuilder().group({ + buildForm(): UntypedFormGroup { + const formGroup = new UntypedFormBuilder().group({ id: [this.id], label: [this.label], status: [this.status], @@ -48,12 +48,12 @@ export class DmpProfileDefinitionEditorModel { return this; } - buildForm(): FormGroup { - const formBuilder = new FormBuilder(); + buildForm(): UntypedFormGroup { + const formBuilder = new UntypedFormBuilder(); const formGroup = formBuilder.group({}); - const fieldsFormArray = new Array(); + const fieldsFormArray = new Array(); this.fields.forEach(item => { - const form: FormGroup = item.buildForm(); + const form: UntypedFormGroup = item.buildForm(); fieldsFormArray.push(form); }); formGroup.addControl('fields', formBuilder.array(fieldsFormArray)); @@ -82,8 +82,8 @@ export class DmpProfileFieldEditorModel { return this; } - buildForm(): FormGroup { - const formGroup = new FormBuilder().group({ + buildForm(): UntypedFormGroup { + const formGroup = new UntypedFormBuilder().group({ type: [this.type], id: [this.id], dataType: [this.dataType], diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/external-autocomplete/dmp-profile-external-autocomplete-field-editor.component.ts b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/external-autocomplete/dmp-profile-external-autocomplete-field-editor.component.ts index 00f70eb79..4cf02ad06 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/external-autocomplete/dmp-profile-external-autocomplete-field-editor.component.ts +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/external-autocomplete/dmp-profile-external-autocomplete-field-editor.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { DmpProfileExternalAutoCompleteFieldDataEditorModel } from './dmp-profile-external-autocomplete-field-editor.model'; @Component({ @@ -9,7 +9,7 @@ import { DmpProfileExternalAutoCompleteFieldDataEditorModel } from './dmp-profil }) export class DmpProfileExternalAutocompleteFieldEditorComponent implements OnInit { - @Input() form: FormGroup + @Input() form: UntypedFormGroup private externalAutocomplete: DmpProfileExternalAutoCompleteFieldDataEditorModel; ngOnInit() { diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/external-autocomplete/dmp-profile-external-autocomplete-field-editor.model.ts b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/external-autocomplete/dmp-profile-external-autocomplete-field-editor.model.ts index 64a9ee437..9aafc1506 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/external-autocomplete/dmp-profile-external-autocomplete-field-editor.model.ts +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/external-autocomplete/dmp-profile-external-autocomplete-field-editor.model.ts @@ -1,4 +1,4 @@ -import { FormGroup, FormBuilder } from "@angular/forms"; +import { UntypedFormGroup, UntypedFormBuilder } from "@angular/forms"; import { DmpProfileExternalAutoCompleteField } from "../../../../../core/model/dmp-profile/dmp-profile-external-autocomplete"; export class DmpProfileExternalAutoCompleteFieldDataEditorModel { @@ -9,8 +9,8 @@ export class DmpProfileExternalAutoCompleteFieldDataEditorModel { public label: string; public value: string; - buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { - const formGroup = new FormBuilder().group({ + buildForm(disabled: boolean = false, skipDisable: Array = []): UntypedFormGroup { + const formGroup = new UntypedFormBuilder().group({ url: [{ value: this.url, disabled: (disabled && !skipDisable.includes('DmpProfileExternalAutoCompleteFieldDataEditorModel.url')) }], optionsRoot: [{ value: this.optionsRoot, disabled: (disabled && !skipDisable.includes('DmpProfileExternalAutoCompleteFieldDataEditorModel.optionsRoot')) }], multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('DmpProfileExternalAutoCompleteFieldDataEditorModel.multiAutoComplete')) }], diff --git a/dmp-frontend/src/app/ui/admin/user/listing/criteria/user-criteria.component.ts b/dmp-frontend/src/app/ui/admin/user/listing/criteria/user-criteria.component.ts index 5431debc9..b93b03e31 100644 --- a/dmp-frontend/src/app/ui/admin/user/listing/criteria/user-criteria.component.ts +++ b/dmp-frontend/src/app/ui/admin/user/listing/criteria/user-criteria.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { FormBuilder, FormGroup } from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { AppRole } from '@app/core/common/enum/app-role'; import { UserCriteria } from '@app/core/query/user/user-criteria'; import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; @@ -18,7 +18,7 @@ export class UserCriteriaComponent extends BaseCriteriaComponent implements OnIn public criteria: UserCriteria = new UserCriteria(); constructor( - private formBuilder: FormBuilder, + private formBuilder: UntypedFormBuilder, public enumUtils: EnumUtils ) { super(new ValidationErrorModel()); @@ -49,7 +49,7 @@ export class UserCriteriaComponent extends BaseCriteriaComponent implements OnIn return this.criteria; } - buildForm(): FormGroup { + buildForm(): UntypedFormGroup { return this.formBuilder.group({ like: [this.criteria.label, []], appRoles: [this.criteria.appRoles, []], diff --git a/dmp-frontend/src/app/ui/admin/user/listing/role-editor/user-role-editor.component.ts b/dmp-frontend/src/app/ui/admin/user/listing/role-editor/user-role-editor.component.ts index 1e1c7a10f..7954a6603 100644 --- a/dmp-frontend/src/app/ui/admin/user/listing/role-editor/user-role-editor.component.ts +++ b/dmp-frontend/src/app/ui/admin/user/listing/role-editor/user-role-editor.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { AbstractControl, FormArray, FormBuilder, FormControl, FormGroup } from '@angular/forms'; +import { AbstractControl, UntypedFormArray, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; import { AppRole } from '@app/core/common/enum/app-role'; import { UserListingModel } from '@app/core/model/user/user-listing'; import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service'; @@ -18,13 +18,13 @@ import { takeUntil } from 'rxjs/operators'; export class UserRoleEditorComponent extends BaseComponent implements OnInit { @Input() public item: UserListingModel; - public formGroup: FormGroup = null; + public formGroup: UntypedFormGroup = null; public nowEditing = false; constructor( private language: TranslateService, private userService: UserService, - private formBuilder: FormBuilder, + private formBuilder: UntypedFormBuilder, private enumUtils: EnumUtils, private uiNotificationService: UiNotificationService ) { super(); } @@ -33,11 +33,11 @@ export class UserRoleEditorComponent extends BaseComponent implements OnInit { if (this.formGroup == null) { this.formGroup = this.buildForm(); } } - buildForm(): FormGroup { + buildForm(): UntypedFormGroup { const context: ValidationContext = this.createValidationContext(); return this.formBuilder.group({ - appRoles: new FormControl({ value: this.item.appRoles, disabled: true }, context.getValidation('appRoles').validators) + appRoles: new UntypedFormControl({ value: this.item.appRoles, disabled: true }, context.getValidation('appRoles').validators) }); } @@ -85,14 +85,14 @@ export class UserRoleEditorComponent extends BaseComponent implements OnInit { } validateAllFormFields(formControl: AbstractControl) { - if (formControl instanceof FormControl) { + if (formControl instanceof UntypedFormControl) { formControl.updateValueAndValidity({ emitEvent: false }); - } else if (formControl instanceof FormGroup) { + } else if (formControl instanceof UntypedFormGroup) { Object.keys(formControl.controls).forEach(item => { const control = formControl.get(item); this.validateAllFormFields(control); }); - } else if (formControl instanceof FormArray) { + } else if (formControl instanceof UntypedFormArray) { formControl.controls.forEach(item => { this.validateAllFormFields(item); }); @@ -100,14 +100,14 @@ export class UserRoleEditorComponent extends BaseComponent implements OnInit { } touchAllFormFields(formControl: AbstractControl) { - if (formControl instanceof FormControl) { + if (formControl instanceof UntypedFormControl) { formControl.markAsTouched(); - } else if (formControl instanceof FormGroup) { + } else if (formControl instanceof UntypedFormGroup) { Object.keys(formControl.controls).forEach(item => { const control = formControl.get(item); this.touchAllFormFields(control); }); - } else if (formControl instanceof FormArray) { + } else if (formControl instanceof UntypedFormArray) { formControl.controls.forEach(item => { this.touchAllFormFields(item); }); diff --git a/dmp-frontend/src/app/ui/auth/login/email-confirmation/email-confirmation.component.ts b/dmp-frontend/src/app/ui/auth/login/email-confirmation/email-confirmation.component.ts index 317f563fb..ae92d1208 100644 --- a/dmp-frontend/src/app/ui/auth/login/email-confirmation/email-confirmation.component.ts +++ b/dmp-frontend/src/app/ui/auth/login/email-confirmation/email-confirmation.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from "@angular/core"; -import { FormControl } from '@angular/forms'; +import { UntypedFormControl } from '@angular/forms'; import { ActivatedRoute, Router } from "@angular/router"; import { EmailConfirmationService } from '@app/core/services/email-confirmation/email-confirmation.service'; import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service'; @@ -13,7 +13,7 @@ import { takeUntil } from "rxjs/operators"; }) export class EmailConfirmation extends BaseComponent implements OnInit { - public emailFormControl = new FormControl(''); + public emailFormControl = new UntypedFormControl(''); public showForm: boolean = false; public mailSent: boolean = false; diff --git a/dmp-frontend/src/app/ui/auth/login/login.component.ts b/dmp-frontend/src/app/ui/auth/login/login.component.ts index 17ed6d2ac..16804379c 100644 --- a/dmp-frontend/src/app/ui/auth/login/login.component.ts +++ b/dmp-frontend/src/app/ui/auth/login/login.component.ts @@ -13,7 +13,7 @@ import { MergeLoginService } from './utilities/merge-login.service'; import { Oauth2DialogService } from '@app/ui/misc/oauth2-dialog/service/oauth2-dialog.service'; import { HttpClient, HttpHeaders } from '@angular/common/http'; import { BehaviorSubject } from 'rxjs'; -import { FormControl } from '@angular/forms'; +import { UntypedFormControl } from '@angular/forms'; import { OrcidUser } from '@app/core/model/orcid/orcidUser'; import { ZenodoToken } from '@app/core/model/zenodo/zenodo-token.model'; import { LoginInfo } from '@app/core/model/auth/login-info'; @@ -38,7 +38,7 @@ export class LoginComponent extends BaseComponent implements OnInit, AfterViewIn public auth2: any; private returnUrl: string; private twitterUrl = new BehaviorSubject(undefined); - private emailFormControl = new FormControl(''); + private emailFormControl = new UntypedFormControl(''); private orcidUser: OrcidUser; private zenodoToken: ZenodoToken; private accessToken: string; diff --git a/dmp-frontend/src/app/ui/auth/login/merge-email-confirmation/merge-email-confirmation.component.ts b/dmp-frontend/src/app/ui/auth/login/merge-email-confirmation/merge-email-confirmation.component.ts index dbff4c3d4..209507f5b 100644 --- a/dmp-frontend/src/app/ui/auth/login/merge-email-confirmation/merge-email-confirmation.component.ts +++ b/dmp-frontend/src/app/ui/auth/login/merge-email-confirmation/merge-email-confirmation.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from "@angular/core"; -import { FormControl } from '@angular/forms'; +import { UntypedFormControl } from '@angular/forms'; import { ActivatedRoute, Router } from "@angular/router"; import { AuthService } from "@app/core/services/auth/auth.service"; import { EmailConfirmationService } from '@app/core/services/email-confirmation/email-confirmation.service'; @@ -15,7 +15,7 @@ import { takeUntil } from "rxjs/operators"; }) export class MergeEmailConfirmation extends BaseComponent implements OnInit { - public emailFormControl = new FormControl(''); + public emailFormControl = new UntypedFormControl(''); public showForm: boolean = false; public mailSent: boolean = false; diff --git a/dmp-frontend/src/app/ui/auth/login/orcid-login/orcid-login.component.ts b/dmp-frontend/src/app/ui/auth/login/orcid-login/orcid-login.component.ts index fc477826b..a797b416a 100644 --- a/dmp-frontend/src/app/ui/auth/login/orcid-login/orcid-login.component.ts +++ b/dmp-frontend/src/app/ui/auth/login/orcid-login/orcid-login.component.ts @@ -1,6 +1,6 @@ import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Component, OnInit } from '@angular/core'; -import { FormControl } from '@angular/forms'; +import { UntypedFormControl } from '@angular/forms'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { AuthProvider } from '@app/core/common/enum/auth-provider'; import { OrcidUser } from '@app/core/model/orcid/orcidUser'; @@ -21,7 +21,7 @@ export class OrcidLoginComponent extends BaseComponent implements OnInit { private returnUrl: string; private orcidUser: OrcidUser private accessToken: string; - private emailFormControl = new FormControl(''); + private emailFormControl = new UntypedFormControl(''); constructor( private route: ActivatedRoute, diff --git a/dmp-frontend/src/app/ui/auth/login/twitter-login/twitter-login.component.ts b/dmp-frontend/src/app/ui/auth/login/twitter-login/twitter-login.component.ts index 56f2a61ea..88df71c19 100644 --- a/dmp-frontend/src/app/ui/auth/login/twitter-login/twitter-login.component.ts +++ b/dmp-frontend/src/app/ui/auth/login/twitter-login/twitter-login.component.ts @@ -9,7 +9,7 @@ import { BaseComponent } from '@common/base/base.component'; import { environment } from 'environments/environment'; import { takeUntil } from 'rxjs/operators'; import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; -import { FormControl } from '@angular/forms'; +import { UntypedFormControl } from '@angular/forms'; import { stringify } from 'querystring'; @Component({ @@ -19,7 +19,7 @@ import { stringify } from 'querystring'; export class TwitterLoginComponent extends BaseComponent implements OnInit { private returnUrl: string; - private emailFormControl = new FormControl(''); + private emailFormControl = new UntypedFormControl(''); constructor( private route: ActivatedRoute, diff --git a/dmp-frontend/src/app/ui/auth/login/zenodo-login/zenodo-login.component.ts b/dmp-frontend/src/app/ui/auth/login/zenodo-login/zenodo-login.component.ts index 17a260e1d..688d9872d 100644 --- a/dmp-frontend/src/app/ui/auth/login/zenodo-login/zenodo-login.component.ts +++ b/dmp-frontend/src/app/ui/auth/login/zenodo-login/zenodo-login.component.ts @@ -1,6 +1,6 @@ import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Component, OnInit } from '@angular/core'; -import { FormControl } from '@angular/forms'; +import { UntypedFormControl } from '@angular/forms'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { AuthProvider } from '@app/core/common/enum/auth-provider'; import { OrcidUser } from '@app/core/model/orcid/orcidUser'; @@ -22,7 +22,7 @@ export class ZenodoLoginComponent extends BaseComponent implements OnInit { private returnUrl: string; private zenodoToken: ZenodoToken private accessToken: string; - private emailFormControl = new FormControl(''); + private emailFormControl = new UntypedFormControl(''); constructor( private route: ActivatedRoute, diff --git a/dmp-frontend/src/app/ui/contact/contact-content/contact-content.component.ts b/dmp-frontend/src/app/ui/contact/contact-content/contact-content.component.ts index 21b4ad874..71f6531d3 100644 --- a/dmp-frontend/src/app/ui/contact/contact-content/contact-content.component.ts +++ b/dmp-frontend/src/app/ui/contact/contact-content/contact-content.component.ts @@ -1,6 +1,6 @@ import { Location } from '@angular/common'; import { Component, Input, OnInit } from '@angular/core'; -import { AbstractControl, FormArray, FormControl, FormGroup } from '@angular/forms'; +import { AbstractControl, FormArray, FormControl, UntypedFormGroup } from '@angular/forms'; import { ContactEmailFormModel } from '@app/core/model/contact/contact-email-form-model'; import { ContactSupportService } from '@app/core/services/contact-support/contact-support.service'; import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service'; @@ -20,9 +20,9 @@ import { HttpClient } from '@angular/common/http'; export class ContactContentComponent extends BaseComponent implements OnInit { @Input() isDialog: boolean; - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; private contactEmailFormModel: ContactEmailFormModel; - public formGroup: FormGroup; + public formGroup: UntypedFormGroup; constructor( private contactSupportService: ContactSupportService, diff --git a/dmp-frontend/src/app/ui/contact/contact.module.ts b/dmp-frontend/src/app/ui/contact/contact.module.ts index ce8dc2912..e5cce00f7 100644 --- a/dmp-frontend/src/app/ui/contact/contact.module.ts +++ b/dmp-frontend/src/app/ui/contact/contact.module.ts @@ -6,21 +6,17 @@ import { ContactRoutingModule } from '@app/ui/contact/contact.routing'; import { CommonUiModule } from '@common/ui/common-ui.module'; @NgModule({ - imports: [ - CommonUiModule, - ContactRoutingModule, - ReactiveFormsModule - ], - declarations: [ - ContactContentComponent, - ContactDialogComponent - ], - entryComponents: [ - ContactContentComponent, - ContactDialogComponent - ], - exports: [ - ContactDialogComponent - ] + imports: [ + CommonUiModule, + ContactRoutingModule, + ReactiveFormsModule + ], + declarations: [ + ContactContentComponent, + ContactDialogComponent + ], + exports: [ + ContactDialogComponent + ] }) export class ContactModule { } diff --git a/dmp-frontend/src/app/ui/dashboard/dashboard.component.ts b/dmp-frontend/src/app/ui/dashboard/dashboard.component.ts index 9897d725a..250fbd3ab 100644 --- a/dmp-frontend/src/app/ui/dashboard/dashboard.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/dashboard.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; -import { FormControl } from '@angular/forms'; +import { UntypedFormControl } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; import { RecentActivityType } from '@app/core/common/enum/recent-activity-type'; import { DashboardStatisticsModel } from '@app/core/model/dashboard/dashboard-statistics-model'; @@ -54,9 +54,9 @@ export class DashboardComponent extends BaseComponent implements OnInit, IBreadC dmpActivities: any[]; organisationActivities: any[]; public dashboardStatisticsData: DashboardStatisticsModel; - public formControl = new FormControl(); + public formControl = new UntypedFormControl(); grantAutoCompleteConfiguration: SingleAutoCompleteConfiguration; - public searchControl = new FormControl(); + public searchControl = new UntypedFormControl(); filteredOptions: Observable; recentActivityTypeEnum = RecentActivityType; public search = false; diff --git a/dmp-frontend/src/app/ui/dashboard/dashboard.module.ts b/dmp-frontend/src/app/ui/dashboard/dashboard.module.ts index 6f4217527..f5db07c30 100644 --- a/dmp-frontend/src/app/ui/dashboard/dashboard.module.ts +++ b/dmp-frontend/src/app/ui/dashboard/dashboard.module.ts @@ -21,33 +21,30 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormattingModule } from '@app/core/formatting.module'; @NgModule({ - imports: [ - CommonUiModule, - FormattingModule, - DashboardRoutingModule, - ExportMethodDialogModule, - ConfirmationDialogModule, - DatasetCopyDialogModule, - FormsModule, - ReactiveFormsModule - ], - declarations: [ - DashboardComponent, - RecentActivityComponent, - CardComponent, - QuickWizardCreateAdd, - WizardComponent, - InfoCounterComponent, - RecentVisitedActivityComponent, - RecentEditedActivityComponent, - DraftsComponent, - DmpInfoCounterComponent, - DatasetInfoCounterComponent, - RecentEditedDatasetActivityComponent, - RecentEditedDmpActivityComponent - ], - entryComponents: [ - QuickWizardCreateAdd - ] + imports: [ + CommonUiModule, + FormattingModule, + DashboardRoutingModule, + ExportMethodDialogModule, + ConfirmationDialogModule, + DatasetCopyDialogModule, + FormsModule, + ReactiveFormsModule + ], + declarations: [ + DashboardComponent, + RecentActivityComponent, + CardComponent, + QuickWizardCreateAdd, + WizardComponent, + InfoCounterComponent, + RecentVisitedActivityComponent, + RecentEditedActivityComponent, + DraftsComponent, + DmpInfoCounterComponent, + DatasetInfoCounterComponent, + RecentEditedDatasetActivityComponent, + RecentEditedDmpActivityComponent + ] }) export class DashboardModule { } diff --git a/dmp-frontend/src/app/ui/dashboard/dataset-info-counter/dataset-info-counter.component.spec.ts b/dmp-frontend/src/app/ui/dashboard/dataset-info-counter/dataset-info-counter.component.spec.ts index 93f146d49..a95cf5c28 100644 --- a/dmp-frontend/src/app/ui/dashboard/dataset-info-counter/dataset-info-counter.component.spec.ts +++ b/dmp-frontend/src/app/ui/dashboard/dataset-info-counter/dataset-info-counter.component.spec.ts @@ -8,8 +8,9 @@ describe('DatasetInfoCounterComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ DatasetInfoCounterComponent ] - }) + declarations: [DatasetInfoCounterComponent], + teardown: { destroyAfterEach: false } +}) .compileComponents(); })); diff --git a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts index 8ff1a60e6..8ac0c8947 100644 --- a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts @@ -12,7 +12,7 @@ import { TranslateService } from '@ngx-translate/core'; import {debounceTime, map, takeUntil} from 'rxjs/operators'; import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component'; import { DatasetCopyDialogueComponent } from '@app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component'; -import {FormControl, FormBuilder, FormGroup} from '@angular/forms'; +import {UntypedFormControl, UntypedFormBuilder, UntypedFormGroup} from '@angular/forms'; import { BaseComponent } from '@common/base/base.component'; import { MatDialog } from '@angular/material/dialog'; import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service'; @@ -66,11 +66,11 @@ export class DraftsComponent extends BaseComponent implements OnInit { datasetOffset: number = 0; offsetLess: number = 0; pageSize: number = 5; - dmpFormGroup: FormGroup; + dmpFormGroup: UntypedFormGroup; hasMoreActivity:boolean = true; - public formGroup = new FormBuilder().group({ - like: new FormControl(), - order: new FormControl() + public formGroup = new UntypedFormBuilder().group({ + like: new UntypedFormControl(), + order: new UntypedFormControl() }); publicMode = false; @@ -610,7 +610,7 @@ export class DraftsComponent extends BaseComponent implements OnInit { } openDmpSearchDialogue(dataset: RecentDatasetModel) { - const formControl = new FormControl(); + const formControl = new UntypedFormControl(); const dialogRef = this.dialog.open(DatasetCopyDialogueComponent, { width: '500px', restoreFocus: false, diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts index 3df35983b..0cd7ca4fc 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts @@ -27,7 +27,7 @@ import { RecentDmpModel } from '@app/core/model/recent-activity/recent-dmp-activ import { RecentDatasetModel } from '@app/core/model/recent-activity/recent-dataset-activity.model'; import { UserInfoListingModel } from '@app/core/model/user/user-info-listing'; import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service'; -import { FormControl, FormBuilder, FormGroup } from '@angular/forms'; +import { UntypedFormControl, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { DatasetCopyDialogueComponent } from '@app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component'; import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order'; import { Location } from '@angular/common'; @@ -66,11 +66,11 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn datasetOffset: number = 0; offsetLess: number = 0; pageSize: number = 5; - dmpFormGroup: FormGroup; + dmpFormGroup: UntypedFormGroup; hasMoreActivity:boolean = true; - public formGroup = new FormBuilder().group({ - like: new FormControl(), - order: new FormControl() + public formGroup = new UntypedFormBuilder().group({ + like: new UntypedFormControl(), + order: new UntypedFormControl() }); publicMode = false; @@ -685,7 +685,7 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn } openDmpSearchDialogue(dataset: RecentDatasetModel) { - const formControl = new FormControl(); + const formControl = new UntypedFormControl(); const dialogRef = this.dialog.open(DatasetCopyDialogueComponent, { width: '500px', restoreFocus: false, diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.ts b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.ts index e33f46266..35f7fc046 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.ts @@ -8,7 +8,7 @@ import { BaseComponent } from '@common/base/base.component'; import { Principal } from '@app/core/model/auth/principal'; import { TranslateService } from '@ngx-translate/core'; import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; -import { FormControl, FormBuilder } from '@angular/forms'; +import { UntypedFormControl, UntypedFormBuilder } from '@angular/forms'; import { DatasetCopyDialogueComponent } from '@app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component'; import { MatDialog } from '@angular/material/dialog'; import { debounceTime, takeUntil } from 'rxjs/operators'; @@ -46,9 +46,9 @@ export class RecentEditedDatasetActivityComponent extends BaseComponent implemen offsetLess: number = 0; hasMoreResults:boolean = true; pageSize: number = 5; - public formGroup = new FormBuilder().group({ - like: new FormControl(), - order: new FormControl() + public formGroup = new UntypedFormBuilder().group({ + like: new UntypedFormControl(), + order: new UntypedFormControl() }); publicMode = false; @@ -304,7 +304,7 @@ export class RecentEditedDatasetActivityComponent extends BaseComponent implemen } openDmpSearchDialogue(dataset: DatasetListingModel) { - const formControl = new FormControl(); + const formControl = new UntypedFormControl(); const dialogRef = this.dialog.open(DatasetCopyDialogueComponent, { width: '500px', restoreFocus: false, diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.ts b/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.ts index c381774f8..79506428a 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.ts @@ -20,7 +20,7 @@ import { DmpStatus } from '@app/core/common/enum/dmp-status'; import { DatasetService } from '@app/core/services/dataset/dataset.service'; import { DatasetListingModel } from '@app/core/model/dataset/dataset-listing'; import { Role } from '@app/core/common/enum/role'; -import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order'; import { Location } from '@angular/common'; import { LockService } from '@app/core/services/lock/lock.service'; @@ -60,10 +60,10 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O offsetLess: number = 0; hasMoreResults:boolean = true; pageSize: number = 5; - dmpFormGroup: FormGroup; - public formGroup = new FormBuilder().group({ - like: new FormControl(), - order: new FormControl() + dmpFormGroup: UntypedFormGroup; + public formGroup = new UntypedFormBuilder().group({ + like: new UntypedFormControl(), + order: new UntypedFormControl() }); publicMode = false; diff --git a/dmp-frontend/src/app/ui/dataset-create-wizard/dataset-create-wizard.component.ts b/dmp-frontend/src/app/ui/dataset-create-wizard/dataset-create-wizard.component.ts index 893786801..4599943a9 100644 --- a/dmp-frontend/src/app/ui/dataset-create-wizard/dataset-create-wizard.component.ts +++ b/dmp-frontend/src/app/ui/dataset-create-wizard/dataset-create-wizard.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit, ViewChild } from '@angular/core'; -import { FormArray, FormBuilder, FormGroup } from '@angular/forms'; +import { UntypedFormArray, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { MatStepper } from '@angular/material/stepper'; import { Router } from '@angular/router'; @@ -28,7 +28,7 @@ export class DatasetCreateWizard extends CheckDeactivateBaseComponent implements isLinear = false; isNew = true; isSubmitted = false; - formGroup: FormGroup; + formGroup: UntypedFormGroup; datasetCreateWizardModel: DatasetCreateWizardModel; @@ -36,7 +36,7 @@ export class DatasetCreateWizard extends CheckDeactivateBaseComponent implements constructor( private router: Router, - private formBuilder: FormBuilder, + private formBuilder: UntypedFormBuilder, public quickWizardService: QuickWizardService, public language: TranslateService, private uiNotificationService: UiNotificationService, @@ -61,8 +61,8 @@ export class DatasetCreateWizard extends CheckDeactivateBaseComponent implements } save() { - if (this.formGroup.get('datasets') && this.formGroup.get('datasets').get('datasetsList') && (this.formGroup.get('datasets').get('datasetsList') as FormArray).length > 0) { - for (let control of (this.formGroup.get('datasets').get('datasetsList') as FormArray).controls) { + if (this.formGroup.get('datasets') && this.formGroup.get('datasets').get('datasetsList') && (this.formGroup.get('datasets').get('datasetsList') as UntypedFormArray).length > 0) { + for (let control of (this.formGroup.get('datasets').get('datasetsList') as UntypedFormArray).controls) { control.get('status').setValue(DatasetStatus.Draft); } // this.onSubmitSave(); @@ -91,8 +91,8 @@ export class DatasetCreateWizard extends CheckDeactivateBaseComponent implements dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { if (result) { if (!this.isFormValid()) { return; } - if (this.formGroup.get('datasets') && this.formGroup.get('datasets').get('datasetsList') && (this.formGroup.get('datasets').get('datasetsList') as FormArray).length > 0) { - for (let control of (this.formGroup.get('datasets').get('datasetsList') as FormArray).controls) { + if (this.formGroup.get('datasets') && this.formGroup.get('datasets').get('datasetsList') && (this.formGroup.get('datasets').get('datasetsList') as UntypedFormArray).length > 0) { + for (let control of (this.formGroup.get('datasets').get('datasetsList') as UntypedFormArray).controls) { control.get('status').setValue(DatasetStatus.Finalized); } this.onSubmitSaveAndFinalize(); @@ -134,7 +134,7 @@ export class DatasetCreateWizard extends CheckDeactivateBaseComponent implements } hasDatasets() { - if ((this.formGroup.get('datasets').get('datasetsList') as FormArray).length > 0) { + if ((this.formGroup.get('datasets').get('datasetsList') as UntypedFormArray).length > 0) { return true; } else { return false; diff --git a/dmp-frontend/src/app/ui/dataset-create-wizard/dataset-create-wizard.model.ts b/dmp-frontend/src/app/ui/dataset-create-wizard/dataset-create-wizard.model.ts index 159489cbf..a331a0f01 100644 --- a/dmp-frontend/src/app/ui/dataset-create-wizard/dataset-create-wizard.model.ts +++ b/dmp-frontend/src/app/ui/dataset-create-wizard/dataset-create-wizard.model.ts @@ -1,4 +1,4 @@ -import { FormBuilder, FormGroup, Validators } from "@angular/forms"; +import { UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms"; import { DmpCreateWizardFormModel } from '@app/core/model/dmp/dmp-create-wizard/dmp-create-wizard-form.model'; import { DatasetWizardEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; import { DatasetEditorWizardModel } from '@app/ui/quick-wizard/dataset-editor/dataset-editor-wizard-model'; @@ -22,9 +22,9 @@ export class DatasetCreateWizardModel { return this; } - buildForm(context: ValidationContext = null): FormGroup { + buildForm(context: ValidationContext = null): UntypedFormGroup { if (context == null) { context = this.createValidationContext(); } - const formBuilder = new FormBuilder(); + const formBuilder = new UntypedFormBuilder(); const formGroup = formBuilder.group({ dmpMeta: new DmpCreateWizardFormModel().buildForm(), datasets: new DatasetEditorWizardModel().buildForm() diff --git a/dmp-frontend/src/app/ui/dataset-create-wizard/dataset-create-wizard.module.ts b/dmp-frontend/src/app/ui/dataset-create-wizard/dataset-create-wizard.module.ts index ae3a5c492..7bac0da77 100644 --- a/dmp-frontend/src/app/ui/dataset-create-wizard/dataset-create-wizard.module.ts +++ b/dmp-frontend/src/app/ui/dataset-create-wizard/dataset-create-wizard.module.ts @@ -14,27 +14,24 @@ import { CommonFormsModule } from '@common/forms/common-forms.module'; import { CommonUiModule } from '@common/ui/common-ui.module'; @NgModule({ - imports: [ - DatasetCreateWizardRoutingModule, - CommonUiModule, - CommonFormsModule, - AutoCompleteModule, - FormattingModule, - UrlListingModule, - ConfirmationDialogModule, - QuickWizardRoutingModule, - DatasetDescriptionFormModule, - OuickWizardModule, - - ], - declarations: [ - DatasetCreateWizard, - DatasetDmpSelector, - ], - entryComponents: [ - ], - providers: [ - CanDeactivateGuard - ] + imports: [ + DatasetCreateWizardRoutingModule, + CommonUiModule, + CommonFormsModule, + AutoCompleteModule, + FormattingModule, + UrlListingModule, + ConfirmationDialogModule, + QuickWizardRoutingModule, + DatasetDescriptionFormModule, + OuickWizardModule, + ], + declarations: [ + DatasetCreateWizard, + DatasetDmpSelector, + ], + providers: [ + CanDeactivateGuard + ] }) export class DatasetCreateWizardModule { } diff --git a/dmp-frontend/src/app/ui/dataset-create-wizard/dmp-selector/dataset-dmp-selector.component.ts b/dmp-frontend/src/app/ui/dataset-create-wizard/dmp-selector/dataset-dmp-selector.component.ts index f2600e2e7..68b3a704d 100644 --- a/dmp-frontend/src/app/ui/dataset-create-wizard/dmp-selector/dataset-dmp-selector.component.ts +++ b/dmp-frontend/src/app/ui/dataset-create-wizard/dmp-selector/dataset-dmp-selector.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormArray, FormControl, FormGroup } from '@angular/forms'; +import { UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; import { MatStepper } from '@angular/material/stepper'; import { ActivatedRoute, Router } from '@angular/router'; import { DmpStatus } from '@app/core/common/enum/dmp-status'; @@ -31,10 +31,10 @@ export class DatasetDmpSelector extends BaseComponent implements OnInit, IBreadC breadCrumbs: Observable; dmpAutoCompleteConfiguration: SingleAutoCompleteConfiguration; - @Input() formGroup: FormGroup; - @Input() datasetFormGroup: FormGroup; + @Input() formGroup: UntypedFormGroup; + @Input() datasetFormGroup: UntypedFormGroup; @Input() stepper: MatStepper; - formControl: FormControl; + formControl: UntypedFormControl; availableProfiles: DatasetProfileModel[] = []; constructor( @@ -68,7 +68,7 @@ export class DatasetDmpSelector extends BaseComponent implements OnInit, IBreadC this.formGroup.get('datasetProfile').valueChanges .pipe(takeUntil(this._destroyed)) .subscribe(x => { - (this.datasetFormGroup.get('datasetsList') as FormArray).controls.length = 0; + (this.datasetFormGroup.get('datasetsList') as UntypedFormArray).controls.length = 0; }); } diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.module.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.module.ts index 8c2094b8f..d1c8a4602 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.module.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.module.ts @@ -6,16 +6,13 @@ import { CommonFormsModule } from '@common/forms/common-forms.module'; import { DatasetCopyDialogueComponent } from './dataset-copy-dialogue.component'; @NgModule({ - imports: [ - CommonUiModule, - CommonFormsModule, - AutoCompleteModule - ], - declarations: [ - DatasetCopyDialogueComponent - ], - entryComponents: [ - DatasetCopyDialogueComponent - ] + imports: [ + CommonUiModule, + CommonFormsModule, + AutoCompleteModule + ], + declarations: [ + DatasetCopyDialogueComponent + ] }) export class DatasetCopyDialogModule { } diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.ts index 5f5d2a023..aafb6fe66 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.ts @@ -1,5 +1,5 @@ import { Component, Input } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { Router } from '@angular/router'; import { BaseComponent } from '@common/base/base.component'; import { GuidedTourService } from '@app/library/guided-tour/guided-tour.service'; @@ -18,7 +18,7 @@ import { PopupNotificationDialogComponent } from '@app/library/notification/popu }) export class DatasetEditorComponent extends BaseComponent { - @Input() formGroup: FormGroup; + @Input() formGroup: UntypedFormGroup; // @Input() formGroup: FormGroup = null; @Input() availableProfiles: DatasetProfileModel[]; @Input() dmpId: string; diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard-editor.model.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard-editor.model.ts index e2a3f45a5..47ec72a17 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard-editor.model.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard-editor.model.ts @@ -1,4 +1,4 @@ -import { FormBuilder, FormGroup, Validators } from "@angular/forms"; +import { UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms"; import { ExternalDatasetType } from '@app/core/common/enum/external-dataset-type'; import { DataRepositoryModel } from '@app/core/model/data-repository/data-repository'; import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; @@ -52,9 +52,9 @@ export class DatasetWizardEditorModel { return this; } - buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { + buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup { if (context == null) { context = this.createValidationContext(); } - const formBuilder = new FormBuilder(); + const formBuilder = new UntypedFormBuilder(); const formGroup = formBuilder.group({ id: [{ value: this.id, disabled: disabled }, context.getValidation('id').validators], label: [{ value: this.label, disabled: disabled }, context.getValidation('label').validators], @@ -72,7 +72,7 @@ export class DatasetWizardEditorModel { modified: [{value: this.modified, disabled: disabled}, context.getValidation('modified').validators] }); - const externalDatasetsFormArray = new Array(); + const externalDatasetsFormArray = new Array(); //if (this.externalDatasets && this.externalDatasets.length > 0) { this.externalDatasets.forEach(item => { externalDatasetsFormArray.push(item.buildForm(context.getValidation('externalDatasets').descendantValidations, disabled)); @@ -92,7 +92,7 @@ export class DatasetWizardEditorModel { // } // formGroup.addControl('tags', formBuilder.array(tagsFormArray)); - const registriesFormArray = new Array(); + const registriesFormArray = new Array(); //if (this.registries && this.registries.length > 0) { this.registries.forEach(item => { registriesFormArray.push(item.buildForm(context.getValidation('registries').descendantValidations, disabled)); @@ -102,7 +102,7 @@ export class DatasetWizardEditorModel { // } formGroup.addControl('registries', formBuilder.array(registriesFormArray)); - const dataRepositoriesFormArray = new Array(); + const dataRepositoriesFormArray = new Array(); //if (this.dataRepositories && this.dataRepositories.length > 0) { this.dataRepositories.forEach(item => { dataRepositoriesFormArray.push(item.buildForm(context.getValidation('dataRepositories').descendantValidations, disabled)); @@ -112,7 +112,7 @@ export class DatasetWizardEditorModel { // } formGroup.addControl('dataRepositories', formBuilder.array(dataRepositoriesFormArray)); - const servicesFormArray = new Array(); + const servicesFormArray = new Array(); // if (this.services && this.services.length > 0) { this.services.forEach(item => { servicesFormArray.push(item.buildForm(context.getValidation('services').descendantValidations, disabled)); @@ -173,8 +173,8 @@ export class ExternalTagEditorModel { return this; } - buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { - return new FormBuilder().group({ + buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup { + return new UntypedFormBuilder().group({ id: [this.id], name: [this.name] }); @@ -211,8 +211,8 @@ export class ExternalServiceEditorModel { return this; } - buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { - return new FormBuilder().group({ + buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup { + return new UntypedFormBuilder().group({ id: [this.id], abbreviation: [this.abbreviation], label: [this.label, Validators.required], @@ -255,8 +255,8 @@ export class ExternalRegistryEditorModel { return this; } - buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { - return new FormBuilder().group({ + buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup { + return new UntypedFormBuilder().group({ id: [this.id], abbreviation: [this.abbreviation], label: [this.label, Validators.required], @@ -300,8 +300,8 @@ export class ExternalDatasetEditorModel { return this; } - buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { - return new FormBuilder().group({ + buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup { + return new UntypedFormBuilder().group({ id: [this.id], abbreviation: [this.abbreviation], name: [this.name, Validators.required], @@ -344,8 +344,8 @@ export class ExternalDataRepositoryEditorModel { return this; } - buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { - return new FormBuilder().group({ + buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup { + return new UntypedFormBuilder().group({ id: [this.id], name: [this.name, [Validators.required]], abbreviation: [this.abbreviation], diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts index f8a91057a..91df9c33e 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts @@ -1,5 +1,5 @@ import {ChangeDetectorRef, Component, OnInit, ViewChild} from '@angular/core'; -import {AbstractControl, FormArray, FormControl, FormGroup} from '@angular/forms'; +import {AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup} from '@angular/forms'; import {MatDialog} from '@angular/material/dialog'; import {MatSnackBar} from '@angular/material/snack-bar'; import {ActivatedRoute, Router} from '@angular/router'; @@ -89,7 +89,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme datasetWizardModel: DatasetWizardEditorModel; isNew = true; isCopy = false; - formGroup: FormGroup = null; + formGroup: UntypedFormGroup = null; datasetProfileDefinitionModel: DatasetDescriptionFormEditorModel; availableProfiles: DatasetProfileModel[] = []; @@ -659,7 +659,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme return this.formGroup.valid; } - public isSemiFormValid(formGroup: FormGroup): boolean { + public isSemiFormValid(formGroup: UntypedFormGroup): boolean { var isValid: boolean = true; Object.keys(formGroup.controls).forEach(controlName => { if (controlName != 'datasetProfileDefinition' && !formGroup.get(controlName).disabled && !(formGroup.get(controlName).valid)) { @@ -778,16 +778,16 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme /*in case the aControl is FormControl then the it should have provided its error messages above. No need to check case of FormControl below*/ - if (aControl instanceof FormGroup) { + if (aControl instanceof UntypedFormGroup) { - const fg = aControl as FormGroup; + const fg = aControl as UntypedFormGroup; //check children Object.keys(fg.controls).forEach(controlName => { errmess.push(...this._buildErrorMessagesForAbstractControl(fg.get(controlName), controlName)); }); - } else if (aControl instanceof FormArray) { + } else if (aControl instanceof UntypedFormArray) { - const fa = aControl as FormArray; + const fa = aControl as UntypedFormArray; fa.controls.forEach((control, index) => { errmess.push(...this._buildErrorMessagesForAbstractControl(control, `${controlName} --> ${index + 1}`)); @@ -1142,7 +1142,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme } openDmpSearchDialogue() { - const formControl = new FormControl(); + const formControl = new UntypedFormControl(); const dialogRef = this.dialog.open(DatasetCopyDialogueComponent, { width: '500px', restoreFocus: false, diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/dataset-external-references-editor.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/dataset-external-references-editor.component.ts index b3cc56cc1..cac88b15d 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/dataset-external-references-editor.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/dataset-external-references-editor.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit, Output, EventEmitter } from '@angular/core'; -import { FormArray, FormGroup } from '@angular/forms'; +import { UntypedFormArray, UntypedFormGroup } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { Router } from '@angular/router'; import { ExternalSourceItemModel } from '@app/core/model/external-sources/external-source-item'; @@ -38,7 +38,7 @@ import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/mu }) export class DatasetExternalReferencesEditorComponent extends BaseComponent implements OnInit { - @Input() formGroup: FormGroup = null; + @Input() formGroup: UntypedFormGroup = null; @Input() viewOnly = false; @Output() formChanged: EventEmitter = new EventEmitter(); @@ -133,28 +133,28 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl externalDatasetsOnItemChange(event) { const externalDatasetModel = new ExternalDatasetEditorModel(event.id, event.abbreviation, event.name, event.pid ? event.pid : event.reference, event.source); - (this.formGroup.get('externalDatasets')).push(externalDatasetModel.buildForm()); + (this.formGroup.get('externalDatasets')).push(externalDatasetModel.buildForm()); } registriesOnItemChange(event) { const registryModel = new ExternalRegistryEditorModel(event.abbreviation, event.definition, event.id, event.name, event.pid ? event.pid : event.reference, event.uri, event.source); - (this.formGroup.get('registries')).push(registryModel.buildForm()); + (this.formGroup.get('registries')).push(registryModel.buildForm()); } servicesOnItemChange(event) { const serviceModel = new ExternalServiceEditorModel(event.abbreviation, event.definition, event.id, event.label, event.reference, event.uri); - (this.formGroup.get('services')).push(serviceModel.buildForm()); + (this.formGroup.get('services')).push(serviceModel.buildForm()); } tagsOnItemChange(event) { const tagModel = new ExternalTagEditorModel(event.id, event.name); - (this.formGroup.get('tags')).push(tagModel.buildForm()); + (this.formGroup.get('tags')).push(tagModel.buildForm()); } dataRepositoriesOnItemChange(event) { const dataRepositoryModel = new ExternalDataRepositoryEditorModel(event.id, event.name, event.abbreviation, event.uri, event.pid, event.source); - (this.formGroup.get('dataRepositories')).push(dataRepositoryModel.buildForm()); + (this.formGroup.get('dataRepositories')).push(dataRepositoryModel.buildForm()); } addDataRepository() { @@ -168,7 +168,7 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl .subscribe(result => { if (!result) { return; } const dataRepositoryModel = new ExternalDataRepositoryEditorModel(result.id, result.name, result.abbreviation, result.uri, result.pid, result.source); - (this.formGroup.get('dataRepositories')).push(dataRepositoryModel.buildForm()); + (this.formGroup.get('dataRepositories')).push(dataRepositoryModel.buildForm()); }); } @@ -183,7 +183,7 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl .subscribe(result => { if (!result) { return; } const registryModel = new ExternalRegistryEditorModel(result.abbreviation, result.definition, result.id, result.label, result.reference, result.uri, result.source); - (this.formGroup.get('registries')).push(registryModel.buildForm()); + (this.formGroup.get('registries')).push(registryModel.buildForm()); }); } @@ -198,7 +198,7 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl .subscribe(result => { if (!result) { return; } const externalDatasetModel = new ExternalDatasetEditorModel(result.id, result.abbreviation, result.name, result.reference, result.source); - (this.formGroup.get('externalDatasets')).push(externalDatasetModel.buildForm()); + (this.formGroup.get('externalDatasets')).push(externalDatasetModel.buildForm()); }); } @@ -213,7 +213,7 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl .subscribe(result => { if (!result) { return; } const serviceModel = new ExternalServiceEditorModel(result.abbreviation, result.definition, result.id, result.label, result.reference, result.uri, result.source); - (this.formGroup.get('services')).push(serviceModel.buildForm()); + (this.formGroup.get('services')).push(serviceModel.buildForm()); }); } @@ -258,7 +258,7 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl } removeTag(tag: any) { - (this.formGroup.get('tags')).removeAt(((this.formGroup.get('tags')).value as any[]).indexOf(tag)); + (this.formGroup.get('tags')).removeAt(((this.formGroup.get('tags')).value as any[]).indexOf(tag)); } addTag(ev: any) { @@ -281,7 +281,7 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl return element.get('source').value === 'Internal'; } - updateDataRepository(dataRepository: FormGroup) { + updateDataRepository(dataRepository: UntypedFormGroup) { this.externalDataRepositoryService.create(dataRepository.value) .pipe(takeUntil(this._destroyed)) .subscribe( @@ -291,7 +291,7 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl ); } - updateExternalDataset(externalDataset: FormGroup) { + updateExternalDataset(externalDataset: UntypedFormGroup) { this.externalDatasetService.create(externalDataset.value) .pipe(takeUntil(this._destroyed)) .subscribe( @@ -301,7 +301,7 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl ); } - updateRegistry(registry: FormGroup) { + updateRegistry(registry: UntypedFormGroup) { this.externalRegistryService.create(registry.value) .pipe(takeUntil(this._destroyed)) .subscribe( @@ -311,7 +311,7 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl ); } - updateService(service: FormGroup) { + updateService(service: UntypedFormGroup) { this.externalServiceService.create(service.value) .pipe(takeUntil(this._destroyed)) .subscribe( diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/data-repository/dataset-external-data-repository-dialog-editor.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/data-repository/dataset-external-data-repository-dialog-editor.component.ts index 62bfc8c6b..db74faa69 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/data-repository/dataset-external-data-repository-dialog-editor.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/data-repository/dataset-external-data-repository-dialog-editor.component.ts @@ -1,5 +1,5 @@ import { Component, Inject, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { ExternalDataRepositoryService } from '@app/core/services/external-sources/data-repository/extternal-data-repository.service'; import { ExternalDataRepositoryEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; @@ -12,7 +12,7 @@ import { takeUntil } from 'rxjs/operators'; styleUrls: ['./dataset-external-data-repository-dialog-editor.component.scss'] }) export class DatasetExternalDataRepositoryDialogEditorComponent extends BaseComponent implements OnInit { - public formGroup: FormGroup; + public formGroup: UntypedFormGroup; constructor( private externalDataRepositoryService: ExternalDataRepositoryService, diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/external-dataset/dataset-external-dataset-dialog-editor.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/external-dataset/dataset-external-dataset-dialog-editor.component.ts index 74cdd6d34..f15d7e4b4 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/external-dataset/dataset-external-dataset-dialog-editor.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/external-dataset/dataset-external-dataset-dialog-editor.component.ts @@ -1,5 +1,5 @@ import { Component, Inject, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { ExternalDatasetService } from '@app/core/services/external-sources/dataset/external-dataset.service'; import { ExternalDatasetEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; @@ -12,7 +12,7 @@ import { FormService } from '@common/forms/form-service'; styleUrls: ['./dataset-external-dataset-dialog-editor.component.scss'] }) export class DatasetExternalDatasetDialogEditorComponent extends BaseComponent implements OnInit { - public formGroup: FormGroup; + public formGroup: UntypedFormGroup; constructor( private externalDatasetService: ExternalDatasetService, diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/registry/dataset-external-registry-dialog-editor.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/registry/dataset-external-registry-dialog-editor.component.ts index 353233c75..9725f2d64 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/registry/dataset-external-registry-dialog-editor.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/registry/dataset-external-registry-dialog-editor.component.ts @@ -1,5 +1,5 @@ import { Component, Inject, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { ExternalRegistryService } from '@app/core/services/external-sources/registry/external-registry.service'; import { ExternalRegistryEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; @@ -12,7 +12,7 @@ import { takeUntil } from 'rxjs/operators'; styleUrls: ['./dataset-external-registry-dialog-editor.component.scss'] }) export class DatasetExternalRegistryDialogEditorComponent extends BaseComponent implements OnInit { - public formGroup: FormGroup; + public formGroup: UntypedFormGroup; constructor( private externalRegistryService: ExternalRegistryService, diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/service/dataset-external-service-dialog-editor.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/service/dataset-external-service-dialog-editor.component.ts index 10d7d0718..adb0f7d35 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/service/dataset-external-service-dialog-editor.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/service/dataset-external-service-dialog-editor.component.ts @@ -1,5 +1,5 @@ import { Component, Inject, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { ExternalServiceService } from '@app/core/services/external-sources/service/external-service.service'; import { ExternalServiceEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; @@ -12,7 +12,7 @@ import { FormService } from '@common/forms/form-service'; styleUrls: ['./dataset-external-service-dialog-editor.component.scss'] }) export class DatasetExternalServiceDialogEditorComponent extends BaseComponent implements OnInit { - public formGroup: FormGroup; + public formGroup: UntypedFormGroup; constructor( private externalServiceService: ExternalServiceService, diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component.ts index bc632ae2d..dc554efa0 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component.ts @@ -7,7 +7,7 @@ import {SingleAutoCompleteConfiguration} from "@app/library/auto-complete/single import {Observable, of} from "rxjs"; import {Prefilling} from "@app/core/model/dataset/prefilling"; import {PrefillingService} from "@app/core/services/prefilling.service"; -import {FormBuilder, FormGroup, Validators} from "@angular/forms"; +import {UntypedFormBuilder, UntypedFormGroup, Validators} from "@angular/forms"; import { DatasetProfileModel } from "@app/core/model/dataset/dataset-profile"; import { DmpProfileService } from "@app/core/services/dmp/dmp-profile.service"; import { PopupNotificationDialogComponent } from "@app/library/notification/popup/popup-notification.component"; @@ -23,7 +23,7 @@ export class PrefillDatasetComponent extends BaseComponent implements OnInit { progressIndication = false; prefillAutoCompleteConfiguration: SingleAutoCompleteConfiguration; isPrefilled: boolean = false; - prefillForm: FormGroup; + prefillForm: UntypedFormGroup; constructor(public dialogRef: MatDialogRef, private prefillingService: PrefillingService, @@ -31,7 +31,7 @@ export class PrefillDatasetComponent extends BaseComponent implements OnInit { private dialog: MatDialog, private language: TranslateService, private progressIndicationService: ProgressIndicationService, - private fb: FormBuilder, + private fb: UntypedFormBuilder, @Inject(MAT_DIALOG_DATA) public data: any) { super(); } diff --git a/dmp-frontend/src/app/ui/dataset/dataset.module.ts b/dmp-frontend/src/app/ui/dataset/dataset.module.ts index c08b69868..c31346c9b 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset.module.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset.module.ts @@ -31,57 +31,48 @@ import {RichTextEditorModule} from "@app/library/rich-text-editor/rich-text-edit import {PrefillDatasetComponent} from "@app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component"; @NgModule({ - imports: [ - CommonUiModule, - CommonFormsModule, - UrlListingModule, - FormattingModule, - ConfirmationDialogModule, - AutoCompleteModule, - ExternalSourcesModule, - ExportMethodDialogModule, - DatasetDescriptionFormModule, - TableOfContentsModule, - AngularStickyThingsModule, - DatasetRoutingModule, - FormValidationErrorsDialogModule, - DatasetCopyDialogModule, - DatasetOverviewModule, - FormProgressIndicationModule, - RichTextEditorModule - ], - declarations: [ - DatasetListingComponent, - DatasetCriteriaComponent, - DatasetWizardComponent, - DatasetEditorComponent, - DatasetExternalReferencesEditorComponent, - DatasetExternalDataRepositoryDialogEditorComponent, - DatasetExternalDatasetDialogEditorComponent, - DatasetExternalRegistryDialogEditorComponent, - DatasetExternalServiceDialogEditorComponent, - DatasetUploadDialogue, - DatasetListingItemComponent, - DatasetCriteriaDialogComponent, - PrefillDatasetComponent - ], - entryComponents: [ - DatasetExternalDataRepositoryDialogEditorComponent, - DatasetExternalDatasetDialogEditorComponent, - DatasetExternalRegistryDialogEditorComponent, - DatasetExternalServiceDialogEditorComponent, - DatasetUploadDialogue, - DatasetCriteriaDialogComponent - ], - exports: [ - DatasetExternalReferencesEditorComponent, - DatasetExternalDataRepositoryDialogEditorComponent, - DatasetExternalDatasetDialogEditorComponent, - DatasetExternalRegistryDialogEditorComponent, - DatasetExternalServiceDialogEditorComponent, - - DatasetEditorComponent, - DatasetDescriptionFormModule - ] + imports: [ + CommonUiModule, + CommonFormsModule, + UrlListingModule, + FormattingModule, + ConfirmationDialogModule, + AutoCompleteModule, + ExternalSourcesModule, + ExportMethodDialogModule, + DatasetDescriptionFormModule, + TableOfContentsModule, + AngularStickyThingsModule, + DatasetRoutingModule, + FormValidationErrorsDialogModule, + DatasetCopyDialogModule, + DatasetOverviewModule, + FormProgressIndicationModule, + RichTextEditorModule + ], + declarations: [ + DatasetListingComponent, + DatasetCriteriaComponent, + DatasetWizardComponent, + DatasetEditorComponent, + DatasetExternalReferencesEditorComponent, + DatasetExternalDataRepositoryDialogEditorComponent, + DatasetExternalDatasetDialogEditorComponent, + DatasetExternalRegistryDialogEditorComponent, + DatasetExternalServiceDialogEditorComponent, + DatasetUploadDialogue, + DatasetListingItemComponent, + DatasetCriteriaDialogComponent, + PrefillDatasetComponent + ], + exports: [ + DatasetExternalReferencesEditorComponent, + DatasetExternalDataRepositoryDialogEditorComponent, + DatasetExternalDatasetDialogEditorComponent, + DatasetExternalRegistryDialogEditorComponent, + DatasetExternalServiceDialogEditorComponent, + DatasetEditorComponent, + DatasetDescriptionFormModule + ] }) export class DatasetModule { } diff --git a/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria-dialogue/dataset-criteria-dialog.component.ts b/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria-dialogue/dataset-criteria-dialog.component.ts index 1789cb458..6f9a64b6b 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria-dialogue/dataset-criteria-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria-dialogue/dataset-criteria-dialog.component.ts @@ -1,6 +1,6 @@ import { Inject, Component, ViewChild, OnInit, Output, EventEmitter } from '@angular/core'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { DatasetCriteriaComponent } from '../dataset-criteria.component'; import { DatasetCriteria } from '@app/core/query/dataset/dataset-criteria'; import { MatomoService } from '@app/core/services/matomo/matomo-service'; @@ -20,7 +20,7 @@ export class DatasetCriteriaDialogComponent implements OnInit { public dialogRef: MatDialogRef, private httpClient: HttpClient, private matomoService: MatomoService, - @Inject(MAT_DIALOG_DATA) public data: { isPublic: boolean, status: Number, criteria: DatasetCriteria, formGroup: FormGroup, updateDataFn: Function } + @Inject(MAT_DIALOG_DATA) public data: { isPublic: boolean, status: Number, criteria: DatasetCriteria, formGroup: UntypedFormGroup, updateDataFn: Function } ) { } diff --git a/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.ts b/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.ts index 3fa368ef9..79368187c 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.ts +++ b/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnInit, Output, EventEmitter } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { MatSnackBar } from '@angular/material/snack-bar'; import { Router } from '@angular/router'; @@ -48,27 +48,27 @@ export class DatasetCriteriaComponent extends BaseCriteriaComponent implements O @Input() dmpSearchEnabled; @Input() status; @Input() isPublic: boolean; - @Input() criteriaFormGroup: FormGroup; + @Input() criteriaFormGroup: UntypedFormGroup; @Output() filtersChanged: EventEmitter = new EventEmitter(); public criteria: any; public filteringTagsAsync = false; public filteredTags: ExternalSourceItemModel[]; statuses = DatasetStatus; - options: FormGroup; + options: UntypedFormGroup; - public formGroup = new FormBuilder().group({ - like: new FormControl(), - groupIds: new FormControl(), - grants: new FormControl(), - status: new FormControl(), - role: new FormControl(), - organisations: new FormControl(), - collaborators: new FormControl(), - datasetTemplates: new FormControl(), - tags: new FormControl(), - allVersions: new FormControl(), - grantStatus: new FormControl() + public formGroup = new UntypedFormBuilder().group({ + like: new UntypedFormControl(), + groupIds: new UntypedFormControl(), + grants: new UntypedFormControl(), + status: new UntypedFormControl(), + role: new UntypedFormControl(), + organisations: new UntypedFormControl(), + collaborators: new UntypedFormControl(), + datasetTemplates: new UntypedFormControl(), + tags: new UntypedFormControl(), + allVersions: new UntypedFormControl(), + grantStatus: new UntypedFormControl() }); tagsAutoCompleteConfiguration = { @@ -128,7 +128,7 @@ export class DatasetCriteriaComponent extends BaseCriteriaComponent implements O private organisationService: OrganisationService, private userService: UserService, private datasetService: DatasetService, - fb: FormBuilder, + fb: UntypedFormBuilder, private authService: AuthService ) { diff --git a/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.ts b/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.ts index 0a1e89bdc..e9fa443cf 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.ts +++ b/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.ts @@ -21,7 +21,7 @@ import { AuthService } from '@app/core/services/auth/auth.service'; import { isNullOrUndefined } from '@app/utilities/enhancers/utils'; import { DatasetCriteriaDialogComponent } from './criteria/dataset-criteria-dialogue/dataset-criteria-dialog.component'; import { MatDialog } from '@angular/material/dialog'; -import { FormGroup, FormBuilder, FormControl } from '@angular/forms'; +import { UntypedFormGroup, UntypedFormBuilder, UntypedFormControl } from '@angular/forms'; import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order'; import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; import { GuidedTourService } from '@app/library/guided-tour/guided-tour.service'; @@ -58,10 +58,10 @@ export class DatasetListingComponent extends BaseComponent implements OnInit, IB startIndex: number = 0; pageSize: number = 5; criteria: DatasetCriteria; - criteriaFormGroup: FormGroup; - public formGroup = new FormBuilder().group({ - like: new FormControl(), - order: new FormControl() + criteriaFormGroup: UntypedFormGroup; + public formGroup = new UntypedFormBuilder().group({ + like: new UntypedFormControl(), + order: new UntypedFormControl() }); scrollbar: boolean; diff --git a/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.ts b/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.ts index 04d6db3d1..b3bd6ff78 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.ts +++ b/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.ts @@ -10,7 +10,7 @@ import * as FileSaver from 'file-saver'; import { DmpInvitationDialogComponent } from '@app/ui/dmp/invitation/dmp-invitation-dialog.component'; import { MatDialog } from '@angular/material/dialog'; import { DatasetCopyDialogueComponent } from '../../dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component'; -import { FormControl } from '@angular/forms'; +import { UntypedFormControl } from '@angular/forms'; import { TranslateService } from '@ngx-translate/core'; import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component'; import { UiNotificationService, SnackBarNotificationLevel } from '@app/core/services/notification/ui-notification-service'; @@ -160,7 +160,7 @@ export class DatasetListingItemComponent extends BaseComponent implements OnInit } openDmpSearchDialogue(dataset: DatasetListingModel) { - const formControl = new FormControl(); + const formControl = new UntypedFormControl(); const dialogRef = this.dialog.open(DatasetCopyDialogueComponent, { width: '500px', restoreFocus: false, diff --git a/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts b/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts index acbcca4f1..05c9dec4e 100644 --- a/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts +++ b/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts @@ -23,7 +23,7 @@ import * as FileSaver from 'file-saver'; import { DmpInvitationDialogComponent } from '@app/ui/dmp/invitation/dmp-invitation-dialog.component'; import { DatasetWizardEditorModel } from '../dataset-wizard/dataset-wizard-editor.model'; import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service'; -import { FormControl } from '@angular/forms'; +import { UntypedFormControl } from '@angular/forms'; import { DatasetCopyDialogueComponent } from '../dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component'; import { DmpService } from '@app/core/services/dmp/dmp.service'; import { ResearcherModel } from '@app/core/model/researcher/researcher'; @@ -397,7 +397,7 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit { } openDmpSearchDialogue() { - const formControl = new FormControl(); + const formControl = new UntypedFormControl(); const dialogRef = this.dialog.open(DatasetCopyDialogueComponent, { width: '500px', restoreFocus: false, diff --git a/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.component.ts index 8acb8f9eb..56e03422c 100644 --- a/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.component.ts @@ -3,7 +3,7 @@ import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dial import { DmpService } from '@app/core/services/dmp/dmp.service'; import { map, takeUntil } from 'rxjs/operators'; import { DmpModel } from '@app/core/model/dmp/dmp'; -import { FormBuilder, FormArray, FormControl } from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormArray, UntypedFormControl } from '@angular/forms'; import { DatasetDescriptionFormEditorModel } from '@app/ui/misc/dataset-description-form/dataset-description-form.model'; import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration'; import { Observable } from 'rxjs'; @@ -63,10 +63,10 @@ export class CloneDialogComponent extends BaseComponent { selectionChanged(selectedItems) { this.data.formGroup.removeControl('datasets'); - this.data.formGroup.addControl('datasets', new FormBuilder().array(new Array())); + this.data.formGroup.addControl('datasets', new UntypedFormBuilder().array(new Array())); if (selectedItems && selectedItems.selectedOptions && selectedItems.selectedOptions.selected.length > 0) { selectedItems.selectedOptions.selected.forEach(element => { - (this.data.formGroup.get('datasets')).push(new FormBuilder().group({ id: element.value })); + (this.data.formGroup.get('datasets')).push(new UntypedFormBuilder().group({ id: element.value })); }); } } diff --git a/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.module.ts b/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.module.ts index e2945082b..a68cbe124 100644 --- a/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.module.ts +++ b/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.module.ts @@ -6,10 +6,9 @@ import { AutoCompleteModule } from '@app/library/auto-complete/auto-complete.mod import {RichTextEditorModule} from "@app/library/rich-text-editor/rich-text-editor.module"; @NgModule({ - imports: [CommonUiModule, FormsModule, ReactiveFormsModule, AutoCompleteModule, RichTextEditorModule], - declarations: [CloneDialogComponent], - exports: [CloneDialogComponent], - entryComponents: [CloneDialogComponent] + imports: [CommonUiModule, FormsModule, ReactiveFormsModule, AutoCompleteModule, RichTextEditorModule], + declarations: [CloneDialogComponent], + exports: [CloneDialogComponent] }) export class CloneDialogModule { constructor() { } diff --git a/dmp-frontend/src/app/ui/dmp/clone/dmp-clone.component.ts b/dmp-frontend/src/app/ui/dmp/clone/dmp-clone.component.ts index 7b707bc02..f652b7e4f 100644 --- a/dmp-frontend/src/app/ui/dmp/clone/dmp-clone.component.ts +++ b/dmp-frontend/src/app/ui/dmp/clone/dmp-clone.component.ts @@ -1,7 +1,7 @@ import { HttpErrorResponse } from '@angular/common/http'; import { Component, OnInit } from '@angular/core'; -import { FormGroup, FormControl, FormBuilder, FormArray } from '@angular/forms'; +import { UntypedFormGroup, UntypedFormControl, UntypedFormBuilder, UntypedFormArray } from '@angular/forms'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { DmpModel } from '@app/core/model/dmp/dmp'; import { DmpService } from '@app/core/services/dmp/dmp.service'; @@ -44,7 +44,7 @@ export class DmpCloneComponent extends BaseComponent implements OnInit { breadCrumbs: Observable; // dmp: DmpWizardEditorModel; dmp: DmpEditorModel; - formGroup: FormGroup; + formGroup: UntypedFormGroup; itemId: string; datasetId: string = null; isFinalized: false; @@ -55,7 +55,7 @@ export class DmpCloneComponent extends BaseComponent implements OnInit { isNew: boolean = false; isUserOwner: boolean = true; // datasets: DatasetListingModel[] = []; - datasets = new FormArray([]); + datasets = new UntypedFormArray([]); removeIndexes = []; selectedTab = 0; @@ -104,7 +104,7 @@ export class DmpCloneComponent extends BaseComponent implements OnInit { }); } - this.datasets = this.formGroup.get('datasets') as FormArray; + this.datasets = this.formGroup.get('datasets') as UntypedFormArray; this.parentDmpLabel = this.formGroup.get('label').value; if (this.route.routeConfig.path.startsWith('new_version/')) { @@ -280,10 +280,10 @@ export class DmpCloneComponent extends BaseComponent implements OnInit { addDataset() { if (!this.formGroup.get('datasets')) { - this.formGroup.addControl('datasets', new FormBuilder().array(new Array())); + this.formGroup.addControl('datasets', new UntypedFormBuilder().array(new Array())); } this.formGroup.get('datasets')['controls'].push(new DatasetWizardEditorModel().buildForm()); - this.datasets = this.formGroup.get('datasets') as FormArray; + this.datasets = this.formGroup.get('datasets') as UntypedFormArray; this.step = this.stepsBeforeDatasets + this.formGroup.get('datasets')['controls'].length - 1; this.maxStep = this.maxStep + this.formGroup.get('datasets')['controls'].length - 1; } diff --git a/dmp-frontend/src/app/ui/dmp/dataset-preview/dataset-preview-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/dataset-preview/dataset-preview-dialog.component.ts index a00cc07fc..2bc208250 100644 --- a/dmp-frontend/src/app/ui/dmp/dataset-preview/dataset-preview-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/dataset-preview/dataset-preview-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service'; import { ProgressIndicationService } from '@app/core/services/progress-indication/progress-indication-service'; @@ -15,7 +15,7 @@ import { takeUntil } from 'rxjs/operators'; export class DatasetPreviewDialogComponent extends BaseComponent implements OnInit { datasetProfileDefinitionModel: DatasetDescriptionFormEditorModel; - datasetProfileDefinitionFormGroup: FormGroup; + datasetProfileDefinitionFormGroup: UntypedFormGroup; progressIndication = false; constructor( diff --git a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.ts b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.ts index 0da9ee5a8..45e838c9d 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.ts +++ b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { AbstractControl, FormArray, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { AbstractControl, UntypedFormArray, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; import { DmpBlueprintDefinition, ExtraFieldType, FieldCategory, SystemFieldType } from '@app/core/model/dmp/dmp-blueprint/dmp-blueprint'; import { DmpBlueprintCriteria } from '@app/core/query/dmp/dmp-blueprint-criteria'; @@ -90,9 +90,9 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im dmp: DmpEditorModel; dmpSectionIndex: number = 0; - formGroup: FormGroup = null; + formGroup: UntypedFormGroup = null; formGroupRawValue: any; - datasets = new FormArray([]); + datasets = new UntypedFormArray([]); associatedUsers: Array; people: Array; @@ -175,7 +175,7 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im this.dmp.fromModel(data); this.formGroup = this.dmp.buildForm(); - this.datasets = this.formGroup.get('datasets') as FormArray; + this.datasets = this.formGroup.get('datasets') as UntypedFormArray; this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue())); if (!isNullOrUndefined(this.formGroup.get('profile').value)) { @@ -308,8 +308,8 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im }; } - extraFieldsArray(): FormArray { - return this.formGroup.get('extraFields') as FormArray; + extraFieldsArray(): UntypedFormArray { + return this.formGroup.get('extraFields') as UntypedFormArray; } setIsUserOwner() { @@ -464,7 +464,7 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im // } } - changeStep(index: number, dataset?: FormControl) { + changeStep(index: number, dataset?: UntypedFormControl) { this.step = index; this.resetScroll(); // if (dataset) { this.datasetId = dataset.get('id').value }; @@ -701,7 +701,7 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im //checks if the dpm is valid not taking into account the datasets validity private _isDMPDescriptionValid():boolean{ - const form: FormGroup = this.formGroup; + const form: UntypedFormGroup = this.formGroup; if(form.controls){ return Object.keys(form.controls) .map(controlName=>{//get validity of each control @@ -776,16 +776,16 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im /*in case the aControl is FormControl then the it should have provided its error messages above. No need to check case of FormControl below*/ - if(aControl instanceof FormGroup){ + if(aControl instanceof UntypedFormGroup){ - const fg = aControl as FormGroup; + const fg = aControl as UntypedFormGroup; //check children Object.keys(fg.controls).forEach(controlName=>{ errmess.push(...this._buildErrorMessagesForAbstractControl(fg.get(controlName), controlName)); }); - }else if(aControl instanceof FormArray){ + }else if(aControl instanceof UntypedFormArray){ - const fa = aControl as FormArray; + const fa = aControl as UntypedFormArray; fa.controls.forEach((control,index)=>{ errmess.push(... this._buildErrorMessagesForAbstractControl(control, `${controlName} --> ${index+1}`)); @@ -852,7 +852,7 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im } private buildExtraFields(): void { - const extraFields = new Array(); + const extraFields = new Array(); this.selectedDmpBlueprintDefinition.sections.forEach(section => section.fields.forEach(field => { if (field.category as unknown == 'EXTRA') { let extraField = new DmpExtraFieldEditorModel(); @@ -866,12 +866,12 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im extraFields.push(extraField.buildForm()); } })); - this.formGroup.setControl('extraFields', new FormBuilder().array(extraFields)); + this.formGroup.setControl('extraFields', new UntypedFormBuilder().array(extraFields)); } getExtraFieldIndex(id: string): string { let foundFieldIndex: number; - (this.formGroup.get('extraFields') as FormArray).controls.forEach((element, index) => { + (this.formGroup.get('extraFields') as UntypedFormArray).controls.forEach((element, index) => { if(element.value.id === id) { foundFieldIndex = index; } diff --git a/dmp-frontend/src/app/ui/dmp/dmp.module.ts b/dmp-frontend/src/app/ui/dmp/dmp.module.ts index be42b903d..6b58d73f3 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp.module.ts +++ b/dmp-frontend/src/app/ui/dmp/dmp.module.ts @@ -60,75 +60,59 @@ import {RichTextEditorModule} from "@app/library/rich-text-editor/rich-text-edit import { DmpEditorBlueprintComponent } from './dmp-editor-blueprint/dmp-editor-blueprint.component'; @NgModule({ - imports: [ - CommonUiModule, - CommonFormsModule, - UrlListingModule, - ConfirmationDialogModule, - ExportMethodDialogModule, - FormattingModule, - AutoCompleteModule, - DmpRoutingModule, - DmpOverviewModule, - FormValidationErrorsDialogModule, - MultipleChoiceDialogModule, - DatasetEditorDetailsModule, - DatasetDescriptionFormModule, - NgxDropzoneModule, - FormProgressIndicationModule, - RichTextEditorModule - ], - declarations: [ - DmpListingComponent, - DmpCriteriaComponent, - DmpEditorComponent, - DmpInvitationDialogComponent, - InvitationAcceptedComponent, - DmpToDatasetDialogComponent, - DmpWizardComponent, - DmpWizardEditorComponent, - DmpWizardDatasetListingComponent, - AddResearcherComponent, - AvailableProfilesComponent, - DmpFinalizeDialogComponent, - DynamicDmpFieldResolverComponent, - DynamicFieldsGrantComponent, - DynamicFieldGrantComponent, - DmpUploadDialogue, - DmpListingItemComponent, - GeneralTabComponent, - PeopleTabComponent, - GrantTabComponent, - DatasetsTabComponent, - DmpCloneComponent, - AddOrganizationComponent, - DmpCriteriaDialogComponent, - AddCostComponent, - CostListingComponent, - StartNewDmpDialogComponent, - StartNewDatasetDialogComponent, - MainInfoComponent, - FundingInfoComponent, - DatasetInfoComponent, - LicenseInfoComponent, - DatasetPreviewDialogComponent, - DmpEditorBlueprintComponent - ], - entryComponents: [ - DmpInvitationDialogComponent, - DmpToDatasetDialogComponent, - AddResearcherComponent, - AvailableProfilesComponent, - DmpFinalizeDialogComponent, - DmpUploadDialogue, - AddOrganizationComponent, - DmpCriteriaDialogComponent, - AddOrganizationComponent, - AddCostComponent, - StartNewDmpDialogComponent, - StartNewDatasetDialogComponent, - DatasetEditorDetailsComponent, - DatasetPreviewDialogComponent - ] + imports: [ + CommonUiModule, + CommonFormsModule, + UrlListingModule, + ConfirmationDialogModule, + ExportMethodDialogModule, + FormattingModule, + AutoCompleteModule, + DmpRoutingModule, + DmpOverviewModule, + FormValidationErrorsDialogModule, + MultipleChoiceDialogModule, + DatasetEditorDetailsModule, + DatasetDescriptionFormModule, + NgxDropzoneModule, + FormProgressIndicationModule, + RichTextEditorModule + ], + declarations: [ + DmpListingComponent, + DmpCriteriaComponent, + DmpEditorComponent, + DmpInvitationDialogComponent, + InvitationAcceptedComponent, + DmpToDatasetDialogComponent, + DmpWizardComponent, + DmpWizardEditorComponent, + DmpWizardDatasetListingComponent, + AddResearcherComponent, + AvailableProfilesComponent, + DmpFinalizeDialogComponent, + DynamicDmpFieldResolverComponent, + DynamicFieldsGrantComponent, + DynamicFieldGrantComponent, + DmpUploadDialogue, + DmpListingItemComponent, + GeneralTabComponent, + PeopleTabComponent, + GrantTabComponent, + DatasetsTabComponent, + DmpCloneComponent, + AddOrganizationComponent, + DmpCriteriaDialogComponent, + AddCostComponent, + CostListingComponent, + StartNewDmpDialogComponent, + StartNewDatasetDialogComponent, + MainInfoComponent, + FundingInfoComponent, + DatasetInfoComponent, + LicenseInfoComponent, + DatasetPreviewDialogComponent, + DmpEditorBlueprintComponent + ] }) export class DmpModule { } diff --git a/dmp-frontend/src/app/ui/dmp/editor/add-organization/add-organization.component.ts b/dmp-frontend/src/app/ui/dmp/editor/add-organization/add-organization.component.ts index 97ef43256..958de156f 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/add-organization/add-organization.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/add-organization/add-organization.component.ts @@ -1,5 +1,5 @@ import { Component, Inject, OnInit } from '@angular/core'; -import { AbstractControl, AsyncValidatorFn, FormControl, FormGroup, ValidationErrors } from '@angular/forms'; +import { AbstractControl, AsyncValidatorFn, UntypedFormControl, UntypedFormGroup, ValidationErrors } from '@angular/forms'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service'; import { ExternalResearcherService } from '@app/core/services/external-sources/researcher/external-researcher.service'; @@ -15,7 +15,7 @@ import { OrganizationEditorModel } from './add-organization.model'; }) export class AddOrganizationComponent extends BaseComponent implements OnInit { - public formGroup: FormGroup; + public formGroup: UntypedFormGroup; private readonly _REFERENCE_PREFIX:string = "Internal:"; private readonly _KEY: string = 'Internal'; @@ -34,7 +34,7 @@ export class AddOrganizationComponent extends BaseComponent implements OnInit { ) { super(); if(data){ - const organisations = (data as FormControl).value ; + const organisations = (data as UntypedFormControl).value ; if(organisations){ this.existingReferences = (organisations as Array).map(organisation => organisation.reference); } diff --git a/dmp-frontend/src/app/ui/dmp/editor/add-organization/add-organization.model.ts b/dmp-frontend/src/app/ui/dmp/editor/add-organization/add-organization.model.ts index 582212274..6cb515c84 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/add-organization/add-organization.model.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/add-organization/add-organization.model.ts @@ -1,4 +1,4 @@ -import { FormBuilder, FormGroup } from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { ResearcherModel } from '@app/core/model/researcher/researcher'; import { BackendErrorValidator } from '@common/forms/validation/custom-validator'; import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model'; @@ -18,9 +18,9 @@ export class OrganizationEditorModel { return this; } - buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { + buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup { if (context == null) { context = this.createValidationContext(); } - const formGroup = new FormBuilder().group({ + const formGroup = new UntypedFormBuilder().group({ reference: [{ value: this.reference, disabled: disabled }, context.getValidation('reference').validators], name: [{ value: this.name, disabled: disabled }, context.getValidation('name').validators] }); diff --git a/dmp-frontend/src/app/ui/dmp/editor/add-researcher/add-researcher.component.ts b/dmp-frontend/src/app/ui/dmp/editor/add-researcher/add-researcher.component.ts index 79b29faec..977b7e55b 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/add-researcher/add-researcher.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/add-researcher/add-researcher.component.ts @@ -1,5 +1,5 @@ import { Component, Inject, OnInit } from '@angular/core'; -import { AbstractControl, AsyncValidatorFn, FormControl, FormGroup, ValidationErrors } from '@angular/forms'; +import { AbstractControl, AsyncValidatorFn, UntypedFormControl, UntypedFormGroup, ValidationErrors } from '@angular/forms'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service'; import { ExternalResearcherService } from '@app/core/services/external-sources/researcher/external-researcher.service'; @@ -14,7 +14,7 @@ import { debounceTime, distinctUntilChanged, filter, first, map, mergeMap, start }) export class AddResearcherComponent extends BaseComponent implements OnInit { - public formGroup: FormGroup; + public formGroup: UntypedFormGroup; private readonly _REFERENCE_PREFIX:string = "dmp:"; private readonly _KEY:string = 'Internal'; @@ -33,7 +33,7 @@ export class AddResearcherComponent extends BaseComponent implements OnInit { ) { super(); if(data){ - const researchers = (data as FormControl).value ; + const researchers = (data as UntypedFormControl).value ; if(researchers){ this.existingReferences = (researchers as Array).map(researcher => researcher.reference); } diff --git a/dmp-frontend/src/app/ui/dmp/editor/add-researcher/add-researcher.model.ts b/dmp-frontend/src/app/ui/dmp/editor/add-researcher/add-researcher.model.ts index af8586f95..d27a42e5c 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/add-researcher/add-researcher.model.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/add-researcher/add-researcher.model.ts @@ -1,4 +1,4 @@ -import {FormBuilder, FormGroup, ValidationErrors } from '@angular/forms'; +import {UntypedFormBuilder, UntypedFormGroup, ValidationErrors } from '@angular/forms'; import { ResearcherModel } from '@app/core/model/researcher/researcher'; import { BackendErrorValidator } from '@common/forms/validation/custom-validator'; import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model'; @@ -23,9 +23,9 @@ export class ResearcherEditorModel { return this; } - buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { + buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup { if (context == null) { context = this.createValidationContext(); } - const formGroup = new FormBuilder().group({ + const formGroup = new UntypedFormBuilder().group({ reference: [{ value: this.reference, disabled: disabled },context.getValidation('reference')], firstName: [{ value: this.name, disabled: disabled }, context.getValidation('firstName').validators], lastName: [{ value: this.lastName, disabled: disabled }, context.getValidation('lastName').validators] diff --git a/dmp-frontend/src/app/ui/dmp/editor/available-profiles/available-profiles.component.ts b/dmp-frontend/src/app/ui/dmp/editor/available-profiles/available-profiles.component.ts index 6ee413cc2..d1cc39561 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/available-profiles/available-profiles.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/available-profiles/available-profiles.component.ts @@ -1,5 +1,5 @@ import { Component, Inject, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; @@ -15,7 +15,7 @@ import { takeUntil } from 'rxjs/operators'; }) export class AvailableProfilesComponent extends BaseComponent implements OnInit { - public formGroup: FormGroup; + public formGroup: UntypedFormGroup; public profiles: DatasetProfileModel[] = []; public selectedProfiles: DatasetProfileModel[] = []; public selectedOptions: any; diff --git a/dmp-frontend/src/app/ui/dmp/editor/cost-editor/add-cost/add-cost.component.ts b/dmp-frontend/src/app/ui/dmp/editor/cost-editor/add-cost/add-cost.component.ts index 7a4da0f75..49b44db30 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/cost-editor/add-cost/add-cost.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/cost-editor/add-cost/add-cost.component.ts @@ -1,5 +1,5 @@ import { Component, Inject, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { ExternalResearcherService } from '@app/core/services/external-sources/researcher/external-researcher.service'; import { BaseComponent } from '@common/base/base.component'; @@ -16,7 +16,7 @@ import { CurrencyService } from '@app/core/services/currency/currency.service'; }) export class AddCostComponent extends BaseComponent implements OnInit { - public formGroup: FormGroup; + public formGroup: UntypedFormGroup; currencyAutoCompleteConfiguration: SingleAutoCompleteConfiguration = { filterFn: this.searchCurrency.bind(this), diff --git a/dmp-frontend/src/app/ui/dmp/editor/cost-editor/add-cost/add-cost.model.ts b/dmp-frontend/src/app/ui/dmp/editor/cost-editor/add-cost/add-cost.model.ts index 252e4950d..3441c8e8f 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/cost-editor/add-cost/add-cost.model.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/cost-editor/add-cost/add-cost.model.ts @@ -1,4 +1,4 @@ -import { FormBuilder, FormGroup } from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { ResearcherModel } from '@app/core/model/researcher/researcher'; import { BackendErrorValidator } from '@common/forms/validation/custom-validator'; import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model'; @@ -21,9 +21,9 @@ export class CostEditorModel implements CostModel{ return this; } - buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { + buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup { if (context == null) { context = this.createValidationContext(); } - const formGroup = new FormBuilder().group({ + const formGroup = new UntypedFormBuilder().group({ code: [{ value: this.code, disabled: disabled }, context.getValidation('code').validators], description: [{ value: this.description, disabled: disabled }, context.getValidation('description').validators], title: [{ value: this.title, disabled: disabled }, context.getValidation('title').validators], diff --git a/dmp-frontend/src/app/ui/dmp/editor/cost-editor/cost-listing/cost-listing.component.ts b/dmp-frontend/src/app/ui/dmp/editor/cost-editor/cost-listing/cost-listing.component.ts index 16bbc9a89..70f9c5ce5 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/cost-editor/cost-listing/cost-listing.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/cost-editor/cost-listing/cost-listing.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit, Input } from '@angular/core'; import { BaseComponent } from '@common/base/base.component'; -import { FormArray, FormControl } from '@angular/forms'; +import { UntypedFormArray, FormControl } from '@angular/forms'; import { takeUntil } from 'rxjs/operators'; import { CostModel } from '@app/core/model/dmp/cost'; import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration'; @@ -16,7 +16,7 @@ import { CostEditorModel } from '../add-cost/add-cost.model'; }) export class CostListingComponent extends BaseComponent implements OnInit { - @Input() form: FormArray; + @Input() form: UntypedFormArray; private cost: CostEditorModel[] = []; diff --git a/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts index 49eba19b3..9983eb487 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts @@ -15,7 +15,7 @@ import { FormService } from '@common/forms/form-service'; import { LockService } from '@app/core/services/lock/lock.service'; import { AuthService } from '@app/core/services/auth/auth.service'; import { DatasetStatus } from '@app/core/common/enum/dataset-status'; -import { FormGroup, FormControl, FormArray } from '@angular/forms'; +import { UntypedFormGroup, FormControl, UntypedFormArray } from '@angular/forms'; import { DatasetDescriptionFormEditorModel } from '@app/ui/misc/dataset-description-form/dataset-description-form.model'; import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; import { LockModel } from '@app/core/model/lock/lock.model'; @@ -66,7 +66,7 @@ export class DatasetEditorDetailsComponent extends BaseComponent implements OnIn lockStatus: Boolean; dmpText: string = null; - @Input() formGroup: FormGroup; + @Input() formGroup: UntypedFormGroup; @Input() dmpId: string; @Input() datasetId: string; @Input() availableProfiles: DatasetProfileModel[]; @@ -243,12 +243,12 @@ export class DatasetEditorDetailsComponent extends BaseComponent implements OnIn } removeTag(tag: any) { - (this.formGroup.get('tags')).removeAt(((this.formGroup.get('tags')).value as any[]).indexOf(tag)); + (this.formGroup.get('tags')).removeAt(((this.formGroup.get('tags')).value as any[]).indexOf(tag)); } addTag(ev: MatChipInputEvent) { - if (ev.value !== '' && isNullOrUndefined(((this.formGroup.get('tags')).value as ExternalTagEditorModel[]).find(tag => tag.name === ev.value))) { - (this.formGroup.get('tags')).push(new ExternalTagEditorModel('', ev.value).buildForm()); + if (ev.value !== '' && isNullOrUndefined(((this.formGroup.get('tags')).value as ExternalTagEditorModel[]).find(tag => tag.name === ev.value))) { + (this.formGroup.get('tags')).push(new ExternalTagEditorModel('', ev.value).buildForm()); } ev.input.value = ''; } diff --git a/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.module.ts b/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.module.ts index a3629ddd6..4cb2c8679 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.module.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.module.ts @@ -21,34 +21,26 @@ import { DatasetDescriptionFormModule } from '@app/ui/misc/dataset-description-f @NgModule({ - imports: [ - CommonUiModule, - CommonFormsModule, - UrlListingModule, - ConfirmationDialogModule, - ExportMethodDialogModule, - FormattingModule, - AutoCompleteModule, - DmpRoutingModule, - DmpOverviewModule, - FormValidationErrorsDialogModule, - MultipleChoiceDialogModule, - DatasetModule, - DatasetDescriptionFormModule - ], - declarations: [ - DatasetEditorDetailsComponent - ], - entryComponents: [ - DatasetEditorDetailsComponent, - DatasetExternalReferencesEditorComponent, - DatasetExternalDataRepositoryDialogEditorComponent, - DatasetExternalDatasetDialogEditorComponent, - DatasetExternalRegistryDialogEditorComponent, - DatasetExternalServiceDialogEditorComponent - ], - exports: [ - DatasetEditorDetailsComponent - ] + imports: [ + CommonUiModule, + CommonFormsModule, + UrlListingModule, + ConfirmationDialogModule, + ExportMethodDialogModule, + FormattingModule, + AutoCompleteModule, + DmpRoutingModule, + DmpOverviewModule, + FormValidationErrorsDialogModule, + MultipleChoiceDialogModule, + DatasetModule, + DatasetDescriptionFormModule + ], + declarations: [ + DatasetEditorDetailsComponent + ], + exports: [ + DatasetEditorDetailsComponent + ] }) export class DatasetEditorDetailsModule { } diff --git a/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts index 4980c991e..1d88e6a52 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts @@ -1,6 +1,6 @@ import { BaseComponent } from '@common/base/base.component'; import { OnInit, Component, Input, Output, EventEmitter } from '@angular/core'; -import { FormGroup, FormArray } from '@angular/forms'; +import { UntypedFormGroup, FormArray } from '@angular/forms'; import { TranslateService } from '@ngx-translate/core'; import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration'; @@ -30,7 +30,7 @@ import { DatasetPreviewDialogComponent } from '../../dataset-preview/dataset-pre }) export class DatasetInfoComponent extends BaseComponent implements OnInit { - @Input() formGroup: FormGroup = null; + @Input() formGroup: UntypedFormGroup = null; // @Input() datasetFormGroup: FormGroup = null; @Input() isUserOwner: boolean; @Input() dmp: DmpEditorModel; @@ -47,7 +47,7 @@ export class DatasetInfoComponent extends BaseComponent implements OnInit { profilesAutoCompleteConfiguration: MultipleAutoCompleteConfiguration; datasetProfileDefinitionModel: DatasetDescriptionFormEditorModel; - datasetProfileDefinitionFormGroup: FormGroup; + datasetProfileDefinitionFormGroup: UntypedFormGroup; constructor( private language: TranslateService, diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts index 72f300910..987a87021 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit} from '@angular/core'; -import { FormGroup, AbstractControl, FormControl, FormArray} from '@angular/forms'; +import { UntypedFormGroup, AbstractControl, UntypedFormControl, UntypedFormArray} from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { DmpStatus } from '@app/core/common/enum/dmp-status'; @@ -74,11 +74,11 @@ export class DmpEditorComponent extends CheckDeactivateBaseComponent implements dmp: DmpEditorModel; dmpModel: DmpModel; - formGroup: FormGroup = null; + formGroup: UntypedFormGroup = null; // datasetFormGroup: FormGroup; formGroupRawValue: any; datasetId: string = null; - datasets = new FormArray([]); + datasets = new UntypedFormArray([]); datasetWizardEditorModel: DatasetWizardEditorModel; createNewVersion; @@ -175,7 +175,7 @@ export class DmpEditorComponent extends CheckDeactivateBaseComponent implements this.dmp.fromModel(data); this.formGroup = this.dmp.buildForm(); - this.datasets = this.formGroup.get('datasets') as FormArray; + this.datasets = this.formGroup.get('datasets') as UntypedFormArray; this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue())); this.maxStep = this.formGroup.get('datasets') ? this.maxStep + this.formGroup.get('datasets').value.length - 1 : this.maxStep; @@ -262,7 +262,7 @@ export class DmpEditorComponent extends CheckDeactivateBaseComponent implements // this.formGroup.get('datasets')['controls'].forEach(element => { // this.datasets.push(element); // }); - this.datasets = this.formGroup.get('datasets') as FormArray; + this.datasets = this.formGroup.get('datasets') as UntypedFormArray; this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue())); this.maxStep = this.formGroup.get('datasets') ? this.maxStep + this.formGroup.get('datasets').value.length - 1 : this.maxStep; @@ -343,16 +343,16 @@ export class DmpEditorComponent extends CheckDeactivateBaseComponent implements } copyFormControl(control: AbstractControl) { - if (control instanceof FormControl) { - return new FormControl(control.value); - } else if (control instanceof FormGroup) { - const copy = new FormGroup({}); + if (control instanceof UntypedFormControl) { + return new UntypedFormControl(control.value); + } else if (control instanceof UntypedFormGroup) { + const copy = new UntypedFormGroup({}); Object.keys(control.getRawValue()).forEach(key => { copy.addControl(key, this.copyFormControl(control.controls[key])); }); return copy; - } else if (control instanceof FormArray) { - const copy = new FormArray([]); + } else if (control instanceof UntypedFormArray) { + const copy = new UntypedFormArray([]); control.controls.forEach(control => { copy.push(this.copyFormControl(control)); }) @@ -795,7 +795,7 @@ export class DmpEditorComponent extends CheckDeactivateBaseComponent implements //checks if the dpm is valid not taking into account the datasets validity private _isDMPDescriptionValid():boolean{ - const form: FormGroup = this.formGroup; + const form: UntypedFormGroup = this.formGroup; if(form.controls){ return Object.keys(form.controls) .map(controlName=>{//get validity of each control @@ -871,16 +871,16 @@ export class DmpEditorComponent extends CheckDeactivateBaseComponent implements /*in case the aControl is FormControl then the it should have provided its error messages above. No need to check case of FormControl below*/ - if(aControl instanceof FormGroup){ + if(aControl instanceof UntypedFormGroup){ - const fg = aControl as FormGroup; + const fg = aControl as UntypedFormGroup; //check children Object.keys(fg.controls).forEach(controlName=>{ errmess.push(...this._buildErrorMessagesForAbstractControl(fg.get(controlName), controlName)); }); - }else if(aControl instanceof FormArray){ + }else if(aControl instanceof UntypedFormArray){ - const fa = aControl as FormArray; + const fa = aControl as UntypedFormArray; fa.controls.forEach((control,index)=>{ errmess.push(... this._buildErrorMessagesForAbstractControl(control, `${controlName} --> ${index+1}`)); @@ -1022,7 +1022,7 @@ export class DmpEditorComponent extends CheckDeactivateBaseComponent implements this.lockService.createOrUpdate(this.lock).pipe(takeUntil(this._destroyed)).subscribe(async result => this.lock.id = Guid.parse(result)); } - public changeStep(index: number, dataset?: FormControl) { + public changeStep(index: number, dataset?: UntypedFormControl) { this.step = index; this.resetScroll(); if (dataset) { this.datasetId = dataset.get('id').value }; diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.model.ts b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.model.ts index 3c1888121..74363593e 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.model.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.model.ts @@ -1,4 +1,4 @@ -import { FormBuilder, FormGroup, Validators } from "@angular/forms"; +import { UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms"; import { DmpProfileFieldDataType } from '@app/core/common/enum/dmp-profile-field-type'; import { DmpProfileType } from '@app/core/common/enum/dmp-profile-type'; import { DmpStatus } from '@app/core/common/enum/dmp-status'; @@ -80,10 +80,10 @@ export class DmpEditorModel { return this; } - buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { + buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup { if (context == null) { context = this.createValidationContext(); } - const formGroup = new FormBuilder().group({ + const formGroup = new UntypedFormBuilder().group({ id: [{ value: this.id, disabled: disabled }, context.getValidation('id').validators], profile: [{ value: this.profile, disabled: disabled }, context.getValidation('profile').validators], label: [{ value: this.label, disabled: disabled }, context.getValidation('label').validators], @@ -105,17 +105,17 @@ export class DmpEditorModel { extraProperties: this.extraProperties.buildForm(), }); - const datasets = new Array(); + const datasets = new Array(); if(this.datasets) { this.datasets.forEach(item => datasets.push(item.buildForm())); } - formGroup.addControl('datasets', new FormBuilder().array(datasets)); + formGroup.addControl('datasets', new UntypedFormBuilder().array(datasets)); - const dynamicFields = new Array(); + const dynamicFields = new Array(); if (this.dynamicFields) { this.dynamicFields.forEach(item => dynamicFields.push(item.buildForm())); } - formGroup.addControl('dynamicFields', new FormBuilder().array(dynamicFields)); + formGroup.addControl('dynamicFields', new UntypedFormBuilder().array(dynamicFields)); - const extraFields = new Array(); + const extraFields = new Array(); if (this.extraFields) { this.extraFields.forEach(item => extraFields.push(item.buildForm())); } - formGroup.addControl('extraFields', new FormBuilder().array(extraFields)); + formGroup.addControl('extraFields', new UntypedFormBuilder().array(extraFields)); return formGroup; } @@ -154,8 +154,8 @@ export class DmpExtraFieldEditorModel { return this; } - buildForm(): FormGroup { - const builder = new FormBuilder(); + buildForm(): UntypedFormGroup { + const builder = new UntypedFormBuilder(); const formGroup = builder.group({ id: [this.id], value: [this.value] @@ -183,8 +183,8 @@ export class DmpDynamicFieldEditorModel { return this; } - buildForm(): FormGroup { - const builder = new FormBuilder(); + buildForm(): UntypedFormGroup { + const builder = new UntypedFormBuilder(); const formGroup = builder.group({ id: [this.id], name: [this.name], @@ -207,8 +207,8 @@ export class DmpDynamicFieldDependencyEditorModel { return this; } - buildForm(): FormGroup { - return new FormBuilder().group({ + buildForm(): UntypedFormGroup { + return new UntypedFormBuilder().group({ id: [this.id], queryProperty: [this.queryProperty] }); @@ -236,8 +236,8 @@ export class DmpDefinitionFieldEditorModel implements DmpProfileField { return this; } - buildForm(): FormGroup { - const formGroup = new FormBuilder().group({ + buildForm(): UntypedFormGroup { + const formGroup = new UntypedFormBuilder().group({ type: [this.type], id: [this.id], dataType: [this.dataType], diff --git a/dmp-frontend/src/app/ui/dmp/editor/dynamic-field-resolver/dynamic-dmp-field-resolver.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dynamic-field-resolver/dynamic-dmp-field-resolver.component.ts index 23ff93644..d0aff7f47 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dynamic-field-resolver/dynamic-dmp-field-resolver.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dynamic-field-resolver/dynamic-dmp-field-resolver.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnDestroy, OnInit, SimpleChanges } from '@angular/core'; -import { FormArray, FormBuilder, FormGroup, FormControl } from '@angular/forms'; +import { UntypedFormArray, UntypedFormBuilder, UntypedFormGroup, FormControl } from '@angular/forms'; import { DmpProfileFieldDataType } from '../../../../core/common/enum/dmp-profile-field-type'; import { DmpProfileType } from '../../../../core/common/enum/dmp-profile-type'; import { DmpProfileDefinition } from '../../../../core/model/dmp-profile/dmp-profile'; @@ -25,7 +25,7 @@ export class DynamicDmpFieldResolverComponent implements OnInit, OnDestroy { @Input() dmpProfileId: string; @Input() dmpProfileDefinition: DmpProfileDefinition; - @Input() formGroup: FormGroup; + @Input() formGroup: UntypedFormGroup; @Input() isUserOwner: boolean; constructor( @@ -71,10 +71,10 @@ export class DynamicDmpFieldResolverComponent implements OnInit, OnDestroy { createControleFields(): void { if (this.dmpProfileDefinition != null) { const diasableBoolean = this.formGroup.disabled; - this.formGroup.addControl('properties', new FormBuilder().group([])); - (this.formGroup.get('properties')).addControl('fields', new FormBuilder().array([])); + this.formGroup.addControl('properties', new UntypedFormBuilder().group([])); + (this.formGroup.get('properties')).addControl('fields', new UntypedFormBuilder().array([])); this.dmpProfileDefinition.fields.forEach(item => { - (this.formGroup.get('properties').get('fields')).push(new FormBuilder().group({ + (this.formGroup.get('properties').get('fields')).push(new UntypedFormBuilder().group({ id: [{ value: item.id, disabled: diasableBoolean }], value: [{ value: item.value, disabled: diasableBoolean }] })); diff --git a/dmp-frontend/src/app/ui/dmp/editor/dynamic-fields-grant/dynamic-field-grant/dynamic-field-grant.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dynamic-fields-grant/dynamic-field-grant/dynamic-field-grant.component.ts index feaf64ff1..4b547f491 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dynamic-fields-grant/dynamic-field-grant/dynamic-field-grant.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dynamic-fields-grant/dynamic-field-grant/dynamic-field-grant.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { RequestItem } from '../../../../../core/query/request-item'; import { DmpService } from '../../../../../core/services/dmp/dmp.service'; import { SingleAutoCompleteConfiguration } from '../../../../../library/auto-complete/single/single-auto-complete-configuration'; @@ -16,9 +16,9 @@ export class DynamicFieldGrantComponent implements OnInit { private dmpService: DmpService ) { } - @Input()dependencies: Array; + @Input()dependencies: Array; - @Input()formGroup: FormGroup; + @Input()formGroup: UntypedFormGroup; autoCompleteConfiguration: SingleAutoCompleteConfiguration; diff --git a/dmp-frontend/src/app/ui/dmp/editor/dynamic-fields-grant/dynamic-fields-grant.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dynamic-fields-grant/dynamic-fields-grant.component.ts index 5489736ae..1ff153196 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dynamic-fields-grant/dynamic-fields-grant.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dynamic-fields-grant/dynamic-fields-grant.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormArray, FormGroup } from '@angular/forms'; +import { UntypedFormArray, UntypedFormGroup } from '@angular/forms'; import { DmpDynamicFieldDependency } from '../../../../core/model/dmp/dmp-dynamic-field-dependency'; @Component({ @@ -10,20 +10,20 @@ import { DmpDynamicFieldDependency } from '../../../../core/model/dmp/dmp-dynami export class DynamicFieldsGrantComponent implements OnInit { @Input() - formGroup: FormGroup; + formGroup: UntypedFormGroup; ngOnInit(): void { } findDependencies(id: number) { - const formGroupDependencies: Array = new Array(); - const dynamicFieldDependency: DmpDynamicFieldDependency[] = (this.formGroup.get('dynamicFields')).at(id).get('dependencies').value; + const formGroupDependencies: Array = new Array(); + const dynamicFieldDependency: DmpDynamicFieldDependency[] = (this.formGroup.get('dynamicFields')).at(id).get('dependencies').value; if (dynamicFieldDependency.length > 0) { dynamicFieldDependency.forEach(item => { - const length = (this.formGroup.get('dynamicFields')).length; + const length = (this.formGroup.get('dynamicFields')).length; for (let i = 0; i < length; i++) { - const formGroup = (this.formGroup.get('dynamicFields')).at(i); - if (formGroup.get('id').value === item.id) { formGroupDependencies.push(formGroup); } + const formGroup = (this.formGroup.get('dynamicFields')).at(i); + if (formGroup.get('id').value === item.id) { formGroupDependencies.push(formGroup); } } }); } diff --git a/dmp-frontend/src/app/ui/dmp/editor/funding-info/funding-info.component.ts b/dmp-frontend/src/app/ui/dmp/editor/funding-info/funding-info.component.ts index 8559eda7f..1663bcce9 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/funding-info/funding-info.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/funding-info/funding-info.component.ts @@ -1,6 +1,6 @@ import { BaseComponent } from '@common/base/base.component'; import { OnInit, Component, Input, EventEmitter, Output, ViewChild } from '@angular/core'; -import { AbstractControl, FormGroup, Validators } from '@angular/forms'; +import { AbstractControl, UntypedFormGroup, Validators } from '@angular/forms'; import { TranslateService } from '@ngx-translate/core'; import { GrantTabModel } from '../grant-tab/grant-tab-model'; import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration'; @@ -31,10 +31,10 @@ export class FundingInfoComponent extends BaseComponent implements OnInit { @Input() isRequired: boolean; @Input() type: number; - @Input() formGroup: FormGroup; - @Input() grantformGroup: FormGroup; - @Input() projectFormGroup: FormGroup; - @Input() funderFormGroup: FormGroup = null; + @Input() formGroup: UntypedFormGroup; + @Input() grantformGroup: UntypedFormGroup; + @Input() projectFormGroup: UntypedFormGroup; + @Input() funderFormGroup: UntypedFormGroup = null; @Output() onFormChanged: EventEmitter = new EventEmitter(); isCreateNew = false; diff --git a/dmp-frontend/src/app/ui/dmp/editor/general-tab/extra-properties-form.model.ts b/dmp-frontend/src/app/ui/dmp/editor/general-tab/extra-properties-form.model.ts index 061348b2d..2da5a6380 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/general-tab/extra-properties-form.model.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/general-tab/extra-properties-form.model.ts @@ -1,5 +1,5 @@ import { ValidationContext } from '@common/forms/validation/validation-context'; -import { FormGroup, FormBuilder, Validators } from '@angular/forms'; +import { UntypedFormGroup, UntypedFormBuilder, Validators } from '@angular/forms'; import { BackendErrorValidator } from '@common/forms/validation/custom-validator'; import { CostModel } from '@app/core/model/dmp/cost'; import { isNullOrUndefined } from '@app/utilities/enhancers/utils'; @@ -29,10 +29,10 @@ export class ExtraPropertiesFormModel { return this; } - buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { + buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup { if (context == null) { context = this.createValidationContext(); } - const formBuilder = new FormBuilder(); - const formGroup = new FormBuilder().group({ + const formBuilder = new UntypedFormBuilder(); + const formGroup = new UntypedFormBuilder().group({ language: [{ value: this.language, disabled: disabled }, context.getValidation('language').validators], license: [{ value: this.license, disabled: disabled }, context.getValidation('license').validators], visible: [{ value: this.visible, disabled: disabled }, context.getValidation('visible').validators], @@ -41,7 +41,7 @@ export class ExtraPropertiesFormModel { // costs: [{ value: this.costs, disabled: disabled }, context.getValidation('costs').validators] }); - const costArray = new Array(); + const costArray = new Array(); //if (this.externalDatasets && this.externalDatasets.length > 0) { this.costs.forEach(item => { costArray.push(item.buildForm(context.getValidation('costs').descendantValidations, true)); diff --git a/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.ts b/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.ts index 59c3ffc95..223446719 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup, FormArray } from '@angular/forms'; +import { UntypedFormGroup, UntypedFormArray } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; @@ -41,7 +41,7 @@ interface Visible { }) export class GeneralTabComponent extends BaseComponent implements OnInit { - @Input() formGroup: FormGroup = null; + @Input() formGroup: UntypedFormGroup = null; @Input() isNewVersion: boolean; @Input() isUserOwner: boolean; @Input() isClone: boolean; @@ -275,7 +275,7 @@ export class GeneralTabComponent extends BaseComponent implements OnInit { costsArray.push(result); let costeditModel: CostEditorModel = new CostEditorModel(); costeditModel = costeditModel.fromModel(result); - (this.formGroup.get('extraProperties').get('costs')).push(costeditModel.buildForm(null, true)); + (this.formGroup.get('extraProperties').get('costs')).push(costeditModel.buildForm(null, true)); } }); } diff --git a/dmp-frontend/src/app/ui/dmp/editor/grant-tab/funder-form-model.ts b/dmp-frontend/src/app/ui/dmp/editor/grant-tab/funder-form-model.ts index b06b1fb89..49d43d422 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/grant-tab/funder-form-model.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/grant-tab/funder-form-model.ts @@ -1,4 +1,4 @@ -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; import { Status } from '@app/core/common/enum/status'; import { FunderModel } from '@app/core/model/funder/funder'; import { BackendErrorValidator } from '@common/forms/validation/custom-validator'; @@ -20,10 +20,10 @@ export class FunderFormModel { return this; } - buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { + buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup { if (context == null) { context = this.createValidationContext(); } - const formGroup = new FormBuilder().group({ + const formGroup = new UntypedFormBuilder().group({ id: [{ value: this.id, disabled: disabled }, context.getValidation('id').validators], label: [{ value: this.label, disabled: disabled }, context.getValidation('label').validators], status: [{ value: this.status, disabled: disabled }, context.getValidation('status').validators], diff --git a/dmp-frontend/src/app/ui/dmp/editor/grant-tab/grant-tab-model.ts b/dmp-frontend/src/app/ui/dmp/editor/grant-tab/grant-tab-model.ts index aa2f38789..f7635121a 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/grant-tab/grant-tab-model.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/grant-tab/grant-tab-model.ts @@ -1,4 +1,4 @@ -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; import { Status } from '@app/core/common/enum/status'; import { GrantListingModel } from '@app/core/model/grant/grant-listing'; import { ValidJsonValidator } from '@app/library/auto-complete/auto-complete-custom-validator'; @@ -23,10 +23,10 @@ export class GrantTabModel { return this; } - buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { + buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup { if (context == null) { context = this.createValidationContext(); } - const formGroup = new FormBuilder().group({ + const formGroup = new UntypedFormBuilder().group({ id: [{ value: this.id, disabled: disabled }, context.getValidation('id').validators], label: [{ value: this.label, disabled: disabled }, context.getValidation('label').validators], status: [{ value: this.status, disabled: disabled }, context.getValidation('status').validators], diff --git a/dmp-frontend/src/app/ui/dmp/editor/grant-tab/grant-tab.component.ts b/dmp-frontend/src/app/ui/dmp/editor/grant-tab/grant-tab.component.ts index 843176570..6e4eaaf0a 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/grant-tab/grant-tab.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/grant-tab/grant-tab.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { FunderCriteria } from '@app/core/query/funder/funder-criteria'; import { GrantCriteria } from '@app/core/query/grant/grant-criteria'; import { ProjectCriteria } from '@app/core/query/project/project-criteria'; @@ -20,9 +20,9 @@ import { takeUntil } from 'rxjs/operators'; }) export class GrantTabComponent extends BaseComponent implements OnInit { - @Input() grantformGroup: FormGroup; - @Input() projectFormGroup: FormGroup; - @Input() funderFormGroup: FormGroup = null; + @Input() grantformGroup: UntypedFormGroup; + @Input() projectFormGroup: UntypedFormGroup; + @Input() funderFormGroup: UntypedFormGroup = null; @Input() isFinalized: boolean; @Input() isNewVersion: boolean; @Input() isNew: boolean; diff --git a/dmp-frontend/src/app/ui/dmp/editor/grant-tab/project-form-model.ts b/dmp-frontend/src/app/ui/dmp/editor/grant-tab/project-form-model.ts index fbcee5fe4..4b165ec71 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/grant-tab/project-form-model.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/grant-tab/project-form-model.ts @@ -1,4 +1,4 @@ -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; import { Status } from '@app/core/common/enum/status'; import { ProjectModel } from '@app/core/model/project/project'; import { BackendErrorValidator } from '@common/forms/validation/custom-validator'; @@ -21,10 +21,10 @@ export class ProjectFormModel { return this; } - buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { + buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup { if (context == null) { context = this.createValidationContext(); } - const formGroup = new FormBuilder().group({ + const formGroup = new UntypedFormBuilder().group({ id: [{ value: this.id, disabled: disabled }, context.getValidation('id').validators], label: [{ value: this.label, disabled: disabled }, context.getValidation('label').validators], status: [{ value: this.status, disabled: disabled }, context.getValidation('status').validators], diff --git a/dmp-frontend/src/app/ui/dmp/editor/license-info/license-info.component.ts b/dmp-frontend/src/app/ui/dmp/editor/license-info/license-info.component.ts index e87151aa0..91975a5c5 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/license-info/license-info.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/license-info/license-info.component.ts @@ -1,6 +1,6 @@ import { BaseComponent } from '@common/base/base.component'; import { OnInit, Component, Input, Output, EventEmitter } from '@angular/core'; -import { FormGroup, FormControl, FormArray } from '@angular/forms'; +import { UntypedFormGroup, UntypedFormControl, UntypedFormArray } from '@angular/forms'; import { map, takeUntil } from 'rxjs/operators'; import { ExternalSourceItemModel } from '@app/core/model/external-sources/external-source-item'; import { Observable } from 'rxjs'; @@ -27,14 +27,14 @@ interface Visible { }) export class LicenseInfoComponent extends BaseComponent implements OnInit { - @Input() formGroup: FormGroup = null; + @Input() formGroup: UntypedFormGroup = null; // @Input() datasetFormGroup: FormGroup; @Input() isNewVersion: boolean; @Input() isUserOwner: boolean; @Input() isClone: boolean; @Output() onFormChanged: EventEmitter = new EventEmitter(); - public formControl = new FormControl(); + public formControl = new UntypedFormControl(); visibles: Visible[] = [ { value: true, name: 'DMP-EDITOR.VISIBILITY.PUBLIC' }, @@ -90,7 +90,7 @@ export class LicenseInfoComponent extends BaseComponent implements OnInit { costsArray.push(result); let costeditModel: CostEditorModel = new CostEditorModel(); costeditModel = costeditModel.fromModel(result); - (this.formGroup.get('extraProperties').get('costs')).push(costeditModel.buildForm(null, true)); + (this.formGroup.get('extraProperties').get('costs')).push(costeditModel.buildForm(null, true)); } }); } diff --git a/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.ts b/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.ts index 1beaec367..1d371c001 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.ts @@ -1,6 +1,6 @@ import { BaseComponent } from '@common/base/base.component'; import { OnInit, Component, Input, Output, EventEmitter } from '@angular/core'; -import { FormGroup, FormControl } from '@angular/forms'; +import { UntypedFormGroup, UntypedFormControl } from '@angular/forms'; import { TranslateService } from '@ngx-translate/core'; import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration'; @@ -32,14 +32,14 @@ import { OrganisationService } from '@app/core/services/organisation/organisatio }) export class MainInfoComponent extends BaseComponent implements OnInit { - @Input() formGroup: FormGroup = null; + @Input() formGroup: UntypedFormGroup = null; // @Input() datasetFormGroup: FormGroup; @Input() isNewVersion: boolean; @Input() isUserOwner: boolean; @Input() isClone: boolean; @Output() onFormChanged: EventEmitter = new EventEmitter(); - public formControl = new FormControl(); + public formControl = new UntypedFormControl(); private associates: UserModel[] = []; diff --git a/dmp-frontend/src/app/ui/dmp/editor/people-tab/people-tab.component.ts b/dmp-frontend/src/app/ui/dmp/editor/people-tab/people-tab.component.ts index a3529f51d..749c26ac9 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/people-tab/people-tab.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/people-tab/people-tab.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component'; import { TranslateService } from '@ngx-translate/core'; @@ -17,7 +17,7 @@ import { DmpEditorModel } from '../dmp-editor.model'; }) export class PeopleTabComponent implements OnInit { - @Input() formGroup: FormGroup; + @Input() formGroup: UntypedFormGroup; @Input() dmp: DmpEditorModel; @Input() isPublic: boolean; @Input() isFinalized: boolean; diff --git a/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation-dialog.component.ts index f3304275b..9a77f2608 100644 --- a/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation-dialog.component.ts @@ -1,7 +1,7 @@ import { COMMA, ENTER } from '@angular/cdk/keycodes'; import { Component, Inject, OnInit, ViewChild } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { MatChipInputEvent } from '@angular/material/chips'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; @@ -27,7 +27,7 @@ import { TranslateService } from '@ngx-translate/core'; }) export class DmpInvitationDialogComponent extends BaseComponent implements OnInit { - public formGroup: FormGroup; + public formGroup: UntypedFormGroup; public filteredUsersAsync = false; public filteredUsers: DmpInvitationUser[]; public emails: string[] = []; diff --git a/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria-dialog.component.ts index 168530b98..b17af0e78 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria-dialog.component.ts @@ -2,7 +2,7 @@ import { Inject, Component, ViewChild, OnInit, Output, EventEmitter } from '@ang import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { DmpCriteriaComponent } from './dmp-criteria.component'; import { DmpCriteria } from '@app/core/query/dmp/dmp-criteria'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { MatomoService } from '@app/core/services/matomo/matomo-service'; import { HttpClient } from '@angular/common/http'; @@ -20,7 +20,7 @@ export class DmpCriteriaDialogComponent implements OnInit { public dialogRef: MatDialogRef, private httpClient: HttpClient, private matomoService: MatomoService, - @Inject(MAT_DIALOG_DATA) public data: { showGrant: boolean, isPublic: boolean, criteria: DmpCriteria, formGroup: FormGroup, updateDataFn: Function } + @Inject(MAT_DIALOG_DATA) public data: { showGrant: boolean, isPublic: boolean, criteria: DmpCriteria, formGroup: UntypedFormGroup, updateDataFn: Function } ) { } diff --git a/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.ts b/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.ts index 8ec624e36..0a39cbdcd 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnInit, Output, EventEmitter } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; import { GrantListingModel } from '@app/core/model/grant/grant-listing'; @@ -34,7 +34,7 @@ export class DmpCriteriaComponent extends BaseCriteriaComponent implements OnIni @Input() showGrant: boolean; @Input() isPublic: boolean; - @Input() criteriaFormGroup: FormGroup; + @Input() criteriaFormGroup: UntypedFormGroup; @Output() filtersChanged: EventEmitter = new EventEmitter(); filteringGrantsAsync = false; @@ -43,15 +43,15 @@ export class DmpCriteriaComponent extends BaseCriteriaComponent implements OnIni filteringOrganisationsAsync = false; filteredGrants: GrantListingModel[]; - public formGroup = new FormBuilder().group({ - like: new FormControl(), - grants: new FormControl(), - status: new FormControl(), - role: new FormControl, - organisations: new FormControl(), - collaborators: new FormControl(), - datasetTemplates: new FormControl(), - grantStatus: new FormControl() + public formGroup = new UntypedFormBuilder().group({ + like: new UntypedFormControl(), + grants: new UntypedFormControl(), + status: new UntypedFormControl(), + role: new UntypedFormControl, + organisations: new UntypedFormControl(), + collaborators: new UntypedFormControl(), + datasetTemplates: new UntypedFormControl(), + grantStatus: new UntypedFormControl() }); collaboratorsAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = { @@ -87,7 +87,7 @@ export class DmpCriteriaComponent extends BaseCriteriaComponent implements OnIni public language: TranslateService, public grantService: GrantService, private dmpService: DmpService, - public formBuilder: FormBuilder, + public formBuilder: UntypedFormBuilder, private dialog: MatDialog, private organisationService: OrganisationService, private userService: UserService, diff --git a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts index f825230d6..b2ec95b89 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts @@ -23,7 +23,7 @@ import { DmpUploadDialogue } from './upload-dialogue/dmp-upload-dialogue.compone import { UiNotificationService, SnackBarNotificationLevel } from '@app/core/services/notification/ui-notification-service'; import { isNullOrUndefined } from '@app/utilities/enhancers/utils'; import { AuthService } from '@app/core/services/auth/auth.service'; -import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; import { DmpCriteriaDialogComponent } from './criteria/dmp-criteria-dialog.component'; import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order'; import { GuidedTourService } from '@app/library/guided-tour/guided-tour.service'; @@ -60,10 +60,10 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread pageSize: number = 5; criteria: DmpCriteria; - criteriaFormGroup: FormGroup; - public formGroup = new FormBuilder().group({ - like: new FormControl(), - order: new FormControl() + criteriaFormGroup: UntypedFormGroup; + public formGroup = new UntypedFormBuilder().group({ + like: new UntypedFormControl(), + order: new UntypedFormControl() }); scrollbar: boolean; @@ -441,7 +441,7 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread this.criteria.grantStatus = formGroup.get('grantStatus').value; } - setPublicCriteria(formGroup?: FormGroup): void { + setPublicCriteria(formGroup?: UntypedFormGroup): void { if (!isNullOrUndefined(formGroup)) { if (formGroup.get('status').value == 2) { this.criteria.status = 1; diff --git a/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.ts b/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.ts index 73760cb11..3cf55ed81 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.ts @@ -19,7 +19,7 @@ import { Role } from '@app/core/common/enum/role'; import { LockService } from '@app/core/services/lock/lock.service'; import { Location } from '@angular/common'; import { DmpModel } from '@app/core/model/dmp/dmp'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { DmpEditorModel } from '../../editor/dmp-editor.model'; import { CloneDialogComponent } from '../../clone/clone-dialog/clone-dialog.component'; import { ProjectFormModel } from '../../editor/grant-tab/project-form-model'; @@ -48,7 +48,7 @@ export class DmpListingItemComponent extends BaseComponent implements OnInit { isFinalized: boolean; isPublished: boolean; dmpModel: DmpEditorModel; - dmpFormGroup: FormGroup; + dmpFormGroup: UntypedFormGroup; constructor( private router: Router, diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts index 7e6599836..723d0aabe 100644 --- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts +++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts @@ -30,7 +30,7 @@ import {Role} from "@app/core/common/enum/role"; import {DmpInvitationDialogComponent} from '../invitation/dmp-invitation-dialog.component'; import {ConfigurationService} from '@app/core/services/configuration/configuration.service'; import {Location} from '@angular/common'; -import {FormGroup} from '@angular/forms'; +import {UntypedFormGroup} from '@angular/forms'; import {LockService} from '@app/core/services/lock/lock.service'; import {VersionListingModel} from '@app/core/model/version/version-listing.model'; import {CloneDialogComponent} from '../clone/clone-dialog/clone-dialog.component'; @@ -77,7 +77,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { depositRepos: DepositConfigurationModel[] = []; - formGroup: FormGroup; + formGroup: UntypedFormGroup; constructor( private route: ActivatedRoute, diff --git a/dmp-frontend/src/app/ui/dmp/start-new-dataset-dialogue/start-new-dataset-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/start-new-dataset-dialogue/start-new-dataset-dialog.component.ts index 8a86bc52b..0783b92bf 100644 --- a/dmp-frontend/src/app/ui/dmp/start-new-dataset-dialogue/start-new-dataset-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/start-new-dataset-dialogue/start-new-dataset-dialog.component.ts @@ -10,7 +10,7 @@ import { DmpCriteria } from '@app/core/query/dmp/dmp-criteria'; import { DmpStatus } from '@app/core/common/enum/dmp-status'; import { map } from 'rxjs/operators'; import { DmpService } from '@app/core/services/dmp/dmp.service'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; @Component({ selector: 'app-start-new-dataset', @@ -20,7 +20,7 @@ import { FormGroup } from '@angular/forms'; export class StartNewDatasetDialogComponent extends BaseComponent { public isDialog: boolean = false; - public formGroup: FormGroup; + public formGroup: UntypedFormGroup; dmpAutoCompleteConfiguration: SingleAutoCompleteConfiguration = { filterFn: this.searchDmp.bind(this), diff --git a/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard-editor.model.ts b/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard-editor.model.ts index 208a8f2e0..372e55c3b 100644 --- a/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard-editor.model.ts +++ b/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard-editor.model.ts @@ -1,4 +1,4 @@ -import { FormBuilder, FormGroup, Validators } from "@angular/forms"; +import { UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms"; import { DmpModel } from '@app/core/model/dmp/dmp'; import { DmpDynamicField } from '@app/core/model/dmp/dmp-dynamic-field'; import { DmpDynamicFieldDependency } from '@app/core/model/dmp/dmp-dynamic-field-dependency'; @@ -65,10 +65,10 @@ export class DmpWizardEditorModel { return this; } - buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { + buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup { if (context == null) { context = this.createValidationContext(); } - const formGroup = new FormBuilder().group({ + const formGroup = new UntypedFormBuilder().group({ id: [{ value: this.id, disabled: disabled }, context.getValidation('id').validators], profile: [{ value: this.profile, disabled: disabled }, context.getValidation('profile').validators], label: [{ value: this.label, disabled: disabled }, context.getValidation('label').validators], @@ -88,13 +88,13 @@ export class DmpWizardEditorModel { extraProperties: this.extraProperties.buildForm(), }); - const dynamicFields = new Array(); + const dynamicFields = new Array(); if (this.dynamicFields) { this.dynamicFields.forEach(item => dynamicFields.push(item.buildForm())); } - formGroup.addControl('dynamicFields', new FormBuilder().array(dynamicFields)); + formGroup.addControl('dynamicFields', new UntypedFormBuilder().array(dynamicFields)); - const extraFields = new Array(); + const extraFields = new Array(); if (this.extraFields) { this.extraFields.forEach(item => extraFields.push(item.buildForm())); } - formGroup.addControl('extraFields', new FormBuilder().array(extraFields)); + formGroup.addControl('extraFields', new UntypedFormBuilder().array(extraFields)); return formGroup; } @@ -140,8 +140,8 @@ export class DmpDynamicFieldEditorModel { return this; } - buildForm(): FormGroup { - const builder = new FormBuilder(); + buildForm(): UntypedFormGroup { + const builder = new UntypedFormBuilder(); const formGroup = builder.group({ id: [this.id], name: [this.name], @@ -164,8 +164,8 @@ export class DmpDynamicFieldDependencyEditorModel { return this; } - buildForm(): FormGroup { - return new FormBuilder().group({ + buildForm(): UntypedFormGroup { + return new UntypedFormBuilder().group({ id: [this.id], queryProperty: [this.queryProperty] }); diff --git a/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard.component.ts b/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard.component.ts index 1d8c100a7..0d3e9ee3a 100644 --- a/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard.component.ts +++ b/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard.component.ts @@ -1,7 +1,7 @@ import { HttpErrorResponse } from '@angular/common/http'; import { Component, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { DmpModel } from '@app/core/model/dmp/dmp'; @@ -32,7 +32,7 @@ export class DmpWizardComponent extends BaseComponent implements OnInit, IBreadC breadCrumbs: Observable; itemId: string; dmp: DmpWizardEditorModel; - formGroup: FormGroup; + formGroup: UntypedFormGroup; isClone: boolean; saving = false; diff --git a/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.ts b/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.ts index d050ea2bc..74767095c 100644 --- a/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.ts +++ b/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; @@ -31,7 +31,7 @@ import { DataTableRequest } from '@app/core/model/data-table/data-table-request' export class DmpWizardEditorComponent extends BaseComponent implements OnInit { isNew = true; - @Input() formGroup: FormGroup = null; + @Input() formGroup: UntypedFormGroup = null; filteringOrganisationsAsync = false; filteringResearchersAsync = false; diff --git a/dmp-frontend/src/app/ui/dmp/wizard/listing/dmp-wizard-dataset-listing.component.ts b/dmp-frontend/src/app/ui/dmp/wizard/listing/dmp-wizard-dataset-listing.component.ts index 98a5dbf7e..4e840d3ec 100644 --- a/dmp-frontend/src/app/ui/dmp/wizard/listing/dmp-wizard-dataset-listing.component.ts +++ b/dmp-frontend/src/app/ui/dmp/wizard/listing/dmp-wizard-dataset-listing.component.ts @@ -1,6 +1,6 @@ import { SelectionModel } from '@angular/cdk/collections'; import { Component, Input, OnInit, ViewChild } from '@angular/core'; -import { FormArray, FormBuilder, FormControl, FormGroup } from '@angular/forms'; +import { UntypedFormArray, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; import { MatPaginator } from '@angular/material/paginator'; import { MatSnackBar } from '@angular/material/snack-bar'; import { MatSort } from '@angular/material/sort'; @@ -31,7 +31,7 @@ export class DmpWizardDatasetListingComponent extends BaseComponent implements O datasets: DatasetListingModel[] = []; @Input() dmpId: string; - @Input() formGroup: FormGroup; + @Input() formGroup: UntypedFormGroup; selection = new SelectionModel(true, []); statuses = [ @@ -70,14 +70,14 @@ export class DmpWizardDatasetListingComponent extends BaseComponent implements O .subscribe(items => { this.datasets = items.data; }); - this.formGroup.addControl('datasets', new FormBuilder().array(new Array())); + this.formGroup.addControl('datasets', new UntypedFormBuilder().array(new Array())); } selectionChanged(event, selectedItems) { this.formGroup.removeControl('datasets'); - this.formGroup.addControl('datasets', new FormBuilder().array(new Array())); + this.formGroup.addControl('datasets', new UntypedFormBuilder().array(new Array())); selectedItems.selectedOptions.selected.forEach(element => { - (this.formGroup.get('datasets')).push(new FormBuilder().group({ id: element.value })); + (this.formGroup.get('datasets')).push(new UntypedFormBuilder().group({ id: element.value })); }); } } diff --git a/dmp-frontend/src/app/ui/faq/faq.module.ts b/dmp-frontend/src/app/ui/faq/faq.module.ts index 71b795ed3..fd529a96f 100644 --- a/dmp-frontend/src/app/ui/faq/faq.module.ts +++ b/dmp-frontend/src/app/ui/faq/faq.module.ts @@ -5,20 +5,16 @@ import { FaqContentComponent } from './faq-content/faq-content.component'; import { FaqRoutingModule } from './faq.routing'; @NgModule({ - imports: [ - CommonUiModule, - FaqRoutingModule - ], - declarations: [ - FaqContentComponent, - FaqDialogComponent - ], - entryComponents: [ - FaqContentComponent, - FaqDialogComponent - ], - exports: [ - FaqDialogComponent - ] + imports: [ + CommonUiModule, + FaqRoutingModule + ], + declarations: [ + FaqContentComponent, + FaqDialogComponent + ], + exports: [ + FaqDialogComponent + ] }) export class FaqModule { } diff --git a/dmp-frontend/src/app/ui/glossary/glossary.module.ts b/dmp-frontend/src/app/ui/glossary/glossary.module.ts index c84ed0310..a29257e27 100644 --- a/dmp-frontend/src/app/ui/glossary/glossary.module.ts +++ b/dmp-frontend/src/app/ui/glossary/glossary.module.ts @@ -5,20 +5,16 @@ import { GlossaryContentComponent } from './glossary-content/glossary-content.co import { GlossaryRoutingModule } from './glossary.routing'; @NgModule({ - imports: [ - CommonUiModule, - GlossaryRoutingModule - ], - declarations: [ - GlossaryContentComponent, - GlossaryDialogComponent - ], - entryComponents: [ - GlossaryContentComponent, - GlossaryDialogComponent - ], - exports: [ - GlossaryDialogComponent - ] + imports: [ + CommonUiModule, + GlossaryRoutingModule + ], + declarations: [ + GlossaryContentComponent, + GlossaryDialogComponent + ], + exports: [ + GlossaryDialogComponent + ] }) export class GlossaryModule { } diff --git a/dmp-frontend/src/app/ui/grant/editor/grant-editor.model.ts b/dmp-frontend/src/app/ui/grant/editor/grant-editor.model.ts index 28769e4a8..abc99e8d9 100644 --- a/dmp-frontend/src/app/ui/grant/editor/grant-editor.model.ts +++ b/dmp-frontend/src/app/ui/grant/editor/grant-editor.model.ts @@ -1,4 +1,4 @@ -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; import { BackendErrorValidator } from '@common/forms/validation/custom-validator'; import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model'; import { ValidationContext } from '@common/forms/validation/validation-context'; @@ -37,10 +37,10 @@ export class GrantEditorModel { return this; } - buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { + buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup { if (context == null) { context = this.createValidationContext(); } - const formGroup = new FormBuilder().group({ + const formGroup = new UntypedFormBuilder().group({ id: [{ value: this.id, disabled: disabled }, context.getValidation('id').validators], label: [{ value: this.label, disabled: disabled }, context.getValidation('label').validators], abbreviation: [{ value: this.abbreviation, disabled: disabled }, context.getValidation('abbreviation').validators], @@ -73,7 +73,7 @@ export class GrantEditorModel { } } -export function startEndValidator(formGroup: FormGroup) { +export function startEndValidator(formGroup: UntypedFormGroup) { const start = formGroup.get('startDate').value; const end = formGroup.get('endDate').value; if (start != null && end != null && end < start) { diff --git a/dmp-frontend/src/app/ui/language-editor/language-editor.component.ts b/dmp-frontend/src/app/ui/language-editor/language-editor.component.ts index effcdd6e5..d0e52615a 100644 --- a/dmp-frontend/src/app/ui/language-editor/language-editor.component.ts +++ b/dmp-frontend/src/app/ui/language-editor/language-editor.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit, OnDestroy, ViewChild, AfterViewInit, ChangeDetectorR import { LanguageService } from '@app/core/services/language/language.service'; import { BaseComponent } from '@common/base/base.component'; import { takeUntil } from 'rxjs/operators'; -import { FormGroup, FormBuilder } from '@angular/forms'; +import { UntypedFormGroup, UntypedFormBuilder } from '@angular/forms'; import { TranslateService } from '@ngx-translate/core'; import { UiNotificationService, SnackBarNotificationLevel } from '@app/core/services/notification/ui-notification-service'; import { Router } from '@angular/router'; @@ -29,8 +29,8 @@ export class LanguageEditorComponent extends BaseComponent implements OnInit, Af endIndex: number; parseFinished = false; currentLang: string; - formGroup: FormGroup; - formBuilder: FormBuilder; + formGroup: UntypedFormGroup; + formBuilder: UntypedFormBuilder; constructor( private language: LanguageService, @@ -58,7 +58,7 @@ export class LanguageEditorComponent extends BaseComponent implements OnInit, Af ngOnInit() { this.matomoService.trackPageView('Admin: Language Editor'); - this.formBuilder = new FormBuilder(); + this.formBuilder = new UntypedFormBuilder(); this.formGroup = this.formBuilder.group({}); this.endIndex = this.maxElements; window.addEventListener('scroll', this.refreshFn, true); @@ -92,12 +92,12 @@ export class LanguageEditorComponent extends BaseComponent implements OnInit, Af fr.readAsText(blob); } - convertObjectToForm(obj: any, parentKey: string, form: FormGroup) { + convertObjectToForm(obj: any, parentKey: string, form: UntypedFormGroup) { for (let prop in obj) { const key = parentKey !== '' ? `${parentKey}.${prop}` : prop; if (typeof obj[prop] === 'object') { form.addControl(prop, this.formBuilder.group({})); - this.convertObjectToForm(obj[prop], key, form.get(prop) as FormGroup); + this.convertObjectToForm(obj[prop], key, form.get(prop) as UntypedFormGroup); continue; } else { form.addControl(prop, this.formBuilder.control(obj[prop])); diff --git a/dmp-frontend/src/app/ui/language/language.module.ts b/dmp-frontend/src/app/ui/language/language.module.ts index 78c7d5dc0..df4d32040 100644 --- a/dmp-frontend/src/app/ui/language/language.module.ts +++ b/dmp-frontend/src/app/ui/language/language.module.ts @@ -6,20 +6,16 @@ import { LanguageDialogComponent } from './dialog/language-dialog.component'; @NgModule({ - declarations: [ - LanguageComponent, - LanguageDialogComponent -], - imports: [ - CommonUiModule - ], - entryComponents: [ - LanguageComponent, - LanguageDialogComponent - ], - exports: [ - LanguageComponent, - LanguageDialogComponent - ] + declarations: [ + LanguageComponent, + LanguageDialogComponent + ], + imports: [ + CommonUiModule + ], + exports: [ + LanguageComponent, + LanguageDialogComponent + ] }) export class LanguageModule { } diff --git a/dmp-frontend/src/app/ui/misc/criteria/base-criteria.component.ts b/dmp-frontend/src/app/ui/misc/criteria/base-criteria.component.ts index ac1926486..15a1bcf78 100644 --- a/dmp-frontend/src/app/ui/misc/criteria/base-criteria.component.ts +++ b/dmp-frontend/src/app/ui/misc/criteria/base-criteria.component.ts @@ -1,5 +1,5 @@ import { OnInit, Directive } from '@angular/core'; -import { AbstractControl, FormArray, FormControl, FormGroup } from '@angular/forms'; +import { AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; import { BaseComponent } from '@common/base/base.component'; import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model'; @@ -7,7 +7,7 @@ import { ValidationErrorModel } from '@common/forms/validation/error-model/valid export class BaseCriteriaComponent extends BaseComponent implements OnInit { public refreshCallback: Function = null; - public formGroup: FormGroup = null; + public formGroup: UntypedFormGroup = null; constructor( public validationErrorModel: ValidationErrorModel, @@ -44,14 +44,14 @@ export class BaseCriteriaComponent extends BaseComponent implements OnInit { } public validateAllFormFields(formControl: AbstractControl) { - if (formControl instanceof FormControl) { + if (formControl instanceof UntypedFormControl) { formControl.updateValueAndValidity({ emitEvent: false }); - } else if (formControl instanceof FormGroup) { + } else if (formControl instanceof UntypedFormGroup) { Object.keys(formControl.controls).forEach(item => { const control = formControl.get(item); this.validateAllFormFields(control); }); - } else if (formControl instanceof FormArray) { + } else if (formControl instanceof UntypedFormArray) { formControl.controls.forEach(item => { this.validateAllFormFields(item); }); @@ -59,14 +59,14 @@ export class BaseCriteriaComponent extends BaseComponent implements OnInit { } public touchAllFormFields(formControl: AbstractControl) { - if (formControl instanceof FormControl) { + if (formControl instanceof UntypedFormControl) { formControl.markAsTouched(); - } else if (formControl instanceof FormGroup) { + } else if (formControl instanceof UntypedFormGroup) { Object.keys(formControl.controls).forEach(item => { const control = formControl.get(item); this.touchAllFormFields(control); }); - } else if (formControl instanceof FormArray) { + } else if (formControl instanceof UntypedFormArray) { formControl.controls.forEach(item => { this.touchAllFormFields(item); }); diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.ts index 3e28f1ef5..0009da801 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.ts @@ -1,5 +1,5 @@ import {ChangeDetectionStrategy, ChangeDetectorRef, Component, Input} from '@angular/core'; -import {FormArray, FormGroup} from '@angular/forms'; +import {UntypedFormArray, UntypedFormGroup} from '@angular/forms'; import {BaseComponent} from '@common/base/base.component'; import {takeUntil} from 'rxjs/operators'; import {ToCEntry} from '../../dataset-description.component'; @@ -19,7 +19,7 @@ import {cloneAbstractControl} from "@app/utilities/enhancers/utils"; export class FormCompositeFieldComponent extends BaseComponent { @Input() datasetProfileId: String; - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; @Input() isChild: Boolean = false; @Input() showDelete: Boolean = false; @Input() tocentry: ToCEntry; @@ -44,7 +44,7 @@ export class FormCompositeFieldComponent extends BaseComponent { this.changeDetector.markForCheck(); }); if (this.tocentry) { - this.form = this.tocentry.form as FormGroup; + this.form = this.tocentry.form as UntypedFormGroup; } } @@ -86,15 +86,15 @@ export class FormCompositeFieldComponent extends BaseComponent { deleteCompositeFieldFormGroup() { - const compositeFieldId = ((this.form.get('multiplicityItems') as FormArray).get('' + 0) as FormGroup).getRawValue().id; - const fieldIds = (this.form.get('fields') as FormArray).controls.map(control => control.get('id').value) as string[]; + const compositeFieldId = ((this.form.get('multiplicityItems') as UntypedFormArray).get('' + 0) as UntypedFormGroup).getRawValue().id; + const fieldIds = (this.form.get('fields') as UntypedFormArray).controls.map(control => control.get('id').value) as string[]; const numberOfItems = this.form.get('multiplicityItems').get('' + 0).get('fields').value.length; for (let i = 0; i < numberOfItems; i++) { const multiplicityItem = this.form.get('multiplicityItems').get('' + 0).get('fields').get('' + i).value; this.form.get('fields').get('' + i).patchValue(multiplicityItem); } - ((this.form.get('multiplicityItems'))).removeAt(0); + ((this.form.get('multiplicityItems'))).removeAt(0); this.visibilityRulesService.removeAllIdReferences(compositeFieldId); @@ -103,17 +103,17 @@ export class FormCompositeFieldComponent extends BaseComponent { deleteMultipeFieldFromCompositeFormGroup() { const parent = this.form.parent; - const index = (parent as FormArray).controls.indexOf(this.form); + const index = (parent as UntypedFormArray).controls.indexOf(this.form); const currentId = this.form.get('id').value; - const fieldIds = (this.form.get('fields') as FormArray).controls.map(control => control.get('id').value) as string[]; + const fieldIds = (this.form.get('fields') as UntypedFormArray).controls.map(control => control.get('id').value) as string[]; this.visibilityRulesService.removeAllIdReferences(currentId); fieldIds.forEach(x => this.visibilityRulesService.removeAllIdReferences(x)); - (parent as FormArray).removeAt(index); - (parent as FormArray).controls.forEach((control, i) => { + (parent as UntypedFormArray).removeAt(index); + (parent as UntypedFormArray).controls.forEach((control, i) => { try { control.get('ordinal').setValue(i); } catch { diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-title/form-composite-title.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-title/form-composite-title.component.ts index 797650d47..5cfc7027a 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-title/form-composite-title.component.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-title/form-composite-title.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit, Input } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { ToCEntry } from '../../dataset-description.component'; @Component({ @@ -9,7 +9,7 @@ import { ToCEntry } from '../../dataset-description.component'; }) export class FormCompositeTitleComponent implements OnInit { - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; @Input() isChild: Boolean = false; @Input() tocentry:ToCEntry; @@ -19,7 +19,7 @@ export class FormCompositeTitleComponent implements OnInit { ngOnInit() { if(this.tocentry){ - this.form = this.tocentry.form as FormGroup; + this.form = this.tocentry.form as UntypedFormGroup; } } diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.ts index 0bc73c23f..c19014f99 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.ts @@ -1,6 +1,6 @@ import {ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnInit, SimpleChanges} from '@angular/core'; -import { FormGroup, FormArray, FormControl } from '@angular/forms'; +import { UntypedFormGroup, FormArray, UntypedFormControl } from '@angular/forms'; import { DatasetProfileComboBoxType } from '@app/core/common/enum/dataset-profile-combo-box-type'; import { DatasetProfileFieldViewStyle } from '@app/core/common/enum/dataset-profile-field-view-style'; import { DatasetProfileInternalDmpEntitiesType } from '@app/core/common/enum/dataset-profile-internal-dmp-entities-type'; @@ -58,7 +58,7 @@ import * as FileSaver from "file-saver"; export class FormFieldComponent extends BaseComponent implements OnInit { // @Input() field: Field; - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; @Input() datasetProfileId: any; @Input() isChild: Boolean = false; autocompleteOptions: AutoCompleteSingleData[]; @@ -596,8 +596,8 @@ export class FormFieldComponent extends BaseComponent implements OnInit { return this.externalSourcesService.searchDMPResearchers({ criteria: { name: value, like: null } }); } - getDatasetIdControl(name: string): FormControl { - return this.form.get('value').get(name) as FormControl; + getDatasetIdControl(name: string): UntypedFormControl { + return this.form.get('value').get(name) as UntypedFormControl; } searchCurrency(query: string): Observable { diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component.ts index dd3cfa289..689270e7c 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component.ts @@ -1,5 +1,5 @@ import {ChangeDetectorRef, Component, ElementRef, Input, OnChanges, OnInit, SimpleChanges} from '@angular/core'; -import { AbstractControl, FormArray, FormControl, FormGroup } from '@angular/forms'; +import { AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; import { VisibilityRulesService } from '@app/ui/misc/dataset-description-form/visibility-rules/visibility-rules.service'; import { BaseComponent } from '@common/base/base.component'; import { takeUntil } from 'rxjs/operators'; @@ -10,7 +10,7 @@ import { takeUntil } from 'rxjs/operators'; styleUrls: ['./form-progress-indication.component.scss'] }) export class FormProgressIndicationComponent extends BaseComponent implements OnInit, OnChanges { - @Input() formGroup: FormGroup; + @Input() formGroup: UntypedFormGroup; @Input() isDmpEditor: boolean; @Input() isDatasetEditor: boolean; @Input() public progressValueAccuracy = 2; @@ -59,12 +59,12 @@ export class FormProgressIndicationComponent extends BaseComponent implements On countFormControlsWithValueForProgress(formControl: AbstractControl): number { let valueCurent = 0; - if (formControl instanceof FormGroup) { - if (this.checkFormsIfIsFieldsAndVisible(formControl) && this.checkIfIsRequired((formControl as FormGroup))) { + if (formControl instanceof UntypedFormGroup) { + if (this.checkFormsIfIsFieldsAndVisible(formControl) && this.checkIfIsRequired((formControl as UntypedFormGroup))) { if (this.hasValue(formControl)) valueCurent++; } - if (this.chechFieldIfIsFieldSetAndVisible((formControl as FormGroup)) && this.checkIfIsRequired((formControl as FormGroup))) { + if (this.chechFieldIfIsFieldSetAndVisible((formControl as UntypedFormGroup)) && this.checkIfIsRequired((formControl as UntypedFormGroup))) { valueCurent = valueCurent + this.compositeFieldsGetChildsForProgress(formControl); } else { Object.keys(formControl.controls).forEach(item => { @@ -72,43 +72,43 @@ export class FormProgressIndicationComponent extends BaseComponent implements On valueCurent = valueCurent + this.countFormControlsWithValueForProgress(control); }); } - } else if (formControl instanceof FormArray) { + } else if (formControl instanceof UntypedFormArray) { formControl.controls.forEach(item => { valueCurent = valueCurent + this.countFormControlsWithValueForProgress(item); }); } return valueCurent; } - private hasValue(formGroup: FormGroup): boolean { + private hasValue(formGroup: UntypedFormGroup): boolean { return formGroup.get('value').valid && formGroup.get('value').value != null && formGroup.get('value').value !== '' && this.visibilityRulesService.checkElementVisibility(formGroup.get('id').value); } - private compositeFieldsGetChildsForProgress(formGroup: FormGroup): number { + private compositeFieldsGetChildsForProgress(formGroup: UntypedFormGroup): number { let valueCurent = 0; if (this.visibilityRulesService.checkElementVisibility(formGroup.get('id').value)) { - (formGroup.get('fields') as FormArray).controls.forEach((element: FormGroup) => { + (formGroup.get('fields') as UntypedFormArray).controls.forEach((element: UntypedFormGroup) => { valueCurent = valueCurent + this.countFormControlsWithValueForProgress(element); }); - (formGroup.get('multiplicityItems') as FormArray).controls.forEach((element: FormGroup) => { + (formGroup.get('multiplicityItems') as UntypedFormArray).controls.forEach((element: UntypedFormGroup) => { valueCurent = valueCurent + this.countFormControlsWithValueForProgress(element); }); } return valueCurent; } - private checkIfIsRequired(formControl: FormGroup): boolean { + private checkIfIsRequired(formControl: UntypedFormGroup): boolean { return !!(formControl.get('validationRequired') && formControl.get('validationRequired').value); } - private checkFormsIfIsFieldsAndVisible(formControl: FormGroup): boolean { + private checkFormsIfIsFieldsAndVisible(formControl: UntypedFormGroup): boolean { if (formControl.contains('id') && formControl.contains('value')) { return true; } return false; } - private chechFieldIfIsFieldSetAndVisible(formControl: FormGroup): boolean { + private chechFieldIfIsFieldSetAndVisible(formControl: UntypedFormGroup): boolean { if (formControl.contains('id') && formControl.contains('fields')) { return true; } @@ -117,14 +117,14 @@ export class FormProgressIndicationComponent extends BaseComponent implements On CountFormControlDepthLengthFotTotal(formControl: AbstractControl): number { let valueCurent = 0; - if (formControl instanceof FormArray) { + if (formControl instanceof UntypedFormArray) { formControl.controls.forEach(item => { valueCurent = valueCurent + this.CountFormControlDepthLengthFotTotal(item); }); - } else if (formControl instanceof FormGroup) { - if ((formControl as FormGroup).contains('id') && (formControl as FormGroup).contains('value') && (this.visibilityRulesService.checkElementVisibility((formControl as FormGroup).get('id').value)) && this.checkIfIsRequired((formControl as FormGroup))) { + } else if (formControl instanceof UntypedFormGroup) { + if ((formControl as UntypedFormGroup).contains('id') && (formControl as UntypedFormGroup).contains('value') && (this.visibilityRulesService.checkElementVisibility((formControl as UntypedFormGroup).get('id').value)) && this.checkIfIsRequired((formControl as UntypedFormGroup))) { valueCurent++; - } else if ((formControl as FormGroup).contains('id') && (formControl as FormGroup).contains('fields')) { + } else if ((formControl as UntypedFormGroup).contains('id') && (formControl as UntypedFormGroup).contains('fields')) { valueCurent = valueCurent + this.compositeFieldsGetChildsForTotal(formControl); } else { Object.keys(formControl.controls).forEach(item => { @@ -137,13 +137,13 @@ export class FormProgressIndicationComponent extends BaseComponent implements On return valueCurent; } - private compositeFieldsGetChildsForTotal(formGroup: FormGroup): number { + private compositeFieldsGetChildsForTotal(formGroup: UntypedFormGroup): number { let valueCurent = 0; if (this.visibilityRulesService.checkElementVisibility(formGroup.get('id').value)) { - (formGroup.get('fields') as FormArray).controls.forEach((element: FormGroup) => { + (formGroup.get('fields') as UntypedFormArray).controls.forEach((element: UntypedFormGroup) => { valueCurent = valueCurent + this.CountFormControlDepthLengthFotTotal(element); }); - (formGroup.get('multiplicityItems') as FormArray).controls.forEach((element: FormGroup) => { + (formGroup.get('multiplicityItems') as UntypedFormArray).controls.forEach((element: UntypedFormGroup) => { valueCurent = valueCurent + this.CountFormControlDepthLengthFotTotal(element); }); } @@ -152,16 +152,16 @@ export class FormProgressIndicationComponent extends BaseComponent implements On countFormControlsValidForProgress(formControl: AbstractControl): number { let valueCurrent = 0; - if (formControl instanceof FormControl) { + if (formControl instanceof UntypedFormControl) { if (this.controlRequired(formControl) && this.controlEnabled(formControl) && formControl.valid) { valueCurrent++; } - } else if (formControl instanceof FormGroup) { + } else if (formControl instanceof UntypedFormGroup) { Object.keys(formControl.controls).forEach(item => { const control = formControl.get(item); valueCurrent = valueCurrent + this.countFormControlsValidForProgress(control); }); - } else if (formControl instanceof FormArray) { + } else if (formControl instanceof UntypedFormArray) { formControl.controls.forEach(item => { valueCurrent = valueCurrent + this.countFormControlsValidForProgress(item); }); @@ -171,18 +171,18 @@ export class FormProgressIndicationComponent extends BaseComponent implements On countFormControlsRequiredFieldsForTotal(formControl: AbstractControl, checkVisibility = false): number { let valueCurrent = 0; - if (formControl instanceof FormControl) { + if (formControl instanceof UntypedFormControl) { if (this.controlRequired(formControl) && this.controlEnabled(formControl)) { valueCurrent++; } - } else if (formControl instanceof FormGroup) { + } else if (formControl instanceof UntypedFormGroup) { if(!checkVisibility || (!formControl.get('id')?.value || this.visibilityRulesService.checkElementVisibility(formControl.get('id').value))) { Object.keys(formControl.controls).forEach(item => { const control = formControl.get(item); valueCurrent = valueCurrent + this.countFormControlsRequiredFieldsForTotal(control, checkVisibility); }); } - } else if (formControl instanceof FormArray) { + } else if (formControl instanceof UntypedFormArray) { formControl.controls.forEach(item => { valueCurrent = valueCurrent + this.countFormControlsRequiredFieldsForTotal(item, checkVisibility); }); diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section-inner/form-section-inner.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section-inner/form-section-inner.component.ts index b93dc7107..ce9c1ceab 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section-inner/form-section-inner.component.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section-inner/form-section-inner.component.ts @@ -1,5 +1,5 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'; -import { FormArray, FormGroup } from '@angular/forms'; +import { UntypedFormArray, UntypedFormGroup } from '@angular/forms'; import { BaseComponent } from '@common/base/base.component'; import { takeUntil } from 'rxjs/operators'; import { DatasetDescriptionCompositeFieldEditorModel } from '../../../dataset-description-form.model'; @@ -18,7 +18,7 @@ export class FormSectionInnerComponent extends BaseComponent implements OnInit, //@Input() section: DatasetDescriptionSectionEditorModel; @Input() datasetProfileId: String; // @Input() compositeFieldFormGroup: FormGroup; - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; @Input() pathName: string; @Input() path: string; // @Input() i: number; @@ -66,8 +66,8 @@ export class FormSectionInnerComponent extends BaseComponent implements OnInit, // } addMultipleField(fieldsetIndex: number) { - const compositeFieldToBeCloned = (this.form.get('compositeFields').get('' + fieldsetIndex) as FormGroup).getRawValue(); - const multiplicityItemsArray = ((this.form.get('compositeFields').get('' + fieldsetIndex).get('multiplicityItems'))); + const compositeFieldToBeCloned = (this.form.get('compositeFields').get('' + fieldsetIndex) as UntypedFormGroup).getRawValue(); + const multiplicityItemsArray = ((this.form.get('compositeFields').get('' + fieldsetIndex).get('multiplicityItems'))); const compositeField: DatasetDescriptionCompositeFieldEditorModel = new DatasetDescriptionCompositeFieldEditorModel().cloneForMultiplicity(compositeFieldToBeCloned, multiplicityItemsArray.length); multiplicityItemsArray.push(compositeField.buildForm()); } @@ -78,11 +78,11 @@ export class FormSectionInnerComponent extends BaseComponent implements OnInit, const multiplicityItem = this.form.get('compositeFields').get('' + compositeFildIndex).get('multiplicityItems').get('' + 0).get('fields').get('' + i).value; this.form.get('compositeFields').get('' + compositeFildIndex).get('fields').get('' + i).patchValue(multiplicityItem); } - ((this.form.get('compositeFields').get('' + compositeFildIndex).get('multiplicityItems'))).removeAt(0); + ((this.form.get('compositeFields').get('' + compositeFildIndex).get('multiplicityItems'))).removeAt(0); } deleteMultipeFieldFromCompositeFormGroup(compositeFildIndex: number, fildIndex: number) { - const multiplicityItemsArray = ((this.form.get('compositeFields').get('' + compositeFildIndex).get('multiplicityItems'))) + const multiplicityItemsArray = ((this.form.get('compositeFields').get('' + compositeFildIndex).get('multiplicityItems'))) multiplicityItemsArray.removeAt(fildIndex); multiplicityItemsArray.controls.forEach((control, i) => { try { diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.ts index f04760f7d..761f69988 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.ts @@ -9,7 +9,7 @@ import { Output, SimpleChanges } from '@angular/core'; -import {FormArray, FormGroup} from '@angular/forms'; +import {UntypedFormArray, UntypedFormGroup} from '@angular/forms'; import {Rule} from '@app/core/model/dataset-profile-definition/rule'; import {BaseComponent} from '@common/base/base.component'; import {takeUntil} from 'rxjs/operators'; @@ -31,7 +31,7 @@ export class FormSectionComponent extends BaseComponent implements OnInit, OnCha //@Input() section: DatasetDescriptionSectionEditorModel; @Input() datasetProfileId: String; - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; @Input() tocentry: ToCEntry; @Input() pathName: string; @Input() path: string; @@ -65,7 +65,7 @@ export class FormSectionComponent extends BaseComponent implements OnInit, OnCha // } if (this.tocentry) {//maybe not needed as well - this.form = this.tocentry.form as FormGroup; + this.form = this.tocentry.form as UntypedFormGroup; } this.initMultipleFieldsVisibility(); } @@ -201,8 +201,8 @@ export class FormSectionComponent extends BaseComponent implements OnInit, OnCha } initMultipleFieldsVisibility() { - (this.form.get('compositeFields') as FormArray).controls.forEach(control => { - let parentCompositeField = (control as FormGroup).getRawValue(); + (this.form.get('compositeFields') as UntypedFormArray).controls.forEach(control => { + let parentCompositeField = (control as UntypedFormGroup).getRawValue(); if (parentCompositeField.multiplicityItems && parentCompositeField.multiplicityItems.length > 0) { parentCompositeField.multiplicityItems.forEach(compositeField => { let idMappings: { old: string, new: string }[] = [{old: parentCompositeField.id, new: compositeField.id}]; @@ -219,8 +219,8 @@ export class FormSectionComponent extends BaseComponent implements OnInit, OnCha if(this.form.get('compositeFields').get('' + fieldsetIndex).disabled) { return; } - const compositeFieldToBeCloned = (this.form.get('compositeFields').get('' + fieldsetIndex) as FormGroup).getRawValue(); - const multiplicityItemsArray = ((this.form.get('compositeFields').get('' + fieldsetIndex).get('multiplicityItems'))); + const compositeFieldToBeCloned = (this.form.get('compositeFields').get('' + fieldsetIndex) as UntypedFormGroup).getRawValue(); + const multiplicityItemsArray = ((this.form.get('compositeFields').get('' + fieldsetIndex).get('multiplicityItems'))); const ordinal = multiplicityItemsArray.length ? multiplicityItemsArray.controls.reduce((ordinal, currentControl) => { const currentOrdinal = currentControl.get('ordinal').value as number; @@ -243,11 +243,11 @@ export class FormSectionComponent extends BaseComponent implements OnInit, OnCha const multiplicityItem = this.form.get('compositeFields').get('' + compositeFildIndex).get('multiplicityItems').get('' + 0).get('fields').get('' + i).value; this.form.get('compositeFields').get('' + compositeFildIndex).get('fields').get('' + i).patchValue(multiplicityItem); } - ((this.form.get('compositeFields').get('' + compositeFildIndex).get('multiplicityItems'))).removeAt(0); + ((this.form.get('compositeFields').get('' + compositeFildIndex).get('multiplicityItems'))).removeAt(0); } deleteMultipeFieldFromCompositeFormGroup(compositeFildIndex: number, fildIndex: number) { - const multiplicityItemsArray = ((this.form.get('compositeFields').get('' + compositeFildIndex).get('multiplicityItems'))); + const multiplicityItemsArray = ((this.form.get('compositeFields').get('' + compositeFildIndex).get('multiplicityItems'))); multiplicityItemsArray.removeAt(fildIndex); multiplicityItemsArray.controls.forEach((control, i) => { try { diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.component.ts index a3ce2ebae..67ad4fdfe 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.component.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.component.ts @@ -1,5 +1,5 @@ import { AfterViewInit, Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { MatHorizontalStepper } from '@angular/material/stepper'; import { Rule } from '@app/core/model/dataset-profile-definition/rule'; import { LinkToScroll } from '@app/ui/misc/dataset-description-form/tableOfContentsMaterial/table-of-contents'; @@ -15,7 +15,7 @@ export class DatasetDescriptionFormComponent extends BaseComponent implements On @ViewChild('stepper') stepper: MatHorizontalStepper; @Input() path: string; - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; @Input() visibilityRules: Rule[] = []; @Input() datasetProfileId: String; @Input() linkToScroll: LinkToScroll; diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.model.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.model.ts index 5c8a74e46..030196340 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.model.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.model.ts @@ -1,4 +1,4 @@ -import { FormBuilder, FormControl, FormGroup, ValidatorFn, Validators } from "@angular/forms"; +import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, ValidatorFn, Validators } from "@angular/forms"; import { Guid } from '@common/types/guid'; import { ValidationType, ValidatorURL } from "../../../core/common/enum/validation-type"; import { BaseFormModel } from "../../../core/model/base-form-model"; @@ -28,14 +28,14 @@ export class DatasetDescriptionFormEditorModel extends BaseFormModel { return this; } - buildForm(): FormGroup { - const formGroup: FormGroup = new FormBuilder().group({ + buildForm(): UntypedFormGroup { + const formGroup: UntypedFormGroup = new UntypedFormBuilder().group({ rules: [{ value: this.rules, disabled: false }, BackendErrorValidator(this.validationErrorModel, 'rules')] }); - const pagesFormArray = new Array(); + const pagesFormArray = new Array(); this.pages.forEach(item => { - const form: FormGroup = item.buildForm(); + const form: UntypedFormGroup = item.buildForm(); pagesFormArray.push(form); }); formGroup.addControl('pages', this.formBuilder.array(pagesFormArray)); @@ -55,16 +55,16 @@ export class DatasetDescriptionPageEditorModel extends BaseFormModel { return this; } - buildForm(): FormGroup { - const formGroup: FormGroup = new FormBuilder().group({}); - const sectionsFormArray = new Array(); + buildForm(): UntypedFormGroup { + const formGroup: UntypedFormGroup = new UntypedFormBuilder().group({}); + const sectionsFormArray = new Array(); this.sections.forEach(item => { - const form: FormGroup = item.buildForm(); + const form: UntypedFormGroup = item.buildForm(); sectionsFormArray.push(form); }); formGroup.addControl('sections', this.formBuilder.array(sectionsFormArray)); - formGroup.addControl('title', new FormControl({ value: this.title, disabled: true })); - formGroup.addControl('ordinal', new FormControl({ value: this.ordinal, disabled: true })); + formGroup.addControl('title', new UntypedFormControl({ value: this.title, disabled: true })); + formGroup.addControl('ordinal', new UntypedFormControl({ value: this.ordinal, disabled: true })); return formGroup; } } @@ -94,29 +94,29 @@ export class DatasetDescriptionSectionEditorModel extends BaseFormModel { return this; } - buildForm(): FormGroup { - const formGroup: FormGroup = new FormBuilder().group({}); - const sectionsFormArray = new Array(); + buildForm(): UntypedFormGroup { + const formGroup: UntypedFormGroup = new UntypedFormBuilder().group({}); + const sectionsFormArray = new Array(); if (this.sections) { this.sections.forEach(item => { - const form: FormGroup = item.buildForm(); + const form: UntypedFormGroup = item.buildForm(); sectionsFormArray.push(form); }); } - const compositeFieldsFormArray = new Array(); + const compositeFieldsFormArray = new Array(); if (this.compositeFields) { this.compositeFields.forEach(item => { - const form: FormGroup = item.buildForm(); + const form: UntypedFormGroup = item.buildForm(); compositeFieldsFormArray.push(form); }); } formGroup.addControl('compositeFields', this.formBuilder.array(compositeFieldsFormArray)); formGroup.addControl('sections', this.formBuilder.array(sectionsFormArray)); - formGroup.addControl('description', new FormControl({ value: this.description, disabled: true })); - formGroup.addControl('numbering', new FormControl({ value: this.numbering, disabled: true })); - formGroup.addControl('title', new FormControl({ value: this.title, disabled: true })); - formGroup.addControl('id', new FormControl({ value: this.id, disabled: false })); - formGroup.addControl('ordinal', new FormControl({ value: this.ordinal, disabled: true })); + formGroup.addControl('description', new UntypedFormControl({ value: this.description, disabled: true })); + formGroup.addControl('numbering', new UntypedFormControl({ value: this.numbering, disabled: true })); + formGroup.addControl('title', new UntypedFormControl({ value: this.title, disabled: true })); + formGroup.addControl('id', new UntypedFormControl({ value: this.id, disabled: false })); + formGroup.addControl('ordinal', new UntypedFormControl({ value: this.ordinal, disabled: true })); return formGroup; } } @@ -153,7 +153,7 @@ export class DatasetDescriptionCompositeFieldEditorModel extends BaseFormModel { return this; } - buildForm(): FormGroup { + buildForm(): UntypedFormGroup { const formGroup = this.formBuilder.group({ id: this.id, ordinal: this.ordinal, @@ -167,16 +167,16 @@ export class DatasetDescriptionCompositeFieldEditorModel extends BaseFormModel { numbering: [{ value: this.numbering, disabled: true }], }); - const fieldsFormArray = new Array(); + const fieldsFormArray = new Array(); this.fields.forEach(item => { - const form: FormGroup = item.buildForm(); + const form: UntypedFormGroup = item.buildForm(); fieldsFormArray.push(form); }); formGroup.addControl('fields', this.formBuilder.array(fieldsFormArray)); - const multiplicityItemsFormArray = new Array(); + const multiplicityItemsFormArray = new Array(); this.multiplicityItems.forEach(item => { - const form: FormGroup = item.buildForm(); + const form: UntypedFormGroup = item.buildForm(); multiplicityItemsFormArray.push(form); }); formGroup.addControl('multiplicityItems', this.formBuilder.array(multiplicityItemsFormArray)); @@ -253,7 +253,7 @@ export class DatasetDescriptionFieldEditorModel extends BaseFormModel { return this; } - buildForm(): FormGroup { + buildForm(): UntypedFormGroup { if (this.validations) { this.validations.forEach(validation => { if (validation === ValidationType.Required) { @@ -285,9 +285,9 @@ export class DatasetDescriptionFieldEditorModel extends BaseFormModel { ordinal: [{ value: this.ordinal, disabled: true }] }); - const multiplicityItemsFormArray = new Array(); + const multiplicityItemsFormArray = new Array(); this.multiplicityItems.forEach(item => { - const form: FormGroup = item.buildForm(); + const form: UntypedFormGroup = item.buildForm(); multiplicityItemsFormArray.push(form); }); formGroup.addControl('multiplicityItems', this.formBuilder.array(multiplicityItemsFormArray)); @@ -344,7 +344,7 @@ export class DatasetDescriptionMultiplicityEditorModel extends BaseFormModel { return this; } - buildForm(): FormGroup { + buildForm(): UntypedFormGroup { const formGroup = this.formBuilder.group({ min: [this.min], max: [this.max], @@ -365,7 +365,7 @@ export class DatasetDescriptionDefaultValueEditorModel extends BaseFormModel { return this; } - buildForm(): FormGroup { + buildForm(): UntypedFormGroup { const formGroup = this.formBuilder.group({ type: [this.type], value: [this.value] diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description.component.ts index 91a5a18c9..09fb2bf26 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description.component.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description.component.ts @@ -1,5 +1,5 @@ import { AfterViewInit, Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild, Output, EventEmitter } from '@angular/core'; -import { AbstractControl, AbstractControlOptions, FormArray, FormGroup } from '@angular/forms'; +import { AbstractControl, AbstractControlOptions, UntypedFormArray, UntypedFormGroup } from '@angular/forms'; import { MatExpansionPanel } from '@angular/material/expansion'; import { MatHorizontalStepper } from '@angular/material/stepper'; import { CompositeField } from '@app/core/model/dataset-profile-definition/composite-field'; @@ -29,7 +29,7 @@ export class DatasetDescriptionComponent extends BaseComponent implements OnInit @Output() fieldsetFocusChange: EventEmitter = new EventEmitter(); tocentries: ToCEntry[]; - @Input() form: FormGroup; + @Input() form: UntypedFormGroup; @Input() TOCENTRY_ID_PREFIX=""; @Output() visibilityRulesInstance = new EventEmitter(); @@ -138,14 +138,14 @@ export class DatasetDescriptionComponent extends BaseComponent implements OnInit if(entry && (entry.type === ToCEntryType.FieldSet)){ //childs that are either target or source - const childIdsWithVisRules = (entry.form.get('fields') as FormArray).controls.reduce((all, s) => + const childIdsWithVisRules = (entry.form.get('fields') as UntypedFormArray).controls.reduce((all, s) => { const sval = s.value as Field; return this.visibilityRules.find(x => (x.targetField === sval.id) || (x.sourceField === sval.id)) ? [...all, sval] : all; },[]) as Field[]; - const innerCompositeFieldOriginalIds = (entry.form.get('fields') as FormArray).controls.map( x=> x.get('id').value) as string[]; + const innerCompositeFieldOriginalIds = (entry.form.get('fields') as UntypedFormArray).controls.map( x=> x.get('id').value) as string[]; //multiplicity items const multiplicityItemsValue = entry.form.get('multiplicityItems').value as CompositeField[]; @@ -256,25 +256,25 @@ export class DatasetDescriptionComponent extends BaseComponent implements OnInit return rules_to_append; } - private _buildRecursively(form: FormGroup,whatAmI:ToCEntryType):ToCEntry{ + private _buildRecursively(form: UntypedFormGroup,whatAmI:ToCEntryType):ToCEntry{ if(!form) return null; switch(whatAmI){ case ToCEntryType.Section: - const sections = form.get('sections') as FormArray; - const fieldsets = form.get('compositeFields') as FormArray; + const sections = form.get('sections') as UntypedFormArray; + const fieldsets = form.get('compositeFields') as UntypedFormArray; const tempResult:ToCEntry[] = []; if(sections &§ions.length){ sections.controls.forEach(section=>{ - tempResult.push(this._buildRecursively(section as FormGroup, ToCEntryType.Section)); + tempResult.push(this._buildRecursively(section as UntypedFormGroup, ToCEntryType.Section)); }); }else if(fieldsets && fieldsets.length){ fieldsets.controls.forEach(fieldset=>{ - tempResult.push(this._buildRecursively(fieldset as FormGroup, ToCEntryType.FieldSet)); + tempResult.push(this._buildRecursively(fieldset as UntypedFormGroup, ToCEntryType.FieldSet)); }); } return { @@ -334,7 +334,7 @@ export class DatasetDescriptionComponent extends BaseComponent implements OnInit const result: ToCEntry[] = []; //build parent pages - (this.form.get('pages') as FormArray).controls.forEach((pageElement, i) => { + (this.form.get('pages') as UntypedFormArray).controls.forEach((pageElement, i) => { result.push({ id: i+'id', label: pageElement.get('title').value, @@ -351,10 +351,10 @@ export class DatasetDescriptionComponent extends BaseComponent implements OnInit result.forEach((entry,i)=>{ - const sections = entry.form.get('sections') as FormArray; + const sections = entry.form.get('sections') as UntypedFormArray; sections.controls.forEach(section=>{ - const tempResults = this._buildRecursively(section as FormGroup,ToCEntryType.Section); + const tempResults = this._buildRecursively(section as UntypedFormGroup,ToCEntryType.Section); entry.subEntries.push(tempResults); }); @@ -377,7 +377,7 @@ export class DatasetDescriptionComponent extends BaseComponent implements OnInit invisibleEntries.push(entry.id); }else{ //check field inputs - const fields = entry.form.get('fields') as FormArray; + const fields = entry.form.get('fields') as UntypedFormArray; const oneFieldAtLeastIsVisible = fields.controls.some(field=> this.visibilityRulesService.checkElementVisibility(field.get('id').value)); if(!oneFieldAtLeastIsVisible){ diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/tableOfContentsMaterial/table-of-contents-internal/table-of-contents-internal.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/tableOfContentsMaterial/table-of-contents-internal/table-of-contents-internal.ts index 517027084..6e4e64d43 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/tableOfContentsMaterial/table-of-contents-internal/table-of-contents-internal.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/tableOfContentsMaterial/table-of-contents-internal/table-of-contents-internal.ts @@ -1,6 +1,6 @@ import {Component, EventEmitter, Inject, OnInit, Output, Input, ViewChildren, QueryList} from '@angular/core'; import { SimpleChanges } from '@angular/core'; -import { FormArray } from '@angular/forms'; +import { UntypedFormArray } from '@angular/forms'; import { ToCEntry, ToCEntryType } from '../../dataset-description.component'; import { VisibilityRulesService } from '../../visibility-rules/visibility-rules.service'; @@ -147,7 +147,7 @@ export class TableOfContentsInternal implements OnInit { if(!this.visibilityRulesService.checkElementVisibility(id)){ return false; } - const fieldsArray = entry.form.get('fields') as FormArray; + const fieldsArray = entry.form.get('fields') as UntypedFormArray; const hasError = !fieldsArray.controls.every(field=>{//every invalid field should be invisible if(field.invalid){ const id = field.get('id').value; diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/tableOfContentsMaterial/table-of-contents.module.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/tableOfContentsMaterial/table-of-contents.module.ts index b033f34e7..76b5706bb 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/tableOfContentsMaterial/table-of-contents.module.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/tableOfContentsMaterial/table-of-contents.module.ts @@ -7,10 +7,9 @@ import { VisibilityRulesService } from '../visibility-rules/visibility-rules.ser import { MatIconModule } from '@angular/material/icon'; @NgModule({ - imports: [CommonModule, RouterModule, MatIconModule], - declarations: [TableOfContents, TableOfContentsInternal], - exports: [TableOfContents], - entryComponents: [TableOfContents], - providers:[VisibilityRulesService] + imports: [CommonModule, RouterModule, MatIconModule], + declarations: [TableOfContents, TableOfContentsInternal], + exports: [TableOfContents], + providers: [VisibilityRulesService] }) export class TableOfContentsModule { } diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/tableOfContentsMaterial/table-of-contents.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/tableOfContentsMaterial/table-of-contents.ts index cfdeffefa..6e21ab54d 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/tableOfContentsMaterial/table-of-contents.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/tableOfContentsMaterial/table-of-contents.ts @@ -6,7 +6,7 @@ import { debounceTime, distinctUntilChanged, takeUntil } from 'rxjs/operators'; import { type } from 'os'; import { SimpleChanges } from '@angular/core'; import { ToCEntry, ToCEntryType } from '../dataset-description.component'; -import { FormArray, FormGroup } from '@angular/forms'; +import { UntypedFormArray, UntypedFormGroup } from '@angular/forms'; import { VisibilityRulesService } from '../visibility-rules/visibility-rules.service'; import { Rule } from '@app/core/model/dataset-profile-definition/rule'; import { TableOfContentsInternal } from './table-of-contents-internal/table-of-contents-internal'; @@ -68,7 +68,7 @@ export class TableOfContents extends BaseComponent implements OnInit, OnChanges this._tocentrySelected = value; } - @Input() formGroup: FormGroup; + @Input() formGroup: UntypedFormGroup; @Input() hasFocus: boolean = false; @Input() visibilityRulesService: VisibilityRulesService; show: boolean = false; @@ -176,7 +176,7 @@ export class TableOfContents extends BaseComponent implements OnInit, OnChanges invisibleEntries.push(entry.id); }else{ //check field inputs - const fields = entry.form.get('fields') as FormArray; + const fields = entry.form.get('fields') as UntypedFormArray; const oneFieldAtLeastIsVisible = fields.controls.some(field=> this.visibilityRulesService.checkElementVisibility(field.get('id').value)); if(!oneFieldAtLeastIsVisible){ @@ -330,25 +330,25 @@ export class TableOfContents extends BaseComponent implements OnInit, OnChanges // } - private _buildRecursively(form: FormGroup,whatAmI:ToCEntryType):ToCEntry{ + private _buildRecursively(form: UntypedFormGroup,whatAmI:ToCEntryType):ToCEntry{ if(!form) return null; switch(whatAmI){ case ToCEntryType.Section: - const sections = form.get('sections') as FormArray; - const fieldsets = form.get('compositeFields') as FormArray; + const sections = form.get('sections') as UntypedFormArray; + const fieldsets = form.get('compositeFields') as UntypedFormArray; const tempResult:ToCEntry[] = []; if(sections &§ions.length){ sections.controls.forEach(section=>{ - tempResult.push(this._buildRecursively(section as FormGroup, ToCEntryType.Section)); + tempResult.push(this._buildRecursively(section as UntypedFormGroup, ToCEntryType.Section)); }); }else if(fieldsets && fieldsets.length){ fieldsets.controls.forEach(fieldset=>{ - tempResult.push(this._buildRecursively(fieldset as FormGroup, ToCEntryType.FieldSet)); + tempResult.push(this._buildRecursively(fieldset as UntypedFormGroup, ToCEntryType.FieldSet)); }); } return { @@ -409,7 +409,7 @@ export class TableOfContents extends BaseComponent implements OnInit, OnChanges const result: ToCEntry[] = []; //build parent pages - (form.get('pages') as FormArray).controls.forEach((pageElement, i) => { + (form.get('pages') as UntypedFormArray).controls.forEach((pageElement, i) => { result.push({ id: i+'id', label: pageElement.get('title').value, @@ -426,10 +426,10 @@ export class TableOfContents extends BaseComponent implements OnInit, OnChanges result.forEach((entry,i)=>{ - const sections = entry.form.get('sections') as FormArray; + const sections = entry.form.get('sections') as UntypedFormArray; sections.controls.forEach(section=>{ - const tempResults = this._buildRecursively(section as FormGroup,ToCEntryType.Section); + const tempResults = this._buildRecursively(section as UntypedFormGroup,ToCEntryType.Section); entry.subEntries.push(tempResults); }); diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/visibility-rules/visibility-rules.service.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/visibility-rules/visibility-rules.service.ts index 73e0bb5d8..2501cd894 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/visibility-rules/visibility-rules.service.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/visibility-rules/visibility-rules.service.ts @@ -1,5 +1,5 @@ import { ApplicationRef, Injectable, NgZone } from '@angular/core'; -import { AbstractControl, FormArray, FormGroup } from '@angular/forms'; +import { AbstractControl, UntypedFormArray, UntypedFormGroup } from '@angular/forms'; import { DatasetProfileFieldViewStyle } from '@app/core/common/enum/dataset-profile-field-view-style'; import { isNumeric } from '@app/utilities/enhancers/utils'; import { Observable, Subject } from 'rxjs'; @@ -190,9 +190,9 @@ export class VisibilityRulesService { return false; } - scanIfChildsOfCompositeFieldHasVisibleItems(compositeFieldParent: FormGroup): boolean { + scanIfChildsOfCompositeFieldHasVisibleItems(compositeFieldParent: UntypedFormGroup): boolean { let isVisible = false; - ((compositeFieldParent.get('fields'))).controls.forEach(element => { + ((compositeFieldParent.get('fields'))).controls.forEach(element => { if (this.checkElementVisibility(element.get('id').value)) { isVisible = true; } @@ -209,10 +209,10 @@ export class VisibilityRulesService { } private resetControlWithId(formControl: AbstractControl, id: string) { - if (formControl instanceof FormGroup) { - if ((formControl as FormGroup).contains('id') && (formControl as FormGroup).contains('value') && (formControl as FormGroup).get('id').value === id) { + if (formControl instanceof UntypedFormGroup) { + if ((formControl as UntypedFormGroup).contains('id') && (formControl as UntypedFormGroup).contains('value') && (formControl as UntypedFormGroup).get('id').value === id) { this.resetFieldFormGroup(formControl); - } if ((formControl as FormGroup).contains('id') && (formControl as FormGroup).contains('fields') && (formControl as FormGroup).get('id').value === id) { + } if ((formControl as UntypedFormGroup).contains('id') && (formControl as UntypedFormGroup).contains('fields') && (formControl as UntypedFormGroup).get('id').value === id) { this.resetCompositeFieldFormGroup(formControl); } else { Object.keys(formControl.controls).forEach(item => { @@ -220,14 +220,14 @@ export class VisibilityRulesService { this.resetControlWithId(control, id); }); } - } else if (formControl instanceof FormArray) { + } else if (formControl instanceof UntypedFormArray) { formControl.controls.forEach(item => { this.resetControlWithId(item, id); }); } } - private resetFieldFormGroup(formGroup: FormGroup) { + private resetFieldFormGroup(formGroup: UntypedFormGroup) { const renderStyle = formGroup.getRawValue().viewStyle.renderStyle; if (renderStyle === DatasetProfileFieldViewStyle.Validation || renderStyle === DatasetProfileFieldViewStyle.DatasetIdentifier) { formGroup.get('value').setValue({ identifier: '', type: '' }); @@ -237,11 +237,11 @@ export class VisibilityRulesService { } - private resetCompositeFieldFormGroup(formGroup: FormGroup) { - (formGroup.get('fields') as FormArray).controls.forEach((element: FormGroup) => { + private resetCompositeFieldFormGroup(formGroup: UntypedFormGroup) { + (formGroup.get('fields') as UntypedFormArray).controls.forEach((element: UntypedFormGroup) => { this.resetFieldFormGroup(element); }); - (formGroup.get('multiplicityItems') as FormArray).controls.splice(0); + (formGroup.get('multiplicityItems') as UntypedFormArray).controls.splice(0); } private _emitChangesIfNeeded(id: string, valueToBeSet: boolean) { if (this.elementVisibilityMap.has(id)) { diff --git a/dmp-frontend/src/app/ui/misc/external-sources/listing/external-item-listing.component.ts b/dmp-frontend/src/app/ui/misc/external-sources/listing/external-item-listing.component.ts index 5d9bf3a4f..97ec738bd 100644 --- a/dmp-frontend/src/app/ui/misc/external-sources/listing/external-item-listing.component.ts +++ b/dmp-frontend/src/app/ui/misc/external-sources/listing/external-item-listing.component.ts @@ -1,5 +1,5 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { FormArray, FormControl } from '@angular/forms'; +import { UntypedFormArray, UntypedFormControl } from '@angular/forms'; import { ExternalSourceUrlModel } from '@app/core/model/external-sources/external-source-url'; import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration'; import { BaseComponent } from '@common/base/base.component'; @@ -14,13 +14,13 @@ export class ExternalItemListingComponent extends BaseComponent implements OnIni @Input() public placeholder: string; @Input() public autoCompleteConfiguration: SingleAutoCompleteConfiguration; - @Input() formArray: FormArray; + @Input() formArray: UntypedFormArray; @Input() parentTemplate; @Input() public options: Array; @Output() public onItemChange = new EventEmitter(); public choice: string; - public formControl = new FormControl(); + public formControl = new UntypedFormControl(); constructor() { super(); } ngOnInit() { diff --git a/dmp-frontend/src/app/ui/misc/navigation/navigation.component.scss b/dmp-frontend/src/app/ui/misc/navigation/navigation.component.scss index 0b4651e59..01d53a206 100644 --- a/dmp-frontend/src/app/ui/misc/navigation/navigation.component.scss +++ b/dmp-frontend/src/app/ui/misc/navigation/navigation.component.scss @@ -1,4 +1,4 @@ -@use '~@angular/material' as mat; +@use '@angular/material' as mat; @mixin navigation-component-theme($theme) { $accent: map-get($theme, accent); diff --git a/dmp-frontend/src/app/ui/misc/navigation/navigation.component.ts b/dmp-frontend/src/app/ui/misc/navigation/navigation.component.ts index 5ef95ef24..bfd52420f 100644 --- a/dmp-frontend/src/app/ui/misc/navigation/navigation.component.ts +++ b/dmp-frontend/src/app/ui/misc/navigation/navigation.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; -import { FormControl } from '@angular/forms'; +import { UntypedFormControl } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { Router } from '@angular/router'; import { AppRole } from '@app/core/common/enum/app-role'; @@ -32,7 +32,7 @@ export class NavigationComponent extends BaseComponent implements OnInit { progressIndication = false; public search = false; grantAutoCompleteConfiguration: SingleAutoCompleteConfiguration; - public searchControl = new FormControl(); + public searchControl = new UntypedFormControl(); filteredOptions: Observable; events: string[] = []; diff --git a/dmp-frontend/src/app/ui/misc/navigation/navigation.module.ts b/dmp-frontend/src/app/ui/misc/navigation/navigation.module.ts index c7e8099af..f5ac2ff9d 100644 --- a/dmp-frontend/src/app/ui/misc/navigation/navigation.module.ts +++ b/dmp-frontend/src/app/ui/misc/navigation/navigation.module.ts @@ -6,16 +6,15 @@ import { CommonFormsModule } from '@common/forms/common-forms.module'; import { CommonUiModule } from '@common/ui/common-ui.module'; @NgModule({ - imports: [ - CommonUiModule, - CommonFormsModule, - RouterModule, - ], - declarations: [ - NavigationComponent, - UserDialogComponent - ], - entryComponents: [UserDialogComponent], - exports: [NavigationComponent] + imports: [ + CommonUiModule, + CommonFormsModule, + RouterModule, + ], + declarations: [ + NavigationComponent, + UserDialogComponent + ], + exports: [NavigationComponent] }) export class NavigationModule { } diff --git a/dmp-frontend/src/app/ui/misc/navigation/user-dialog/user-dialog.component.ts b/dmp-frontend/src/app/ui/misc/navigation/user-dialog/user-dialog.component.ts index 2315661af..25d1a0b2b 100644 --- a/dmp-frontend/src/app/ui/misc/navigation/user-dialog/user-dialog.component.ts +++ b/dmp-frontend/src/app/ui/misc/navigation/user-dialog/user-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { Router } from '@angular/router'; import { Principal } from '../../../../core/model/auth/principal'; @@ -12,7 +12,7 @@ import { AuthService } from '../../../../core/services/auth/auth.service'; }) export class UserDialogComponent implements OnInit { - public formGroup: FormGroup; + public formGroup: UntypedFormGroup; constructor( private authentication: AuthService, diff --git a/dmp-frontend/src/app/ui/misc/search/search.component.spec.ts b/dmp-frontend/src/app/ui/misc/search/search.component.spec.ts index be8e387b3..fc21494f0 100644 --- a/dmp-frontend/src/app/ui/misc/search/search.component.spec.ts +++ b/dmp-frontend/src/app/ui/misc/search/search.component.spec.ts @@ -8,8 +8,9 @@ describe('SearchComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ SearchComponent ] - }) + declarations: [SearchComponent], + teardown: { destroyAfterEach: false } +}) .compileComponents(); })); diff --git a/dmp-frontend/src/app/ui/misc/search/search.component.ts b/dmp-frontend/src/app/ui/misc/search/search.component.ts index 2dd49ca75..cb1c110f0 100644 --- a/dmp-frontend/src/app/ui/misc/search/search.component.ts +++ b/dmp-frontend/src/app/ui/misc/search/search.component.ts @@ -2,7 +2,7 @@ import { mergeMap, distinctUntilChanged, debounceTime } from 'rxjs/operators'; import { Component, OnInit } from "@angular/core"; import { AuthService } from '../../../core/services/auth/auth.service'; -import { FormControl } from "@angular/forms"; +import { UntypedFormControl } from "@angular/forms"; import { SearchBarService } from '../../../core/services/search-bar/search-bar.service'; import { Router } from '@angular/router'; import { Observable } from "rxjs"; @@ -22,7 +22,7 @@ export enum SearchBarType { }) export class SearchComponent implements OnInit { public search = false; - public searchControl = new FormControl(); + public searchControl = new UntypedFormControl(); filteredOptions: Observable; constructor( diff --git a/dmp-frontend/src/app/ui/navbar/navbar.module.ts b/dmp-frontend/src/app/ui/navbar/navbar.module.ts index 78fd53053..fb0c74970 100644 --- a/dmp-frontend/src/app/ui/navbar/navbar.module.ts +++ b/dmp-frontend/src/app/ui/navbar/navbar.module.ts @@ -8,18 +8,17 @@ import { CommonUiModule } from '@common/ui/common-ui.module'; import { LanguageModule } from '../language/language.module'; @NgModule({ - imports: [ - CommonUiModule, - CommonFormsModule, - RouterModule, - BreadcrumbModule, - LanguageModule - ], - declarations: [ - NavbarComponent, - SearchComponent - ], - entryComponents: [], - exports: [NavbarComponent] + imports: [ + CommonUiModule, + CommonFormsModule, + RouterModule, + BreadcrumbModule, + LanguageModule + ], + declarations: [ + NavbarComponent, + SearchComponent + ], + exports: [NavbarComponent] }) export class NavbarModule { } diff --git a/dmp-frontend/src/app/ui/quick-wizard/dataset-editor/dataset-editor-wizard-model.ts b/dmp-frontend/src/app/ui/quick-wizard/dataset-editor/dataset-editor-wizard-model.ts index c681b72f5..be9b8c829 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/dataset-editor/dataset-editor-wizard-model.ts +++ b/dmp-frontend/src/app/ui/quick-wizard/dataset-editor/dataset-editor-wizard-model.ts @@ -1,4 +1,4 @@ -import { FormBuilder, FormGroup } from "@angular/forms"; +import { UntypedFormBuilder, UntypedFormGroup } from "@angular/forms"; import { BaseFormModel } from '@app/core/model/base-form-model'; import { DatasetWizardEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; import { QuickWizardDatasetDescriptionModel } from '@app/ui/quick-wizard/dataset-editor/quick-wizard-dataset-description-model'; @@ -17,12 +17,12 @@ export class DatasetEditorWizardModel extends BaseFormModel { return this; } - buildForm(context: ValidationContext = null): FormGroup { + buildForm(context: ValidationContext = null): UntypedFormGroup { if (context == null) { context = this.createValidationContext(); } - const formGroup = new FormBuilder().group({}, context.getValidation('datasetsList').validators); - const formArray = new Array(); + const formGroup = new UntypedFormBuilder().group({}, context.getValidation('datasetsList').validators); + const formArray = new Array(); this.datasetsList.forEach(item => { - const form: FormGroup = item.buildForm(); + const form: UntypedFormGroup = item.buildForm(); formArray.push(form); }); formGroup.addControl('datasetsList', this.formBuilder.array(formArray)); diff --git a/dmp-frontend/src/app/ui/quick-wizard/dataset-editor/dataset-editor-wizard.component.ts b/dmp-frontend/src/app/ui/quick-wizard/dataset-editor/dataset-editor-wizard.component.ts index e1684f122..3d554d5ba 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/dataset-editor/dataset-editor-wizard.component.ts +++ b/dmp-frontend/src/app/ui/quick-wizard/dataset-editor/dataset-editor-wizard.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from "@angular/core"; -import { FormArray, FormGroup } from "@angular/forms"; +import { UntypedFormArray, UntypedFormGroup } from "@angular/forms"; import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service'; import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item'; import { IBreadCrumbComponent } from '@app/ui/misc/breadcrumb/definition/IBreadCrumbComponent'; @@ -19,8 +19,8 @@ import { LinkToScroll } from '@app/ui/misc/dataset-description-form/tableOfConte export class DatasetEditorWizardComponent extends BaseComponent implements OnInit, IBreadCrumbComponent { breadCrumbs: Observable; - @Input() formGroup: FormGroup; - @Input() datasetProfile: FormGroup; // DatasetProfileModel; + @Input() formGroup: UntypedFormGroup; + @Input() datasetProfile: UntypedFormGroup; // DatasetProfileModel; @Input() datasetLabel: string; editedDataset: boolean = false; dataset: DatasetDescriptionFormEditorModel; @@ -44,7 +44,7 @@ export class DatasetEditorWizardComponent extends BaseComponent implements OnIni .subscribe(item => { this.datasetProfileDefinition = new DatasetDescriptionFormEditorModel().fromModel(item); this.onValChange("list"); - const length = (this.formGroup.get('datasets').get('datasetsList') as FormArray).length; + const length = (this.formGroup.get('datasets').get('datasetsList') as UntypedFormArray).length; if (length == 0) { this.lastIndexOfDataset = length; this.isFirst = true; @@ -81,14 +81,14 @@ export class DatasetEditorWizardComponent extends BaseComponent implements OnIni this.toggleButton = 0; this.editedDataset = false; this._inputValue = "list"; - (this.formGroup.get('datasets').get('datasetsList') as FormArray).removeAt(index); + (this.formGroup.get('datasets').get('datasetsList') as UntypedFormArray).removeAt(index); if (index == 0) { this.isFirst = true; } } addDataset(isFirst: boolean) { - const formArray: FormArray = (this.formGroup.get('datasets').get('datasetsList') as FormArray); + const formArray: UntypedFormArray = (this.formGroup.get('datasets').get('datasetsList') as UntypedFormArray); let dataset = new QuickWizardDatasetDescriptionModel().fromModel(this.datasetProfileDefinition); let formGroup = dataset.buildForm(); diff --git a/dmp-frontend/src/app/ui/quick-wizard/dataset-editor/quick-wizard-dataset-description-model.ts b/dmp-frontend/src/app/ui/quick-wizard/dataset-editor/quick-wizard-dataset-description-model.ts index 1c876601a..75b30d1f8 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/dataset-editor/quick-wizard-dataset-description-model.ts +++ b/dmp-frontend/src/app/ui/quick-wizard/dataset-editor/quick-wizard-dataset-description-model.ts @@ -1,4 +1,4 @@ -import { FormControl, FormGroup } from "@angular/forms"; +import { UntypedFormControl, UntypedFormGroup } from "@angular/forms"; import { DatasetProfileDefinitionModel } from "../../../core/model/dataset-profile-definition/dataset-profile-definition"; import { DatasetDescriptionFormEditorModel } from "../../misc/dataset-description-form/dataset-description-form.model"; @@ -11,10 +11,10 @@ export class QuickWizardDatasetDescriptionModel extends DatasetDescriptionFormEd return this; } - buildForm(): FormGroup { - const formGroup: FormGroup = super.buildForm(); - formGroup.addControl('datasetLabel', new FormControl({ value: this.datasetLabel })); - formGroup.addControl('status', new FormControl({ value: this.status })); + buildForm(): UntypedFormGroup { + const formGroup: UntypedFormGroup = super.buildForm(); + formGroup.addControl('datasetLabel', new UntypedFormControl({ value: this.datasetLabel })); + formGroup.addControl('status', new UntypedFormControl({ value: this.status })); return formGroup; } } diff --git a/dmp-frontend/src/app/ui/quick-wizard/dmp-editor/dmp-editor-wizard-model.ts b/dmp-frontend/src/app/ui/quick-wizard/dmp-editor/dmp-editor-wizard-model.ts index 088f44d84..95acbcab8 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/dmp-editor/dmp-editor-wizard-model.ts +++ b/dmp-frontend/src/app/ui/quick-wizard/dmp-editor/dmp-editor-wizard-model.ts @@ -1,4 +1,4 @@ -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; import { Status } from '@app/core/common/enum/status'; import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; import { DmpProfileDefinition } from '@app/core/model/dmp-profile/dmp-profile'; @@ -29,9 +29,9 @@ export class DmpEditorWizardModel { return this; } - buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { + buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup { if (context == null) { context = this.createValidationContext(); } - const formGroup = new FormBuilder().group({ + const formGroup = new UntypedFormBuilder().group({ id: [{ value: this.id, disabled: disabled }, context.getValidation('id').validators], label: [{ value: this.label, disabled: disabled }, context.getValidation('label').validators], status: [{ value: this.status, disabled: disabled }, context.getValidation('status').validators], diff --git a/dmp-frontend/src/app/ui/quick-wizard/dmp-editor/dmp-editor-wizard.component.ts b/dmp-frontend/src/app/ui/quick-wizard/dmp-editor/dmp-editor-wizard.component.ts index 716eb29b9..ce13e98bd 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/dmp-editor/dmp-editor-wizard.component.ts +++ b/dmp-frontend/src/app/ui/quick-wizard/dmp-editor/dmp-editor-wizard.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormArray, FormGroup } from '@angular/forms'; +import { UntypedFormArray, UntypedFormGroup } from '@angular/forms'; import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; @@ -34,9 +34,9 @@ export class DmpEditorWizardComponent extends BaseComponent implements OnInit, I isNew = true; dmp: DmpEditorWizardModel; - @Input() formGroup: FormGroup; + @Input() formGroup: UntypedFormGroup; @Input() dmpLabel: string; - @Input() datasetFormGroup: FormGroup; + @Input() datasetFormGroup: UntypedFormGroup; private uiNotificationService: UiNotificationService profilesAutoCompleteConfiguration: SingleAutoCompleteConfiguration; @@ -129,7 +129,7 @@ export class DmpEditorWizardComponent extends BaseComponent implements OnInit, I } datasetIsEmpty() { - if (this.datasetFormGroup && this.datasetFormGroup.get('datasetsList') && (this.datasetFormGroup.get('datasetsList') as FormArray).length != 0) { + if (this.datasetFormGroup && this.datasetFormGroup.get('datasetsList') && (this.datasetFormGroup.get('datasetsList') as UntypedFormArray).length != 0) { return true; } return false; diff --git a/dmp-frontend/src/app/ui/quick-wizard/funder-editor/funder-editor-wizard.component.ts b/dmp-frontend/src/app/ui/quick-wizard/funder-editor/funder-editor-wizard.component.ts index 9f0de44d1..569e5f433 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/funder-editor/funder-editor-wizard.component.ts +++ b/dmp-frontend/src/app/ui/quick-wizard/funder-editor/funder-editor-wizard.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { FunderModel } from '@app/core/model/funder/funder'; import { TranslateService } from '@ngx-translate/core'; import { FunderCriteria } from '../../../core/query/funder/funder-criteria'; @@ -18,7 +18,7 @@ export class FunderEditorWizardComponent implements OnInit { isNew = false; funder: FunderFormModel; funderLabelCleared = true; - @Input() funderFormGroup: FormGroup; + @Input() funderFormGroup: UntypedFormGroup; funderAutoCompleteConfiguration: SingleAutoCompleteConfiguration; constructor( diff --git a/dmp-frontend/src/app/ui/quick-wizard/grant-editor/grant-editor-wizard-model.ts b/dmp-frontend/src/app/ui/quick-wizard/grant-editor/grant-editor-wizard-model.ts index 90cbdd8ae..7a243c40e 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/grant-editor/grant-editor-wizard-model.ts +++ b/dmp-frontend/src/app/ui/quick-wizard/grant-editor/grant-editor-wizard-model.ts @@ -1,4 +1,4 @@ -import { FormBuilder, FormGroup, Validators } from "@angular/forms"; +import { UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms"; import { Status } from '@app/core/common/enum/status'; import { GrantListingModel } from '@app/core/model/grant/grant-listing'; import { ValidJsonValidator } from '@app/library/auto-complete/auto-complete-custom-validator'; @@ -23,10 +23,10 @@ export class GrantEditorWizardModel { return this; } - buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { + buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup { if (context == null) { context = this.createValidationContext(); } - const formGroup = new FormBuilder().group({ + const formGroup = new UntypedFormBuilder().group({ id: [{ value: this.id, disabled: disabled }, context.getValidation('id').validators], label: [{ value: this.label, disabled: disabled }, context.getValidation('label').validators], status: [{ value: this.status, disabled: disabled }, context.getValidation('status').validators], diff --git a/dmp-frontend/src/app/ui/quick-wizard/grant-editor/grant-editor-wizard.component.ts b/dmp-frontend/src/app/ui/quick-wizard/grant-editor/grant-editor-wizard.component.ts index f74216ded..e2e31863e 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/grant-editor/grant-editor-wizard.component.ts +++ b/dmp-frontend/src/app/ui/quick-wizard/grant-editor/grant-editor-wizard.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnInit } from '@angular/core'; -import { AbstractControl, FormArray, FormControl, FormGroup } from '@angular/forms'; +import { AbstractControl, FormArray, FormControl, UntypedFormGroup } from '@angular/forms'; import { MatSnackBar } from '@angular/material/snack-bar'; import { Router } from '@angular/router'; import { GrantCriteria } from '@app/core/query/grant/grant-criteria'; @@ -29,8 +29,8 @@ export class GrantEditorWizardComponent extends BaseComponent implements OnInit, isNew = false; grant: GrantEditorWizardModel; - @Input() grantformGroup: FormGroup; - @Input() funderFormGroup: FormGroup; + @Input() grantformGroup: UntypedFormGroup; + @Input() funderFormGroup: UntypedFormGroup; private uiNotificationService: UiNotificationService grantAutoCompleteConfiguration: SingleAutoCompleteConfiguration; diff --git a/dmp-frontend/src/app/ui/quick-wizard/project-editor/project-editor-wizard.component.ts b/dmp-frontend/src/app/ui/quick-wizard/project-editor/project-editor-wizard.component.ts index 3734ca29d..dcfb6dee4 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/project-editor/project-editor-wizard.component.ts +++ b/dmp-frontend/src/app/ui/quick-wizard/project-editor/project-editor-wizard.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit, Input } from '@angular/core'; import { SingleAutoCompleteConfiguration } from '../../../library/auto-complete/single/single-auto-complete-configuration'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { ProjectService } from '../../../core/services/project/project.service'; import { RequestItem } from '../../../core/query/request-item'; import { ProjectCriteria } from '../../../core/query/project/project-criteria'; @@ -16,7 +16,7 @@ export class ProjectEditorWizardComponent implements OnInit { isNew = false; project: ProjectFormModel; - @Input() formGroup: FormGroup; + @Input() formGroup: UntypedFormGroup; projectAutoCompleteConfiguration: SingleAutoCompleteConfiguration; constructor( diff --git a/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.ts b/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.ts index d7d89b2ae..2a1160d60 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.ts +++ b/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit, ViewChild } from '@angular/core'; -import { AbstractControl, FormArray, FormControl, FormGroup } from '@angular/forms'; +import { AbstractControl, UntypedFormArray, FormControl, UntypedFormGroup } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { MatSnackBar } from '@angular/material/snack-bar'; import { MatStepper } from '@angular/material/stepper'; @@ -40,7 +40,7 @@ export class QuickWizardEditorComponent extends CheckDeactivateBaseComponent imp isSubmitted = false; quickWizard: QuickWizardEditorWizardModel; allDatasets: DmpFinalizeDialogDataset[] = []; - formGroup: FormGroup = null; + formGroup: UntypedFormGroup = null; constructor( public snackBar: MatSnackBar, @@ -85,8 +85,8 @@ export class QuickWizardEditorComponent extends CheckDeactivateBaseComponent imp formSubmit(): void { this.formService.touchAllFormFields(this.formGroup); - if (this.formGroup.get('datasets') && this.formGroup.get('datasets').get('datasetsList') && (this.formGroup.get('datasets').get('datasetsList') as FormArray).length > 0) { - for (let control of (this.formGroup.get('datasets').get('datasetsList') as FormArray).controls) { + if (this.formGroup.get('datasets') && this.formGroup.get('datasets').get('datasetsList') && (this.formGroup.get('datasets').get('datasetsList') as UntypedFormArray).length > 0) { + for (let control of (this.formGroup.get('datasets').get('datasetsList') as UntypedFormArray).controls) { control.get('status').setValue(DatasetStatus.Draft); } this.onSubmitSave(); @@ -102,7 +102,7 @@ export class QuickWizardEditorComponent extends CheckDeactivateBaseComponent imp const dialogInputModel: DmpFinalizeDialogInput = { dmpLabel: this.formGroup.get('dmp').get('label').value, dmpDescription: this.formGroup.get('dmp').get('description').value, - datasets: (this.formGroup.get('datasets').get('datasetsList') as FormArray).controls.map(x => { + datasets: (this.formGroup.get('datasets').get('datasetsList') as UntypedFormArray).controls.map(x => { return { label: x.get('datasetLabel').value, status: DatasetStatus.Finalized }; }), accessRights: false @@ -120,8 +120,8 @@ export class QuickWizardEditorComponent extends CheckDeactivateBaseComponent imp }); dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { if (result && !result.cancelled) { - if (this.formGroup.get('datasets') && this.formGroup.get('datasets').get('datasetsList') && (this.formGroup.get('datasets').get('datasetsList') as FormArray).length > 0) { - for (let control of (this.formGroup.get('datasets').get('datasetsList') as FormArray).controls) { + if (this.formGroup.get('datasets') && this.formGroup.get('datasets').get('datasetsList') && (this.formGroup.get('datasets').get('datasetsList') as UntypedFormArray).length > 0) { + for (let control of (this.formGroup.get('datasets').get('datasetsList') as UntypedFormArray).controls) { control.get('status').setValue(DatasetStatus.Finalized); } this.formGroup.get('dmp').get('status').setValue(DmpStatus.Finalized); diff --git a/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.model.ts b/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.model.ts index c707da664..069011166 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.model.ts +++ b/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.model.ts @@ -1,4 +1,4 @@ -import { FormBuilder, FormGroup } from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { DmpModel } from '@app/core/model/dmp/dmp'; import { FunderModel } from '@app/core/model/funder/funder'; import { GrantListingModel } from '@app/core/model/grant/grant-listing'; @@ -46,9 +46,9 @@ export class QuickWizardEditorWizardModel { return this; } - buildForm(context: ValidationContext = null): FormGroup { + buildForm(context: ValidationContext = null): UntypedFormGroup { // if (context == null) { context = this.createValidationContext(); } - const formGroup = new FormBuilder().group({ + const formGroup = new UntypedFormBuilder().group({ grant: new GrantEditorWizardModel().buildForm(), funder: new FunderFormModel().buildForm(), project: new ProjectFormModel().buildForm(), diff --git a/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.ts b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.ts index 20cefa854..8ae6ec5ac 100644 --- a/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.ts +++ b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { Router } from '@angular/router'; import { ContactEmailFormModel } from '@app/core/model/contact/contact-email-form-model'; @@ -26,7 +26,7 @@ import { MatomoService } from '@app/core/services/matomo/matomo-service'; export class SidebarFooterComponent extends BaseComponent implements OnInit { private contactEmailFormModel: ContactEmailFormModel; - private formGroup: FormGroup; + private formGroup: UntypedFormGroup; constructor( private dialog: MatDialog, diff --git a/dmp-frontend/src/app/ui/sidebar/sidebar.module.ts b/dmp-frontend/src/app/ui/sidebar/sidebar.module.ts index aac7e2199..dd3239c11 100644 --- a/dmp-frontend/src/app/ui/sidebar/sidebar.module.ts +++ b/dmp-frontend/src/app/ui/sidebar/sidebar.module.ts @@ -11,21 +11,20 @@ import { UserGuideModule } from '../user-guide/user-guide.module'; import { LanguageModule } from '../language/language.module'; @NgModule({ - imports: [ - CommonUiModule, - CommonFormsModule, - GlossaryModule, - FaqModule, - RouterModule, - ContactModule, - UserGuideModule, - LanguageModule - ], - declarations: [ - SidebarComponent, - SidebarFooterComponent - ], - entryComponents: [], - exports: [SidebarComponent] + imports: [ + CommonUiModule, + CommonFormsModule, + GlossaryModule, + FaqModule, + RouterModule, + ContactModule, + UserGuideModule, + LanguageModule + ], + declarations: [ + SidebarComponent, + SidebarFooterComponent + ], + exports: [SidebarComponent] }) export class SidebarModule { } diff --git a/dmp-frontend/src/app/ui/user-guide-editor/user-guide-editor.component.ts b/dmp-frontend/src/app/ui/user-guide-editor/user-guide-editor.component.ts index 74e630be4..88ac72ce1 100644 --- a/dmp-frontend/src/app/ui/user-guide-editor/user-guide-editor.component.ts +++ b/dmp-frontend/src/app/ui/user-guide-editor/user-guide-editor.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { FormGroup, FormBuilder } from '@angular/forms'; +import { UntypedFormGroup, UntypedFormBuilder } from '@angular/forms'; import { BaseComponent } from '@common/base/base.component'; import { UserGuideService } from '@app/core/services/user-guide/user-guide.service'; import { takeUntil } from 'rxjs/operators'; @@ -20,8 +20,8 @@ import { HttpClient } from '@angular/common/http'; styleUrls: ['./user-guide-editor.component.scss'] }) export class UserGuideEditorComponent extends BaseComponent implements OnInit { - public formGroup: FormGroup; - private formBuilder: FormBuilder; + public formGroup: UntypedFormGroup; + private formBuilder: UntypedFormBuilder; constructor(private userGuideService: UserGuideService, private uiNotificationService: UiNotificationService, @@ -35,7 +35,7 @@ export class UserGuideEditorComponent extends BaseComponent implements OnInit { ngOnInit() { this.matomoService.trackPageView('Admin: User Guide Editor'); - this.formBuilder = new FormBuilder(); + this.formBuilder = new UntypedFormBuilder(); this.formGroup = this.formBuilder.group({ name: [''], html: [''] diff --git a/dmp-frontend/src/app/ui/user-guide/user-guide.module.ts b/dmp-frontend/src/app/ui/user-guide/user-guide.module.ts index ec7507784..f833e2cb3 100644 --- a/dmp-frontend/src/app/ui/user-guide/user-guide.module.ts +++ b/dmp-frontend/src/app/ui/user-guide/user-guide.module.ts @@ -7,20 +7,16 @@ import { CommonUiModule } from '@common/ui/common-ui.module'; @NgModule({ - declarations: [ - UserGuideContentComponent, - UserGuideDialogComponent -], - imports: [ - CommonUiModule, - UserGuideRoutingModule - ], - entryComponents: [ - UserGuideContentComponent, - UserGuideDialogComponent - ], - exports: [ - UserGuideDialogComponent - ] + declarations: [ + UserGuideContentComponent, + UserGuideDialogComponent + ], + imports: [ + CommonUiModule, + UserGuideRoutingModule + ], + exports: [ + UserGuideDialogComponent + ] }) export class UserGuideModule { } diff --git a/dmp-frontend/src/app/ui/user-profile/add-account/add-account-dialog.component.ts b/dmp-frontend/src/app/ui/user-profile/add-account/add-account-dialog.component.ts index fe2ffbb76..cf519a7cc 100644 --- a/dmp-frontend/src/app/ui/user-profile/add-account/add-account-dialog.component.ts +++ b/dmp-frontend/src/app/ui/user-profile/add-account/add-account-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { UserMergeRequestModel } from '@app/core/model/merge/user-merge-request'; import { MergeLoginService } from '@app/ui/auth/login/utilities/merge-login.service'; @@ -13,7 +13,7 @@ import { DatasetDescriptionFormEditorModel } from '@app/ui/misc/dataset-descript export class AddAccountDialogComponent implements OnInit { datasetProfileDefinitionModel: DatasetDescriptionFormEditorModel; - datasetProfileDefinitionFormGroup: FormGroup; + datasetProfileDefinitionFormGroup: UntypedFormGroup; progressIndication = false; public hasEmail = true; private request: UserMergeRequestModel; diff --git a/dmp-frontend/src/app/ui/user-profile/user-profile-editor.model.ts b/dmp-frontend/src/app/ui/user-profile/user-profile-editor.model.ts index 9f5ea71ac..6856a565e 100644 --- a/dmp-frontend/src/app/ui/user-profile/user-profile-editor.model.ts +++ b/dmp-frontend/src/app/ui/user-profile/user-profile-editor.model.ts @@ -1,4 +1,4 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms'; import { RoleOrganizationType } from '@app/core/common/enum/role-organization-type'; import { OrganizationModel } from '@app/core/model/organisation/organization'; import { UserListingModel } from '@app/core/model/user/user-listing'; @@ -24,15 +24,15 @@ export class UserProfileEditorModel { return this; } - buildForm(availableLanguages: any[]): FormGroup { - const formGroup = new FormBuilder().group({ - id: new FormControl(this.id), - name: new FormControl(this.name), - language: new FormControl(this.language ? availableLanguages.filter(x => x.value === this.language.value).pop() : '', [Validators.required]), - timezone: new FormControl(this.timezone, [Validators.required]), - culture: new FormControl(this.culture, [Validators.required]), - organization: new FormControl(this.organization), - roleOrganization: new FormControl(this.roleOrganization), + buildForm(availableLanguages: any[]): UntypedFormGroup { + const formGroup = new UntypedFormBuilder().group({ + id: new UntypedFormControl(this.id), + name: new UntypedFormControl(this.name), + language: new UntypedFormControl(this.language ? availableLanguages.filter(x => x.value === this.language.value).pop() : '', [Validators.required]), + timezone: new UntypedFormControl(this.timezone, [Validators.required]), + culture: new UntypedFormControl(this.culture, [Validators.required]), + organization: new UntypedFormControl(this.organization), + roleOrganization: new UntypedFormControl(this.roleOrganization), }); return formGroup; diff --git a/dmp-frontend/src/app/ui/user-profile/user-profile.component.ts b/dmp-frontend/src/app/ui/user-profile/user-profile.component.ts index 30c60921b..d923f2237 100644 --- a/dmp-frontend/src/app/ui/user-profile/user-profile.component.ts +++ b/dmp-frontend/src/app/ui/user-profile/user-profile.component.ts @@ -1,5 +1,5 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; -import { FormArray, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { UntypedFormArray, FormBuilder, FormControl, UntypedFormGroup, Validators } from '@angular/forms'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { CultureInfo } from '@app/core/model/culture-info'; import { DmpModel } from '@app/core/model/dmp/dmp'; @@ -68,7 +68,7 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes subtitleFn: (item) => item['tag'] ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item['tag'] : (item['key'] ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item['key'] : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')) }; - formGroup: FormGroup; + formGroup: UntypedFormGroup; constructor( private userService: UserService, private route: ActivatedRoute, @@ -360,7 +360,7 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes }); } - printErrors(rootform: FormGroup) { + printErrors(rootform: UntypedFormGroup) { if (!rootform.valid) { Object.keys(rootform.controls).forEach(key => { const errors = rootform.get(key).errors; @@ -382,12 +382,12 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes } }); } else { - if (rootform.get(key) instanceof FormGroup) { - this.printErrors(rootform.get(key)); - } else if (rootform.get(key) instanceof FormArray) { + if (rootform.get(key) instanceof UntypedFormGroup) { + this.printErrors(rootform.get(key)); + } else if (rootform.get(key) instanceof UntypedFormArray) { this.nestedIndex++; this.nestedCount[this.nestedIndex] = 0; - for (let childForm of (rootform.get(key)).controls) { + for (let childForm of (rootform.get(key)).controls) { this.nestedCount[this.nestedIndex]++; this.printErrors(childForm); } diff --git a/dmp-frontend/src/app/ui/user-profile/user-profile.module.ts b/dmp-frontend/src/app/ui/user-profile/user-profile.module.ts index c5efaeb7c..b8cd5f809 100644 --- a/dmp-frontend/src/app/ui/user-profile/user-profile.module.ts +++ b/dmp-frontend/src/app/ui/user-profile/user-profile.module.ts @@ -12,20 +12,17 @@ import { UserProfileComponent } from './user-profile.component'; import { UserProfileRoutingModule } from './user-profile.routing'; @NgModule({ - imports: [ - CommonUiModule, - CommonFormsModule, - FormattingModule, - UserProfileRoutingModule, - AutoCompleteModule, - AddAccountDialogModule, - FormValidationErrorsDialogModule - ], - declarations: [ - UserProfileComponent - ], - entryComponents: [ - AddAccountDialogComponent - ] + imports: [ + CommonUiModule, + CommonFormsModule, + FormattingModule, + UserProfileRoutingModule, + AutoCompleteModule, + AddAccountDialogModule, + FormValidationErrorsDialogModule + ], + declarations: [ + UserProfileComponent + ] }) export class UserProfileModule { } diff --git a/dmp-frontend/src/app/utilities/enhancers/utils.ts b/dmp-frontend/src/app/utilities/enhancers/utils.ts index 6b439858f..a89763a19 100644 --- a/dmp-frontend/src/app/utilities/enhancers/utils.ts +++ b/dmp-frontend/src/app/utilities/enhancers/utils.ts @@ -1,4 +1,4 @@ -import {AbstractControl, FormArray, FormControl, FormGroup} from "@angular/forms"; +import {AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup} from "@angular/forms"; export function isNullOrUndefined(object: any): boolean { return object === null || object === undefined; @@ -16,8 +16,8 @@ export function isNumeric(val: any): val is number | string { export function cloneAbstractControl(control: T): T { let newControl: T; - if (control instanceof FormGroup) { - const formGroup = new FormGroup({}, control.validator, control.asyncValidator); + if (control instanceof UntypedFormGroup) { + const formGroup = new UntypedFormGroup({}, control.validator, control.asyncValidator); const controls = control.controls; Object.keys(controls).forEach(key => { @@ -26,15 +26,15 @@ export function cloneAbstractControl(control: T): T { newControl = formGroup as any; } - else if (control instanceof FormArray) { - const formArray = new FormArray([], control.validator, control.asyncValidator); + else if (control instanceof UntypedFormArray) { + const formArray = new UntypedFormArray([], control.validator, control.asyncValidator); control.controls.forEach(formControl => formArray.push(cloneAbstractControl(formControl))) newControl = formArray as any; } - else if (control instanceof FormControl) { - newControl = new FormControl(control.value, control.validator, control.asyncValidator) as any; + else if (control instanceof UntypedFormControl) { + newControl = new UntypedFormControl(control.value, control.validator, control.asyncValidator) as any; } else { throw new Error('Error: unexpected control value'); diff --git a/dmp-frontend/src/assets/scss/blue-theme.scss b/dmp-frontend/src/assets/scss/blue-theme.scss index 0c539ba18..8a064ac7a 100644 --- a/dmp-frontend/src/assets/scss/blue-theme.scss +++ b/dmp-frontend/src/assets/scss/blue-theme.scss @@ -1,6 +1,6 @@ -@use '~@angular/material' as mat; +@use '@angular/material' as mat; @import "app/ui/misc/navigation/navigation.component.scss"; -@import "~@angular/material/theming"; // @import '../../../node_modules/@angular/material/theming'; +@import "@angular/material/theming"; // @import '../../../node_modules/@angular/material/theming'; $app-blue-theme-primary-palette: ( 50: #e2eef1, diff --git a/dmp-frontend/src/assets/scss/green-theme.scss b/dmp-frontend/src/assets/scss/green-theme.scss index b6b1f1283..dc585f37a 100644 --- a/dmp-frontend/src/assets/scss/green-theme.scss +++ b/dmp-frontend/src/assets/scss/green-theme.scss @@ -1,6 +1,6 @@ -@use '~@angular/material' as mat; +@use '@angular/material' as mat; @import "app/ui/misc/navigation/navigation.component.scss"; -@import "~@angular/material/theming"; // @import '../../../node_modules/@angular/material/theming'; +@import "@angular/material/theming"; // @import '../../../node_modules/@angular/material/theming'; $app-green-theme-primary-palette: ( 50: #e3f3f3, diff --git a/dmp-frontend/src/assets/scss/material-dashboard.scss b/dmp-frontend/src/assets/scss/material-dashboard.scss index 0f9072667..e5ef1ae4f 100644 --- a/dmp-frontend/src/assets/scss/material-dashboard.scss +++ b/dmp-frontend/src/assets/scss/material-dashboard.scss @@ -14,10 +14,10 @@ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. */ -@use '~@angular/material' as mat; +@use '@angular/material' as mat; @use 'sass:math'; -@import "~@angular/material/prebuilt-themes/indigo-pink.css"; -@import "~@angular/material/theming"; // @import '../../../node_modules/@angular/material/theming'; +@import "@angular/material/prebuilt-themes/indigo-pink.css"; +@import "@angular/material/theming"; // @import '../../../node_modules/@angular/material/theming'; @import "./blue-theme.scss"; // @import "./green-theme.scss"; diff --git a/dmp-frontend/src/common/forms/form-service.ts b/dmp-frontend/src/common/forms/form-service.ts index 3bb75fa85..5af373ea1 100644 --- a/dmp-frontend/src/common/forms/form-service.ts +++ b/dmp-frontend/src/common/forms/form-service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { AbstractControl, FormArray, FormControl, FormGroup } from '@angular/forms'; +import { AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; @Injectable() export class FormService { @@ -8,14 +8,14 @@ export class FormService { } public validateAllFormFields(formControl: AbstractControl) { - if (formControl instanceof FormControl) { + if (formControl instanceof UntypedFormControl) { formControl.updateValueAndValidity({ emitEvent: false }); - } else if (formControl instanceof FormGroup) { + } else if (formControl instanceof UntypedFormGroup) { Object.keys(formControl.controls).forEach(item => { const control = formControl.get(item); this.validateAllFormFields(control); }); - } else if (formControl instanceof FormArray) { + } else if (formControl instanceof UntypedFormArray) { formControl.controls.forEach(item => { this.validateAllFormFields(item); }); @@ -23,14 +23,14 @@ export class FormService { } public touchAllFormFields(formControl: AbstractControl) { - if (formControl instanceof FormControl) { + if (formControl instanceof UntypedFormControl) { formControl.markAsTouched(); - } else if (formControl instanceof FormGroup) { + } else if (formControl instanceof UntypedFormGroup) { Object.keys(formControl.controls).forEach(item => { const control = formControl.get(item); this.touchAllFormFields(control); }); - } else if (formControl instanceof FormArray) { + } else if (formControl instanceof UntypedFormArray) { formControl.controls.forEach(item => { this.touchAllFormFields(item); }); @@ -38,21 +38,21 @@ export class FormService { } public removeAllBackEndErrors(formControl: AbstractControl) { - if (formControl instanceof FormControl) { + if (formControl instanceof UntypedFormControl) { this.removeError(formControl, 'backendError'); - } else if (formControl instanceof FormGroup) { + } else if (formControl instanceof UntypedFormGroup) { Object.keys(formControl.controls).forEach(item => { const control = formControl.get(item); this.removeAllBackEndErrors(control); }); - } else if (formControl instanceof FormArray) { + } else if (formControl instanceof UntypedFormArray) { formControl.controls.forEach(item => { this.removeAllBackEndErrors(item); }); } } - public removeError(control: FormControl, error: string) { + public removeError(control: UntypedFormControl, error: string) { const err = control.errors; if (err && err[error]) { delete err[error]; diff --git a/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.ts b/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.ts index 7d4d14a33..1426c6443 100644 --- a/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.ts +++ b/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { AbstractControl, FormArray, FormControl, FormGroup } from '@angular/forms'; +import { AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { TranslateService } from '@ngx-translate/core'; @@ -10,7 +10,7 @@ import { TranslateService } from '@ngx-translate/core'; }) export class FormValidationErrorsDialogComponent { - formGroup: FormGroup; + formGroup: UntypedFormGroup; errorMessages: string[] = []; constructor(public dialogRef: MatDialogRef, @@ -31,7 +31,7 @@ export class FormValidationErrorsDialogComponent { public getErrors(formControl: AbstractControl, key?: string): string[] { const errors: string[] = []; - if (formControl instanceof FormControl) { + if (formControl instanceof UntypedFormControl) { if (formControl.errors !== null) { let name: string; if ((formControl).nativeElement !== undefined && (formControl).nativeElement !== null) { @@ -41,13 +41,13 @@ export class FormValidationErrorsDialogComponent { } errors.push(...this.getErrorMessage(formControl, name)); } - } else if (formControl instanceof FormGroup) { + } else if (formControl instanceof UntypedFormGroup) { if (formControl.errors) { (errors.push(...Object.values(formControl.errors).map(x => x.message) as string[])); } Object.keys(formControl.controls).forEach(key => { const control = formControl.get(key); errors.push(...this.getErrors(control, key)); }); - } else if (formControl instanceof FormArray) { + } else if (formControl instanceof UntypedFormArray) { if (formControl.errors) { (errors.push(...Object.values(formControl.errors).map(x => x.message) as string[])); } formControl.controls.forEach(item => { errors.push(...this.getErrors(item)); @@ -56,7 +56,7 @@ export class FormValidationErrorsDialogComponent { return errors; } - getErrorMessage(formControl: FormControl, name: string): string[] { + getErrorMessage(formControl: UntypedFormControl, name: string): string[] { const errors: string[] = []; Object.keys(formControl.errors).forEach(key => { if (key === 'required') { errors.push(this.language.instant(name + ": " + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.REQUIRED'))); } diff --git a/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.module.ts b/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.module.ts index fad8c4028..191b61a0b 100644 --- a/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.module.ts +++ b/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.module.ts @@ -4,22 +4,19 @@ import { FormValidationErrorsDirective } from '@common/forms/form-validation-err import { CommonUiModule } from '@common/ui/common-ui.module'; @NgModule({ - imports: [ - CommonUiModule, - ], - exports: [ - FormValidationErrorsDialogComponent, - FormValidationErrorsDirective - ], - declarations: [ - FormValidationErrorsDialogComponent, - FormValidationErrorsDirective - ], - entryComponents: [ - FormValidationErrorsDialogComponent - ], - providers: [ - FormValidationErrorsDirective - ] + imports: [ + CommonUiModule, + ], + exports: [ + FormValidationErrorsDialogComponent, + FormValidationErrorsDirective + ], + declarations: [ + FormValidationErrorsDialogComponent, + FormValidationErrorsDirective + ], + providers: [ + FormValidationErrorsDirective + ] }) export class FormValidationErrorsDialogModule { } diff --git a/dmp-frontend/src/common/modules/confirmation-dialog/confirmation-dialog.module.ts b/dmp-frontend/src/common/modules/confirmation-dialog/confirmation-dialog.module.ts index 124fea2f1..583a71d39 100644 --- a/dmp-frontend/src/common/modules/confirmation-dialog/confirmation-dialog.module.ts +++ b/dmp-frontend/src/common/modules/confirmation-dialog/confirmation-dialog.module.ts @@ -4,10 +4,9 @@ import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog import { CommonUiModule } from '@common/ui/common-ui.module'; @NgModule({ - imports: [CommonUiModule, FormsModule], - declarations: [ConfirmationDialogComponent], - exports: [ConfirmationDialogComponent], - entryComponents: [ConfirmationDialogComponent] + imports: [CommonUiModule, FormsModule], + declarations: [ConfirmationDialogComponent], + exports: [ConfirmationDialogComponent] }) export class ConfirmationDialogModule { constructor() { } diff --git a/dmp-frontend/src/common/modules/multiple-choice-dialog/multiple-choice-dialog.module.ts b/dmp-frontend/src/common/modules/multiple-choice-dialog/multiple-choice-dialog.module.ts index 5f435c90b..abecaded6 100644 --- a/dmp-frontend/src/common/modules/multiple-choice-dialog/multiple-choice-dialog.module.ts +++ b/dmp-frontend/src/common/modules/multiple-choice-dialog/multiple-choice-dialog.module.ts @@ -7,9 +7,8 @@ import { FormsModule } from '@angular/forms'; @NgModule({ - imports: [CommonUiModule, FormsModule], - declarations: [MultipleChoiceDialogComponent], - exports: [MultipleChoiceDialogComponent], - entryComponents: [MultipleChoiceDialogComponent] + imports: [CommonUiModule, FormsModule], + declarations: [MultipleChoiceDialogComponent], + exports: [MultipleChoiceDialogComponent] }) export class MultipleChoiceDialogModule { } diff --git a/dmp-frontend/src/polyfills.ts b/dmp-frontend/src/polyfills.ts index 5dc0b3e49..c921fb830 100644 --- a/dmp-frontend/src/polyfills.ts +++ b/dmp-frontend/src/polyfills.ts @@ -20,20 +20,10 @@ import 'core-js/es7/array'; -/** IE10 and IE11 requires the following for NgClass support on SVG elements */ -//import 'classlist.js'; // Run `npm install --save classlist.js`. - /** Evergreen browsers require these. **/ import 'core-js/es6/reflect'; -/** - * Required to support Web Animations `@angular/platform-browser/animations`. - * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation - **/ -//import 'web-animations-js'; // Run `npm install --save web-animations-js`. - - /*************************************************************************************************** * Zone JS is required by Angular itself. diff --git a/dmp-frontend/src/styles.scss b/dmp-frontend/src/styles.scss index dc24a9757..863c6661b 100644 --- a/dmp-frontend/src/styles.scss +++ b/dmp-frontend/src/styles.scss @@ -1,6 +1,6 @@ // @import "~@covalent/core/theming/all-theme"; -@import "~@angular/material/theming"; // @import '../node_modules/@angular/material/theming'; -@import "~@angular/material/prebuilt-themes/indigo-pink.css"; +@import "@angular/material/theming"; // @import '../node_modules/@angular/material/theming'; +@import "@angular/material/prebuilt-themes/indigo-pink.css"; // Material-Bootstrap configuration @import "~bootstrap/scss/bootstrap"; diff --git a/dmp-frontend/tsconfig.json b/dmp-frontend/tsconfig.json index c554a09e7..e82da0493 100644 --- a/dmp-frontend/tsconfig.json +++ b/dmp-frontend/tsconfig.json @@ -10,7 +10,7 @@ "experimentalDecorators": true, "importHelpers": true, "skipLibCheck": true, - "target": "es2015", + "target": "es2020", "typeRoots": [ "node_modules/@types" ], From 96c2940eb01ff97ab2caaf67170a36a61a2c9361 Mon Sep 17 00:00:00 2001 From: Diamantis Tziotzios Date: Thu, 5 Oct 2023 16:58:45 +0300 Subject: [PATCH 2/4] angular 15 update --- dmp-frontend/package.json | 32 ++++++------ dmp-frontend/src/app/app-routing.module.ts | 2 +- dmp-frontend/src/app/app.module.ts | 2 +- .../app/core/services/auth/auth.service.ts | 2 +- .../multiple-auto-complete.component.ts | 6 +-- .../single/single-auto-complete.component.ts | 4 +- .../deactivate/can-deactivate.guard.ts | 2 +- .../export-method-dialog.component.ts | 2 +- .../notification/notification.component.ts | 4 +- .../popup/popup-notification.component.ts | 2 +- .../snack-bar-notification.component.ts | 2 +- ...rofile-editor-composite-field.component.ts | 4 +- ...t-profile-editor-upload-field.component.ts | 2 +- .../dataset-profile-editor-field.component.ts | 6 +-- .../dataset-profile-editor.component.ts | 4 +- .../criteria/dataset-profile.component.ts | 2 +- ...-confirmation-upload-profiles.component.ts | 2 +- .../dataset-profile-listing.component.ts | 4 +- .../table-of-contents/table-of-contents.ts | 2 +- .../listing/description-types.component.ts | 6 +-- .../editor/dmp-profile-editor.component.ts | 2 +- ...-confirmation-upload-profiles.component.ts | 2 +- .../dmp-profile-criteria.component.ts | 2 +- .../listing/dmp-profile-listing.component.ts | 6 +-- .../user/listing/user-listing.component.ts | 6 +-- .../contact-dialog.component.ts | 2 +- .../app/ui/dashboard/dashboard.component.ts | 2 +- .../ui/dashboard/drafts/drafts.component.ts | 2 +- .../quick-wizard-create-add.component.ts | 2 +- .../recent-edited-activity.component.ts | 2 +- ...ecent-edited-dataset-activity.component.ts | 2 +- .../recent-edited-dmp-activity.component.ts | 2 +- .../dataset-create-wizard.component.ts | 2 +- .../dataset-copy-dialogue.component.ts | 2 +- .../dataset-editor.component.ts | 2 +- .../dataset-wizard.component.ts | 4 +- ...et-external-references-editor.component.ts | 4 +- ...data-repository-dialog-editor.component.ts | 2 +- ...xternal-dataset-dialog-editor.component.ts | 2 +- ...ternal-registry-dialog-editor.component.ts | 2 +- ...xternal-service-dialog-editor.component.ts | 2 +- .../prefill-dataset.component.ts | 2 +- .../dataset-criteria-dialog.component.ts | 2 +- .../criteria/dataset-criteria.component.ts | 4 +- .../dataset-upload-dialogue.component.ts | 2 +- .../listing/dataset-listing.component.ts | 4 +- .../dataset-listing-item.component.ts | 2 +- .../overview/dataset-overview.component.ts | 2 +- .../clone-dialog/clone-dialog.component.ts | 2 +- .../app/ui/dmp/clone/dmp-clone.component.ts | 2 +- .../dataset-preview-dialog.component.ts | 2 +- .../dmp-editor-blueprint.component.ts | 2 +- .../dmp-to-dataset-dialog.component.ts | 2 +- .../add-organization.component.ts | 2 +- .../add-researcher.component.ts | 2 +- .../available-profiles.component.ts | 2 +- .../add-cost/add-cost.component.ts | 2 +- .../dataset-editor-details.component.ts | 6 +-- .../dataset-info/dataset-info.component.ts | 2 +- .../dmp-deposit-dropdown.component.ts | 2 +- .../app/ui/dmp/editor/dmp-editor.component.ts | 2 +- .../dmp-finalize-dialog.component.ts | 2 +- .../general-tab/general-tab.component.ts | 2 +- .../license-info/license-info.component.ts | 2 +- .../editor/main-info/main-info.component.ts | 2 +- .../editor/people-tab/people-tab.component.ts | 2 +- .../dmp-invitation-dialog.component.ts | 4 +- .../criteria/dmp-criteria-dialog.component.ts | 2 +- .../criteria/dmp-criteria.component.ts | 2 +- .../ui/dmp/listing/dmp-listing.component.ts | 4 +- .../dmp-listing-item.component.ts | 2 +- .../dmp-upload-dialogue.component.ts | 2 +- .../ui/dmp/overview/dmp-overview.component.ts | 2 +- .../start-new-dataset-dialog.component.ts | 2 +- .../start-new-dmp-dialog.component.ts | 2 +- .../app/ui/dmp/wizard/dmp-wizard.component.ts | 2 +- .../editor/dmp-wizard-editor.component.ts | 2 +- .../dmp-wizard-dataset-listing.component.ts | 4 +- .../app/ui/faq/dialog/faq-dialog.component.ts | 2 +- .../dialog/glossary-dialog.component.ts | 2 +- .../dialog/language-dialog.component.ts | 2 +- .../form-composite-field-dialog.component.ts | 2 +- .../form-composite-field.component.ts | 2 +- .../form-field/form-field.component.ts | 4 +- .../misc/navigation/navigation.component.ts | 2 +- .../user-dialog/user-dialog.component.ts | 2 +- .../oauth2-dialog/oauth2-dialog.component.ts | 2 +- .../src/app/ui/navbar/navbar.component.ts | 4 +- .../dmp-editor/dmp-editor-wizard.component.ts | 2 +- .../grant-editor-wizard.component.ts | 2 +- .../quick-wizard-editor.component.ts | 4 +- .../sidebar-footer.component.ts | 2 +- .../src/app/ui/sidebar/sidebar.component.ts | 2 +- .../dialog/user-guide-dialog.component.ts | 2 +- .../add-account-dialog.component.ts | 2 +- .../ui/user-profile/user-profile.component.ts | 2 +- dmp-frontend/src/assets/scss/blue-theme.scss | 32 +++++++++--- dmp-frontend/src/assets/scss/green-theme.scss | 32 +++++++++--- .../src/assets/scss/material-dashboard.scss | 13 ++++- ...form-validation-errors-dialog.component.ts | 2 +- .../pending-form-changes-guard.service.ts | 2 +- .../response-payload.interceptor.ts | 2 +- .../src/common/material/material.module.ts | 44 ++++++++-------- .../confirmation-dialog.component.ts | 2 +- .../multiple-choice-dialog.component.ts | 2 +- dmp-frontend/src/test.ts | 14 +++++ dmp-frontend/tsconfig.json | 51 ++++++++++--------- 107 files changed, 266 insertions(+), 206 deletions(-) create mode 100644 dmp-frontend/src/test.ts diff --git a/dmp-frontend/package.json b/dmp-frontend/package.json index 1cb946f13..46e88aaea 100644 --- a/dmp-frontend/package.json +++ b/dmp-frontend/package.json @@ -12,13 +12,13 @@ }, "private": true, "dependencies": { - "@angular/animations": "^14.3.0", - "@angular/common": "^14.3.0", - "@angular/compiler": "^14.3.0", - "@angular/core": "^14.3.0", - "@angular/forms": "^14.3.0", - "@angular/material-moment-adapter": "^14.2.7", - "@angular/platform-browser": "^14.3.0", + "@angular/animations": "^15.2.10", + "@angular/common": "^15.2.10", + "@angular/compiler": "^15.2.10", + "@angular/core": "^15.2.10", + "@angular/forms": "^15.2.10", + "@angular/material-moment-adapter": "^15.2.9", + "@angular/platform-browser": "^15.2.10", "@kolkov/angular-editor": "^1.2.0", "@ngx-translate/core": "^13.0.0", "@ngx-translate/http-loader": "^6.0.0", @@ -46,14 +46,14 @@ "zone.js": "~0.11.4" }, "devDependencies": { - "@angular-devkit/build-angular": "^14.2.12", - "@angular/cdk": "^14.2.7", - "@angular/cli": "14.2.12", - "@angular/compiler-cli": "^14.3.0", - "@angular/language-service": "^14.3.0", - "@angular/material": "^14.2.7", - "@angular/platform-browser-dynamic": "^14.3.0", - "@angular/router": "^14.3.0", + "@angular-devkit/build-angular": "^15.2.9", + "@angular/cdk": "^15.2.9", + "@angular/cli": "15.2.9", + "@angular/compiler-cli": "^15.2.10", + "@angular/language-service": "^15.2.10", + "@angular/material": "^15.2.9", + "@angular/platform-browser-dynamic": "^15.2.10", + "@angular/router": "^15.2.10", "@types/facebook-js-sdk": "^3.3.5", "@types/file-saver": "^2.0.3", "@types/gapi": "^0.0.41", @@ -66,6 +66,6 @@ "codelyzer": "^6.0.2", "ts-node": "~10.2.1", "tslint": "~6.1.0", - "typescript": "4.6.4" + "typescript": "^4.8" } } \ No newline at end of file diff --git a/dmp-frontend/src/app/app-routing.module.ts b/dmp-frontend/src/app/app-routing.module.ts index e13c1e00b..b508b09eb 100644 --- a/dmp-frontend/src/app/app-routing.module.ts +++ b/dmp-frontend/src/app/app-routing.module.ts @@ -273,7 +273,7 @@ const appRoutes: Routes = [ ]; @NgModule({ - imports: [RouterModule.forRoot(appRoutes, { relativeLinkResolution: 'legacy' })], + imports: [RouterModule.forRoot(appRoutes, {})], exports: [RouterModule], }) export class AppRoutingModule { } diff --git a/dmp-frontend/src/app/app.module.ts b/dmp-frontend/src/app/app.module.ts index fac755393..18b7a6b51 100644 --- a/dmp-frontend/src/app/app.module.ts +++ b/dmp-frontend/src/app/app.module.ts @@ -4,7 +4,7 @@ import { LOCALE_ID, NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { MatMomentDateModule, MAT_MOMENT_DATE_FORMATS } from '@angular/material-moment-adapter'; import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core'; -import { MatFormFieldDefaultOptions, MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field'; +import { MatLegacyFormFieldDefaultOptions as MatFormFieldDefaultOptions, MAT_LEGACY_FORM_FIELD_DEFAULT_OPTIONS as MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/legacy-form-field'; import { BrowserModule, Title } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { AppRoutingModule } from '@app/app-routing.module'; diff --git a/dmp-frontend/src/app/core/services/auth/auth.service.ts b/dmp-frontend/src/app/core/services/auth/auth.service.ts index 53355056d..8beb72c64 100644 --- a/dmp-frontend/src/app/core/services/auth/auth.service.ts +++ b/dmp-frontend/src/app/core/services/auth/auth.service.ts @@ -1,7 +1,7 @@ import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { MatSnackBar } from '@angular/material/snack-bar'; +import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; import { Router } from '@angular/router'; import { Credential } from '@app/core/model/auth/credential'; import { LoginInfo } from '@app/core/model/auth/login-info'; diff --git a/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.ts b/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.ts index f39413c8f..7b612997e 100644 --- a/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.ts +++ b/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.ts @@ -17,10 +17,10 @@ import { ViewChild } from '@angular/core'; import {ControlValueAccessor, FormGroupDirective, NgControl, NgForm} from '@angular/forms'; -import {MatChipInputEvent} from '@angular/material/chips'; +import {MatLegacyChipInputEvent as MatChipInputEvent} from '@angular/material/legacy-chips'; import {ErrorStateMatcher, mixinErrorState} from '@angular/material/core'; -import {MatAutocomplete, MatAutocompleteSelectedEvent, MatAutocompleteTrigger} from '@angular/material/autocomplete'; -import {MatFormFieldControl} from '@angular/material/form-field'; +import {MatLegacyAutocomplete as MatAutocomplete, MatLegacyAutocompleteSelectedEvent as MatAutocompleteSelectedEvent, MatLegacyAutocompleteTrigger as MatAutocompleteTrigger} from '@angular/material/legacy-autocomplete'; +import {MatLegacyFormFieldControl as MatFormFieldControl} from '@angular/material/legacy-form-field'; import {AutoCompleteGroup} from '@app/library/auto-complete/auto-complete-group'; import { MultipleAutoCompleteConfiguration diff --git a/dmp-frontend/src/app/library/auto-complete/single/single-auto-complete.component.ts b/dmp-frontend/src/app/library/auto-complete/single/single-auto-complete.component.ts index c63215f13..714d3e9ef 100644 --- a/dmp-frontend/src/app/library/auto-complete/single/single-auto-complete.component.ts +++ b/dmp-frontend/src/app/library/auto-complete/single/single-auto-complete.component.ts @@ -2,9 +2,9 @@ import { FocusMonitor } from '@angular/cdk/a11y'; import { ENTER } from '@angular/cdk/keycodes'; import { Component, DoCheck, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Optional, Output, Self, SimpleChanges, TemplateRef, ViewChild } from '@angular/core'; import { ControlValueAccessor, FormGroupDirective, NgControl, NgForm } from '@angular/forms'; -import { MatAutocomplete, MatAutocompleteSelectedEvent, MatAutocompleteTrigger } from '@angular/material/autocomplete'; +import { MatLegacyAutocomplete as MatAutocomplete, MatLegacyAutocompleteSelectedEvent as MatAutocompleteSelectedEvent, MatLegacyAutocompleteTrigger as MatAutocompleteTrigger } from '@angular/material/legacy-autocomplete'; import { ErrorStateMatcher, mixinErrorState } from '@angular/material/core'; -import { MatFormFieldControl } from '@angular/material/form-field'; +import { MatLegacyFormFieldControl as MatFormFieldControl } from '@angular/material/legacy-form-field'; import { AutoCompleteGroup } from '@app/library/auto-complete/auto-complete-group'; import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration'; import { BaseComponent } from '@common/base/base.component'; diff --git a/dmp-frontend/src/app/library/deactivate/can-deactivate.guard.ts b/dmp-frontend/src/app/library/deactivate/can-deactivate.guard.ts index 8e6df7ff9..06845c5e9 100644 --- a/dmp-frontend/src/app/library/deactivate/can-deactivate.guard.ts +++ b/dmp-frontend/src/app/library/deactivate/can-deactivate.guard.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { CanDeactivate } from '@angular/router'; import { CheckDeactivateBaseComponent } from '@app/library/deactivate/deactivate.component'; import { BaseComponent } from '@common/base/base.component'; diff --git a/dmp-frontend/src/app/library/export-method-dialog/export-method-dialog.component.ts b/dmp-frontend/src/app/library/export-method-dialog/export-method-dialog.component.ts index 37406942a..ef4d6546c 100644 --- a/dmp-frontend/src/app/library/export-method-dialog/export-method-dialog.component.ts +++ b/dmp-frontend/src/app/library/export-method-dialog/export-method-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit, Inject } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; @Component({ diff --git a/dmp-frontend/src/app/library/notification/notification.component.ts b/dmp-frontend/src/app/library/notification/notification.component.ts index 2bc6c31b6..aead1307a 100644 --- a/dmp-frontend/src/app/library/notification/notification.component.ts +++ b/dmp-frontend/src/app/library/notification/notification.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; -import { MatSnackBar } from '@angular/material/snack-bar'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; import { PopupNotification, SnackBarNotification, SnackBarNotificationLevel, UiNotificationService, UiNotificationType } from '@app/core/services/notification/ui-notification-service'; import { PopupNotificationDialogComponent } from '@app/library/notification/popup/popup-notification.component'; import { SnackBarNotificationComponent } from '@app/library/notification/snack-bar/snack-bar-notification.component'; diff --git a/dmp-frontend/src/app/library/notification/popup/popup-notification.component.ts b/dmp-frontend/src/app/library/notification/popup/popup-notification.component.ts index b672e34f6..e8c14d9a9 100644 --- a/dmp-frontend/src/app/library/notification/popup/popup-notification.component.ts +++ b/dmp-frontend/src/app/library/notification/popup/popup-notification.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; import { PopupNotification } from '../../../core/services/notification/ui-notification-service'; @Component({ diff --git a/dmp-frontend/src/app/library/notification/snack-bar/snack-bar-notification.component.ts b/dmp-frontend/src/app/library/notification/snack-bar/snack-bar-notification.component.ts index ff8745b38..ba9a1f4fc 100644 --- a/dmp-frontend/src/app/library/notification/snack-bar/snack-bar-notification.component.ts +++ b/dmp-frontend/src/app/library/notification/snack-bar/snack-bar-notification.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MAT_SNACK_BAR_DATA } from '@angular/material/snack-bar'; +import { MAT_LEGACY_SNACK_BAR_DATA as MAT_SNACK_BAR_DATA } from '@angular/material/legacy-snack-bar'; import { SnackBarNotification } from '../../../core/services/notification/ui-notification-service'; @Component({ diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts index 44c95cfd4..2a9b9509e 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts @@ -4,14 +4,14 @@ import {FieldEditorModel} from '../../../admin/field-editor-model'; import {Guid} from '@common/types/guid'; import {RuleEditorModel} from '../../../admin/rule-editor-model'; import {ValidationType} from '@app/core/common/enum/validation-type'; -import {MatCheckboxChange} from '@angular/material/checkbox'; +import {MMatLegacyCheckboxChange as MatCheckboxChange from '@@angular/material/legacy-checkbox; import { DatasetDescriptionCompositeFieldEditorModel, DatasetDescriptionFieldEditorModel, DatasetDescriptionSectionEditorModel } from '@app/ui/misc/dataset-description-form/dataset-description-form.model'; import {DatasetProfileFieldViewStyle} from '@app/core/common/enum/dataset-profile-field-view-style'; -import {MatDialog} from '@angular/material/dialog'; +import {MMatLegacyDialog as MatDialog from '@@angular/material/legacy-dialog; import {ConfirmationDialogComponent} from '@common/modules/confirmation-dialog/confirmation-dialog.component'; import {TranslateService} from '@ngx-translate/core'; import {ViewStyleType} from '../field/view-style-enum'; diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/upload/dataset-profile-editor-upload-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/upload/dataset-profile-editor-upload-field.component.ts index 3c0ed1769..0b7003eb5 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/upload/dataset-profile-editor-upload-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/upload/dataset-profile-editor-upload-field.component.ts @@ -3,7 +3,7 @@ import {UntypedFormArray, UntypedFormBuilder, UntypedFormControl, UntypedFormGro import { UploadFieldDataEditorModel } from '../../../../admin/field-data/upload-field-data-editor-model'; import {FieldDataOption} from "@app/core/model/dataset-profile-definition/field-data/field-data"; import {FieldDataOptionEditorModel} from "@app/ui/admin/dataset-profile/admin/field-data/field-data-option-editor-model"; -import {MatSelect} from "@angular/material/select"; +import {MatLegacySelect as MatSelect} from "@angular/material/legacy-select"; import {ConfigurationService} from "@app/core/services/configuration/configuration.service"; @Component({ diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts index d4312892f..1cefd7483 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts @@ -9,9 +9,9 @@ import {BaseComponent} from '@common/base/base.component'; import {Observable, Subscription} from 'rxjs'; import {ViewStyleType} from './view-style-enum'; import {DatasetProfileComboBoxType} from '@app/core/common/enum/dataset-profile-combo-box-type'; -import {ErrorStateMatcher} from '@angular/material/core'; -import {MatDialog} from '@angular/material/dialog'; -import {MatSlideToggleChange} from '@angular/material/slide-toggle'; +iimport {ErrorStateMatcher} from '@angular/material/core'; +import {MMatLegacyDialog as MatDialog from '@@angular/material/legacy-dialog; +import {MMatLegacySlideToggleChange as MatSlideToggleChange from '@@angular/material/legacy-slide-toggle; import {DefaultValue, Field} from '@app/core/model/admin/dataset-profile/dataset-profile'; import {DatasetProfileInternalDmpEntitiesType} from '@app/core/common/enum/dataset-profile-internal-dmp-entities-type'; import {FieldEditorModel} from '../../../admin/field-editor-model'; diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts index 17ae8c8c0..af9184e83 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts @@ -3,7 +3,7 @@ import { of as observableOf, Observable, combineLatest, BehaviorSubject,of } fr import { HttpClient, HttpErrorResponse } from '@angular/common/http'; import { Component, OnInit, QueryList, ViewChild } from '@angular/core'; import { AbstractControl, UntypedFormArray, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { MatHorizontalStepper} from '@angular/material/stepper'; import { ActivatedRoute, ParamMap, Router } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; @@ -43,7 +43,7 @@ import { EditorCustomValidators, EditorCustomValidatorsEnum } from './custom-val import { GENERAL_ANIMATIONS, STEPPER_ANIMATIONS } from './animations/animations'; import { DatasetProfileComboBoxType } from '@app/core/common/enum/dataset-profile-combo-box-type'; import { UserService } from '@app/core/services/user/user.service'; -import { MatInput } from '@angular/material/input'; +import { MatLegacyInput as MatInput } from '@angular/material/legacy-input'; import { CheckDeactivateBaseComponent } from '@app/library/deactivate/deactivate.component'; import { DescriptionTemplateTypeService } from '@app/core/services/description-template-type/description-template-type.service'; import { DescriptionTemplateType } from '@app/core/model/description-template-type/description-template-type'; diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/listing/criteria/dataset-profile.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/listing/criteria/dataset-profile.component.ts index 7cf625f1f..607a0e2e2 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/listing/criteria/dataset-profile.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/listing/criteria/dataset-profile.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { DatasetProfileCriteria } from '@app/core/query/dataset-profile/dataset-profile-criteria'; import { DatasetProfileService } from '@app/core/services/dataset-profile/dataset-profile.service'; import { DialogConfirmationUploadDatasetProfiles } from '@app/ui/admin/dataset-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component'; diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.ts index 2fe4b0343..234444ef8 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.ts @@ -1,4 +1,4 @@ -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; import { Inject, Component } from '@angular/core'; diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/listing/dataset-profile-listing.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/listing/dataset-profile-listing.component.ts index cfb0315f6..05d31fec1 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/listing/dataset-profile-listing.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/listing/dataset-profile-listing.component.ts @@ -1,8 +1,8 @@ import { DataSource } from '@angular/cdk/table'; import { HttpClient, HttpErrorResponse } from '@angular/common/http'; import { Component, OnInit, ViewChild } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; -import { MatPaginator, PageEvent } from '@angular/material/paginator'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatLegacyPaginator as MatPaginator, LegacyPageEvent as PageEvent } from '@angular/material/legacy-paginator'; import { MatSort } from '@angular/material/sort'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { DatasetStatus } from '@app/core/common/enum/dataset-status'; diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents.ts index 31d8b6ac9..9357f3e99 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents.ts @@ -8,7 +8,7 @@ import { SimpleChanges } from '@angular/core'; import { NewEntryType, TableUpdateInfo, ToCEntry, ToCEntryType } from './table-of-contents-entry'; import { DragulaService } from 'ng2-dragula'; import { UntypedFormArray } from '@angular/forms'; -import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; +import { MatLegacySnackBar as MatSnackBar, MatLegacySnackBarConfig as MatSnackBarConfig } from '@angular/material/legacy-snack-bar'; import { TranslateService } from '@ngx-translate/core'; import { ContentObserver } from '@angular/cdk/observers'; diff --git a/dmp-frontend/src/app/ui/admin/description-types/listing/description-types.component.ts b/dmp-frontend/src/app/ui/admin/description-types/listing/description-types.component.ts index bdeb32aa3..452ad2cb2 100644 --- a/dmp-frontend/src/app/ui/admin/description-types/listing/description-types.component.ts +++ b/dmp-frontend/src/app/ui/admin/description-types/listing/description-types.component.ts @@ -1,10 +1,10 @@ import { DataSource } from '@angular/cdk/table'; import { HttpErrorResponse } from '@angular/common/http'; import { Component, EventEmitter, OnInit, ViewChild } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; -import { MatPaginator } from '@angular/material/paginator'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatLegacyPaginator as MatPaginator } from '@angular/material/legacy-paginator'; import { MatSort } from '@angular/material/sort'; -import { MatTableDataSource } from '@angular/material/table'; +import { MatLegacyTableDataSource as MatTableDataSource } from '@angular/material/legacy-table'; import { Router } from '@angular/router'; import { DescriptionTemplateType } from '@app/core/model/description-template-type/description-template-type'; import { DescriptionTemplateTypeLookup } from '@app/core/query/description-template/description-template-type.lookup'; diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.ts b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.ts index bb0a2d8a0..762bd5a96 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.ts +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.ts @@ -23,7 +23,7 @@ import { map, takeUntil } from 'rxjs/operators'; import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; import { HttpClient } from '@angular/common/http'; import { MatomoService } from '@app/core/services/matomo/matomo-service'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component'; import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration'; import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.ts b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.ts index c8081101f..4fec08bb4 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.ts +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.ts @@ -1,4 +1,4 @@ -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; import { Inject, Component } from '@angular/core'; diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.ts b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.ts index e80bea6b3..2c29752da 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.ts +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { DmpBlueprintCriteria } from '@app/core/query/dmp/dmp-blueprint-criteria'; import { DmpProfileService } from '@app/core/services/dmp/dmp-profile.service'; import { BaseCriteriaComponent } from '@app/ui/misc/criteria/base-criteria.component'; diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.ts b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.ts index cac8ff4a9..0b79cc3ba 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.ts +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.ts @@ -2,9 +2,9 @@ import { DataSource } from '@angular/cdk/table'; import { HttpClient, HttpErrorResponse } from '@angular/common/http'; import { Component, OnInit, ViewChild } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; -import { MatPaginator, PageEvent } from '@angular/material/paginator'; -import { MatSnackBar } from '@angular/material/snack-bar'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatLegacyPaginator as MatPaginator, LegacyPageEvent as PageEvent } from '@angular/material/legacy-paginator'; +import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; import { MatSort } from '@angular/material/sort'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; diff --git a/dmp-frontend/src/app/ui/admin/user/listing/user-listing.component.ts b/dmp-frontend/src/app/ui/admin/user/listing/user-listing.component.ts index 8fb1377a5..73127bee2 100644 --- a/dmp-frontend/src/app/ui/admin/user/listing/user-listing.component.ts +++ b/dmp-frontend/src/app/ui/admin/user/listing/user-listing.component.ts @@ -4,8 +4,8 @@ import {of as observableOf, merge as observableMerge, Observable } from 'rxjs'; import {map, catchError, switchMap, startWith, takeUntil} from 'rxjs/operators'; import { DataSource } from '@angular/cdk/table'; import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core'; -import { MatPaginator } from '@angular/material/paginator'; -import { MatSnackBar } from '@angular/material/snack-bar'; +import { MatLegacyPaginator as MatPaginator } from '@angular/material/legacy-paginator'; +import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; import { MatSort } from '@angular/material/sort'; import { TranslateService } from '@ngx-translate/core'; import { UserListingModel } from '../../../../core/model/user/user-listing'; @@ -19,7 +19,7 @@ import { BaseComponent } from '@common/base/base.component'; import * as FileSaver from 'file-saver'; import { MatomoService } from '@app/core/services/matomo/matomo-service'; import { HttpClient } from '@angular/common/http'; -import { MatTableDataSource } from '@angular/material/table'; +import { MatLegacyTableDataSource as MatTableDataSource } from '@angular/material/legacy-table'; export class UsersDataSource extends DataSource { diff --git a/dmp-frontend/src/app/ui/contact/contact-dialog/contact-dialog.component.ts b/dmp-frontend/src/app/ui/contact/contact-dialog/contact-dialog.component.ts index dca466aef..b28c6acd7 100644 --- a/dmp-frontend/src/app/ui/contact/contact-dialog/contact-dialog.component.ts +++ b/dmp-frontend/src/app/ui/contact/contact-dialog/contact-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; import { FormGroup } from '@angular/forms'; @Component({ diff --git a/dmp-frontend/src/app/ui/dashboard/dashboard.component.ts b/dmp-frontend/src/app/ui/dashboard/dashboard.component.ts index 250fbd3ab..728ebfd6a 100644 --- a/dmp-frontend/src/app/ui/dashboard/dashboard.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/dashboard.component.ts @@ -25,7 +25,7 @@ import { BreadcrumbItem } from '../misc/breadcrumb/definition/breadcrumb-item'; import { IBreadCrumbComponent } from '../misc/breadcrumb/definition/IBreadCrumbComponent'; import { DmpCriteria } from '@app/core/query/dmp/dmp-criteria'; import { DatasetCriteria } from '@app/core/query/dataset/dataset-criteria'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { StartNewDmpDialogComponent } from '../dmp/start-new-dmp-dialogue/start-new-dmp-dialog.component'; import { StartNewDatasetDialogComponent } from '../dmp/start-new-dataset-dialogue/start-new-dataset-dialog.component'; import { DatasetWizardEditorModel } from '../dataset/dataset-wizard/dataset-wizard-editor.model'; diff --git a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts index 8ac0c8947..d2c740bbd 100644 --- a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts @@ -14,7 +14,7 @@ import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog import { DatasetCopyDialogueComponent } from '@app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component'; import {UntypedFormControl, UntypedFormBuilder, UntypedFormGroup} from '@angular/forms'; import { BaseComponent } from '@common/base/base.component'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service'; import { SnackBarNotificationLevel } from '@app/core/services/notification/ui-notification-service'; import * as FileSaver from 'file-saver'; diff --git a/dmp-frontend/src/app/ui/dashboard/quick-wizard-create-add/quick-wizard-create-add.component.ts b/dmp-frontend/src/app/ui/dashboard/quick-wizard-create-add/quick-wizard-create-add.component.ts index d64a2de98..a463b5ba5 100644 --- a/dmp-frontend/src/app/ui/dashboard/quick-wizard-create-add/quick-wizard-create-add.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/quick-wizard-create-add/quick-wizard-create-add.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from "@angular/core"; -import { MatSnackBar } from "@angular/material/snack-bar"; +import { MatLegacySnackBar as MatSnackBar } from "@angular/material/legacy-snack-bar"; import { ActivatedRoute, Router } from "@angular/router"; import { BaseComponent } from '@common/base/base.component'; import { TranslateService } from "@ngx-translate/core"; diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts index 0cd7ca4fc..ae3119ec0 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts @@ -1,5 +1,5 @@ import {Component, OnInit, Output, EventEmitter, Input, ViewChild} from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import {ActivatedRoute, Router} from '@angular/router'; import { RecentActivityType } from '@app/core/common/enum/recent-activity-type'; import { Principal } from '@app/core/model/auth/principal'; diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.ts b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.ts index 35f7fc046..34ebce7de 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.ts @@ -10,7 +10,7 @@ import { TranslateService } from '@ngx-translate/core'; import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; import { UntypedFormControl, UntypedFormBuilder } from '@angular/forms'; import { DatasetCopyDialogueComponent } from '@app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { debounceTime, takeUntil } from 'rxjs/operators'; import {ActivatedRoute, Router} from '@angular/router'; import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service'; diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.ts b/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.ts index 79506428a..b43564d7a 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.ts @@ -1,5 +1,5 @@ import {Component, OnInit, Output, EventEmitter, Input, ViewChild} from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import {ActivatedRoute, Router} from '@angular/router'; import { RecentActivityType } from '@app/core/common/enum/recent-activity-type'; import { Principal } from '@app/core/model/auth/principal'; diff --git a/dmp-frontend/src/app/ui/dataset-create-wizard/dataset-create-wizard.component.ts b/dmp-frontend/src/app/ui/dataset-create-wizard/dataset-create-wizard.component.ts index 4599943a9..52cd5e7b9 100644 --- a/dmp-frontend/src/app/ui/dataset-create-wizard/dataset-create-wizard.component.ts +++ b/dmp-frontend/src/app/ui/dataset-create-wizard/dataset-create-wizard.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { UntypedFormArray, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { MatStepper } from '@angular/material/stepper'; import { Router } from '@angular/router'; import { DatasetStatus } from '@app/core/common/enum/dataset-status'; diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component.ts index 37b53eb00..c26024b5d 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component.ts @@ -1,7 +1,7 @@ import { map, filter } from 'rxjs/operators'; import { Component } from "@angular/core"; -import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog"; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from "@angular/material/legacy-dialog"; import { SingleAutoCompleteConfiguration } from "../../../../library/auto-complete/single/single-auto-complete-configuration"; import { Observable } from "rxjs"; import { DataTableRequest } from "../../../../core/model/data-table/data-table-request"; diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.ts index aafb6fe66..fc0ad46c1 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.ts @@ -8,7 +8,7 @@ import { TranslateService } from '@ngx-translate/core'; import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; import { takeUntil } from 'rxjs/operators'; import { DmpProfileService } from '@app/core/services/dmp/dmp-profile.service'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { PopupNotificationDialogComponent } from '@app/library/notification/popup/popup-notification.component'; @Component({ diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts index 91df9c33e..d53569ddd 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts @@ -1,7 +1,7 @@ import {ChangeDetectorRef, Component, OnInit, ViewChild} from '@angular/core'; import {AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup} from '@angular/forms'; -import {MatDialog} from '@angular/material/dialog'; -import {MatSnackBar} from '@angular/material/snack-bar'; +import {MatLegacyDialog as MatDialog} from '@angular/material/legacy-dialog'; +import {MatLegacySnackBar as MatSnackBar} from '@angular/material/legacy-snack-bar'; import {ActivatedRoute, Router} from '@angular/router'; import {DatasetStatus} from '@app/core/common/enum/dataset-status'; import {DmpStatus} from '@app/core/common/enum/dmp-status'; diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/dataset-external-references-editor.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/dataset-external-references-editor.component.ts index cac88b15d..56323b09e 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/dataset-external-references-editor.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/dataset-external-references-editor.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnInit, Output, EventEmitter } from '@angular/core'; import { UntypedFormArray, UntypedFormGroup } from '@angular/forms'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { Router } from '@angular/router'; import { ExternalSourceItemModel } from '@app/core/model/external-sources/external-source-item'; import { ExternalSourcesConfiguration } from '@app/core/model/external-sources/external-sources-configuration'; @@ -23,7 +23,7 @@ import { TranslateService } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { takeUntil, map } from 'rxjs/operators'; import { ENTER, COMMA } from '@angular/cdk/keycodes'; -import { MatChipInputEvent } from '@angular/material/chips'; +import { MatLegacyChipInputEvent as MatChipInputEvent } from '@angular/material/legacy-chips'; import { isNullOrUndefined } from '@app/utilities/enhancers/utils'; import { ExternalDataRepositoryService } from '@app/core/services/external-sources/data-repository/extternal-data-repository.service'; import { ExternalDatasetService } from '@app/core/services/external-sources/dataset/external-dataset.service'; diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/data-repository/dataset-external-data-repository-dialog-editor.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/data-repository/dataset-external-data-repository-dialog-editor.component.ts index db74faa69..47a05a141 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/data-repository/dataset-external-data-repository-dialog-editor.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/data-repository/dataset-external-data-repository-dialog-editor.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; import { ExternalDataRepositoryService } from '@app/core/services/external-sources/data-repository/extternal-data-repository.service'; import { ExternalDataRepositoryEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; import { BaseComponent } from '@common/base/base.component'; diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/external-dataset/dataset-external-dataset-dialog-editor.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/external-dataset/dataset-external-dataset-dialog-editor.component.ts index f15d7e4b4..8033c9b1b 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/external-dataset/dataset-external-dataset-dialog-editor.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/external-dataset/dataset-external-dataset-dialog-editor.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; import { ExternalDatasetService } from '@app/core/services/external-sources/dataset/external-dataset.service'; import { ExternalDatasetEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; import { BaseComponent } from '@common/base/base.component'; diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/registry/dataset-external-registry-dialog-editor.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/registry/dataset-external-registry-dialog-editor.component.ts index 9725f2d64..22d43bdb1 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/registry/dataset-external-registry-dialog-editor.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/registry/dataset-external-registry-dialog-editor.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; import { ExternalRegistryService } from '@app/core/services/external-sources/registry/external-registry.service'; import { ExternalRegistryEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; import { BaseComponent } from '@common/base/base.component'; diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/service/dataset-external-service-dialog-editor.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/service/dataset-external-service-dialog-editor.component.ts index adb0f7d35..bb022c662 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/service/dataset-external-service-dialog-editor.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/service/dataset-external-service-dialog-editor.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; import { ExternalServiceService } from '@app/core/services/external-sources/service/external-service.service'; import { ExternalServiceEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; import { BaseComponent } from '@common/base/base.component'; diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component.ts index dc554efa0..b0d7951b7 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component.ts @@ -1,5 +1,5 @@ import {Component, Inject, OnInit} from "@angular/core"; -import {MAT_DIALOG_DATA, MatDialog, MatDialogRef} from "@angular/material/dialog"; +import {MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA, MatLegacyDialog as MatDialog, MatLegacyDialogRef as MatDialogRef} from "@angular/material/legacy-dialog"; import {map, takeUntil} from "rxjs/operators"; import {ProgressIndicationService} from "@app/core/services/progress-indication/progress-indication-service"; import {BaseComponent} from "@common/base/base.component"; diff --git a/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria-dialogue/dataset-criteria-dialog.component.ts b/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria-dialogue/dataset-criteria-dialog.component.ts index 6f9a64b6b..9a6fb1900 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria-dialogue/dataset-criteria-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria-dialogue/dataset-criteria-dialog.component.ts @@ -1,5 +1,5 @@ import { Inject, Component, ViewChild, OnInit, Output, EventEmitter } from '@angular/core'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA, MatLegacyDialogRef as MatDialogRef } from '@angular/material/legacy-dialog'; import { UntypedFormGroup } from '@angular/forms'; import { DatasetCriteriaComponent } from '../dataset-criteria.component'; import { DatasetCriteria } from '@app/core/query/dataset/dataset-criteria'; diff --git a/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.ts b/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.ts index 79368187c..62159b8f4 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.ts +++ b/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.ts @@ -1,8 +1,8 @@ import { Component, Input, OnInit, Output, EventEmitter } from '@angular/core'; import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; -import { MatDialog } from '@angular/material/dialog'; -import { MatSnackBar } from '@angular/material/snack-bar'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; import { Router } from '@angular/router'; import { DatasetStatus } from '@app/core/common/enum/dataset-status'; import { DataTableData } from '@app/core/model/data-table/data-table-data'; diff --git a/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-upload-dialogue/dataset-upload-dialogue.component.ts b/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-upload-dialogue/dataset-upload-dialogue.component.ts index 7921bcbd8..2716cbf94 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-upload-dialogue/dataset-upload-dialogue.component.ts +++ b/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-upload-dialogue/dataset-upload-dialogue.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; import { DataTableData } from '@app/core/model/data-table/data-table-data'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; diff --git a/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.ts b/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.ts index e9fa443cf..155ad1476 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.ts +++ b/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit, ViewChild } from '@angular/core'; -import { MatPaginator } from '@angular/material/paginator'; +import { MatLegacyPaginator as MatPaginator } from '@angular/material/legacy-paginator'; import { MatSort } from '@angular/material/sort'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { DatasetStatus } from '@app/core/common/enum/dataset-status'; @@ -20,7 +20,7 @@ import { ExternalTagEditorModel, DatasetWizardEditorModel } from '../dataset-wiz import { AuthService } from '@app/core/services/auth/auth.service'; import { isNullOrUndefined } from '@app/utilities/enhancers/utils'; import { DatasetCriteriaDialogComponent } from './criteria/dataset-criteria-dialogue/dataset-criteria-dialog.component'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { UntypedFormGroup, UntypedFormBuilder, UntypedFormControl } from '@angular/forms'; import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order'; import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; diff --git a/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.ts b/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.ts index b3bd6ff78..4be0b6638 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.ts +++ b/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.ts @@ -8,7 +8,7 @@ import { BaseComponent } from '@common/base/base.component'; import { takeUntil } from 'rxjs/operators'; import * as FileSaver from 'file-saver'; import { DmpInvitationDialogComponent } from '@app/ui/dmp/invitation/dmp-invitation-dialog.component'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { DatasetCopyDialogueComponent } from '../../dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component'; import { UntypedFormControl } from '@angular/forms'; import { TranslateService } from '@ngx-translate/core'; diff --git a/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts b/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts index 05c9dec4e..02bb5d5c6 100644 --- a/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts +++ b/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts @@ -7,7 +7,7 @@ import { ActivatedRoute, Router, Params } from '@angular/router'; import { DatasetService } from '@app/core/services/dataset/dataset.service'; import { TranslateService } from '@ngx-translate/core'; import { AuthService } from '@app/core/services/auth/auth.service'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service'; import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; import { Oauth2DialogService } from '@app/ui/misc/oauth2-dialog/service/oauth2-dialog.service'; diff --git a/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.component.ts index 56e03422c..27f83a507 100644 --- a/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog, MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; import { DmpService } from '@app/core/services/dmp/dmp.service'; import { map, takeUntil } from 'rxjs/operators'; import { DmpModel } from '@app/core/model/dmp/dmp'; diff --git a/dmp-frontend/src/app/ui/dmp/clone/dmp-clone.component.ts b/dmp-frontend/src/app/ui/dmp/clone/dmp-clone.component.ts index f652b7e4f..f0f9cc1fd 100644 --- a/dmp-frontend/src/app/ui/dmp/clone/dmp-clone.component.ts +++ b/dmp-frontend/src/app/ui/dmp/clone/dmp-clone.component.ts @@ -28,7 +28,7 @@ import { DatasetService } from '@app/core/services/dataset/dataset.service'; import { DmpEditorModel } from '../editor/dmp-editor.model'; import { DatasetWizardEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { isNullOrUndefined } from '@app/utilities/enhancers/utils'; import { DmpProfileService } from '@app/core/services/dmp/dmp-profile.service'; import { DmpBlueprintDefinition, SystemFieldType } from '@app/core/model/dmp/dmp-blueprint/dmp-blueprint'; diff --git a/dmp-frontend/src/app/ui/dmp/dataset-preview/dataset-preview-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/dataset-preview/dataset-preview-dialog.component.ts index 2bc208250..2ee1dde41 100644 --- a/dmp-frontend/src/app/ui/dmp/dataset-preview/dataset-preview-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/dataset-preview/dataset-preview-dialog.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service'; import { ProgressIndicationService } from '@app/core/services/progress-indication/progress-indication-service'; import { DatasetDescriptionFormEditorModel } from '@app/ui/misc/dataset-description-form/dataset-description-form.model'; diff --git a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.ts b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.ts index 45e838c9d..52ee05b08 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.ts +++ b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.ts @@ -24,7 +24,7 @@ import { ExternalSourcesService } from '@app/core/services/external-sources/exte import { Observable, interval } from 'rxjs'; import { ExternalSourceItemModel } from '@app/core/model/external-sources/external-source-item'; import { OrganisationService } from '@app/core/services/organisation/organisation.service'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { AddResearcherComponent } from '../editor/add-researcher/add-researcher.component'; import { AddOrganizationComponent } from '../editor/add-organization/add-organization.component'; import { RequestItem } from '@app/core/query/request-item'; diff --git a/dmp-frontend/src/app/ui/dmp/dmp-to-dataset/dmp-to-dataset-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/dmp-to-dataset/dmp-to-dataset-dialog.component.ts index 6d2bd66ba..24da6d1dd 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp-to-dataset/dmp-to-dataset-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/dmp-to-dataset/dmp-to-dataset-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject, OnInit } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; @Component({ selector: 'app-to-dataset-dialog-component', diff --git a/dmp-frontend/src/app/ui/dmp/editor/add-organization/add-organization.component.ts b/dmp-frontend/src/app/ui/dmp/editor/add-organization/add-organization.component.ts index 958de156f..7b6b960a9 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/add-organization/add-organization.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/add-organization/add-organization.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core'; import { AbstractControl, AsyncValidatorFn, UntypedFormControl, UntypedFormGroup, ValidationErrors } from '@angular/forms'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service'; import { ExternalResearcherService } from '@app/core/services/external-sources/researcher/external-researcher.service'; import { OrganisationService } from '@app/core/services/organisation/organisation.service'; diff --git a/dmp-frontend/src/app/ui/dmp/editor/add-researcher/add-researcher.component.ts b/dmp-frontend/src/app/ui/dmp/editor/add-researcher/add-researcher.component.ts index 977b7e55b..35d66eada 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/add-researcher/add-researcher.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/add-researcher/add-researcher.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core'; import { AbstractControl, AsyncValidatorFn, UntypedFormControl, UntypedFormGroup, ValidationErrors } from '@angular/forms'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service'; import { ExternalResearcherService } from '@app/core/services/external-sources/researcher/external-researcher.service'; import { ResearcherEditorModel } from '@app/ui/dmp/editor/add-researcher/add-researcher.model'; diff --git a/dmp-frontend/src/app/ui/dmp/editor/available-profiles/available-profiles.component.ts b/dmp-frontend/src/app/ui/dmp/editor/available-profiles/available-profiles.component.ts index d1cc39561..6760d7772 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/available-profiles/available-profiles.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/available-profiles/available-profiles.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; import { DatasetProfileCriteria } from '@app/core/query/dataset-profile/dataset-profile-criteria'; diff --git a/dmp-frontend/src/app/ui/dmp/editor/cost-editor/add-cost/add-cost.component.ts b/dmp-frontend/src/app/ui/dmp/editor/cost-editor/add-cost/add-cost.component.ts index 49b44db30..3f888009b 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/cost-editor/add-cost/add-cost.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/cost-editor/add-cost/add-cost.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; import { ExternalResearcherService } from '@app/core/services/external-sources/researcher/external-researcher.service'; import { BaseComponent } from '@common/base/base.component'; import { takeUntil } from 'rxjs/operators'; diff --git a/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts index 9983eb487..c085fb846 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts @@ -3,9 +3,9 @@ import { OnInit, Component, Input, Output, EventEmitter } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service'; -import { MatChipInputEvent } from '@angular/material/chips'; -import { MatDialog } from '@angular/material/dialog'; -import { MatSnackBar } from '@angular/material/snack-bar'; +import { MatLegacyChipInputEvent as MatChipInputEvent } from '@angular/material/legacy-chips'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service'; import { ActivatedRoute, Router } from '@angular/router'; import { DmpService } from '@app/core/services/dmp/dmp.service'; diff --git a/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts index 1d88e6a52..74c2b0e2f 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts @@ -7,7 +7,7 @@ import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/mu import { map, takeUntil } from 'rxjs/operators'; import { Observable } from 'rxjs'; import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; import { DatasetProfileCriteria } from '@app/core/query/dataset-profile/dataset-profile-criteria'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-deposit-dropdown/dmp-deposit-dropdown.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dmp-deposit-dropdown/dmp-deposit-dropdown.component.ts index 36a1572a3..2f0905d7d 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-deposit-dropdown/dmp-deposit-dropdown.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-deposit-dropdown/dmp-deposit-dropdown.component.ts @@ -1,5 +1,5 @@ import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; -import {MatDialog} from '@angular/material/dialog'; +import {MatLegacyDialog as MatDialog} from '@angular/material/legacy-dialog'; import {DepositConfigurationStatus} from '@app/core/common/enum/deposit-configuration-status'; import {DepositConfigurationModel} from '@app/core/model/deposit/deposit-configuration'; import {DmpOverviewModel} from '@app/core/model/dmp/dmp-overview'; diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts index 987a87021..0e56b3cf0 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit} from '@angular/core'; import { UntypedFormGroup, AbstractControl, UntypedFormControl, UntypedFormArray} from '@angular/forms'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { DmpStatus } from '@app/core/common/enum/dmp-status'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-finalize-dialog/dmp-finalize-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dmp-finalize-dialog/dmp-finalize-dialog.component.ts index dd8b27e34..b707f86fd 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-finalize-dialog/dmp-finalize-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-finalize-dialog/dmp-finalize-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject, OnInit } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; import { Router } from '@angular/router'; import { DatasetStatus } from '@app/core/common/enum/dataset-status'; import { DatasetService } from '@app/core/services/dataset/dataset.service'; diff --git a/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.ts b/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.ts index 223446719..4c7d5dc0f 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.ts @@ -1,7 +1,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { UntypedFormGroup, UntypedFormArray } from '@angular/forms'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; import { DmpProfileDefinition } from '@app/core/model/dmp-profile/dmp-profile'; diff --git a/dmp-frontend/src/app/ui/dmp/editor/license-info/license-info.component.ts b/dmp-frontend/src/app/ui/dmp/editor/license-info/license-info.component.ts index 91975a5c5..b7918510f 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/license-info/license-info.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/license-info/license-info.component.ts @@ -6,7 +6,7 @@ import { ExternalSourceItemModel } from '@app/core/model/external-sources/extern import { Observable } from 'rxjs'; import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service'; import { isNullOrUndefined } from '@app/utilities/enhancers/utils'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration'; import { LanguageInfo } from '@app/core/model/language-info'; import { LanguageInfoService } from '@app/core/services/culture/language-info-service'; diff --git a/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.ts b/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.ts index 1d371c001..26f087ffe 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.ts @@ -9,7 +9,7 @@ import { ExternalSourceItemModel } from '@app/core/model/external-sources/extern import { Observable } from 'rxjs'; import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service'; import { isNullOrUndefined } from '@app/utilities/enhancers/utils'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { AddOrganizationComponent } from '../add-organization/add-organization.component'; import { AddResearcherComponent } from '../add-researcher/add-researcher.component'; import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration'; diff --git a/dmp-frontend/src/app/ui/dmp/editor/people-tab/people-tab.component.ts b/dmp-frontend/src/app/ui/dmp/editor/people-tab/people-tab.component.ts index 749c26ac9..a3b7e116b 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/people-tab/people-tab.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/people-tab/people-tab.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component'; import { TranslateService } from '@ngx-translate/core'; import { Principal } from '../../../../core/model/auth/principal'; diff --git a/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation-dialog.component.ts index 9a77f2608..d8fa4c484 100644 --- a/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation-dialog.component.ts @@ -2,8 +2,8 @@ import { COMMA, ENTER } from '@angular/cdk/keycodes'; import { Component, Inject, OnInit, ViewChild } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatChipInputEvent } from '@angular/material/chips'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyChipInputEvent as MatChipInputEvent } from '@angular/material/legacy-chips'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; import { ActivatedRoute, Router } from '@angular/router'; import { DmpInvitation } from '@app/core/model/dmp/invitation/dmp-invitation'; import { DmpInvitationUser } from '@app/core/model/dmp/invitation/dmp-invitation-user'; diff --git a/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria-dialog.component.ts index b17af0e78..08190ec01 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria-dialog.component.ts @@ -1,5 +1,5 @@ import { Inject, Component, ViewChild, OnInit, Output, EventEmitter } from '@angular/core'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA, MatLegacyDialogRef as MatDialogRef } from '@angular/material/legacy-dialog'; import { DmpCriteriaComponent } from './dmp-criteria.component'; import { DmpCriteria } from '@app/core/query/dmp/dmp-criteria'; import { UntypedFormGroup } from '@angular/forms'; diff --git a/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.ts b/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.ts index 0a39cbdcd..9978e4053 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.ts @@ -1,7 +1,7 @@ import { Component, Input, OnInit, Output, EventEmitter } from '@angular/core'; import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; import { GrantListingModel } from '@app/core/model/grant/grant-listing'; import { DatasetProfileCriteria } from '@app/core/query/dataset-profile/dataset-profile-criteria'; diff --git a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts index b2ec95b89..4dea4a3a6 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit, ViewChild } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; -import { MatPaginator } from '@angular/material/paginator'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatLegacyPaginator as MatPaginator } from '@angular/material/legacy-paginator'; import { MatSort } from '@angular/material/sort'; import { ActivatedRoute, Router } from '@angular/router'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; diff --git a/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.ts b/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.ts index 3cf55ed81..7db452705 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.ts @@ -1,6 +1,6 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { DmpListingModel } from '../../../../core/model/dmp/dmp-listing'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { DmpInvitationDialogComponent } from '../../invitation/dmp-invitation-dialog.component'; import { Router, ActivatedRoute } from '@angular/router'; import { DatasetService } from '../../../../core/services/dataset/dataset.service'; diff --git a/dmp-frontend/src/app/ui/dmp/listing/upload-dialogue/dmp-upload-dialogue.component.ts b/dmp-frontend/src/app/ui/dmp/listing/upload-dialogue/dmp-upload-dialogue.component.ts index 15cd4b718..7a9f9e7fc 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/upload-dialogue/dmp-upload-dialogue.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/upload-dialogue/dmp-upload-dialogue.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog, MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; import { DmpService } from '../../../../core/services/dmp/dmp.service'; import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration'; import { map, takeUntil } from 'rxjs/operators'; diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts index 723d0aabe..320f89987 100644 --- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts +++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts @@ -1,5 +1,5 @@ import {Component, ElementRef, OnInit, ViewChild} from '@angular/core'; -import {MatDialog} from '@angular/material/dialog'; +import {MatLegacyDialog as MatDialog} from '@angular/material/legacy-dialog'; import {ActivatedRoute, Params, Router} from '@angular/router'; import {DatasetStatus} from '@app/core/common/enum/dataset-status'; import {DmpStatus} from '@app/core/common/enum/dmp-status'; diff --git a/dmp-frontend/src/app/ui/dmp/start-new-dataset-dialogue/start-new-dataset-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/start-new-dataset-dialogue/start-new-dataset-dialog.component.ts index 0783b92bf..fc8d14baa 100644 --- a/dmp-frontend/src/app/ui/dmp/start-new-dataset-dialogue/start-new-dataset-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/start-new-dataset-dialogue/start-new-dataset-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA, MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA, MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { BaseComponent } from '@common/base/base.component'; import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration'; import { TranslateService } from '@ngx-translate/core'; diff --git a/dmp-frontend/src/app/ui/dmp/start-new-dmp-dialogue/start-new-dmp-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/start-new-dmp-dialogue/start-new-dmp-dialog.component.ts index f9b46a8d4..eeb994bf1 100644 --- a/dmp-frontend/src/app/ui/dmp/start-new-dmp-dialogue/start-new-dmp-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/start-new-dmp-dialogue/start-new-dmp-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA, MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA, MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { Router } from '@angular/router'; import { DmpUploadDialogue } from '../listing/upload-dialogue/dmp-upload-dialogue.component'; import { UiNotificationService, SnackBarNotificationLevel } from '@app/core/services/notification/ui-notification-service'; diff --git a/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard.component.ts b/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard.component.ts index 0d3e9ee3a..a1cdb06d9 100644 --- a/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard.component.ts +++ b/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard.component.ts @@ -2,7 +2,7 @@ import { HttpErrorResponse } from '@angular/common/http'; import { Component, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatSnackBar } from '@angular/material/snack-bar'; +import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { DmpModel } from '@app/core/model/dmp/dmp'; import { DmpBlueprintDefinition, SystemFieldType } from '@app/core/model/dmp/dmp-blueprint/dmp-blueprint'; diff --git a/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.ts b/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.ts index 74767095c..3ff161ed0 100644 --- a/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.ts +++ b/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.ts @@ -1,7 +1,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatSnackBar } from '@angular/material/snack-bar'; +import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; import { ExternalSourceItemModel } from '@app/core/model/external-sources/external-source-item'; diff --git a/dmp-frontend/src/app/ui/dmp/wizard/listing/dmp-wizard-dataset-listing.component.ts b/dmp-frontend/src/app/ui/dmp/wizard/listing/dmp-wizard-dataset-listing.component.ts index 4e840d3ec..81620a10e 100644 --- a/dmp-frontend/src/app/ui/dmp/wizard/listing/dmp-wizard-dataset-listing.component.ts +++ b/dmp-frontend/src/app/ui/dmp/wizard/listing/dmp-wizard-dataset-listing.component.ts @@ -1,8 +1,8 @@ import { SelectionModel } from '@angular/cdk/collections'; import { Component, Input, OnInit, ViewChild } from '@angular/core'; import { UntypedFormArray, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; -import { MatPaginator } from '@angular/material/paginator'; -import { MatSnackBar } from '@angular/material/snack-bar'; +import { MatLegacyPaginator as MatPaginator } from '@angular/material/legacy-paginator'; +import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; import { MatSort } from '@angular/material/sort'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; diff --git a/dmp-frontend/src/app/ui/faq/dialog/faq-dialog.component.ts b/dmp-frontend/src/app/ui/faq/dialog/faq-dialog.component.ts index d0ca1f63e..cd2714b2c 100644 --- a/dmp-frontend/src/app/ui/faq/dialog/faq-dialog.component.ts +++ b/dmp-frontend/src/app/ui/faq/dialog/faq-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; @Component({ selector: 'app-faq-dialog', diff --git a/dmp-frontend/src/app/ui/glossary/dialog/glossary-dialog.component.ts b/dmp-frontend/src/app/ui/glossary/dialog/glossary-dialog.component.ts index 976d36ead..d90592019 100644 --- a/dmp-frontend/src/app/ui/glossary/dialog/glossary-dialog.component.ts +++ b/dmp-frontend/src/app/ui/glossary/dialog/glossary-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; @Component({ selector: 'app-glossary-dialog', diff --git a/dmp-frontend/src/app/ui/language/dialog/language-dialog.component.ts b/dmp-frontend/src/app/ui/language/dialog/language-dialog.component.ts index a43dc91bb..5b73b940a 100644 --- a/dmp-frontend/src/app/ui/language/dialog/language-dialog.component.ts +++ b/dmp-frontend/src/app/ui/language/dialog/language-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; @Component({ selector: 'app-language-dialog', diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field-dialog/form-composite-field-dialog.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field-dialog/form-composite-field-dialog.component.ts index d1a3625cb..ae68f6427 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field-dialog/form-composite-field-dialog.component.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field-dialog/form-composite-field-dialog.component.ts @@ -1,5 +1,5 @@ import {Component, Inject} from "@angular/core"; -import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; +import {MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA, MatLegacyDialogRef as MatDialogRef} from "@angular/material/legacy-dialog"; import {VisibilityRulesService} from "@app/ui/misc/dataset-description-form/visibility-rules/visibility-rules.service"; @Component({ diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.ts index 0009da801..6bb7855f9 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.ts @@ -7,7 +7,7 @@ import {VisibilityRulesService} from '../../visibility-rules/visibility-rules.se import { FormCompositeFieldDialogComponent } from "@app/ui/misc/dataset-description-form/components/form-composite-field-dialog/form-composite-field-dialog.component"; -import {MatDialog} from "@angular/material/dialog"; +import {MatLegacyDialog as MatDialog} from "@angular/material/legacy-dialog"; import {cloneAbstractControl} from "@app/utilities/enhancers/utils"; @Component({ diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.ts index c19014f99..45b7c7a0f 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.ts @@ -29,7 +29,7 @@ import { ServiceCriteria } from '@app/core/query/service/service-criteria'; import { TagCriteria } from '@app/core/query/tag/tag-criteria'; import { isNullOrUndefined } from '@app/utilities/enhancers/utils'; import { ExternalTagEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; -import { MatChipInputEvent } from '@angular/material/chips'; +import { MatLegacyChipInputEvent as MatChipInputEvent } from '@angular/material/legacy-chips'; import { ENTER, COMMA } from '@angular/cdk/keycodes'; import { DatasetIdModel } from '@app/core/model/dataset/dataset-id.model'; import { LocalFetchModel } from '@app/core/model/local-fetch/local-fetch.model'; @@ -44,7 +44,7 @@ import { UiNotificationService } from "@app/core/services/notification/ui-notification-service"; import {FormValidationErrorsDialogComponent} from "@common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component"; -import {MatDialog} from "@angular/material/dialog"; +import {MatLegacyDialog as MatDialog} from "@angular/material/legacy-dialog"; import {HttpError} from "@common/modules/errors/error-handling/http-error-handling.service"; import {HttpErrorResponse} from "@angular/common/http"; import * as FileSaver from "file-saver"; diff --git a/dmp-frontend/src/app/ui/misc/navigation/navigation.component.ts b/dmp-frontend/src/app/ui/misc/navigation/navigation.component.ts index bfd52420f..ca9691a33 100644 --- a/dmp-frontend/src/app/ui/misc/navigation/navigation.component.ts +++ b/dmp-frontend/src/app/ui/misc/navigation/navigation.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { UntypedFormControl } from '@angular/forms'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { Router } from '@angular/router'; import { AppRole } from '@app/core/common/enum/app-role'; import { SearchBarItem } from '@app/core/model/dashboard/search-bar-item'; diff --git a/dmp-frontend/src/app/ui/misc/navigation/user-dialog/user-dialog.component.ts b/dmp-frontend/src/app/ui/misc/navigation/user-dialog/user-dialog.component.ts index 25d1a0b2b..bc2f1ca0a 100644 --- a/dmp-frontend/src/app/ui/misc/navigation/user-dialog/user-dialog.component.ts +++ b/dmp-frontend/src/app/ui/misc/navigation/user-dialog/user-dialog.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; import { Router } from '@angular/router'; import { Principal } from '../../../../core/model/auth/principal'; import { AuthService } from '../../../../core/services/auth/auth.service'; diff --git a/dmp-frontend/src/app/ui/misc/oauth2-dialog/oauth2-dialog.component.ts b/dmp-frontend/src/app/ui/misc/oauth2-dialog/oauth2-dialog.component.ts index 4457a9a48..41f49bb69 100644 --- a/dmp-frontend/src/app/ui/misc/oauth2-dialog/oauth2-dialog.component.ts +++ b/dmp-frontend/src/app/ui/misc/oauth2-dialog/oauth2-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit, Inject } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; import { ActivatedRoute, Params } from '@angular/router'; import { BaseComponent } from '@common/base/base.component'; import { takeUntil } from 'rxjs/operators'; diff --git a/dmp-frontend/src/app/ui/navbar/navbar.component.ts b/dmp-frontend/src/app/ui/navbar/navbar.component.ts index c701ab0ce..a8ea20cd2 100644 --- a/dmp-frontend/src/app/ui/navbar/navbar.component.ts +++ b/dmp-frontend/src/app/ui/navbar/navbar.component.ts @@ -1,8 +1,8 @@ import { Location } from '@angular/common'; import { HttpClient } from '@angular/common/http'; import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; -import { MatMenuTrigger } from '@angular/material/menu'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatLegacyMenuTrigger as MatMenuTrigger } from '@angular/material/legacy-menu'; import { Router } from '@angular/router'; import { AppRole } from '@app/core/common/enum/app-role'; import { UserListingModel } from '@app/core/model/user/user-listing'; diff --git a/dmp-frontend/src/app/ui/quick-wizard/dmp-editor/dmp-editor-wizard.component.ts b/dmp-frontend/src/app/ui/quick-wizard/dmp-editor/dmp-editor-wizard.component.ts index ce13e98bd..585636d9f 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/dmp-editor/dmp-editor-wizard.component.ts +++ b/dmp-frontend/src/app/ui/quick-wizard/dmp-editor/dmp-editor-wizard.component.ts @@ -1,7 +1,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { UntypedFormArray, UntypedFormGroup } from '@angular/forms'; -import { MatSnackBar } from '@angular/material/snack-bar'; +import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; import { DatasetProfileCriteria } from '@app/core/query/dataset-profile/dataset-profile-criteria'; diff --git a/dmp-frontend/src/app/ui/quick-wizard/grant-editor/grant-editor-wizard.component.ts b/dmp-frontend/src/app/ui/quick-wizard/grant-editor/grant-editor-wizard.component.ts index e2e31863e..9c4fa0d3d 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/grant-editor/grant-editor-wizard.component.ts +++ b/dmp-frontend/src/app/ui/quick-wizard/grant-editor/grant-editor-wizard.component.ts @@ -1,7 +1,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { AbstractControl, FormArray, FormControl, UntypedFormGroup } from '@angular/forms'; -import { MatSnackBar } from '@angular/material/snack-bar'; +import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; import { Router } from '@angular/router'; import { GrantCriteria } from '@app/core/query/grant/grant-criteria'; import { RequestItem } from '@app/core/query/request-item'; diff --git a/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.ts b/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.ts index 2a1160d60..e966a2d46 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.ts +++ b/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.ts @@ -1,8 +1,8 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { AbstractControl, UntypedFormArray, FormControl, UntypedFormGroup } from '@angular/forms'; -import { MatDialog } from '@angular/material/dialog'; -import { MatSnackBar } from '@angular/material/snack-bar'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; import { MatStepper } from '@angular/material/stepper'; import { Router } from '@angular/router'; import { DatasetStatus } from '@app/core/common/enum/dataset-status'; diff --git a/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.ts b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.ts index 8ae6ec5ac..94b278d3e 100644 --- a/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.ts +++ b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { Router } from '@angular/router'; import { ContactEmailFormModel } from '@app/core/model/contact/contact-email-form-model'; import { ContactSupportService } from '@app/core/services/contact-support/contact-support.service'; diff --git a/dmp-frontend/src/app/ui/sidebar/sidebar.component.ts b/dmp-frontend/src/app/ui/sidebar/sidebar.component.ts index 48bccf255..f1f724ca9 100644 --- a/dmp-frontend/src/app/ui/sidebar/sidebar.component.ts +++ b/dmp-frontend/src/app/ui/sidebar/sidebar.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { TranslateService } from '@ngx-translate/core'; import { AuthService } from '../../core/services/auth/auth.service'; import { UserDialogComponent } from '../misc/navigation/user-dialog/user-dialog.component'; diff --git a/dmp-frontend/src/app/ui/user-guide/dialog/user-guide-dialog.component.ts b/dmp-frontend/src/app/ui/user-guide/dialog/user-guide-dialog.component.ts index 15abff28c..cbe2ad8a8 100644 --- a/dmp-frontend/src/app/ui/user-guide/dialog/user-guide-dialog.component.ts +++ b/dmp-frontend/src/app/ui/user-guide/dialog/user-guide-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; @Component({ selector: 'app-user-guide-dialog', diff --git a/dmp-frontend/src/app/ui/user-profile/add-account/add-account-dialog.component.ts b/dmp-frontend/src/app/ui/user-profile/add-account/add-account-dialog.component.ts index cf519a7cc..f6a8f6e36 100644 --- a/dmp-frontend/src/app/ui/user-profile/add-account/add-account-dialog.component.ts +++ b/dmp-frontend/src/app/ui/user-profile/add-account/add-account-dialog.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; import { UserMergeRequestModel } from '@app/core/model/merge/user-merge-request'; import { MergeLoginService } from '@app/ui/auth/login/utilities/merge-login.service'; import { DatasetDescriptionFormEditorModel } from '@app/ui/misc/dataset-description-form/dataset-description-form.model'; diff --git a/dmp-frontend/src/app/ui/user-profile/user-profile.component.ts b/dmp-frontend/src/app/ui/user-profile/user-profile.component.ts index d923f2237..45df1d11f 100644 --- a/dmp-frontend/src/app/ui/user-profile/user-profile.component.ts +++ b/dmp-frontend/src/app/ui/user-profile/user-profile.component.ts @@ -23,7 +23,7 @@ import { UserProfileEditorModel } from './user-profile-editor.model'; import { RoleOrganizationType } from '@app/core/common/enum/role-organization-type'; import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; import { AddAccountDialogComponent } from './add-account/add-account-dialog.component'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { UserCredentialModel } from '@app/core/model/user/user-credential'; import { AuthProvider } from '@app/core/common/enum/auth-provider'; import { MergeEmailConfirmationService } from '@app/core/services/merge-email-confirmation/merge-email-confirmation.service'; diff --git a/dmp-frontend/src/assets/scss/blue-theme.scss b/dmp-frontend/src/assets/scss/blue-theme.scss index 8a064ac7a..1c770e3e2 100644 --- a/dmp-frontend/src/assets/scss/blue-theme.scss +++ b/dmp-frontend/src/assets/scss/blue-theme.scss @@ -115,28 +115,46 @@ $custom-theme: ( background: $app-blue-theme-background ); -$custom-typography: mat.define-typography-config( +$custom-typography: mat.define-legacy-typography-config( $font-family: "Lato, regular", $headline: mat.define-typography-level(32px, 48px, 700), $body-1: mat.define-typography-level(16px, 24px, 500) ); .blue-theme { - @include mat.core(); + // TODO(v15): As of v15 mat.legacy-core no longer includes default typography styles. +// The following line adds: +// 1. Default typography styles for all components +// 2. Styles for typography hierarchy classes (e.g. .mat-headline-1) +// If you specify typography styles for the components you use elsewhere, you should delete this line. +// If you don't need the default component typographies but still want the hierarchy styles, +// you can delete this line and instead use: +// `@include mat.legacy-typography-hierarchy(mat.define-legacy-typography-config());` +@include mat.all-legacy-component-typographies(); +@include mat.legacy-core(); - @include mat.all-component-themes($custom-theme); + @include mat.all-legacy-component-themes($custom-theme); @include navigation-component-theme($custom-theme); // Override typography CSS classes (e.g., mat-h1, mat-display-1, mat-typography, etc.). - @include mat.typography-hierarchy($custom-typography); + @include mat.legacy-typography-hierarchy($custom-typography); // Override typography for a specific Angular Material components. - @include mat.checkbox-typography($custom-typography); + @include mat.legacy-checkbox-typography($custom-typography); // Override typography for all Angular Material, including mat-base-typography and all components. - @include mat.all-component-typographies($custom-typography); + @include mat.all-legacy-component-typographies($custom-typography); //If you're using Material's theming, you can also pass in your typography config to the mat-core mixin: // Override the typography in the core CSS. - @include mat.core($custom-typography); + // TODO(v15): As of v15 mat.legacy-core no longer includes default typography styles. +// The following line adds: +// 1. Default typography styles for all components +// 2. Styles for typography hierarchy classes (e.g. .mat-headline-1) +// If you specify typography styles for the components you use elsewhere, you should delete this line. +// If you don't need the default component typographies but still want the hierarchy styles, +// you can delete this line and instead use: +// `@include mat.legacy-typography-hierarchy($custom-typography);` +@include mat.all-legacy-component-typographies($custom-typography); +@include mat.legacy-core(); } diff --git a/dmp-frontend/src/assets/scss/green-theme.scss b/dmp-frontend/src/assets/scss/green-theme.scss index dc585f37a..e61bf71f9 100644 --- a/dmp-frontend/src/assets/scss/green-theme.scss +++ b/dmp-frontend/src/assets/scss/green-theme.scss @@ -115,28 +115,46 @@ $custom-theme: ( background: $app-green-theme-background ); -$custom-typography: mat.define-typography-config( +$custom-typography: mat.define-legacy-typography-config( $font-family: "Lato, regular", $headline: mat.define-typography-level(32px, 48px, 700), $body-1: mat.define-typography-level(16px, 24px, 500) ); .green-theme { - @include mat.core(); + // TODO(v15): As of v15 mat.legacy-core no longer includes default typography styles. +// The following line adds: +// 1. Default typography styles for all components +// 2. Styles for typography hierarchy classes (e.g. .mat-headline-1) +// If you specify typography styles for the components you use elsewhere, you should delete this line. +// If you don't need the default component typographies but still want the hierarchy styles, +// you can delete this line and instead use: +// `@include mat.legacy-typography-hierarchy(mat.define-legacy-typography-config());` +@include mat.all-legacy-component-typographies(); +@include mat.legacy-core(); - @include mat.all-component-themes($custom-theme); + @include mat.all-legacy-component-themes($custom-theme); @include navigation-component-theme($custom-theme); // Override typography CSS classes (e.g., mat-h1, mat-display-1, mat-typography, etc.). - @include mat.typography-hierarchy($custom-typography); + @include mat.legacy-typography-hierarchy($custom-typography); // Override typography for a specific Angular Material components. - @include mat.checkbox-typography($custom-typography); + @include mat.legacy-checkbox-typography($custom-typography); // Override typography for all Angular Material, including mat-base-typography and all components. - @include mat.all-component-typographies($custom-typography); + @include mat.all-legacy-component-typographies($custom-typography); //If you're using Material's theming, you can also pass in your typography config to the mat-core mixin: // Override the typography in the core CSS. - @include mat.core($custom-typography); + // TODO(v15): As of v15 mat.legacy-core no longer includes default typography styles. +// The following line adds: +// 1. Default typography styles for all components +// 2. Styles for typography hierarchy classes (e.g. .mat-headline-1) +// If you specify typography styles for the components you use elsewhere, you should delete this line. +// If you don't need the default component typographies but still want the hierarchy styles, +// you can delete this line and instead use: +// `@include mat.legacy-typography-hierarchy($custom-typography);` +@include mat.all-legacy-component-typographies($custom-typography); +@include mat.legacy-core(); } diff --git a/dmp-frontend/src/assets/scss/material-dashboard.scss b/dmp-frontend/src/assets/scss/material-dashboard.scss index e5ef1ae4f..73990a596 100644 --- a/dmp-frontend/src/assets/scss/material-dashboard.scss +++ b/dmp-frontend/src/assets/scss/material-dashboard.scss @@ -21,7 +21,16 @@ @import "./blue-theme.scss"; // @import "./green-theme.scss"; -@include mat.core(); +// TODO(v15): As of v15 mat.legacy-core no longer includes default typography styles. +// The following line adds: +// 1. Default typography styles for all components +// 2. Styles for typography hierarchy classes (e.g. .mat-headline-1) +// If you specify typography styles for the components you use elsewhere, you should delete this line. +// If you don't need the default component typographies but still want the hierarchy styles, +// you can delete this line and instead use: +// `@include mat.legacy-typography-hierarchy(mat.define-legacy-typography-config());` +@include mat.all-legacy-component-typographies(); +@include mat.legacy-core(); // // Define a blue theme. $custom-theme-primary: mat.define-palette($app-blue-theme-primary-palette, 900); @@ -34,7 +43,7 @@ $custom-theme-accent: mat.define-palette($app-blue-theme-accent-palette); // $custom-theme-accent: mat-palette($mat-pink, A200, A100, A400); $custom-theme-warn: mat.define-palette(mat.$red-palette); $custom-theme: mat.define-light-theme($custom-theme-primary, $custom-theme-accent, $custom-theme-warn); -@include mat.all-component-themes($custom-theme); +@include mat.all-legacy-component-themes($custom-theme); @import "core/variables"; @import "core/mixins"; diff --git a/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.ts b/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.ts index 1426c6443..947a9ec6b 100644 --- a/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.ts +++ b/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.ts @@ -1,6 +1,6 @@ import { Component, Inject } from '@angular/core'; import { AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; import { TranslateService } from '@ngx-translate/core'; @Component({ diff --git a/dmp-frontend/src/common/forms/pending-form-changes/pending-form-changes-guard.service.ts b/dmp-frontend/src/common/forms/pending-form-changes/pending-form-changes-guard.service.ts index c8a5166d9..1a879c5e4 100644 --- a/dmp-frontend/src/common/forms/pending-form-changes/pending-form-changes-guard.service.ts +++ b/dmp-frontend/src/common/forms/pending-form-changes/pending-form-changes-guard.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { CanDeactivate } from '@angular/router'; import { BasePendingChangesComponent } from '@common/base/base-pending-changes.component'; import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component'; diff --git a/dmp-frontend/src/common/http/interceptors/response-payload.interceptor.ts b/dmp-frontend/src/common/http/interceptors/response-payload.interceptor.ts index dab8544f8..3130b5453 100644 --- a/dmp-frontend/src/common/http/interceptors/response-payload.interceptor.ts +++ b/dmp-frontend/src/common/http/interceptors/response-payload.interceptor.ts @@ -1,6 +1,6 @@ import { HttpHandler, HttpHeaderResponse, HttpProgressEvent, HttpRequest, HttpResponse, HttpSentEvent, HttpUserEvent } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { MatSnackBar } from '@angular/material/snack-bar'; +import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { BaseInterceptor } from './base.interceptor'; diff --git a/dmp-frontend/src/common/material/material.module.ts b/dmp-frontend/src/common/material/material.module.ts index c450d3ea2..302d949b8 100644 --- a/dmp-frontend/src/common/material/material.module.ts +++ b/dmp-frontend/src/common/material/material.module.ts @@ -1,35 +1,35 @@ import { NgModule } from '@angular/core'; -import { MatAutocompleteModule } from '@angular/material/autocomplete'; -import { MatButtonModule } from '@angular/material/button'; +import { MatLegacyAutocompleteModule as MatAutocompleteModule } from '@angular/material/legacy-autocomplete'; +import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button'; import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatCardModule } from '@angular/material/card'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { MatChipsModule } from '@angular/material/chips'; -import { MatOptionModule } from '@angular/material/core'; +import { MatLegacyCardModule as MatCardModule } from '@angular/material/legacy-card'; +import { MatLegacyCheckboxModule as MatCheckboxModule } from '@angular/material/legacy-checkbox'; +import { MatLegacyChipsModule as MatChipsModule } from '@angular/material/legacy-chips'; +import { MatLegacyOptionModule as MatOptionModule } from '@angular/material/legacy-core'; import { MatDatepickerModule } from '@angular/material/datepicker'; -import { MatDialogModule } from '@angular/material/dialog'; +import { MatLegacyDialogModule as MatDialogModule } from '@angular/material/legacy-dialog'; import { MatExpansionModule } from '@angular/material/expansion'; -import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatLegacyFormFieldModule as MatFormFieldModule } from '@angular/material/legacy-form-field'; import { MatGridListModule } from '@angular/material/grid-list'; import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatListModule } from '@angular/material/list'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatPaginatorModule } from '@angular/material/paginator'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { MatRadioModule } from '@angular/material/radio'; -import { MatSelectModule } from '@angular/material/select'; +import { MatLegacyInputModule as MatInputModule } from '@angular/material/legacy-input'; +import { MatLegacyListModule as MatListModule } from '@angular/material/legacy-list'; +import { MatLegacyMenuModule as MatMenuModule } from '@angular/material/legacy-menu'; +import { MatLegacyPaginatorModule as MatPaginatorModule } from '@angular/material/legacy-paginator'; +import { MatLegacyProgressBarModule as MatProgressBarModule } from '@angular/material/legacy-progress-bar'; +import { MatLegacyProgressSpinnerModule as MatProgressSpinnerModule } from '@angular/material/legacy-progress-spinner'; +import { MatLegacyRadioModule as MatRadioModule } from '@angular/material/legacy-radio'; +import { MatLegacySelectModule as MatSelectModule } from '@angular/material/legacy-select'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import { MatSliderModule } from '@angular/material/slider'; -import { MatSnackBarModule } from '@angular/material/snack-bar'; +import { MatLegacySlideToggleModule as MatSlideToggleModule } from '@angular/material/legacy-slide-toggle'; +import { MatLegacySliderModule as MatSliderModule } from '@angular/material/legacy-slider'; +import { MatLegacySnackBarModule as MatSnackBarModule } from '@angular/material/legacy-snack-bar'; import { MatSortModule } from '@angular/material/sort'; import { MatStepperModule } from '@angular/material/stepper'; -import { MatTableModule } from '@angular/material/table'; -import { MatTabsModule } from '@angular/material/tabs'; +import { MatLegacyTableModule as MatTableModule } from '@angular/material/legacy-table'; +import { MatLegacyTabsModule as MatTabsModule } from '@angular/material/legacy-tabs'; import { MatToolbarModule } from '@angular/material/toolbar'; -import { MatTooltipModule } from '@angular/material/tooltip'; +import { MatLegacyTooltipModule as MatTooltipModule } from '@angular/material/legacy-tooltip'; import { CdkTableModule } from '@angular/cdk/table'; @NgModule({ diff --git a/dmp-frontend/src/common/modules/confirmation-dialog/confirmation-dialog.component.ts b/dmp-frontend/src/common/modules/confirmation-dialog/confirmation-dialog.component.ts index cfb0f0b40..e767aac89 100644 --- a/dmp-frontend/src/common/modules/confirmation-dialog/confirmation-dialog.component.ts +++ b/dmp-frontend/src/common/modules/confirmation-dialog/confirmation-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; @Component({ selector: 'app-confirmation-dialog', diff --git a/dmp-frontend/src/common/modules/multiple-choice-dialog/multiple-choice-dialog.component.ts b/dmp-frontend/src/common/modules/multiple-choice-dialog/multiple-choice-dialog.component.ts index a667ce3b3..b3a5d35f6 100644 --- a/dmp-frontend/src/common/modules/multiple-choice-dialog/multiple-choice-dialog.component.ts +++ b/dmp-frontend/src/common/modules/multiple-choice-dialog/multiple-choice-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; @Component({ selector: 'app-multiple-choice-dialog', diff --git a/dmp-frontend/src/test.ts b/dmp-frontend/src/test.ts new file mode 100644 index 000000000..d494330c2 --- /dev/null +++ b/dmp-frontend/src/test.ts @@ -0,0 +1,14 @@ +// This file is required by karma.conf.js and loads recursively all the .spec and framework files + +import 'zone.js/testing'; +import { getTestBed } from '@angular/core/testing'; +import { + BrowserDynamicTestingModule, + platformBrowserDynamicTesting +} from '@angular/platform-browser-dynamic/testing'; + +// First, initialize the Angular testing environment. +getTestBed().initTestEnvironment( + BrowserDynamicTestingModule, + platformBrowserDynamicTesting(), +); \ No newline at end of file diff --git a/dmp-frontend/tsconfig.json b/dmp-frontend/tsconfig.json index e82da0493..e892561de 100644 --- a/dmp-frontend/tsconfig.json +++ b/dmp-frontend/tsconfig.json @@ -1,30 +1,31 @@ { "compileOnSave": false, "compilerOptions": { - "baseUrl": "./src", - "outDir": "./dist/out-tsc", - "sourceMap": true, - "declaration": false, - "module": "es2020", + "baseUrl": "./src", + "outDir": "./dist/out-tsc", + "sourceMap": true, + "declaration": false, + "module": "es2020", "moduleResolution": "node", - "experimentalDecorators": true, - "importHelpers": true, - "skipLibCheck": true, - "target": "es2020", - "typeRoots": [ - "node_modules/@types" - ], - "lib": [ - "es2018", - "dom" - ], - "paths": { - "@app/*": [ - "./app/*" - ], - "@common/*": [ - "./common/*" - ] - } - } + "experimentalDecorators": true, + "importHelpers": true, + "skipLibCheck": true, + "target": "ES2022", + "typeRoots": [ + "node_modules/@types" + ], + "lib": [ + "es2018", + "dom" + ], + "paths": { + "@app/*": [ + "./app/*" + ], + "@common/*": [ + "./common/*" + ] + }, + "useDefineForClassFields": false + } } \ No newline at end of file From 5a46345f15bce89f8764a1dbb0af65f8a55e0ba1 Mon Sep 17 00:00:00 2001 From: Diamantis Tziotzios Date: Thu, 5 Oct 2023 22:42:47 +0300 Subject: [PATCH 3/4] angular 16 update --- dmp-frontend/angular.json | 1 - dmp-frontend/package.json | 90 ++-- dmp-frontend/src/app/app.component.ts | 1 - dmp-frontend/src/app/app.module.ts | 14 +- .../core/services/culture/culture-service.ts | 10 +- .../services/culture/language-info-service.ts | 6 +- .../core/services/matomo/matomo-service.ts | 8 +- .../multiple-auto-complete.component.ts | 7 +- .../single/single-auto-complete.component.ts | 5 +- ...rofile-editor-composite-field.component.ts | 436 +++++++++--------- .../dataset-profile-editor-field.component.ts | 211 ++++----- .../dataset-profile-editor.component.ts | 4 +- .../table-of-contents/table-of-contents.ts | 2 +- .../dataset-wizard.component.ts | 302 ++++++------ ...et-external-references-editor.component.ts | 2 +- .../dataset-editor-details.component.ts | 2 +- .../dmp-invitation-dialog.component.ts | 2 +- .../form-field/form-field.component.ts | 2 +- .../dataset-description-form.component.ts | 4 +- .../dataset-description.component.ts | 4 +- .../src/assets/scss/core/_buttons.scss | 2 +- .../src/assets/scss/material-dashboard.scss | 3 +- .../forms/validation/custom-validator.ts | 6 +- dmp-frontend/src/polyfills.ts | 4 +- dmp-frontend/src/styles.scss | 10 +- 25 files changed, 571 insertions(+), 567 deletions(-) diff --git a/dmp-frontend/angular.json b/dmp-frontend/angular.json index e2dba7c01..7b6d198f6 100644 --- a/dmp-frontend/angular.json +++ b/dmp-frontend/angular.json @@ -23,7 +23,6 @@ ], "styles": [ "src/styles.scss", - "src/assets/scss/material-dashboard.scss", "src/assets/css/demo.css", "node_modules/cookieconsent/build/cookieconsent.min.css" ], diff --git a/dmp-frontend/package.json b/dmp-frontend/package.json index 46e88aaea..8d826a0ef 100644 --- a/dmp-frontend/package.json +++ b/dmp-frontend/package.json @@ -12,60 +12,62 @@ }, "private": true, "dependencies": { - "@angular/animations": "^15.2.10", - "@angular/common": "^15.2.10", - "@angular/compiler": "^15.2.10", - "@angular/core": "^15.2.10", - "@angular/forms": "^15.2.10", - "@angular/material-moment-adapter": "^15.2.9", - "@angular/platform-browser": "^15.2.10", - "@kolkov/angular-editor": "^1.2.0", - "@ngx-translate/core": "^13.0.0", - "@ngx-translate/http-loader": "^6.0.0", - "@swimlane/ngx-datatable": "^20.0.0", - "@tinymce/tinymce-angular": "^4.2.4", - "@w11k/angular-sticky-things": "^1.3.2", - "bootstrap": "^4.3.1", + "@angular/animations": "^16.2.8", + "@angular/common": "^16.2.8", + "@angular/compiler": "^16.2.8", + "@angular/core": "^16.2.8", + "@angular/forms": "^16.2.8", + "@angular/material-moment-adapter": "^16.2.7", + "@angular/platform-browser": "^16.2.8", + "@kolkov/angular-editor": "^2.1.0", + "@ngx-translate/core": "^15.0.0", + "@ngx-translate/http-loader": "^8.0.0", + "@swimlane/ngx-datatable": "^20.1.0", + "@tinymce/tinymce-angular": "^7.0.0", + "@w11k/angular-sticky-things": "^1.5.2", + "bootstrap": "^4.6.0", "cookieconsent": "^3.1.1", - "core-js": "^2.5.5", + "core-js": "^3.33.0", + "dragula": "^3.7.3", "file-saver": "^2.0.5", - "moment": "^2.29.1", - "moment-timezone": "^0.5.33", + "moment": "^2.29.4", + "moment-timezone": "^0.5.43", "ng-dialog-animation": "^9.0.4", - "ng2-dragula": "^2.1.1", - "ngx-cookie-service": "^12.0.3", - "ngx-cookieconsent": "^2.2.3", + "ng2-dragula": "^5.0.1", + "ngx-cookie-service": "^16.0.1", + "ngx-cookieconsent": "^4.0.2", "ngx-dropzone": "^3.0.0", - "ngx-guided-tour": "^1.1.11", - "ngx-matomo": "^0.1.4", + "ngx-guided-tour": "^2.0.1", + "ngx-matomo-client": "^5.0.4", "pako": "^1.0.11", "rxjs": "^6.3.2", - "tinymce": "^5.9.2", + "tinymce": "^6.7.0", "ts-simple-nameof": "^1.3.1", - "tslib": "^2.0.0", - "zone.js": "~0.11.4" + "tslib": "^2.6.2", + "zone.js": "~0.13.0" }, "devDependencies": { - "@angular-devkit/build-angular": "^15.2.9", - "@angular/cdk": "^15.2.9", - "@angular/cli": "15.2.9", - "@angular/compiler-cli": "^15.2.10", - "@angular/language-service": "^15.2.10", - "@angular/material": "^15.2.9", - "@angular/platform-browser-dynamic": "^15.2.10", - "@angular/router": "^15.2.10", - "@types/facebook-js-sdk": "^3.3.5", - "@types/file-saver": "^2.0.3", - "@types/gapi": "^0.0.41", - "@types/gapi.auth2": "^0.0.55", - "@types/jasmine": "~3.9.1", - "@types/jasminewd2": "~2.0.10", + "@angular-devkit/build-angular": "^16.2.5", + "@angular/cdk": "^16.2.7", + "@angular/cli": "16.2.5", + "@angular/compiler-cli": "^16.2.8", + "@angular/language-service": "^16.2.8", + "@angular/material": "^16.2.7", + "@angular/platform-browser-dynamic": "^16.2.8", + "@angular/router": "^16.2.8", + "@types/dragula": "^3.7.2", + "@types/facebook-js-sdk": "^3.3.7", + "@types/file-saver": "^2.0.5", + "@types/gapi": "^0.0.45", + "@types/gapi.auth2": "^0.0.58", + "@types/jasmine": "~5.1.0", + "@types/jasminewd2": "~2.0.11", "@types/moment-timezone": "^0.5.13", - "@types/node": "^12.11.1", + "@types/node": "^20.8.2", "@types/pako": "^1.0.3", - "codelyzer": "^6.0.2", - "ts-node": "~10.2.1", + "codelyzer": "^0.0.28", + "ts-node": "~10.9.1", "tslint": "~6.1.0", - "typescript": "^4.8" + "typescript": "^4.9.3" } -} \ No newline at end of file +} diff --git a/dmp-frontend/src/app/app.component.ts b/dmp-frontend/src/app/app.component.ts index 8eb8b023f..8f447f72f 100644 --- a/dmp-frontend/src/app/app.component.ts +++ b/dmp-frontend/src/app/app.component.ts @@ -16,7 +16,6 @@ import { LanguageService } from './core/services/language/language.service'; import { ConfigurationService } from './core/services/configuration/configuration.service'; import { Location } from '@angular/common'; -import { MatomoInjector } from 'ngx-matomo'; import { MatomoService } from './core/services/matomo/matomo-service'; import { SideNavService } from './core/services/sidenav/side-nav.sevice'; import { MatSidenav } from '@angular/material/sidenav'; diff --git a/dmp-frontend/src/app/app.module.ts b/dmp-frontend/src/app/app.module.ts index 18b7a6b51..67616a71b 100644 --- a/dmp-frontend/src/app/app.module.ts +++ b/dmp-frontend/src/app/app.module.ts @@ -2,9 +2,9 @@ import { OverlayModule } from '@angular/cdk/overlay'; import { HttpClient, HttpClientModule } from '@angular/common/http'; import { LOCALE_ID, NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatMomentDateModule, MAT_MOMENT_DATE_FORMATS } from '@angular/material-moment-adapter'; +import { MAT_MOMENT_DATE_FORMATS, MatMomentDateModule } from '@angular/material-moment-adapter'; import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core'; -import { MatLegacyFormFieldDefaultOptions as MatFormFieldDefaultOptions, MAT_LEGACY_FORM_FIELD_DEFAULT_OPTIONS as MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/legacy-form-field'; +import { MAT_LEGACY_FORM_FIELD_DEFAULT_OPTIONS as MAT_FORM_FIELD_DEFAULT_OPTIONS, MatLegacyFormFieldDefaultOptions as MatFormFieldDefaultOptions } from '@angular/material/legacy-form-field'; import { BrowserModule, Title } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { AppRoutingModule } from '@app/app-routing.module'; @@ -26,14 +26,14 @@ import { TranslateCompiler, TranslateLoader, TranslateModule } from '@ngx-transl import { DragulaModule } from 'ng2-dragula'; import { CookieService } from 'ngx-cookie-service'; import { NgcCookieConsentConfig, NgcCookieConsentModule } from 'ngx-cookieconsent'; -import { MatomoModule } from 'ngx-matomo'; +import { MatomoInitializationMode, NgxMatomoModule } from 'ngx-matomo-client'; import { ConfigurationService } from './core/services/configuration/configuration.service'; import { CultureService } from './core/services/culture/culture-service'; import { TranslateServerLoader } from './core/services/language/server.loader'; import { MatomoService } from './core/services/matomo/matomo-service'; import { GuidedTourModule } from './library/guided-tour/guided-tour.module'; -import { OpenDMPCustomTranslationCompiler } from './utilities/translate/opendmp-custom-translation-compiler'; import { Oauth2DialogModule } from './ui/misc/oauth2-dialog/oauth2-dialog.module'; +import { OpenDMPCustomTranslationCompiler } from './utilities/translate/opendmp-custom-translation-compiler'; // AoT requires an exported function for factories export function HttpLoaderFactory(http: HttpClient, appConfig: ConfigurationService) { @@ -97,7 +97,6 @@ const appearance: MatFormFieldDefaultOptions = { CommonHttpModule, MatMomentDateModule, LoginModule, - MatomoModule, //Ui NotificationModule, NavigationModule, @@ -111,7 +110,10 @@ const appearance: MatFormFieldDefaultOptions = { NgcCookieConsentModule.forRoot(cookieConfig), Oauth2DialogModule, GuidedTourModule.forRoot(), - DragulaModule.forRoot() + DragulaModule.forRoot(), + NgxMatomoModule.forRoot({ + mode: MatomoInitializationMode.AUTO_DEFERRED, + }) ], declarations: [ AppComponent, diff --git a/dmp-frontend/src/app/core/services/culture/culture-service.ts b/dmp-frontend/src/app/core/services/culture/culture-service.ts index e2f77acdf..96d39241a 100644 --- a/dmp-frontend/src/app/core/services/culture/culture-service.ts +++ b/dmp-frontend/src/app/core/services/culture/culture-service.ts @@ -48,7 +48,7 @@ export class CultureService { const newCulture = this.cultureValues.get(newCultureName); if (!newCulture) { - console.error(`unsupported culture given: ${newCultureName}`); //TODO: throw error? + this.logger.error(`unsupported culture given: ${newCultureName}`); //TODO: throw error? return; } this.currentCulture = newCulture; @@ -58,19 +58,17 @@ export class CultureService { // This is a very hacky way to map cultures with angular cultures, since there is no mapping. We first try to // use the culture with the specialization (ex en-US), and if not exists we import the base culture (first part). let locale = newCulture.name; - import(`@angular/common/locales/${locale}.js`).catch(reason => { + import(`/node_modules/@angular/common/locales/${locale}.mjs`).catch(reason => { this.logger.error('Could not load locale: ' + locale); }).then(selectedLocale => { if (selectedLocale) { registerLocaleData(selectedLocale.default); } else { locale = newCulture.name.split('-')[0]; - import(`@angular/common/locales/${locale}.js`).catch(reason => { + import(`/node_modules/@angular/common/locales/${locale}.mjs`).catch(reason => { this.logger.error('Could not load locale: ' + locale); }).then(selectedDefaultLocale => { - if (selectedDefaultLocale !== undefined) { - registerLocaleData(selectedDefaultLocale.default); - } + registerLocaleData(selectedDefaultLocale.default); }); } }); diff --git a/dmp-frontend/src/app/core/services/culture/language-info-service.ts b/dmp-frontend/src/app/core/services/culture/language-info-service.ts index 8afa52182..c6ef06823 100644 --- a/dmp-frontend/src/app/core/services/culture/language-info-service.ts +++ b/dmp-frontend/src/app/core/services/culture/language-info-service.ts @@ -49,7 +49,7 @@ export class LanguageInfoService { const newLanguageInfo = this.languageInfoValues.get(newLanguageInfoName); if (!newLanguageInfo) { - console.error(`unsupported language given: ${newLanguageInfoName}`); //TODO: throw error? + this.logger.error(`unsupported culture given: ${newLanguageInfo}`); //TODO: throw error? return; } this.currentLanguageInfo = newLanguageInfo; @@ -59,14 +59,14 @@ export class LanguageInfoService { // This is a very hacky way to map cultures with angular cultures, since there is no mapping. We first try to // use the culture with the specialization (ex en-US), and if not exists we import the base culture (first part). let locale = newLanguageInfo.code; - import(`@angular/common/locales/${locale}.js`).catch(reason => { + import(`/node_modules/@angular/common/locales/${locale}.mjs`).catch(reason => { this.logger.error('Could not load locale: ' + locale); }).then(selectedLocale => { if (selectedLocale) { registerLocaleData(selectedLocale.default); } else { // locale = newCulture.code.split('-')[0]; - import(`@angular/common/locales/${locale}.js`).catch(reason => { + import(`/node_modules/@angular/common/locales/${locale}.mjs`).catch(reason => { this.logger.error('Could not load locale: ' + locale); }).then(selectedDefaultLocale => { if (selectedDefaultLocale !== undefined) { diff --git a/dmp-frontend/src/app/core/services/matomo/matomo-service.ts b/dmp-frontend/src/app/core/services/matomo/matomo-service.ts index 700535510..386e7c2fc 100644 --- a/dmp-frontend/src/app/core/services/matomo/matomo-service.ts +++ b/dmp-frontend/src/app/core/services/matomo/matomo-service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { MatomoInjector, MatomoTracker } from 'ngx-matomo'; +import { MatomoInitializerService, MatomoTracker } from 'ngx-matomo-client'; import { AuthService } from '../auth/auth.service'; import { ConfigurationService } from '../configuration/configuration.service'; @@ -8,7 +8,7 @@ export class MatomoService { constructor( private configurationService: ConfigurationService, - private matomoInjector: MatomoInjector, + private matomoInitializerService: MatomoInitializerService, private matomoTracker: MatomoTracker, private authService: AuthService ) { @@ -17,7 +17,7 @@ export class MatomoService { init() { if (this.configurationService.matomoEnabled) { - this.matomoInjector.init(this.configurationService.matomoSiteUrl, this.configurationService.matomoSiteId); + this.matomoInitializerService.initializeTracker({ trackerUrl: this.configurationService.matomoSiteUrl, siteId: this.configurationService.matomoSiteId }); } } @@ -37,7 +37,7 @@ export class MatomoService { } } - trackDownload(category: "dmps"|"datasets", type: "docx"|"pdf"|"xml"|"json", id: string): void { + trackDownload(category: "dmps" | "datasets", type: "docx" | "pdf" | "xml" | "json", id: string): void { if (this.configurationService.matomoEnabled) { var principal = this.authService.current(); if (principal != null) { this.matomoTracker.setUserId(principal.id); } diff --git a/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.ts b/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.ts index 7b612997e..272f1bd44 100644 --- a/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.ts +++ b/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.ts @@ -17,7 +17,7 @@ import { ViewChild } from '@angular/core'; import {ControlValueAccessor, FormGroupDirective, NgControl, NgForm} from '@angular/forms'; -import {MatLegacyChipInputEvent as MatChipInputEvent} from '@angular/material/legacy-chips'; +import { MatChipInputEvent } from '@angular/material/chips'; import {ErrorStateMatcher, mixinErrorState} from '@angular/material/core'; import {MatLegacyAutocomplete as MatAutocomplete, MatLegacyAutocompleteSelectedEvent as MatAutocompleteSelectedEvent, MatLegacyAutocompleteTrigger as MatAutocompleteTrigger} from '@angular/material/legacy-autocomplete'; import {MatLegacyFormFieldControl as MatFormFieldControl} from '@angular/material/legacy-form-field'; @@ -35,7 +35,8 @@ export class CustomComponentBase extends BaseComponent { public _defaultErrorStateMatcher: ErrorStateMatcher, public _parentForm: NgForm, public _parentFormGroup: FormGroupDirective, - public ngControl: NgControl + public ngControl: NgControl, + public stateChanges: Subject ) { super(); } @@ -166,7 +167,7 @@ export class MultipleAutoCompleteComponent extends _CustomComponentMixinBase imp @Optional() _parentFormGroup: FormGroupDirective, _defaultErrorStateMatcher: ErrorStateMatcher ) { - super(_defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl); + super(_defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl, new Subject()); fm.monitor(elRef.nativeElement, true).pipe(takeUntil(this._destroyed)).subscribe((origin) => { this.focused = !!origin; diff --git a/dmp-frontend/src/app/library/auto-complete/single/single-auto-complete.component.ts b/dmp-frontend/src/app/library/auto-complete/single/single-auto-complete.component.ts index 714d3e9ef..4c91fcaac 100644 --- a/dmp-frontend/src/app/library/auto-complete/single/single-auto-complete.component.ts +++ b/dmp-frontend/src/app/library/auto-complete/single/single-auto-complete.component.ts @@ -17,7 +17,8 @@ export class CustomComponentBase extends BaseComponent { public _defaultErrorStateMatcher: ErrorStateMatcher, public _parentForm: NgForm, public _parentFormGroup: FormGroupDirective, - public ngControl: NgControl + public ngControl: NgControl, + public stateChanges: Subject ) { super(); } } export const _CustomComponentMixinBase = mixinErrorState(CustomComponentBase); @@ -110,7 +111,7 @@ export class SingleAutoCompleteComponent extends _CustomComponentMixinBase imple @Optional() _parentFormGroup: FormGroupDirective, _defaultErrorStateMatcher: ErrorStateMatcher ) { - super(_defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl); + super(_defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl, new Subject()); fm.monitor(elRef.nativeElement, true).pipe(takeUntil(this._destroyed)).subscribe((origin) => { this.focused = !!origin; diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts index 2a9b9509e..f38a2b318 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts @@ -1,26 +1,14 @@ -import {Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild} from '@angular/core'; -import {AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup} from '@angular/forms'; -import {FieldEditorModel} from '../../../admin/field-editor-model'; -import {Guid} from '@common/types/guid'; -import {RuleEditorModel} from '../../../admin/rule-editor-model'; -import {ValidationType} from '@app/core/common/enum/validation-type'; -import {MMatLegacyCheckboxChange as MatCheckboxChange from '@@angular/material/legacy-checkbox; -import { - DatasetDescriptionCompositeFieldEditorModel, - DatasetDescriptionFieldEditorModel, - DatasetDescriptionSectionEditorModel -} from '@app/ui/misc/dataset-description-form/dataset-description-form.model'; -import {DatasetProfileFieldViewStyle} from '@app/core/common/enum/dataset-profile-field-view-style'; -import {MMatLegacyDialog as MatDialog from '@@angular/material/legacy-dialog; -import {ConfirmationDialogComponent} from '@common/modules/confirmation-dialog/confirmation-dialog.component'; -import {TranslateService} from '@ngx-translate/core'; -import {ViewStyleType} from '../field/view-style-enum'; -import {EnumUtils} from '@app/core/services/utilities/enum-utils.service'; -import {DatasetProfileService} from '@app/core/services/dataset-profile/dataset-profile.service'; -import {EditorCustomValidators} from '../../custom-validators/editor-custom-validators'; -import {Field, FieldSet} from '@app/core/model/admin/dataset-profile/dataset-profile'; -import {DatasetProfileComboBoxType} from '@app/core/common/enum/dataset-profile-combo-box-type'; -import {DatasetProfileInternalDmpEntitiesType} from '@app/core/common/enum/dataset-profile-internal-dmp-entities-type'; +import { Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core'; +import { AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; +import { MatLegacyCheckboxChange as MatCheckboxChange } from '@angular/material/legacy-checkbox'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { DatasetProfileComboBoxType } from '@app/core/common/enum/dataset-profile-combo-box-type'; +import { DatasetProfileFieldViewStyle } from '@app/core/common/enum/dataset-profile-field-view-style'; +import { DatasetProfileInternalDmpEntitiesType } from '@app/core/common/enum/dataset-profile-internal-dmp-entities-type'; +import { ValidationType } from '@app/core/common/enum/validation-type'; +import { Field, FieldSet } from '@app/core/model/admin/dataset-profile/dataset-profile'; +import { CompositeField } from '@app/core/model/dataset-profile-definition/composite-field'; +import { Field as FieldDefinition } from '@app/core/model/dataset-profile-definition/field'; import { AutoCompleteFieldData, BooleanDecisionFieldData, @@ -33,35 +21,47 @@ import { ExternalDatasetsFieldData, FieldDataOption, FreeTextFieldData, + LicensesFieldData, OrganizationsFieldData, + PublicationsFieldData, RadioBoxFieldData, RegistriesFieldData, ResearchersAutoCompleteFieldData, + RichTextAreaFieldData, ServicesFieldData, TagsFieldData, + TaxonomiesFieldData, TextAreaFieldData, - RichTextAreaFieldData, UploadFieldData, ValidationFieldData, - WordListFieldData, - TaxonomiesFieldData, - LicensesFieldData, - PublicationsFieldData + WordListFieldData } from '@app/core/model/dataset-profile-definition/field-data/field-data'; -import {CompositeField} from '@app/core/model/dataset-profile-definition/composite-field'; -import {Field as FieldDefinition} from '@app/core/model/dataset-profile-definition/field'; -import {Subject} from 'rxjs'; -import {debounceTime, delay, map, takeUntil, tap} from 'rxjs/operators'; -import {GENERAL_ANIMATIONS} from '../../animations/animations'; -import {BaseComponent} from '@common/base/base.component'; -import {TransitionGroupComponent} from "@app/ui/transition-group/transition-group.component"; -import {ConfigurationService} from "@app/core/services/configuration/configuration.service"; +import { ConfigurationService } from "@app/core/services/configuration/configuration.service"; +import { DatasetProfileService } from '@app/core/services/dataset-profile/dataset-profile.service'; +import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; +import { + DatasetDescriptionCompositeFieldEditorModel, + DatasetDescriptionFieldEditorModel, + DatasetDescriptionSectionEditorModel +} from '@app/ui/misc/dataset-description-form/dataset-description-form.model'; +import { TransitionGroupComponent } from "@app/ui/transition-group/transition-group.component"; +import { BaseComponent } from '@common/base/base.component'; +import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component'; +import { Guid } from '@common/types/guid'; +import { TranslateService } from '@ngx-translate/core'; +import { Subject } from 'rxjs'; +import { debounceTime, delay, map, takeUntil, tap } from 'rxjs/operators'; +import { FieldEditorModel } from '../../../admin/field-editor-model'; +import { RuleEditorModel } from '../../../admin/rule-editor-model'; +import { GENERAL_ANIMATIONS } from '../../animations/animations'; +import { EditorCustomValidators } from '../../custom-validators/editor-custom-validators'; +import { ViewStyleType } from '../field/view-style-enum'; @Component({ selector: 'app-dataset-profile-editor-composite-field-component', templateUrl: './dataset-profile-editor-composite-field.component.html', styleUrls: ['./dataset-profile-editor-composite-field.component.scss'], - animations:[GENERAL_ANIMATIONS] + animations: [GENERAL_ANIMATIONS] }) export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent implements OnInit, OnChanges { @@ -75,7 +75,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i @Input() hasFocus: boolean = false; @ViewChild("inputs") inputs: TransitionGroupComponent; - showPreview: boolean = true; + showPreview: boolean = true; previewDirty: boolean = false; @@ -88,9 +88,9 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i // isMultiplicityEnabled = false; viewStyleEnum = DatasetProfileFieldViewStyle; - viewTypeEnum = ViewStyleType; + viewTypeEnum = ViewStyleType; - private myCustomValidators:EditorCustomValidators = new EditorCustomValidators(); + private myCustomValidators: EditorCustomValidators = new EditorCustomValidators(); isMultiplicityEnabled = false; constructor( @@ -100,30 +100,30 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i public datasetProfileService: DatasetProfileService, private configurationService: ConfigurationService ) { - super(); - } + super(); + } - ngOnChanges(changes: SimpleChanges){ + ngOnChanges(changes: SimpleChanges) { // this.setTargetField(null); // this.showExtendedDescription = !!this.form.get('extendedDescription').value; // this.showAdditionalInfo = !!this.form.get('additionalInformation').value; // console.log(this.form.get('fields')['controls']) - if( changes['form']){ + if (changes['form']) { - try{ + try { const multiplicity = this.form.get('multiplicity').value; - this.isMultiplicityEnabled = multiplicity.min > 0 || multiplicity.max >0; - } catch{ + this.isMultiplicityEnabled = multiplicity.min > 0 || multiplicity.max > 0; + } catch { this.isMultiplicityEnabled = false; } } } - get firstField(){ - try{ + get firstField() { + try { return (this.form.get('fields') as UntypedFormArray).at(0); - }catch{ + } catch { return null; } } @@ -153,73 +153,73 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i this.showExtendedDescription = !!this.form.get('extendedDescription').value; this.showAdditionalInfo = !!this.form.get('additionalInformation').value; - this.form.valueChanges.pipe(takeUntil(this._destroyed)).subscribe(changes=>{ + this.form.valueChanges.pipe(takeUntil(this._destroyed)).subscribe(changes => { // this.previewForm = null; this.previewDirty = true; this.generatePreviewForm(); }); this.previewSubject$ - .pipe(debounceTime(600)) - .pipe( - takeUntil(this._destroyed), - map(model => model.buildForm()), - map(updatedForm =>{ - const previewContainer = document.getElementById('preview_container'+ this.form.get('id').value); - // let clientHeight = -1; - if(previewContainer){ - // console.log(previewContainer); - const clientHeight = previewContainer.clientHeight; - // console.log(clientHeight); + .pipe(debounceTime(600)) + .pipe( + takeUntil(this._destroyed), + map(model => model.buildForm()), + map(updatedForm => { + const previewContainer = document.getElementById('preview_container' + this.form.get('id').value); + // let clientHeight = -1; + if (previewContainer) { + // console.log(previewContainer); + const clientHeight = previewContainer.clientHeight; + // console.log(clientHeight); - if(clientHeight){ - previewContainer.style.height = clientHeight.toString() + 'px'; + if (clientHeight) { + previewContainer.style.height = clientHeight.toString() + 'px'; - // console.log('height:' ,previewContainer.style.height); + // console.log('height:' ,previewContainer.style.height); + } } - } - this.showPreview = false; - this.previewDirty = true; - this.previewForm = updatedForm; - return previewContainer; + this.showPreview = false; + this.previewDirty = true; + this.previewForm = updatedForm; + return previewContainer; }), - delay(100), - tap( previewContainer =>{ - this.showPreview = true; - this.previewDirty = false; - }), - delay(100) - ) - .subscribe(previewContainer=>{ + delay(100), + tap(previewContainer => { + this.showPreview = true; + this.previewDirty = false; + }), + delay(100) + ) + .subscribe(previewContainer => { - if(previewContainer){ - previewContainer.style.height = 'auto'; - } + if (previewContainer) { + previewContainer.style.height = 'auto'; + } - // const updatedForm = model.buildForm(); - // this.reloadPreview(updatedForm) - }); + // const updatedForm = model.buildForm(); + // this.reloadPreview(updatedForm) + }); this.generatePreviewForm(); } - get updatedClass(){ - if(this.previewDirty) return ''; + get updatedClass() { + if (this.previewDirty) return ''; else return 'updated'; } - private reloadPreview(updatedForm: UntypedFormGroup){ + private reloadPreview(updatedForm: UntypedFormGroup) { setTimeout(() => { - const previewContainer = document.getElementById('preview_container'+ this.form.get('id').value); + const previewContainer = document.getElementById('preview_container' + this.form.get('id').value); // let clientHeight = -1; - if(previewContainer){ + if (previewContainer) { // console.log(previewContainer); const clientHeight = previewContainer.clientHeight; // console.log(clientHeight); - if(clientHeight){ + if (clientHeight) { previewContainer.style.height = clientHeight.toString() + 'px'; // console.log('height:' ,previewContainer.style.height); @@ -235,9 +235,9 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i this.showPreview = true; this.previewDirty = false; - if(previewContainer){ + if (previewContainer) { setTimeout(() => { - if(previewContainer){ + if (previewContainer) { previewContainer.style.height = 'auto'; } }); @@ -248,55 +248,57 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i previewSubject$: Subject = new Subject(); - private generatePreviewForm(){ - const formValue:FieldSet = this.form.getRawValue(); - const fields:FieldDefinition[] = formValue.fields.map(editorField=>this._fieldToFieldDefinition(editorField)); + private generatePreviewForm() { + const formValue: FieldSet = this.form.getRawValue(); + const fields: FieldDefinition[] = formValue.fields.map(editorField => this._fieldToFieldDefinition(editorField)); - const compositeField: CompositeField = { - id: formValue.id, - additionalInformation: formValue.additionalInformation, - extendedDescription: formValue.extendedDescription, - numbering:'', - title: formValue.title, - ordinal: formValue.ordinal, - description: formValue.description, - hasCommentField: formValue.hasCommentField, - commentFieldValue: '', - multiplicity: {max: formValue.multiplicity.max, min: formValue.multiplicity.min, - placeholder: formValue.multiplicity.placeholder, tableView: formValue.multiplicity.tableView}, - multiplicityItems:null, - fields: fields.map(editorField=>{ - const model = new DatasetDescriptionFieldEditorModel().fromModel(editorField); - if(model.viewStyle.renderStyle === this.viewStyleEnum.CheckBox){ - model.value = model.value?"true":"false";//patch - } - return model; - }) - } + const compositeField: CompositeField = { + id: formValue.id, + additionalInformation: formValue.additionalInformation, + extendedDescription: formValue.extendedDescription, + numbering: '', + title: formValue.title, + ordinal: formValue.ordinal, + description: formValue.description, + hasCommentField: formValue.hasCommentField, + commentFieldValue: '', + multiplicity: { + max: formValue.multiplicity.max, min: formValue.multiplicity.min, + placeholder: formValue.multiplicity.placeholder, tableView: formValue.multiplicity.tableView + }, + multiplicityItems: null, + fields: fields.map(editorField => { + const model = new DatasetDescriptionFieldEditorModel().fromModel(editorField); + if (model.viewStyle.renderStyle === this.viewStyleEnum.CheckBox) { + model.value = model.value ? "true" : "false";//patch + } + return model; + }) + } - const section = new DatasetDescriptionSectionEditorModel(); - section.title = ''; - section.numbering = ''; + const section = new DatasetDescriptionSectionEditorModel(); + section.title = ''; + section.numbering = ''; - const compositeForm = new DatasetDescriptionCompositeFieldEditorModel().fromModel(compositeField) - section.compositeFields = [compositeForm]; + const compositeForm = new DatasetDescriptionCompositeFieldEditorModel().fromModel(compositeField) + section.compositeFields = [compositeForm]; - this.previewSubject$.next(section); + this.previewSubject$.next(section); } - private _fieldToFieldDefinition(editorField: Field): FieldDefinition{ + private _fieldToFieldDefinition(editorField: Field): FieldDefinition { const field = { id: editorField.id, title: '', page: editorField.page, - numbering:'', - multiplicity:null, + numbering: '', + multiplicity: null, multiplicityItems: null, viewStyle: editorField.viewStyle, - defaultValue:editorField.defaultValue, + defaultValue: editorField.defaultValue, value: null, validations: editorField.validations, } as FieldDefinition; @@ -370,7 +372,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i maxControl.setValue(1); placeholder.setValue(''); tableView.setValue(false); - }else{ + } else { minControl.setValue(0); maxControl.setValue(0); placeholder.setValue(null); @@ -385,7 +387,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i addNewField() { const field: FieldEditorModel = new FieldEditorModel(); - field.id=Guid.create().toString(); + field.id = Guid.create().toString(); field.ordinal = (this.form.get('fields') as UntypedFormArray).length; @@ -406,7 +408,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i fieldsForm.removeAt(index); this.inputs.init(); // calculate ordinals - fieldsForm.controls.forEach((field, idx)=>{ + fieldsForm.controls.forEach((field, idx) => { field.get('ordinal').setValue(idx); field.updateValueAndValidity(); }); @@ -419,29 +421,29 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i } - targetField:UntypedFormGroup; + targetField: UntypedFormGroup; validationTypeEnum = ValidationType; - addVisibilityRule(targetField: UntypedFormGroup){ + addVisibilityRule(targetField: UntypedFormGroup) { const rule: RuleEditorModel = new RuleEditorModel(); (targetField.get('visible').get('rules')).push(rule.buildForm()); } - toggleRequired(targetField: UntypedFormGroup, event:MatCheckboxChange){ + toggleRequired(targetField: UntypedFormGroup, event: MatCheckboxChange) { let validationsControl = targetField.get('validations') as UntypedFormControl; let validations: Array = validationsControl.value; - if(event.checked){ - if(!validations.includes(ValidationType.Required)){//IS ALREADY REQUIRED + if (event.checked) { + if (!validations.includes(ValidationType.Required)) {//IS ALREADY REQUIRED // validationsControl.setValue(validations.filter(validator=> validator != ValidationType.Required)); // validationsControl.updateValueAndValidity(); validations.push(ValidationType.Required); // validationsControl.setValue(validations); validationsControl.updateValueAndValidity(); } - }else{ - validationsControl.setValue(validations.filter(validator=> validator != ValidationType.Required)); + } else { + validationsControl.setValue(validations.filter(validator => validator != ValidationType.Required)); validationsControl.updateValueAndValidity(); } @@ -457,12 +459,12 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i // validationsControl.updateValueAndValidity(); // } } - setTargetField(field:AbstractControl){ + setTargetField(field: AbstractControl) { this.targetField = field; } - deleteTargetField(){ + deleteTargetField() { const dialogRef = this.dialog.open(ConfirmationDialogComponent, { restoreFocus: false, @@ -482,29 +484,29 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i } - private _deleteTargetField(){ - if(!this.targetField) return; + private _deleteTargetField() { + if (!this.targetField) return; let index = -1; const fields = this.form.get('fields') as UntypedFormArray; - for(let i=0;i< fields.length; i++){ + for (let i = 0; i < fields.length; i++) { let field = fields.at(i); - if(field.get('id').value === this.targetField.get('id').value){//index found + if (field.get('id').value === this.targetField.get('id').value) {//index found index = i; break; } } - if(index>=0){//target found in fields + if (index >= 0) {//target found in fields this.DeleteField(index); this.targetField = null; } } - deleteField(index: number){ + deleteField(index: number) { const dialogRef = this.dialog.open(ConfirmationDialogComponent, { restoreFocus: false, @@ -526,14 +528,14 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i - addNewInput(type: ViewStyleType){ + addNewInput(type: ViewStyleType) { const fieldsArray = this.form.get('fields') as UntypedFormArray; let targetOrdinal = fieldsArray.length; - try{ - targetOrdinal = fieldsArray.controls.map(control=> control.get('ordinal').value).reduce((a,b)=>Math.max(a,b)) +1; - }catch{ + try { + targetOrdinal = fieldsArray.controls.map(control => control.get('ordinal').value).reduce((a, b) => Math.max(a, b)) + 1; + } catch { } @@ -542,9 +544,9 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i const field = { id: Guid.create().toString(), ordinal: targetOrdinal, - visible:{rules:[],style:null}, - validations:[], - viewStyle:{}, + visible: { rules: [], style: null }, + validations: [], + viewStyle: {}, export: true } as Field; @@ -566,12 +568,12 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i // } switch (type) { - case this.viewTypeEnum.BooleanDecision:{ + case this.viewTypeEnum.BooleanDecision: { // fieldForm.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.BooleanDecision) // fieldForm.addControl('data', new BooleanDecisionFieldDataEditorModel().buildForm()); const data: BooleanDecisionFieldData = { - label:'' + label: '' } field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.BooleanDecision; @@ -579,13 +581,13 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i break; } - case this.viewTypeEnum.CheckBox:{ + case this.viewTypeEnum.CheckBox: { // fieldForm.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.CheckBox) // fieldForm.addControl('data', new CheckBoxFieldDataEditorModel().buildForm()); const data: CheckBoxFieldData = { - label:'' + label: '' } field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.CheckBox; @@ -593,7 +595,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i break; } - case this.viewTypeEnum.Select:{ + case this.viewTypeEnum.Select: { // fieldForm.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.ComboBox) @@ -602,13 +604,13 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i // fieldForm.get('data').setValidators(EditorCustomValidators.atLeastOneElementListValidator('options')); // fieldForm.get('data').updateValueAndValidity(); - const firstOption = {label:'', value:''} as FieldDataOption; + const firstOption = { label: '', value: '' } as FieldDataOption; - const data:WordListFieldData = { - label:'', - multiList:false, - options:[firstOption], - type:DatasetProfileComboBoxType.WordList + const data: WordListFieldData = { + label: '', + multiList: false, + options: [firstOption], + type: DatasetProfileComboBoxType.WordList } field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.ComboBox; @@ -616,7 +618,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i break; } - case this.viewTypeEnum.Other:{ + case this.viewTypeEnum.Other: { // fieldForm.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.ComboBox) @@ -626,9 +628,9 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i // fieldForm.get('data').updateValueAndValidity(); const data: AutoCompleteFieldData = { - autoCompleteSingleDataList:[], + autoCompleteSingleDataList: [], multiAutoComplete: false, - label:'', + label: '', type: DatasetProfileComboBoxType.Autocomplete } @@ -636,14 +638,14 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i field.data = data; break; - }case this.viewTypeEnum.InternalDmpEntities:{ + } case this.viewTypeEnum.InternalDmpEntities: { // fieldForm.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.InternalDmpEntities) // fieldForm.addControl('data', new ResearchersAutoCompleteFieldDataEditorModel().buildForm());//TODO TO SEE const data: DmpsAutoCompleteFieldData = { - label:'', + label: '', multiAutoComplete: false, type: DatasetProfileInternalDmpEntitiesType.Dmps } @@ -654,29 +656,29 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i break; } - case this.viewTypeEnum.FreeText:{ + case this.viewTypeEnum.FreeText: { // fieldForm.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.FreeText) // fieldForm.addControl('data', new FreeTextFieldDataEditorModel().buildForm()); const data: FreeTextFieldData = { - label:'' + label: '' } field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.FreeText; field.data = data; break; } - case this.viewTypeEnum.RadioBox:{ + case this.viewTypeEnum.RadioBox: { // fieldForm.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.RadioBox) // fieldForm.addControl('data', new RadioBoxFieldDataEditorModel().buildForm()); // fieldForm.get('data').setValidators(EditorCustomValidators.atLeastOneElementListValidator('options')); // fieldForm.get('data').updateValueAndValidity(); - const data: RadioBoxFieldData= { - label:'', + const data: RadioBoxFieldData = { + label: '', options: [] } @@ -685,14 +687,14 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i break; } - case this.viewTypeEnum.TextArea:{ + case this.viewTypeEnum.TextArea: { // fieldForm.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.TextArea) // fieldForm.addControl('data', new TextAreaFieldDataEditorModel().buildForm()); const data: TextAreaFieldData = { - label:'' + label: '' } field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.TextArea; @@ -700,14 +702,14 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i break; } - case this.viewTypeEnum.RichTextArea:{ + case this.viewTypeEnum.RichTextArea: { // fieldForm.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.TextArea) // fieldForm.addControl('data', new TextAreaFieldDataEditorModel().buildForm()); const data: RichTextAreaFieldData = { - label:'' + label: '' } field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.RichTextArea; @@ -715,14 +717,14 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i break; } - case this.viewTypeEnum.Upload:{ + case this.viewTypeEnum.Upload: { // fieldForm.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.TextArea) // fieldForm.addControl('data', new TextAreaFieldDataEditorModel().buildForm()); const data: UploadFieldData = { - label:'', + label: '', types: [], maxFileSizeInMB: this.configurationService.maxFileSizeInMB } @@ -732,26 +734,26 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i break; } - case this.viewTypeEnum.DatePicker:{ + case this.viewTypeEnum.DatePicker: { // fieldForm.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.DatePicker) // fieldForm.addControl('data', new DatePickerDataEditorModel().buildForm()); const data: DatePickerFieldData = { - label:'' + label: '' } field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.DatePicker; break; } - case this.viewTypeEnum.ExternalDatasets:{ + case this.viewTypeEnum.ExternalDatasets: { // fieldForm.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.ExternalDatasets) // fieldForm.addControl('data', new ExternalDatasetsDataEditorModel().buildForm()); const data: ExternalDatasetsFieldData = { - label:'', + label: '', multiAutoComplete: false } @@ -759,7 +761,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i field.data = data; break; } - case this.viewTypeEnum.DataRepositories:{ + case this.viewTypeEnum.DataRepositories: { // fieldForm.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.DataRepositories) @@ -775,7 +777,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i break; } - case this.viewTypeEnum.PubRepositories:{ + case this.viewTypeEnum.PubRepositories: { const data: DataRepositoriesFieldData = { @@ -788,7 +790,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i break; } - case this.viewTypeEnum.JournalRepositories:{ + case this.viewTypeEnum.JournalRepositories: { const data: DataRepositoriesFieldData = { label: '', @@ -800,7 +802,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i break; } - case this.viewTypeEnum.Taxonomies:{ + case this.viewTypeEnum.Taxonomies: { const data: TaxonomiesFieldData = { label: '', @@ -812,7 +814,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i break; } - case this.viewTypeEnum.Licenses:{ + case this.viewTypeEnum.Licenses: { const data: LicensesFieldData = { label: '', @@ -824,7 +826,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i break; } - case this.viewTypeEnum.Publications:{ + case this.viewTypeEnum.Publications: { const data: PublicationsFieldData = { label: '', @@ -836,13 +838,13 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i break; } - case this.viewTypeEnum.Registries:{ + case this.viewTypeEnum.Registries: { // fieldForm.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Registries) // fieldForm.addControl('data', new RegistriesDataEditorModel().buildForm()); - const data:RegistriesFieldData = { + const data: RegistriesFieldData = { label: '', multiAutoComplete: false } @@ -852,14 +854,14 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i break; } - case this.viewTypeEnum.Services:{ + case this.viewTypeEnum.Services: { // fieldForm.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Services) // fieldForm.addControl('data', new ServicesDataEditorModel().buildForm()); - const data:ServicesFieldData = { - label:'', + const data: ServicesFieldData = { + label: '', multiAutoComplete: false } @@ -868,21 +870,21 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i break; } - case this.viewTypeEnum.Tags:{ + case this.viewTypeEnum.Tags: { // fieldForm.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Tags) // fieldForm.addControl('data', new TagsDataEditorModel().buildForm()); const data: TagsFieldData = { - label:'' + label: '' } field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.Tags; field.data = data; break; } - case this.viewTypeEnum.Researchers:{ + case this.viewTypeEnum.Researchers: { // fieldForm.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Researchers) @@ -891,8 +893,8 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i // field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.Researchers; - const data : ResearchersAutoCompleteFieldData = { - label:'', + const data: ResearchersAutoCompleteFieldData = { + label: '', multiAutoComplete: false, type: DatasetProfileInternalDmpEntitiesType.Researchers } @@ -901,14 +903,14 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i // field.data = {label:''} field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.Researchers; - field.data = data; + field.data = data; break; } - case this.viewTypeEnum.Organizations:{ + case this.viewTypeEnum.Organizations: { // fieldForm.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Organizations) @@ -917,8 +919,8 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i // fieldForm.addControl('data', new DatasetsAutoCompleteFieldDataEditorModel().buildForm()); //TODO const data = { - autoCompleteSingleDataList:[], - label:'', + autoCompleteSingleDataList: [], + label: '', multiAutoComplete: false, } as OrganizationsFieldData; //TODO @@ -928,14 +930,14 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i break; } - case this.viewTypeEnum.DatasetIdentifier:{ + case this.viewTypeEnum.DatasetIdentifier: { // fieldForm.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.DatasetIdentifier) // fieldForm.addControl('data', new DatasetIdentifierDataEditorModel().buildForm()); - const data : DatasetIdentifierFieldData = { - label:'' + const data: DatasetIdentifierFieldData = { + label: '' } field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.DatasetIdentifier; @@ -943,28 +945,28 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i break; } - case this.viewTypeEnum.Currency:{ + case this.viewTypeEnum.Currency: { // fieldForm.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Currency) // fieldForm.addControl('data', new CurrencyDataEditorModel().buildForm()); const data: CurrencyFieldData = { - label:'' + label: '' } field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.Currency; field.data = data; break; } - case this.viewTypeEnum.Validation:{ + case this.viewTypeEnum.Validation: { // fieldForm.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Validation) // fieldForm.addControl('data', new ValidationDataEditorModel().buildForm()); - const data:ValidationFieldData = { - label:'' + const data: ValidationFieldData = { + label: '' } field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.Validation; @@ -1043,16 +1045,16 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i // } - calculateLabelWidth(numbering: string){ + calculateLabelWidth(numbering: string) { - const width = numbering.split('.').reduce((acc,item)=> item+acc,'').length; + const width = numbering.split('.').reduce((acc, item) => item + acc, '').length; - return {'width':width+'em'} + return { 'width': width + 'em' } } get fieldsArray(): UntypedFormArray { - if(this.form && this.form.get('fields')) { + if (this.form && this.form.get('fields')) { return this.form.get('fields') as UntypedFormArray; } return null; @@ -1063,10 +1065,10 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i if (direction === "up" && this.canGoUp(index)) { let temp = this.fieldsArray.at(index); this.fieldsArray.removeAt(index); - this.fieldsArray.insert(index-1, temp); + this.fieldsArray.insert(index - 1, temp); } else if (direction === "down" && this.canGoDown(index)) { - let temp = this.fieldsArray.at(index+1); - this.fieldsArray.removeAt(index+1); + let temp = this.fieldsArray.at(index + 1); + this.fieldsArray.removeAt(index + 1); this.fieldsArray.insert(index, temp); } this.fieldsArray.controls.forEach((field, index) => { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts index 1cefd7483..d2dc8e314 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts @@ -1,20 +1,14 @@ -import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; -import {UntypedFormArray, UntypedFormControl, UntypedFormGroup, FormGroupDirective, NgForm,} from '@angular/forms'; -import {DatasetProfileFieldViewStyle} from '@app/core/common/enum/dataset-profile-field-view-style'; -import {ValidationType} from '@app/core/common/enum/validation-type'; -import {DatasetProfileService} from '@app/core/services/dataset-profile/dataset-profile.service'; -import {EnumUtils} from '@app/core/services/utilities/enum-utils.service'; -import {RuleEditorModel} from '@app/ui/admin/dataset-profile/admin/rule-editor-model'; -import {BaseComponent} from '@common/base/base.component'; -import {Observable, Subscription} from 'rxjs'; -import {ViewStyleType} from './view-style-enum'; -import {DatasetProfileComboBoxType} from '@app/core/common/enum/dataset-profile-combo-box-type'; -iimport {ErrorStateMatcher} from '@angular/material/core'; -import {MMatLegacyDialog as MatDialog from '@@angular/material/legacy-dialog; -import {MMatLegacySlideToggleChange as MatSlideToggleChange from '@@angular/material/legacy-slide-toggle; -import {DefaultValue, Field} from '@app/core/model/admin/dataset-profile/dataset-profile'; -import {DatasetProfileInternalDmpEntitiesType} from '@app/core/common/enum/dataset-profile-internal-dmp-entities-type'; -import {FieldEditorModel} from '../../../admin/field-editor-model'; +import { COMMA, ENTER } from '@angular/cdk/keycodes'; +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { FormGroupDirective, NgForm, UntypedFormArray, UntypedFormControl, UntypedFormGroup, } from '@angular/forms'; +import { ErrorStateMatcher } from '@angular/material/core'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatLegacySlideToggleChange as MatSlideToggleChange } from '@angular/material/legacy-slide-toggle'; +import { DatasetProfileComboBoxType } from '@app/core/common/enum/dataset-profile-combo-box-type'; +import { DatasetProfileFieldViewStyle } from '@app/core/common/enum/dataset-profile-field-view-style'; +import { DatasetProfileInternalDmpEntitiesType } from '@app/core/common/enum/dataset-profile-internal-dmp-entities-type'; +import { ValidationType } from '@app/core/common/enum/validation-type'; +import { DefaultValue, Field } from '@app/core/model/admin/dataset-profile/dataset-profile'; import { AutoCompleteFieldData, BooleanDecisionFieldData, @@ -34,19 +28,25 @@ import { RegistriesFieldData, ResearchersAutoCompleteFieldData, RichTextAreaFieldData, - UploadFieldData, ServicesFieldData, // TableFieldData, TagsFieldData, TaxonomiesFieldData, TextAreaFieldData, + UploadFieldData, ValidationFieldData, WordListFieldData } from '@app/core/model/dataset-profile-definition/field-data/field-data'; -import {ConfigurationService} from "@app/core/services/configuration/configuration.service"; +import { ConfigurationService } from "@app/core/services/configuration/configuration.service"; +import { DatasetProfileService } from '@app/core/services/dataset-profile/dataset-profile.service'; +import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration'; +import { RuleEditorModel } from '@app/ui/admin/dataset-profile/admin/rule-editor-model'; +import { BaseComponent } from '@common/base/base.component'; +import { Observable, Subscription } from 'rxjs'; import { map } from 'rxjs/operators'; -import { COMMA, ENTER } from '@angular/cdk/keycodes'; +import { FieldEditorModel } from '../../../admin/field-editor-model'; +import { ViewStyleType } from './view-style-enum'; @Component({ selector: 'app-dataset-profile-editor-field-component', @@ -63,13 +63,13 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements // isFieldMultiplicityEnabled = false; viewType: ViewStyleType; - viewTypeEnum = ViewStyleType; + viewTypeEnum = ViewStyleType; // private subject$:Subject = new Subject(); @Input() expandView: boolean = true; - @Input() canBeDeleted:boolean = true; + @Input() canBeDeleted: boolean = true; @Output() delete = new EventEmitter(); @@ -85,20 +85,21 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements filterSemantics(value: string): Observable { return this.datasetProfileService.searchSemantics(value); } - + constructor( public enumUtils: EnumUtils, public datasetProfileService: DatasetProfileService, private dialog: MatDialog, private configurationService: ConfigurationService - ) { super(); + ) { + super(); } isErrorState(control: UntypedFormControl, form: FormGroupDirective | NgForm): boolean { - if(this.form.get('viewStyle').untouched) return false; + if (this.form.get('viewStyle').untouched) return false; return this.form.get('viewStyle').invalid; } @@ -118,12 +119,12 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements // } const renderStyle = this.form.get('viewStyle').get('renderStyle').value; - if(renderStyle){ + if (renderStyle) { // this.matcher.setReference(this.form); const type = this.form.get('viewStyle').get('renderStyle').value; - switch(type){ + switch (type) { case DatasetProfileFieldViewStyle.BooleanDecision: this.viewType = this.viewTypeEnum.BooleanDecision; break; @@ -133,9 +134,9 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements case DatasetProfileFieldViewStyle.ComboBox: const comboType = this.form.get('data').get('type').value; - if(comboType === DatasetProfileComboBoxType.Autocomplete){ + if (comboType === DatasetProfileComboBoxType.Autocomplete) { this.viewType = this.viewTypeEnum.Other; - }else if(comboType === DatasetProfileComboBoxType.WordList){ + } else if (comboType === DatasetProfileComboBoxType.WordList) { this.viewType = this.viewTypeEnum.Select; } break; @@ -209,7 +210,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements this.viewType = this.viewTypeEnum.Validation; break; } - if(this.viewType !== this.viewTypeEnum.FreeText) { + if (this.viewType !== this.viewTypeEnum.FreeText) { this.setValidator(ValidationType.URL, false); } } @@ -340,7 +341,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements } - private _formChangesSubscription:Subscription; + private _formChangesSubscription: Subscription; private _showPreview: boolean = false; // get showPreview(): boolean{ @@ -426,10 +427,10 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements // // }); // }; - get canApplyVisibility():boolean{ + get canApplyVisibility(): boolean { - switch(this.viewType){ + switch (this.viewType) { case this.viewTypeEnum.TextArea: case this.viewTypeEnum.RichTextArea: case this.viewTypeEnum.Upload: @@ -472,7 +473,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements // } - onInputTypeChange(){ + onInputTypeChange() { const x = this.viewType; @@ -484,7 +485,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements const field: Field = this.form.getRawValue(); // field.defaultValue = {type:null, value: null}; field.defaultValue = undefined; - if(!this.canApplyVisibility){ + if (!this.canApplyVisibility) { field.visible.rules = []; } @@ -499,14 +500,14 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements // this.form.addControl('defaultValue',defaultValueModel.buildForm()); switch (x) { - case this.viewTypeEnum.BooleanDecision:{ + case this.viewTypeEnum.BooleanDecision: { // this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.BooleanDecision) // this.form.addControl('data', new BooleanDecisionFieldDataEditorModel().buildForm()); const data: BooleanDecisionFieldData = { - label:"" + label: "" } field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.BooleanDecision; @@ -514,14 +515,14 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements break; } - case this.viewTypeEnum.CheckBox:{ + case this.viewTypeEnum.CheckBox: { // this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.CheckBox) // this.form.addControl('data', new CheckBoxFieldDataEditorModel().buildForm()); const data: CheckBoxFieldData = { - label:'' + label: '' } const defaultValue: DefaultValue = { type: '', @@ -534,7 +535,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements break; } - case this.viewTypeEnum.Select:{ + case this.viewTypeEnum.Select: { // this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.ComboBox) @@ -542,13 +543,13 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements // this.form.get('data').setValidators(EditorCustomValidators.atLeastOneElementListValidator('options')); // this.form.get('data').updateValueAndValidity(); - const option1 = {label:'', value:''} as FieldDataOption; + const option1 = { label: '', value: '' } as FieldDataOption; - const data:WordListFieldData = { - label:'', - multiList:false, - options:[option1], - type:DatasetProfileComboBoxType.WordList + const data: WordListFieldData = { + label: '', + multiList: false, + options: [option1], + type: DatasetProfileComboBoxType.WordList } @@ -557,7 +558,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements break; } - case this.viewTypeEnum.Other:{ + case this.viewTypeEnum.Other: { // this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.ComboBox) @@ -567,9 +568,9 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements // this.form.get('data').updateValueAndValidity(); const data: AutoCompleteFieldData = { - autoCompleteSingleDataList:[], + autoCompleteSingleDataList: [], multiAutoComplete: false, - label:'', + label: '', type: DatasetProfileComboBoxType.Autocomplete } @@ -578,14 +579,14 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements break; } - case this.viewTypeEnum.InternalDmpEntities:{ + case this.viewTypeEnum.InternalDmpEntities: { // this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.InternalDmpEntities) // this.form.addControl('data', new ResearchersAutoCompleteFieldDataEditorModel().buildForm());//TODO TO SEE const data: DmpsAutoCompleteFieldData = { - label:'', + label: '', multiAutoComplete: false, type: DatasetProfileInternalDmpEntitiesType.Dmps } @@ -595,14 +596,14 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements break; } - case this.viewTypeEnum.FreeText:{ + case this.viewTypeEnum.FreeText: { // this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.FreeText) // this.form.addControl('data', new FreeTextFieldDataEditorModel().buildForm()); const data: FreeTextFieldData = { - label:'' + label: '' } field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.FreeText; @@ -610,7 +611,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements break; } - case this.viewTypeEnum.RadioBox:{ + case this.viewTypeEnum.RadioBox: { // this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.RadioBox) @@ -619,8 +620,8 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements // this.form.get('data').setValidators(EditorCustomValidators.atLeastOneElementListValidator('options')); // this.form.get('data').updateValueAndValidity(); - const data: RadioBoxFieldData= { - label:'', + const data: RadioBoxFieldData = { + label: '', options: [] } @@ -630,14 +631,14 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements break; } - case this.viewTypeEnum.TextArea:{ + case this.viewTypeEnum.TextArea: { // this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.TextArea) // this.form.addControl('data', new TextAreaFieldDataEditorModel().buildForm()); const data: TextAreaFieldData = { - label:'' + label: '' } @@ -645,9 +646,9 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements field.data = data; break; } - case this.viewTypeEnum.RichTextArea:{ + case this.viewTypeEnum.RichTextArea: { const data: RichTextAreaFieldData = { - label:'' + label: '' } @@ -655,9 +656,9 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements field.data = data; break; } - case this.viewTypeEnum.Upload:{ + case this.viewTypeEnum.Upload: { const data: UploadFieldData = { - label:'', + label: '', types: [], maxFileSizeInMB: this.configurationService.maxFileSizeInMB } @@ -677,14 +678,14 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements // field.data = data; // break; // } - case this.viewTypeEnum.DatePicker:{ + case this.viewTypeEnum.DatePicker: { // this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.DatePicker) // this.form.addControl('data', new DatePickerDataEditorModel().buildForm()); const data: DatePickerFieldData = { - label:'' + label: '' } field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.DatePicker; @@ -692,12 +693,12 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements break; } - case this.viewTypeEnum.ExternalDatasets:{ + case this.viewTypeEnum.ExternalDatasets: { // this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.ExternalDatasets) // this.form.addControl('data', new ExternalDatasetsDataEditorModel().buildForm()); const data: ExternalDatasetsFieldData = { - label:'', + label: '', multiAutoComplete: false } @@ -707,7 +708,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements break; } - case this.viewTypeEnum.DataRepositories:{ + case this.viewTypeEnum.DataRepositories: { // this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.DataRepositories) @@ -723,7 +724,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements break; } - case this.viewTypeEnum.PubRepositories:{ + case this.viewTypeEnum.PubRepositories: { const data: DataRepositoriesFieldData = { label: '', @@ -735,7 +736,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements break; } - case this.viewTypeEnum.JournalRepositories:{ + case this.viewTypeEnum.JournalRepositories: { const data: DataRepositoriesFieldData = { label: '', @@ -747,7 +748,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements break; } - case this.viewTypeEnum.Taxonomies:{ + case this.viewTypeEnum.Taxonomies: { const data: TaxonomiesFieldData = { label: '', @@ -759,7 +760,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements break; } - case this.viewTypeEnum.Licenses:{ + case this.viewTypeEnum.Licenses: { const data: LicensesFieldData = { label: '', @@ -771,7 +772,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements break; } - case this.viewTypeEnum.Publications:{ + case this.viewTypeEnum.Publications: { const data: PublicationsFieldData = { label: '', @@ -783,13 +784,13 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements break; } - case this.viewTypeEnum.Registries:{ + case this.viewTypeEnum.Registries: { // this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Registries) // this.form.addControl('data', new RegistriesDataEditorModel().buildForm()); - const data:RegistriesFieldData = { + const data: RegistriesFieldData = { label: '', multiAutoComplete: false } @@ -799,14 +800,14 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements break; } - case this.viewTypeEnum.Services:{ + case this.viewTypeEnum.Services: { // this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Services) // this.form.addControl('data', new ServicesDataEditorModel().buildForm()); - const data:ServicesFieldData = { - label:'', + const data: ServicesFieldData = { + label: '', multiAutoComplete: false } @@ -815,12 +816,12 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements break; } - case this.viewTypeEnum.Tags:{ + case this.viewTypeEnum.Tags: { // this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Tags) // this.form.addControl('data', new TagsDataEditorModel().buildForm()); const data: TagsFieldData = { - label:'' + label: '' } field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.Tags; @@ -829,7 +830,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements break; } - case this.viewTypeEnum.Researchers:{ + case this.viewTypeEnum.Researchers: { // this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Researchers) // // this.form.addControl('data', new ResearchersDataEditorModel().buildForm()); //TODO TO ASK @@ -837,8 +838,8 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements // field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.Researchers; - const data : ResearchersAutoCompleteFieldData = { - label:'', + const data: ResearchersAutoCompleteFieldData = { + label: '', multiAutoComplete: false, type: DatasetProfileInternalDmpEntitiesType.Researchers } @@ -850,15 +851,15 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements break; } - case this.viewTypeEnum.Organizations:{ + case this.viewTypeEnum.Organizations: { // this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Organizations) // this.form.addControl('data', new OrganizationsDataEditorModel().buildForm()); const data = { - autoCompleteSingleDataList:[], - label:'', + autoCompleteSingleDataList: [], + label: '', multiAutoComplete: false, } as OrganizationsFieldData; //TODO @@ -868,14 +869,14 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements break; } - case this.viewTypeEnum.DatasetIdentifier:{ + case this.viewTypeEnum.DatasetIdentifier: { // this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.DatasetIdentifier) // this.form.addControl('data', new DatasetIdentifierDataEditorModel().buildForm()); - const data : DatasetIdentifierFieldData = { - label:'' + const data: DatasetIdentifierFieldData = { + label: '' } field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.DatasetIdentifier; @@ -883,28 +884,28 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements break; } - case this.viewTypeEnum.Currency:{ + case this.viewTypeEnum.Currency: { // this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Currency) // this.form.addControl('data', new CurrencyDataEditorModel().buildForm()); const data: CurrencyFieldData = { - label:'' + label: '' } field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.Currency; field.data = data; break; } - case this.viewTypeEnum.Validation:{ + case this.viewTypeEnum.Validation: { // this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Validation) // this.form.addControl('data', new ValidationDataEditorModel().buildForm()); - const data:ValidationFieldData = { - label:'' + const data: ValidationFieldData = { + label: '' } field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.Validation; @@ -925,12 +926,12 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements const fields = this.form.parent as UntypedFormArray; let index = -1; - fields.controls.forEach((control,i)=>{ - if(this.form.get('id').value === control.get('id').value){ + fields.controls.forEach((control, i) => { + if (this.form.get('id').value === control.get('id').value) { index = i } }); - if(index>=0){ + if (index >= 0) { fields.removeAt(index); fields.insert(index, form); this.form = form; @@ -944,11 +945,11 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements } - toggleRequired(event:MatSlideToggleChange){ + toggleRequired(event: MatSlideToggleChange) { this.setValidator(ValidationType.Required, event.checked); } - toggleURL(event:MatSlideToggleChange){ + toggleURL(event: MatSlideToggleChange) { this.setValidator(ValidationType.URL, event.checked); } @@ -956,32 +957,32 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements let validationsControl = this.form.get('validations') as UntypedFormControl; let validations: Array = validationsControl.value; - if(add){ - if(!validations.includes(validationType)){ + if (add) { + if (!validations.includes(validationType)) { validations.push(validationType); validationsControl.updateValueAndValidity(); } - } else{ - validationsControl.setValue(validations.filter(validator=> validator != validationType)); + } else { + validationsControl.setValue(validations.filter(validator => validator != validationType)); validationsControl.updateValueAndValidity(); } this.form.markAsDirty();//deactivate guard } - get isRequired(){ + get isRequired() { let validationsControl = this.form.get('validations') as UntypedFormControl; let validations: Array = validationsControl.value; return validations.includes(ValidationType.Required); } - get isURL(){ + get isURL() { let validationsControl = this.form.get('validations') as UntypedFormControl; let validations: Array = validationsControl.value; return validations.includes(ValidationType.URL); } - onDelete(){ + onDelete() { this.delete.emit(); } } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts index af9184e83..7bc08888c 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts @@ -4,7 +4,7 @@ import { HttpClient, HttpErrorResponse } from '@angular/common/http'; import { Component, OnInit, QueryList, ViewChild } from '@angular/core'; import { AbstractControl, UntypedFormArray, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms'; import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; -import { MatHorizontalStepper} from '@angular/material/stepper'; +import { MatStepper} from '@angular/material/stepper'; import { ActivatedRoute, ParamMap, Router } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; import { debounceTime, filter, map, mergeMap, takeUntil, tap } from 'rxjs/operators'; @@ -77,7 +77,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent newVersionId: string; dataWizardModel: DatasetWizardModel; breadCrumbs: Observable; - @ViewChild('stepper') stepper: MatHorizontalStepper; + @ViewChild('stepper') stepper: MatStepper; viewOnly = false; nestedCount: number[] = []; nestedIndex: number = 0; diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents.ts index 9357f3e99..08945b983 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents.ts @@ -102,7 +102,7 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn if(!(element && (targetContainer ||((element.type===ToCEntryType.Page) && (targetId === this.ROOT_ID))) && (sourceContainer||((element.type===ToCEntryType.Page) && (sourceId === this.ROOT_ID))))){ // console.info('Could not find elements'); this.dataNeedsRefresh.emit(); - drake.cancel(true); + //TODO: angular update //drake.cancel(true); return; } diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts index d53569ddd..03fca64ee 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts @@ -1,68 +1,66 @@ -import {ChangeDetectorRef, Component, OnInit, ViewChild} from '@angular/core'; -import {AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup} from '@angular/forms'; -import {MatLegacyDialog as MatDialog} from '@angular/material/legacy-dialog'; -import {MatLegacySnackBar as MatSnackBar} from '@angular/material/legacy-snack-bar'; -import {ActivatedRoute, Router} from '@angular/router'; -import {DatasetStatus} from '@app/core/common/enum/dataset-status'; -import {DmpStatus} from '@app/core/common/enum/dmp-status'; -import {DataTableRequest} from '@app/core/model/data-table/data-table-request'; -import {DatasetProfileModel} from '@app/core/model/dataset/dataset-profile'; -import {DmpModel} from '@app/core/model/dmp/dmp'; -import {DmpListingModel} from '@app/core/model/dmp/dmp-listing'; -import {DatasetProfileCriteria} from '@app/core/query/dataset-profile/dataset-profile-criteria'; -import {DmpCriteria} from '@app/core/query/dmp/dmp-criteria'; -import {RequestItem} from '@app/core/query/request-item'; -import {DatasetWizardService} from '@app/core/services/dataset-wizard/dataset-wizard.service'; -import {DmpService} from '@app/core/services/dmp/dmp.service'; +import { Location } from '@angular/common'; +import { HttpClient } from '@angular/common/http'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; +import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; +import { ActivatedRoute, Router } from '@angular/router'; +import { DatasetStatus } from '@app/core/common/enum/dataset-status'; +import { DmpStatus } from '@app/core/common/enum/dmp-status'; +import { SaveType } from '@app/core/common/enum/save-type'; +import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; +import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; +import { DatasetWizardModel } from '@app/core/model/dataset/dataset-wizard'; +import { DmpModel } from '@app/core/model/dmp/dmp'; +import { DmpListingModel } from '@app/core/model/dmp/dmp-listing'; +import { LockModel } from '@app/core/model/lock/lock.model'; +import { DatasetProfileCriteria } from '@app/core/query/dataset-profile/dataset-profile-criteria'; +import { DmpCriteria } from '@app/core/query/dmp/dmp-criteria'; +import { RequestItem } from '@app/core/query/request-item'; +import { AuthService } from '@app/core/services/auth/auth.service'; +import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; +import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service'; +import { DmpService } from '@app/core/services/dmp/dmp.service'; import { ExternalSourcesConfigurationService } from '@app/core/services/external-sources/external-sources-configuration.service'; -import {ExternalSourcesService} from '@app/core/services/external-sources/external-sources.service'; +import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service'; +import { LockService } from '@app/core/services/lock/lock.service'; +import { MatomoService } from '@app/core/services/matomo/matomo-service'; import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service'; -import {SingleAutoCompleteConfiguration} from '@app/library/auto-complete/single/single-auto-complete-configuration'; +import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration'; +import { CheckDeactivateBaseComponent } from '@app/library/deactivate/deactivate.component'; +import { PopupNotificationDialogComponent } from '@app/library/notification/popup/popup-notification.component'; import { DatasetCopyDialogueComponent } from '@app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component'; -import {DatasetWizardEditorModel} from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; -import {BreadcrumbItem} from '@app/ui/misc/breadcrumb/definition/breadcrumb-item'; -import {IBreadCrumbComponent} from '@app/ui/misc/breadcrumb/definition/IBreadCrumbComponent'; -import {DatasetDescriptionFormEditorModel} from '@app/ui/misc/dataset-description-form/dataset-description-form.model'; +import { DatasetWizardEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; +import { PrefillDatasetComponent } from "@app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component"; +import { IBreadCrumbComponent } from '@app/ui/misc/breadcrumb/definition/IBreadCrumbComponent'; +import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item'; +import { DatasetDescriptionFormEditorModel } from '@app/ui/misc/dataset-description-form/dataset-description-form.model'; +import { ToCEntry, ToCEntryType } from "@app/ui/misc/dataset-description-form/dataset-description.component"; import { Link, LinkToScroll, TableOfContents } from '@app/ui/misc/dataset-description-form/tableOfContentsMaterial/table-of-contents'; -import {FormService} from '@common/forms/form-service'; +import { VisibilityRulesService } from '@app/ui/misc/dataset-description-form/visibility-rules/visibility-rules.service'; +import { isNullOrUndefined } from '@app/utilities/enhancers/utils'; +import { FormService } from '@common/forms/form-service'; import { FormValidationErrorsDialogComponent } from '@common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component'; -import {ValidationErrorModel} from '@common/forms/validation/error-model/validation-error-model'; -import {ConfirmationDialogComponent} from '@common/modules/confirmation-dialog/confirmation-dialog.component'; -import {TranslateService} from '@ngx-translate/core'; +import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model'; +import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component'; +import { Guid } from '@common/types/guid'; +import { TranslateService } from '@ngx-translate/core'; import * as FileSaver from 'file-saver'; -import {interval, Observable, of as observableOf} from 'rxjs'; -import {catchError, debounceTime, filter, map, takeUntil} from 'rxjs/operators'; -import {LockService} from '@app/core/services/lock/lock.service'; -import {Location} from '@angular/common'; -import {LockModel} from '@app/core/model/lock/lock.model'; -import {Guid} from '@common/types/guid'; -import {isNullOrUndefined} from '@app/utilities/enhancers/utils'; -import {AuthService} from '@app/core/services/auth/auth.service'; -import {ConfigurationService} from '@app/core/services/configuration/configuration.service'; -import {SaveType} from '@app/core/common/enum/save-type'; -import {DatasetWizardModel} from '@app/core/model/dataset/dataset-wizard'; -import {MatomoService} from '@app/core/services/matomo/matomo-service'; -import {HttpClient} from '@angular/common/http'; -import {VisibilityRulesService} from '@app/ui/misc/dataset-description-form/visibility-rules/visibility-rules.service'; -import {PopupNotificationDialogComponent} from '@app/library/notification/popup/popup-notification.component'; -import {CheckDeactivateBaseComponent} from '@app/library/deactivate/deactivate.component'; -import {PrefillDatasetComponent} from "@app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component"; -import {ToCEntry, ToCEntryType} from "@app/ui/misc/dataset-description-form/dataset-description.component"; -import {dispatchFakeEvent} from "@angular/cdk/testing/testbed/fake-events"; -import { DmpDatasetProfile } from '@app/core/model/dmp/dmp-dataset-profile/dmp-dataset-profile'; +import { Observable, interval, of as observableOf } from 'rxjs'; +import { catchError, debounceTime, filter, map, takeUntil } from 'rxjs/operators'; @Component({ selector: 'app-dataset-wizard-component', @@ -196,63 +194,63 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme this.datasetWizardService.getSingle(this.itemId) .pipe(takeUntil(this._destroyed)) .subscribe(data => { - this.lockService.checkLockStatus(data.id).pipe(takeUntil(this._destroyed)).subscribe(lockStatus => { - this.lockStatus = lockStatus; - this.datasetWizardModel = new DatasetWizardEditorModel().fromModel(data); - this.dmpSectionIndex = this.datasetWizardModel.dmpSectionIndex; - this.needsUpdate(); - this.breadCrumbs = observableOf([ - { - parentComponentName: null, - label: this.datasetWizardModel.label, - url: '/datasets/edit/' + this.datasetWizardModel.id, - notFoundResolver: [ - { - parentComponentName: null, - label: this.language.instant('NAV-BAR.MY-DATASET-DESCRIPTIONS').toUpperCase(), - url: '/datasets' - }, - ] - }]); - this.formGroup = this.datasetWizardModel.buildForm(); - let profiles = this.datasetWizardModel.dmp.profiles.filter(profile => profile.data.dmpSectionIndex.includes(this.datasetWizardModel.dmpSectionIndex)); - for(var profile of profiles){ - this.availableDescriptionTemplates.push({id: profile.descriptionTemplateId, label: profile.label, description: ""}) - } - this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue())); - this.editMode = this.datasetWizardModel.status === DatasetStatus.Draft; - if (this.datasetWizardModel.status === DatasetStatus.Finalized || lockStatus) { - this.formGroup.disable(); - this.viewOnly = true; - } - if (!lockStatus && !isNullOrUndefined(this.authService.current())) { - this.lock = new LockModel(data.id, this.authService.current()); + this.lockService.checkLockStatus(data.id).pipe(takeUntil(this._destroyed)).subscribe(lockStatus => { + this.lockStatus = lockStatus; + this.datasetWizardModel = new DatasetWizardEditorModel().fromModel(data); + this.dmpSectionIndex = this.datasetWizardModel.dmpSectionIndex; + this.needsUpdate(); + this.breadCrumbs = observableOf([ + { + parentComponentName: null, + label: this.datasetWizardModel.label, + url: '/datasets/edit/' + this.datasetWizardModel.id, + notFoundResolver: [ + { + parentComponentName: null, + label: this.language.instant('NAV-BAR.MY-DATASET-DESCRIPTIONS').toUpperCase(), + url: '/datasets' + }, + ] + }]); + this.formGroup = this.datasetWizardModel.buildForm(); + let profiles = this.datasetWizardModel.dmp.profiles.filter(profile => profile.data.dmpSectionIndex.includes(this.datasetWizardModel.dmpSectionIndex)); + for (var profile of profiles) { + this.availableDescriptionTemplates.push({ id: profile.descriptionTemplateId, label: profile.label, description: "" }) + } + this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue())); + this.editMode = this.datasetWizardModel.status === DatasetStatus.Draft; + if (this.datasetWizardModel.status === DatasetStatus.Finalized || lockStatus) { + this.formGroup.disable(); + this.viewOnly = true; + } + if (!lockStatus && !isNullOrUndefined(this.authService.current())) { + this.lock = new LockModel(data.id, this.authService.current()); - this.lockService.createOrUpdate(this.lock).pipe(takeUntil(this._destroyed)).subscribe(async result => { - this.lock.id = Guid.parse(result); - interval(this.configurationService.lockInterval).pipe(takeUntil(this._destroyed)).subscribe(() => this.pumpLock()); - }); - } - // if (this.viewOnly) { this.formGroup.disable(); } // For future use, to make Dataset edit like DMP. - this.loadDatasetProfiles(); - this.registerFormListeners(); + this.lockService.createOrUpdate(this.lock).pipe(takeUntil(this._destroyed)).subscribe(async result => { + this.lock.id = Guid.parse(result); + interval(this.configurationService.lockInterval).pipe(takeUntil(this._destroyed)).subscribe(() => this.pumpLock()); + }); + } + // if (this.viewOnly) { this.formGroup.disable(); } // For future use, to make Dataset edit like DMP. + this.loadDatasetProfiles(); + this.registerFormListeners(); - if (lockStatus) { - this.dialog.open(PopupNotificationDialogComponent, { - data: { - title: this.language.instant('DATASET-WIZARD.LOCKED.TITLE'), - message: this.language.instant('DATASET-WIZARD.LOCKED.MESSAGE') - }, maxWidth: '30em' - }); - } - if(this.finalize && !this.lockStatus && !this.viewOnly) { - setTimeout(() => { - this.saveFinalize(); - }, 0); - } - // this.availableProfiles = this.datasetWizardModel.dmp.profiles; - }); - }, + if (lockStatus) { + this.dialog.open(PopupNotificationDialogComponent, { + data: { + title: this.language.instant('DATASET-WIZARD.LOCKED.TITLE'), + message: this.language.instant('DATASET-WIZARD.LOCKED.MESSAGE') + }, maxWidth: '30em' + }); + } + if (this.finalize && !this.lockStatus && !this.viewOnly) { + setTimeout(() => { + this.saveFinalize(); + }, 0); + } + // this.availableProfiles = this.datasetWizardModel.dmp.profiles; + }); + }, error => { switch (error.status) { case 403: @@ -278,8 +276,8 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme this.datasetWizardModel.dmpSectionIndex = this.dmpSectionIndex; this.formGroup = this.datasetWizardModel.buildForm(); let profiles = this.datasetWizardModel.dmp.profiles.filter(profile => profile.data.dmpSectionIndex.includes(this.dmpSectionIndex)); - for(var profile of profiles){ - this.availableDescriptionTemplates.push({id: profile.descriptionTemplateId, label: profile.label, description: ""}) + for (var profile of profiles) { + this.availableDescriptionTemplates.push({ id: profile.descriptionTemplateId, label: profile.label, description: "" }) } this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue())); this.editMode = this.datasetWizardModel.status === DatasetStatus.Draft; @@ -295,7 +293,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme panelClass: 'custom-modalbox' }); dialogRef.afterClosed().subscribe(result => { - if(result) { + if (result) { this.datasetWizardModel = this.datasetWizardModel.fromModel(result); this.datasetWizardModel.dmp = data; this.datasetWizardModel.dmpSectionIndex = this.dmpSectionIndex; @@ -393,11 +391,11 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme this.isNew = false; this.datasetWizardService.getSinglePublic(this.publicId) .pipe(takeUntil(this._destroyed)).pipe( - catchError((error: any) => { - this.uiNotificationService.snackBarNotification(error.error.message, SnackBarNotificationLevel.Error); - this.router.navigate(['/datasets/publicEdit/' + this.publicId]); - return observableOf(null); - })) + catchError((error: any) => { + this.uiNotificationService.snackBarNotification(error.error.message, SnackBarNotificationLevel.Error); + this.router.navigate(['/datasets/publicEdit/' + this.publicId]); + return observableOf(null); + })) .subscribe(data => { if (data) { this.datasetWizardModel = new DatasetWizardEditorModel().fromModel(data); @@ -567,7 +565,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme searchDmp(query: string): Observable { const fields: Array = new Array(); fields.push('-created'); - const dmpDataTableRequest: DataTableRequest = new DataTableRequest(0, null, {fields: fields}); + const dmpDataTableRequest: DataTableRequest = new DataTableRequest(0, null, { fields: fields }); dmpDataTableRequest.criteria = new DmpCriteria(); dmpDataTableRequest.criteria.like = query; dmpDataTableRequest.criteria.status = DmpStatus.Draft; @@ -698,12 +696,12 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme this.hasChanges = false; this.datasetIsOnceSaved = true; this.onCallbackSuccess(data, saveType); - if(onSuccess) { + if (onSuccess) { onSuccess(); } }, error => { - if(onError) { + if (onError) { onError(); } this.onCallbackError(error) @@ -721,9 +719,9 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme else if (key === 'email') { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.EMAIL')); } else if (key === 'min') { - errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.MIN-VALUE', {'min': formControl.getError('min').min})); + errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.MIN-VALUE', { 'min': formControl.getError('min').min })); } else if (key === 'max') { - errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.MAX-VALUE', {'max': formControl.getError('max').max})); + errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.MAX-VALUE', { 'max': formControl.getError('max').max })); } else { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + formControl.errors[key].message); } @@ -878,27 +876,27 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme filter(x => x), takeUntil(this._destroyed) ).subscribe(result => { - if (result) { - // if (!this.isFormValid()) { return; } - this.formGroup.get('status').setValue(DatasetStatus.Draft); - this.submit(SaveType.finalize, () => { - this.viewOnly = false; - this.datasetWizardModel.status = DatasetStatus.Draft; - setTimeout(x => { - this.formGroup = null; + if (result) { + // if (!this.isFormValid()) { return; } + this.formGroup.get('status').setValue(DatasetStatus.Draft); + this.submit(SaveType.finalize, () => { + this.viewOnly = false; + this.datasetWizardModel.status = DatasetStatus.Draft; + setTimeout(x => { + this.formGroup = null; + }); + setTimeout(x => { + this.formGroup = this.datasetWizardModel.buildForm(); + this.registerFormListeners(); + }); + }, () => { + this.formGroup.get('status').setValue(DatasetStatus.Finalized); + this.viewOnly = true; }); - setTimeout(x => { - this.formGroup = this.datasetWizardModel.buildForm(); - this.registerFormListeners(); - }); - }, () => { - this.formGroup.get('status').setValue(DatasetStatus.Finalized); - this.viewOnly = true; - }); - } else { - this.saving = false; - } - }); + } else { + this.saving = false; + } + }); } @@ -983,7 +981,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme document.getElementById('stepper-options').scrollTop = this.tocScrollTop; }, 500); this.saving = false; - if(this.isNew) { + if (this.isNew) { this.reloadDateset(this.datasetWizardModel.id); } // this.router.navigate(['/reload']).then(() => { this.router.navigate(['/datasets', 'edit', data.id]); }); @@ -1014,7 +1012,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme this.datasetWizardService.downloadPDF(id) .pipe(takeUntil(this._destroyed)) .subscribe(response => { - const blob = new Blob([response.body], {type: 'application/pdf'}); + const blob = new Blob([response.body], { type: 'application/pdf' }); const filename = this.getFilenameFromContentDispositionHeader(response.headers.get('Content-Disposition')); FileSaver.saveAs(blob, filename); @@ -1026,7 +1024,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme this.datasetWizardService.downloadDOCX(id) .pipe(takeUntil(this._destroyed)) .subscribe(response => { - const blob = new Blob([response.body], {type: 'application/msword'}); + const blob = new Blob([response.body], { type: 'application/msword' }); const filename = this.getFilenameFromContentDispositionHeader(response.headers.get('Content-Disposition')); FileSaver.saveAs(blob, filename); @@ -1039,7 +1037,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme this.datasetWizardService.downloadXML(id) .pipe(takeUntil(this._destroyed)) .subscribe(response => { - const blob = new Blob([response.body], {type: 'application/xml'}); + const blob = new Blob([response.body], { type: 'application/xml' }); const filename = this.getFilenameFromContentDispositionHeader(response.headers.get('Content-Disposition')); FileSaver.saveAs(blob, filename); @@ -1160,7 +1158,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme .subscribe(result => { if (result && result.datasetProfileExist) { const newDmpId = result.formControl.value.id - this.router.navigate(['/datasets/copy/' + result.datasetId], {queryParams: {newDmpId: newDmpId}}); + this.router.navigate(['/datasets/copy/' + result.datasetId], { queryParams: { newDmpId: newDmpId } }); } }); } @@ -1212,9 +1210,9 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme getEntryVisibleFieldSets(entry: ToCEntry): ToCEntry[] { let fieldSets = []; - if(entry.type === ToCEntryType.FieldSet && !this.table0fContents.internalTable.hiddenEntries.find(hiddenEntry => hiddenEntry === entry.id)) { + if (entry.type === ToCEntryType.FieldSet && !this.table0fContents.internalTable.hiddenEntries.find(hiddenEntry => hiddenEntry === entry.id)) { fieldSets.push(entry); - } else if(entry.type !== ToCEntryType.FieldSet) { + } else if (entry.type !== ToCEntryType.FieldSet) { entry.subEntries.forEach(subEntry => { fieldSets = fieldSets.concat(this.getEntryVisibleFieldSets(subEntry)); }); @@ -1222,13 +1220,13 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme return fieldSets; } - get visibleFieldSets(): ToCEntry[]{ + get visibleFieldSets(): ToCEntry[] { let fieldSets = []; - let arrays= this.table0fContents?this.table0fContents.tocentries. - filter(entry => !this.table0fContents.internalTable.hiddenEntries.find(hiddenEntry => hiddenEntry === entry.id)).map(entry => { - return this.getEntryVisibleFieldSets(entry); + let arrays = this.table0fContents ? this.table0fContents.tocentries. + filter(entry => !this.table0fContents.internalTable.hiddenEntries.find(hiddenEntry => hiddenEntry === entry.id)).map(entry => { + return this.getEntryVisibleFieldSets(entry); }) - :[]; + : []; arrays.forEach(array => { fieldSets = fieldSets.concat(array); }); @@ -1236,11 +1234,11 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme } getFirstFieldSet(entry: ToCEntry): ToCEntry { - if(entry.type === ToCEntryType.FieldSet && !this.table0fContents.internalTable.hiddenEntries.find(hiddenEntry => hiddenEntry === entry.id)) { + if (entry.type === ToCEntryType.FieldSet && !this.table0fContents.internalTable.hiddenEntries.find(hiddenEntry => hiddenEntry === entry.id)) { return entry; } else { let subEntries = entry.subEntries.filter(subEntry => !this.table0fContents.internalTable.hiddenEntries.find(hiddenEntry => hiddenEntry === subEntry.id)); - if(subEntries.length > 0) { + if (subEntries.length > 0) { return this.getFirstFieldSet(subEntries[0]); } else { return null; @@ -1249,11 +1247,11 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme } public changeStep(selected: ToCEntry = null, execute: boolean = true) { - if(execute) { - if(selected) { + if (execute) { + if (selected) { let fieldSet = this.getFirstFieldSet(selected); let index = this.visibleFieldSets.findIndex(entry => entry.id === fieldSet.id); - this.step = index + (selected.type === ToCEntryType.FieldSet?1:0.5); + this.step = index + (selected.type === ToCEntryType.FieldSet ? 1 : 0.5); } else { this.step = 0; this.resetScroll(); @@ -1277,7 +1275,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme public previousStep() { if (this.step > 0) { this.step = Math.ceil(this.step - 1); - if(this.step >= 1) { + if (this.step >= 1) { let entry = this.visibleFieldSets[this.step - 1]; this.table0fContents.onToCentrySelected(entry, false); this.scroll(entry); diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/dataset-external-references-editor.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/dataset-external-references-editor.component.ts index 56323b09e..a2ca711c8 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/dataset-external-references-editor.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/dataset-external-references-editor.component.ts @@ -23,7 +23,7 @@ import { TranslateService } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { takeUntil, map } from 'rxjs/operators'; import { ENTER, COMMA } from '@angular/cdk/keycodes'; -import { MatLegacyChipInputEvent as MatChipInputEvent } from '@angular/material/legacy-chips'; +import { MatChipInputEvent } from '@angular/material/chips'; import { isNullOrUndefined } from '@app/utilities/enhancers/utils'; import { ExternalDataRepositoryService } from '@app/core/services/external-sources/data-repository/extternal-data-repository.service'; import { ExternalDatasetService } from '@app/core/services/external-sources/dataset/external-dataset.service'; diff --git a/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts index c085fb846..ab0ce30c0 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts @@ -3,7 +3,7 @@ import { OnInit, Component, Input, Output, EventEmitter } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service'; -import { MatLegacyChipInputEvent as MatChipInputEvent } from '@angular/material/legacy-chips'; +import { MatChipInputEvent } from '@angular/material/chips'; import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service'; diff --git a/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation-dialog.component.ts index d8fa4c484..e08b80b8e 100644 --- a/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation-dialog.component.ts @@ -2,7 +2,7 @@ import { COMMA, ENTER } from '@angular/cdk/keycodes'; import { Component, Inject, OnInit, ViewChild } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatLegacyChipInputEvent as MatChipInputEvent } from '@angular/material/legacy-chips'; +import { MatChipInputEvent } from '@angular/material/chips'; import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; import { ActivatedRoute, Router } from '@angular/router'; import { DmpInvitation } from '@app/core/model/dmp/invitation/dmp-invitation'; diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.ts index 45b7c7a0f..c76424be7 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.ts @@ -29,7 +29,7 @@ import { ServiceCriteria } from '@app/core/query/service/service-criteria'; import { TagCriteria } from '@app/core/query/tag/tag-criteria'; import { isNullOrUndefined } from '@app/utilities/enhancers/utils'; import { ExternalTagEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; -import { MatLegacyChipInputEvent as MatChipInputEvent } from '@angular/material/legacy-chips'; +import { MatChipInputEvent } from '@angular/material/chips'; import { ENTER, COMMA } from '@angular/cdk/keycodes'; import { DatasetIdModel } from '@app/core/model/dataset/dataset-id.model'; import { LocalFetchModel } from '@app/core/model/local-fetch/local-fetch.model'; diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.component.ts index 67ad4fdfe..733d281e9 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.component.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.component.ts @@ -1,6 +1,6 @@ import { AfterViewInit, Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatHorizontalStepper } from '@angular/material/stepper'; +import { MatStepper } from '@angular/material/stepper'; import { Rule } from '@app/core/model/dataset-profile-definition/rule'; import { LinkToScroll } from '@app/ui/misc/dataset-description-form/tableOfContentsMaterial/table-of-contents'; import { VisibilityRulesService } from '@app/ui/misc/dataset-description-form/visibility-rules/visibility-rules.service'; @@ -13,7 +13,7 @@ import { BaseComponent } from '@common/base/base.component'; }) export class DatasetDescriptionFormComponent extends BaseComponent implements OnInit, AfterViewInit, OnChanges { - @ViewChild('stepper') stepper: MatHorizontalStepper; + @ViewChild('stepper') stepper: MatStepper; @Input() path: string; @Input() form: UntypedFormGroup; @Input() visibilityRules: Rule[] = []; diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description.component.ts index 09fb2bf26..174aa4313 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description.component.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description.component.ts @@ -1,7 +1,7 @@ import { AfterViewInit, Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild, Output, EventEmitter } from '@angular/core'; import { AbstractControl, AbstractControlOptions, UntypedFormArray, UntypedFormGroup } from '@angular/forms'; import { MatExpansionPanel } from '@angular/material/expansion'; -import { MatHorizontalStepper } from '@angular/material/stepper'; +import { MatStepper } from '@angular/material/stepper'; import { CompositeField } from '@app/core/model/dataset-profile-definition/composite-field'; import { Field } from '@app/core/model/dataset-profile-definition/field'; import { Rule } from '@app/core/model/dataset-profile-definition/rule'; @@ -19,7 +19,7 @@ import { VisibilityRuleSource } from './visibility-rules/models/visibility-rule- }) export class DatasetDescriptionComponent extends BaseComponent implements OnInit, AfterViewInit, OnChanges { - // @ViewChild('stepper', { static: false }) stepper: MatHorizontalStepper; + // @ViewChild('stepper', { static: false }) stepper: MatStepper; @Input() path: string; @Input() visibilityRules: Rule[] = []; @Input() datasetProfileId: String; diff --git a/dmp-frontend/src/assets/scss/core/_buttons.scss b/dmp-frontend/src/assets/scss/core/_buttons.scss index 489a4d783..d5bc732c7 100644 --- a/dmp-frontend/src/assets/scss/core/_buttons.scss +++ b/dmp-frontend/src/assets/scss/core/_buttons.scss @@ -14,7 +14,7 @@ cursor: pointer; background-color: transparent; border: 0; - border-radius: $border-radius-sm; + //TODO: angular update border-radius: $border-radius-sm; outline: 0; transition: box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1); will-change: box-shadow, transform; diff --git a/dmp-frontend/src/assets/scss/material-dashboard.scss b/dmp-frontend/src/assets/scss/material-dashboard.scss index 73990a596..a052ec24d 100644 --- a/dmp-frontend/src/assets/scss/material-dashboard.scss +++ b/dmp-frontend/src/assets/scss/material-dashboard.scss @@ -47,7 +47,8 @@ $custom-theme: mat.define-light-theme($custom-theme-primary, $custom-theme-accen @import "core/variables"; @import "core/mixins"; -@import "~bootstrap/scss/bootstrap"; +//Material-Bootstrap configuration +//TODO: angular update @import "assets/scss/bootstrap-material"; // Core Components @import "core/buttons"; diff --git a/dmp-frontend/src/common/forms/validation/custom-validator.ts b/dmp-frontend/src/common/forms/validation/custom-validator.ts index 1ca4dec4b..e8db1e8af 100644 --- a/dmp-frontend/src/common/forms/validation/custom-validator.ts +++ b/dmp-frontend/src/common/forms/validation/custom-validator.ts @@ -39,13 +39,13 @@ export function DateValidator(): ValidatorFn { let monthParsed: number = null; let dayParsed: number = null; - if (!isNullOrUndefined(yearString) && yearString.length === 4 && Number(yearString) !== NaN) { + if (!isNullOrUndefined(yearString) && yearString.length === 4 && !Number.isNaN(Number(yearString))) { yearParsed = Number(yearString); } - if (!isNullOrUndefined(monthString) && monthString.length > 0 && Number(monthString) !== NaN) { + if (!isNullOrUndefined(monthString) && monthString.length > 0 && !Number.isNaN(Number(monthString))) { monthParsed = Number(monthString); } - if (!isNullOrUndefined(dayString) && dayString.length > 0 && Number(dayString) !== NaN) { + if (!isNullOrUndefined(dayString) && dayString.length > 0 && !Number.isNaN(Number(dayString))) { dayParsed = Number(dayString); } diff --git a/dmp-frontend/src/polyfills.ts b/dmp-frontend/src/polyfills.ts index c921fb830..811edbf88 100644 --- a/dmp-frontend/src/polyfills.ts +++ b/dmp-frontend/src/polyfills.ts @@ -18,10 +18,10 @@ * BROWSER POLYFILLS */ -import 'core-js/es7/array'; +//TODO: angular update import 'core-js/es7/array'; /** Evergreen browsers require these. **/ -import 'core-js/es6/reflect'; +//TODO: angular update import 'core-js/es6/reflect'; diff --git a/dmp-frontend/src/styles.scss b/dmp-frontend/src/styles.scss index 863c6661b..f855b65bb 100644 --- a/dmp-frontend/src/styles.scss +++ b/dmp-frontend/src/styles.scss @@ -2,15 +2,15 @@ @import "@angular/material/theming"; // @import '../node_modules/@angular/material/theming'; @import "@angular/material/prebuilt-themes/indigo-pink.css"; -// Material-Bootstrap configuration -@import "~bootstrap/scss/bootstrap"; +@import "~bootstrap/dist/css/bootstrap.css"; + +//Material-Bootstrap configuration +@import "assets/scss/bootstrap-material"; // Guided Tour style @import '../node_modules/ngx-guided-tour/scss/guided-tour-base-theme.scss'; -@import '../node_modules/dragula/dist/dragula.css'; - - +//TODO: angular update @import '../node_modules/dragula/dist/dragula.css'; /* in-flight clone */ .gu-mirror { position: fixed !important; From 922c2110ac316fb0525bb60ab8a0bd0ea3568a47 Mon Sep 17 00:00:00 2001 From: Diamantis Tziotzios Date: Fri, 6 Oct 2023 11:10:53 +0300 Subject: [PATCH 4/4] angular update fixes --- dmp-frontend/angular.json | 1 + dmp-frontend/src/app/app.module.ts | 2 +- .../app/core/services/auth/auth.service.ts | 2 +- .../multiple-auto-complete.component.ts | 30 +- .../single/single-auto-complete.component.ts | 8 +- .../deactivate/can-deactivate.guard.ts | 2 +- .../export-method-dialog.component.ts | 2 +- .../notification/notification.component.ts | 4 +- .../popup/popup-notification.component.ts | 2 +- .../snack-bar-notification.component.ts | 2 +- ...file-editor-composite-field.component.html | 14 +- ...rofile-editor-composite-field.component.ts | 4 +- ...t-profile-editor-upload-field.component.ts | 59 ++-- .../dataset-profile-editor-field.component.ts | 4 +- .../dataset-profile-editor.component.html | 2 +- .../dataset-profile-editor.component.ts | 4 +- .../criteria/dataset-profile.component.ts | 2 +- ...-confirmation-upload-profiles.component.ts | 2 +- .../dataset-profile-listing.component.ts | 34 +- .../table-of-contents/table-of-contents.ts | 333 +++++++++--------- .../description-type-editor.component.html | 2 +- .../listing/description-types.component.ts | 7 +- .../editor/dmp-profile-editor.component.ts | 2 +- ...-confirmation-upload-profiles.component.ts | 2 +- .../dmp-profile-criteria.component.ts | 2 +- .../listing/dmp-profile-listing.component.ts | 116 +++--- .../user/listing/user-listing.component.ts | 23 +- .../contact-dialog.component.ts | 2 +- .../app/ui/dashboard/dashboard.component.ts | 2 +- .../ui/dashboard/drafts/drafts.component.ts | 2 +- .../quick-wizard-create-add.component.ts | 2 +- .../recent-edited-activity.component.ts | 2 +- ...ecent-edited-dataset-activity.component.ts | 2 +- .../recent-edited-dmp-activity.component.ts | 2 +- .../dataset-create-wizard.component.ts | 2 +- .../dataset-copy-dialogue.component.ts | 2 +- .../dataset-editor.component.ts | 2 +- .../dataset-wizard.component.ts | 4 +- ...et-external-references-editor.component.ts | 2 +- ...data-repository-dialog-editor.component.ts | 2 +- ...xternal-dataset-dialog-editor.component.ts | 2 +- ...ternal-registry-dialog-editor.component.ts | 2 +- ...xternal-service-dialog-editor.component.ts | 2 +- .../prefill-dataset.component.ts | 72 ++-- .../dataset-criteria-dialog.component.ts | 8 +- .../criteria/dataset-criteria.component.ts | 4 +- .../dataset-upload-dialogue.component.ts | 2 +- .../listing/dataset-listing.component.ts | 64 ++-- .../dataset-listing-item.component.ts | 2 +- .../overview/dataset-overview.component.ts | 2 +- .../clone-dialog/clone-dialog.component.ts | 19 +- .../app/ui/dmp/clone/dmp-clone.component.ts | 2 +- .../dataset-preview-dialog.component.ts | 2 +- .../dmp-editor-blueprint.component.ts | 2 +- .../dmp-to-dataset-dialog.component.ts | 2 +- .../add-organization.component.ts | 2 +- .../add-researcher.component.ts | 2 +- .../available-profiles.component.ts | 2 +- .../add-cost/add-cost.component.ts | 2 +- .../dataset-editor-details.component.ts | 4 +- .../dataset-info/dataset-info.component.ts | 2 +- .../dmp-deposit-dropdown.component.ts | 2 +- .../app/ui/dmp/editor/dmp-editor.component.ts | 2 +- .../dmp-finalize-dialog.component.ts | 2 +- .../general-tab/general-tab.component.ts | 2 +- .../license-info/license-info.component.ts | 2 +- .../editor/main-info/main-info.component.ts | 2 +- .../editor/people-tab/people-tab.component.ts | 2 +- .../dmp-invitation-dialog.component.ts | 2 +- .../criteria/dmp-criteria-dialog.component.ts | 2 +- .../criteria/dmp-criteria.component.ts | 2 +- .../ui/dmp/listing/dmp-listing.component.ts | 30 +- .../dmp-listing-item.component.ts | 2 +- .../dmp-upload-dialogue.component.ts | 2 +- .../ui/dmp/overview/dmp-overview.component.ts | 2 +- .../start-new-dataset-dialog.component.ts | 2 +- .../start-new-dmp-dialog.component.ts | 2 +- .../app/ui/dmp/wizard/dmp-wizard.component.ts | 2 +- .../editor/dmp-wizard-editor.component.ts | 2 +- .../dmp-wizard-dataset-listing.component.ts | 4 +- .../app/ui/faq/dialog/faq-dialog.component.ts | 2 +- .../dialog/glossary-dialog.component.ts | 2 +- .../dialog/language-dialog.component.ts | 2 +- .../form-composite-field-dialog.component.ts | 2 +- .../form-composite-field.component.ts | 2 +- .../form-field/form-field.component.ts | 2 +- .../misc/navigation/navigation.component.ts | 2 +- .../user-dialog/user-dialog.component.ts | 2 +- .../oauth2-dialog/oauth2-dialog.component.ts | 2 +- .../src/app/ui/navbar/navbar.component.ts | 4 +- .../dmp-editor/dmp-editor-wizard.component.ts | 2 +- .../grant-editor-wizard.component.ts | 2 +- .../quick-wizard-editor.component.ts | 4 +- .../sidebar-footer.component.ts | 2 +- .../src/app/ui/sidebar/sidebar.component.ts | 2 +- .../dialog/user-guide-dialog.component.ts | 2 +- .../add-account-dialog.component.ts | 2 +- .../ui/user-profile/user-profile.component.ts | 2 +- .../src/assets/scss/core/_buttons.scss | 8 +- dmp-frontend/src/assets/scss/core/_forms.scss | 2 + .../src/assets/scss/core/mixins/_buttons.scss | 5 +- .../src/assets/scss/core/variables/_type.scss | 12 +- .../src/assets/scss/material-dashboard.scss | 3 +- ...form-validation-errors-dialog.component.ts | 2 +- .../pending-form-changes-guard.service.ts | 2 +- .../response-payload.interceptor.ts | 2 +- .../src/common/material/material.module.ts | 46 +-- .../confirmation-dialog.component.ts | 2 +- .../multiple-choice-dialog.component.ts | 2 +- .../multiple-choice-dialog.module.ts | 11 +- 110 files changed, 548 insertions(+), 553 deletions(-) diff --git a/dmp-frontend/angular.json b/dmp-frontend/angular.json index 7b6d198f6..e2dba7c01 100644 --- a/dmp-frontend/angular.json +++ b/dmp-frontend/angular.json @@ -23,6 +23,7 @@ ], "styles": [ "src/styles.scss", + "src/assets/scss/material-dashboard.scss", "src/assets/css/demo.css", "node_modules/cookieconsent/build/cookieconsent.min.css" ], diff --git a/dmp-frontend/src/app/app.module.ts b/dmp-frontend/src/app/app.module.ts index 67616a71b..4ae3e7125 100644 --- a/dmp-frontend/src/app/app.module.ts +++ b/dmp-frontend/src/app/app.module.ts @@ -4,7 +4,7 @@ import { LOCALE_ID, NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { MAT_MOMENT_DATE_FORMATS, MatMomentDateModule } from '@angular/material-moment-adapter'; import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core'; -import { MAT_LEGACY_FORM_FIELD_DEFAULT_OPTIONS as MAT_FORM_FIELD_DEFAULT_OPTIONS, MatLegacyFormFieldDefaultOptions as MatFormFieldDefaultOptions } from '@angular/material/legacy-form-field'; +import { MAT_FORM_FIELD_DEFAULT_OPTIONS, MatFormFieldDefaultOptions } from '@angular/material/form-field'; import { BrowserModule, Title } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { AppRoutingModule } from '@app/app-routing.module'; diff --git a/dmp-frontend/src/app/core/services/auth/auth.service.ts b/dmp-frontend/src/app/core/services/auth/auth.service.ts index 8beb72c64..53355056d 100644 --- a/dmp-frontend/src/app/core/services/auth/auth.service.ts +++ b/dmp-frontend/src/app/core/services/auth/auth.service.ts @@ -1,7 +1,7 @@ import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { Router } from '@angular/router'; import { Credential } from '@app/core/model/auth/credential'; import { LoginInfo } from '@app/core/model/auth/login-info'; diff --git a/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.ts b/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.ts index 272f1bd44..7e7ea3d1a 100644 --- a/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.ts +++ b/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.ts @@ -1,5 +1,5 @@ -import {FocusMonitor} from '@angular/cdk/a11y'; -import {BACKSPACE, ENTER} from '@angular/cdk/keycodes'; +import { FocusMonitor } from '@angular/cdk/a11y'; +import { BACKSPACE, ENTER } from '@angular/cdk/keycodes'; import { Component, DoCheck, @@ -16,19 +16,19 @@ import { TemplateRef, ViewChild } from '@angular/core'; -import {ControlValueAccessor, FormGroupDirective, NgControl, NgForm} from '@angular/forms'; +import { ControlValueAccessor, FormGroupDirective, NgControl, NgForm } from '@angular/forms'; +import { MatAutocomplete, MatAutocompleteSelectedEvent, MatAutocompleteTrigger } from '@angular/material/autocomplete'; import { MatChipInputEvent } from '@angular/material/chips'; -import {ErrorStateMatcher, mixinErrorState} from '@angular/material/core'; -import {MatLegacyAutocomplete as MatAutocomplete, MatLegacyAutocompleteSelectedEvent as MatAutocompleteSelectedEvent, MatLegacyAutocompleteTrigger as MatAutocompleteTrigger} from '@angular/material/legacy-autocomplete'; -import {MatLegacyFormFieldControl as MatFormFieldControl} from '@angular/material/legacy-form-field'; -import {AutoCompleteGroup} from '@app/library/auto-complete/auto-complete-group'; +import { ErrorStateMatcher, mixinErrorState } from '@angular/material/core'; +import { MatFormFieldControl } from '@angular/material/form-field'; +import { AutoCompleteGroup } from '@app/library/auto-complete/auto-complete-group'; import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration'; -import {BaseComponent} from '@common/base/base.component'; -import {isNullOrUndefined} from '@swimlane/ngx-datatable'; -import {BehaviorSubject, combineLatest, Observable, of as observableOf, Subject, Subscription} from 'rxjs'; -import {debounceTime, distinctUntilChanged, map, startWith, takeUntil, switchMap, tap} from 'rxjs/operators'; +import { BaseComponent } from '@common/base/base.component'; +import { isNullOrUndefined } from '@swimlane/ngx-datatable'; +import { BehaviorSubject, Observable, Subject, Subscription, combineLatest, of as observableOf } from 'rxjs'; +import { debounceTime, distinctUntilChanged, map, startWith, switchMap, takeUntil, tap } from 'rxjs/operators'; export class CustomComponentBase extends BaseComponent { constructor( @@ -48,14 +48,14 @@ export const _CustomComponentMixinBase = mixinErrorState(CustomComponentBase); selector: 'app-multiple-auto-complete', templateUrl: './multiple-auto-complete.component.html', styleUrls: ['./multiple-auto-complete.component.scss'], - providers: [{provide: MatFormFieldControl, useExisting: MultipleAutoCompleteComponent}] + providers: [{ provide: MatFormFieldControl, useExisting: MultipleAutoCompleteComponent }] }) export class MultipleAutoCompleteComponent extends _CustomComponentMixinBase implements OnInit, MatFormFieldControl, ControlValueAccessor, OnDestroy, DoCheck, OnChanges { static nextId = 0; - @ViewChild('autocomplete', {static: true}) autocomplete: MatAutocomplete; - @ViewChild('autocompleteTrigger', {static: true}) autocompleteTrigger: MatAutocompleteTrigger; - @ViewChild('autocompleteInput', {static: true}) autocompleteInput: ElementRef; + @ViewChild('autocomplete', { static: true }) autocomplete: MatAutocomplete; + @ViewChild('autocompleteTrigger', { static: true }) autocompleteTrigger: MatAutocompleteTrigger; + @ViewChild('autocompleteInput', { static: true }) autocompleteInput: ElementRef; @Input() get configuration(): MultipleAutoCompleteConfiguration { diff --git a/dmp-frontend/src/app/library/auto-complete/single/single-auto-complete.component.ts b/dmp-frontend/src/app/library/auto-complete/single/single-auto-complete.component.ts index 4c91fcaac..36f7b89f6 100644 --- a/dmp-frontend/src/app/library/auto-complete/single/single-auto-complete.component.ts +++ b/dmp-frontend/src/app/library/auto-complete/single/single-auto-complete.component.ts @@ -2,14 +2,14 @@ import { FocusMonitor } from '@angular/cdk/a11y'; import { ENTER } from '@angular/cdk/keycodes'; import { Component, DoCheck, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Optional, Output, Self, SimpleChanges, TemplateRef, ViewChild } from '@angular/core'; import { ControlValueAccessor, FormGroupDirective, NgControl, NgForm } from '@angular/forms'; -import { MatLegacyAutocomplete as MatAutocomplete, MatLegacyAutocompleteSelectedEvent as MatAutocompleteSelectedEvent, MatLegacyAutocompleteTrigger as MatAutocompleteTrigger } from '@angular/material/legacy-autocomplete'; +import { MatAutocomplete, MatAutocompleteSelectedEvent, MatAutocompleteTrigger } from '@angular/material/autocomplete'; import { ErrorStateMatcher, mixinErrorState } from '@angular/material/core'; -import { MatLegacyFormFieldControl as MatFormFieldControl } from '@angular/material/legacy-form-field'; +import { MatFormFieldControl } from '@angular/material/form-field'; import { AutoCompleteGroup } from '@app/library/auto-complete/auto-complete-group'; import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration'; import { BaseComponent } from '@common/base/base.component'; -import { Observable, of as observableOf, Subject } from 'rxjs'; -import {debounceTime, distinctUntilChanged, map, mergeMap, startWith, takeUntil, switchMap, tap} from 'rxjs/operators'; +import { Observable, Subject, of as observableOf } from 'rxjs'; +import { debounceTime, distinctUntilChanged, map, startWith, switchMap, takeUntil, tap } from 'rxjs/operators'; export class CustomComponentBase extends BaseComponent { diff --git a/dmp-frontend/src/app/library/deactivate/can-deactivate.guard.ts b/dmp-frontend/src/app/library/deactivate/can-deactivate.guard.ts index 06845c5e9..8e6df7ff9 100644 --- a/dmp-frontend/src/app/library/deactivate/can-deactivate.guard.ts +++ b/dmp-frontend/src/app/library/deactivate/can-deactivate.guard.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { CanDeactivate } from '@angular/router'; import { CheckDeactivateBaseComponent } from '@app/library/deactivate/deactivate.component'; import { BaseComponent } from '@common/base/base.component'; diff --git a/dmp-frontend/src/app/library/export-method-dialog/export-method-dialog.component.ts b/dmp-frontend/src/app/library/export-method-dialog/export-method-dialog.component.ts index ef4d6546c..a702a72b8 100644 --- a/dmp-frontend/src/app/library/export-method-dialog/export-method-dialog.component.ts +++ b/dmp-frontend/src/app/library/export-method-dialog/export-method-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit, Inject } from '@angular/core'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; @Component({ diff --git a/dmp-frontend/src/app/library/notification/notification.component.ts b/dmp-frontend/src/app/library/notification/notification.component.ts index aead1307a..2bc6c31b6 100644 --- a/dmp-frontend/src/app/library/notification/notification.component.ts +++ b/dmp-frontend/src/app/library/notification/notification.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; -import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; +import { MatDialog } from '@angular/material/dialog'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { PopupNotification, SnackBarNotification, SnackBarNotificationLevel, UiNotificationService, UiNotificationType } from '@app/core/services/notification/ui-notification-service'; import { PopupNotificationDialogComponent } from '@app/library/notification/popup/popup-notification.component'; import { SnackBarNotificationComponent } from '@app/library/notification/snack-bar/snack-bar-notification.component'; diff --git a/dmp-frontend/src/app/library/notification/popup/popup-notification.component.ts b/dmp-frontend/src/app/library/notification/popup/popup-notification.component.ts index e8c14d9a9..6240d08c5 100644 --- a/dmp-frontend/src/app/library/notification/popup/popup-notification.component.ts +++ b/dmp-frontend/src/app/library/notification/popup/popup-notification.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { PopupNotification } from '../../../core/services/notification/ui-notification-service'; @Component({ diff --git a/dmp-frontend/src/app/library/notification/snack-bar/snack-bar-notification.component.ts b/dmp-frontend/src/app/library/notification/snack-bar/snack-bar-notification.component.ts index ba9a1f4fc..ff8745b38 100644 --- a/dmp-frontend/src/app/library/notification/snack-bar/snack-bar-notification.component.ts +++ b/dmp-frontend/src/app/library/notification/snack-bar/snack-bar-notification.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MAT_LEGACY_SNACK_BAR_DATA as MAT_SNACK_BAR_DATA } from '@angular/material/legacy-snack-bar'; +import { MAT_SNACK_BAR_DATA } from '@angular/material/snack-bar'; import { SnackBarNotification } from '../../../core/services/notification/ui-notification-service'; @Component({ diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.html b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.html index 9e415287f..ec0d23910 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.html +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.html @@ -65,11 +65,11 @@ {{numbering}} --> - + - + @@ -91,20 +91,20 @@
- +
- + {{'GENERAL.VALIDATION.REQUIRED' | translate}} - + {{'GENERAL.VALIDATION.REQUIRED' | translate}} @@ -112,13 +112,13 @@
- +
- {{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.MULTIPLICITY-TABLEVIEW' | translate}} diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts index f38a2b318..7e84e85dc 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts @@ -1,7 +1,7 @@ import { Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core'; import { AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; -import { MatLegacyCheckboxChange as MatCheckboxChange } from '@angular/material/legacy-checkbox'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatCheckboxChange } from '@angular/material/checkbox'; +import { MatDialog } from '@angular/material/dialog'; import { DatasetProfileComboBoxType } from '@app/core/common/enum/dataset-profile-combo-box-type'; import { DatasetProfileFieldViewStyle } from '@app/core/common/enum/dataset-profile-field-view-style'; import { DatasetProfileInternalDmpEntitiesType } from '@app/core/common/enum/dataset-profile-internal-dmp-entities-type'; diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/upload/dataset-profile-editor-upload-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/upload/dataset-profile-editor-upload-field.component.ts index 0b7003eb5..76fb38032 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/upload/dataset-profile-editor-upload-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/upload/dataset-profile-editor-upload-field.component.ts @@ -1,10 +1,9 @@ -import {Component, Input, OnInit, ViewChild} from '@angular/core'; -import {UntypedFormArray, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators} from '@angular/forms'; +import { Component, Input, OnInit } from '@angular/core'; +import { UntypedFormArray, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; +import { FieldDataOption } from "@app/core/model/dataset-profile-definition/field-data/field-data"; +import { ConfigurationService } from "@app/core/services/configuration/configuration.service"; +import { FieldDataOptionEditorModel } from "@app/ui/admin/dataset-profile/admin/field-data/field-data-option-editor-model"; import { UploadFieldDataEditorModel } from '../../../../admin/field-data/upload-field-data-editor-model'; -import {FieldDataOption} from "@app/core/model/dataset-profile-definition/field-data/field-data"; -import {FieldDataOptionEditorModel} from "@app/ui/admin/dataset-profile/admin/field-data/field-data-option-editor-model"; -import {MatLegacySelect as MatSelect} from "@angular/material/legacy-select"; -import {ConfigurationService} from "@app/core/services/configuration/configuration.service"; @Component({ selector: 'app-dataset-profile-editor-upload-field-component', @@ -14,33 +13,33 @@ import {ConfigurationService} from "@app/core/services/configuration/configurati export class DatasetProfileEditorUploadFieldComponent implements OnInit { types: Array = [ // images - {label: "Animated Portable Network Graphics (APNG)", value: "image/apng", source: ""}, - {label: "AV1 Image File Format (AVIF)", value: "image/avif", source: ""}, - {label: "Graphics Interchange Format (GIF)", value: "image/gif", source: ""}, - {label: "Joint Photographic Expert Group image (JPEG)", value: "image/jpeg", source: ""}, - {label: "Portable Network Graphics (PNG)", value: "image/png", source: ""}, - {label: "Scalable Vector Graphics (SVG)", value: "image/svg+xml", source: ""}, - {label: "Web Picture format (WEBP)", value: "image/webp", source: ""}, - {label: "Tagged Image File Format (TIFF)", value: "image/tiff", source: ""}, + { label: "Animated Portable Network Graphics (APNG)", value: "image/apng", source: "" }, + { label: "AV1 Image File Format (AVIF)", value: "image/avif", source: "" }, + { label: "Graphics Interchange Format (GIF)", value: "image/gif", source: "" }, + { label: "Joint Photographic Expert Group image (JPEG)", value: "image/jpeg", source: "" }, + { label: "Portable Network Graphics (PNG)", value: "image/png", source: "" }, + { label: "Scalable Vector Graphics (SVG)", value: "image/svg+xml", source: "" }, + { label: "Web Picture format (WEBP)", value: "image/webp", source: "" }, + { label: "Tagged Image File Format (TIFF)", value: "image/tiff", source: "" }, // office word - {label: "Microsoft Word 97-2003", value: "application/msword", source: ""}, // .doc, .dot - {label: "Microsoft Word 2007-2013", value: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", source: ""}, // .docx - {label: "OpenDocument Text", value: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", source: ""}, // .odt + { label: "Microsoft Word 97-2003", value: "application/msword", source: "" }, // .doc, .dot + { label: "Microsoft Word 2007-2013", value: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", source: "" }, // .docx + { label: "OpenDocument Text", value: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", source: "" }, // .odt // office excel - {label: "Microsoft Excel 97-2003", value: "application/vnd.ms-excel", source: ""}, // .xls, .xlt, .xla - {label: "Microsoft Excel 2007-2013", value: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", source: ""}, // .xlsx - {label: "OpenDocument Spreadsheet", value: "application/vnd.oasis.opendocument.spreadsheet", source: ""}, // .ods + { label: "Microsoft Excel 97-2003", value: "application/vnd.ms-excel", source: "" }, // .xls, .xlt, .xla + { label: "Microsoft Excel 2007-2013", value: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", source: "" }, // .xlsx + { label: "OpenDocument Spreadsheet", value: "application/vnd.oasis.opendocument.spreadsheet", source: "" }, // .ods // office powerpoint - {label: "Microsoft PowerPoint 97-2003", value: "application/vnd.ms-powerpoint", source: ""}, // .ppt, .pot, .pps, .ppa - {label: "Microsoft PowerPoint 2007-2013", value: "application/vnd.openxmlformats-officedocument.presentationml.presentation", source: ""}, // .pptx - {label: "OpenDocument Presentation", value: "application/vnd.oasis.opendocument.presentation", source: ""}, // .odp + { label: "Microsoft PowerPoint 97-2003", value: "application/vnd.ms-powerpoint", source: "" }, // .ppt, .pot, .pps, .ppa + { label: "Microsoft PowerPoint 2007-2013", value: "application/vnd.openxmlformats-officedocument.presentationml.presentation", source: "" }, // .pptx + { label: "OpenDocument Presentation", value: "application/vnd.oasis.opendocument.presentation", source: "" }, // .odp - {label: "Comma-Seperated Values (CSV)", value: "text/csv", source: ""}, - {label: "Adobe Portable Document Format (PDF)", value: "application/pdf", source: ""} + { label: "Comma-Seperated Values (CSV)", value: "text/csv", source: "" }, + { label: "Adobe Portable Document Format (PDF)", value: "application/pdf", source: "" } ]; selected: string[] = []; @@ -49,14 +48,14 @@ export class DatasetProfileEditorUploadFieldComponent implements OnInit { @Input() form: UntypedFormGroup; private data: UploadFieldDataEditorModel = new UploadFieldDataEditorModel(); - constructor(private configurationService: ConfigurationService) {} + constructor(private configurationService: ConfigurationService) { } ngOnInit() { let typeValues: string[] = this.types.map(type => type.value); if (!this.form.get('data')) { this.form.addControl('data', this.data.buildForm()); } - if(this.form.get('data') && this.form.get('data').get('types')) { - for(let type of this.form.get('data').get('types').value) { - if(typeValues.indexOf(type.value) != -1) { + if (this.form.get('data') && this.form.get('data').get('types')) { + for (let type of this.form.get('data').get('types').value) { + if (typeValues.indexOf(type.value) != -1) { this.selected.push(type.value); } } @@ -86,7 +85,7 @@ export class DatasetProfileEditorUploadFieldComponent implements OnInit { addNewRow(type: FieldDataOption = null) { const typeListOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel(); - if(type != null) { + if (type != null) { typeListOptions.fromModel(type); } (this.form.get('data')).addControl('types', new UntypedFormBuilder().array([])); diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts index d2dc8e314..cf2a828f6 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts @@ -2,8 +2,8 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { FormGroupDirective, NgForm, UntypedFormArray, UntypedFormControl, UntypedFormGroup, } from '@angular/forms'; import { ErrorStateMatcher } from '@angular/material/core'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; -import { MatLegacySlideToggleChange as MatSlideToggleChange } from '@angular/material/legacy-slide-toggle'; +import { MatDialog } from '@angular/material/dialog'; +import { MatSlideToggleChange } from '@angular/material/slide-toggle'; import { DatasetProfileComboBoxType } from '@app/core/common/enum/dataset-profile-combo-box-type'; import { DatasetProfileFieldViewStyle } from '@app/core/common/enum/dataset-profile-field-view-style'; import { DatasetProfileInternalDmpEntitiesType } from '@app/core/common/enum/dataset-profile-internal-dmp-entities-type'; diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.html b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.html index 6604815b9..b943a4bb1 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.html +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.html @@ -203,7 +203,7 @@
- +
diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts index 7bc08888c..69dfb2db3 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts @@ -3,7 +3,7 @@ import { of as observableOf, Observable, combineLatest, BehaviorSubject,of } fr import { HttpClient, HttpErrorResponse } from '@angular/common/http'; import { Component, OnInit, QueryList, ViewChild } from '@angular/core'; import { AbstractControl, UntypedFormArray, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { MatStepper} from '@angular/material/stepper'; import { ActivatedRoute, ParamMap, Router } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; @@ -43,7 +43,7 @@ import { EditorCustomValidators, EditorCustomValidatorsEnum } from './custom-val import { GENERAL_ANIMATIONS, STEPPER_ANIMATIONS } from './animations/animations'; import { DatasetProfileComboBoxType } from '@app/core/common/enum/dataset-profile-combo-box-type'; import { UserService } from '@app/core/services/user/user.service'; -import { MatLegacyInput as MatInput } from '@angular/material/legacy-input'; +import { MatInput } from '@angular/material/input'; import { CheckDeactivateBaseComponent } from '@app/library/deactivate/deactivate.component'; import { DescriptionTemplateTypeService } from '@app/core/services/description-template-type/description-template-type.service'; import { DescriptionTemplateType } from '@app/core/model/description-template-type/description-template-type'; diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/listing/criteria/dataset-profile.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/listing/criteria/dataset-profile.component.ts index 607a0e2e2..7cf625f1f 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/listing/criteria/dataset-profile.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/listing/criteria/dataset-profile.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { DatasetProfileCriteria } from '@app/core/query/dataset-profile/dataset-profile-criteria'; import { DatasetProfileService } from '@app/core/services/dataset-profile/dataset-profile.service'; import { DialogConfirmationUploadDatasetProfiles } from '@app/ui/admin/dataset-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component'; diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.ts index 234444ef8..144bde02f 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.ts @@ -1,4 +1,4 @@ -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { Inject, Component } from '@angular/core'; diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/listing/dataset-profile-listing.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/listing/dataset-profile-listing.component.ts index 05d31fec1..20fadc783 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/listing/dataset-profile-listing.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/listing/dataset-profile-listing.component.ts @@ -1,8 +1,8 @@ import { DataSource } from '@angular/cdk/table'; import { HttpClient, HttpErrorResponse } from '@angular/common/http'; import { Component, OnInit, ViewChild } from '@angular/core'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; -import { MatLegacyPaginator as MatPaginator, LegacyPageEvent as PageEvent } from '@angular/material/legacy-paginator'; +import { MatDialog } from '@angular/material/dialog'; +import { MatPaginator, PageEvent } from '@angular/material/paginator'; import { MatSort } from '@angular/material/sort'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { DatasetStatus } from '@app/core/common/enum/dataset-status'; @@ -20,7 +20,7 @@ import { BaseComponent } from '@common/base/base.component'; import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component'; import { TranslateService } from '@ngx-translate/core'; import * as FileSaver from 'file-saver'; -import { merge as observableMerge, Observable, of as observableOf } from 'rxjs'; +import { Observable, merge as observableMerge, of as observableOf } from 'rxjs'; import { map, startWith, switchMap, takeUntil } from 'rxjs/operators'; import { DialogConfirmationUploadDatasetProfiles } from './criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component'; @@ -128,7 +128,7 @@ export class DatasetProfileListingComponent extends BaseComponent implements OnI width: '500px', restoreFocus: false, data: { - message: this.language.instant('DATASET-WIZARD.NEW-VERSION-FROM-FILE.NEW-VERSION-XML-FILE-TITLE', {datasetName: label}), + message: this.language.instant('DATASET-WIZARD.NEW-VERSION-FROM-FILE.NEW-VERSION-XML-FILE-TITLE', { datasetName: label }), confirmButton: this.language.instant('DATASET-WIZARD.NEW-VERSION-FROM-FILE.NEW-VERSION-XML'), cancelButton: this.language.instant('DATASET-WIZARD.NEW-VERSION-FROM-FILE.NEW-VERSION-XML-FILE-CANCEL'), name: "", @@ -140,13 +140,13 @@ export class DatasetProfileListingComponent extends BaseComponent implements OnI if (data && data.sucsess && data.name != null && data.file != null) { this.datasetService.uploadFile(data.file, data.name, id) .pipe(takeUntil(this._destroyed)) - .subscribe(_=>{ + .subscribe(_ => { this.uiNotificationService.snackBarNotification(this.language.instant('DATASET-WIZARD.NEW-VERSION-FROM-FILE.NEW-VERSION-XML-SUCCESSFUL'), SnackBarNotificationLevel.Success); this.refresh(); }, - error=>{ - this.uiNotificationService.snackBarNotification(error.message, SnackBarNotificationLevel.Error); - } + error => { + this.uiNotificationService.snackBarNotification(error.message, SnackBarNotificationLevel.Error); + } ); } }); @@ -183,8 +183,8 @@ export class DatasetProfileListingComponent extends BaseComponent implements OnI return filename; } - deleteTemplate(id: string){ - if(id){ + deleteTemplate(id: string) { + if (id) { const dialogRef = this.dialog.open(ConfirmationDialogComponent, { restoreFocus: false, data: { @@ -246,13 +246,13 @@ export class DatasetProfileListingComponent extends BaseComponent implements OnI if (data && data.sucsess && data.name != null && data.file != null) { this.datasetService.uploadFile(data.file, data.name) .pipe(takeUntil(this._destroyed)) - .subscribe(_=>{ + .subscribe(_ => { this.uiNotificationService.snackBarNotification('Template successfully uploaded', SnackBarNotificationLevel.Success); this.refresh(); }, - error=>{ - this.uiNotificationService.snackBarNotification(error.message, SnackBarNotificationLevel.Error); - } + error => { + this.uiNotificationService.snackBarNotification(error.message, SnackBarNotificationLevel.Error); + } ); } }); @@ -261,9 +261,9 @@ export class DatasetProfileListingComponent extends BaseComponent implements OnI /** * gets as a a pameter a number representing the status and returns the class that is applied * to status-chip */ - getStatusClass(status: DatasetStatus):string{ - - if(status == DatasetStatus.Finalized){ + getStatusClass(status: DatasetStatus): string { + + if (status == DatasetStatus.Finalized) { return 'status-chip-finalized' } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents.ts index 08945b983..9fe19a5b9 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents.ts @@ -1,16 +1,13 @@ import { DOCUMENT } from '@angular/common'; -import { Component, EventEmitter, Inject, OnInit, Output, Input, AfterViewInit } from '@angular/core'; -import { BaseComponent } from '@common/base/base.component'; -import { interval, Subject, Subscription } from 'rxjs'; -import { distinctUntilChanged, filter, takeUntil } from 'rxjs/operators'; -import { type } from 'os'; -import { SimpleChanges } from '@angular/core'; -import { NewEntryType, TableUpdateInfo, ToCEntry, ToCEntryType } from './table-of-contents-entry'; -import { DragulaService } from 'ng2-dragula'; +import { AfterViewInit, Component, EventEmitter, Inject, Input, OnInit, Output } from '@angular/core'; import { UntypedFormArray } from '@angular/forms'; -import { MatLegacySnackBar as MatSnackBar, MatLegacySnackBarConfig as MatSnackBarConfig } from '@angular/material/legacy-snack-bar'; +import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; +import { BaseComponent } from '@common/base/base.component'; import { TranslateService } from '@ngx-translate/core'; -import { ContentObserver } from '@angular/cdk/observers'; +import { DragulaService } from 'ng2-dragula'; +import { interval } from 'rxjs'; +import { filter, takeUntil } from 'rxjs/operators'; +import { NewEntryType, TableUpdateInfo, ToCEntry, ToCEntryType } from './table-of-contents-entry'; @Component({ @@ -36,7 +33,7 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn draggingItemId: string = null; tocEntryType = ToCEntryType; - DRAGULA_ITEM_ID_PREFIX="table_item_id_"; + DRAGULA_ITEM_ID_PREFIX = "table_item_id_"; ROOT_ID: string = "ROOT_ID";//no special meaning private _dragStartedAt; private VALID_DROP_TIME = 500;//ms @@ -52,10 +49,10 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn private dragulaService: DragulaService, private snackbar: MatSnackBar, private language: TranslateService - ) { + ) { super(); - - if(this.dragulaService.find('TABLEDRAG')){ + + if (this.dragulaService.find('TABLEDRAG')) { this.dragulaService.destroy('TABLEDRAG'); } @@ -63,43 +60,43 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn const drake = dragula.drake; - drake.on('drop', (el, target, source,sibling)=>{ + drake.on('drop', (el, target, source, sibling) => { - if(this._dragStartedAt){ + if (this._dragStartedAt) { const timeNow = new Date().getTime(); - if(timeNow - this._dragStartedAt> this.VALID_DROP_TIME){ + if (timeNow - this._dragStartedAt > this.VALID_DROP_TIME) { // console.log('timenow: ', timeNow); // console.log('timestarted', this._dragStartedAt); this._dragStartedAt = null; - - }else{ + + } else { this.dataNeedsRefresh.emit();// even though the data is not changed the TABLE DRAG may has changed return; } - }else{ + } else { this.dataNeedsRefresh.emit();// even though the data is not changed the TABLE DRAG may has changed return; - + } - const elementId = (el.id as string).replace(this.DRAGULA_ITEM_ID_PREFIX,''); + const elementId = (el.id as string).replace(this.DRAGULA_ITEM_ID_PREFIX, ''); const targetId = target.id as string; const sourceId = source.id as string; - if(!(elementId && targetId && sourceId)){ + if (!(elementId && targetId && sourceId)) { console.info('Elements do not have an id'); this.dataNeedsRefresh.emit(); return; } - const element:ToCEntry = this._findTocEntryById(elementId, this.links); - const targetContainer:ToCEntry = this._findTocEntryById(targetId , this.links); - const sourceContainer:ToCEntry = this._findTocEntryById(sourceId, this.links); + const element: ToCEntry = this._findTocEntryById(elementId, this.links); + const targetContainer: ToCEntry = this._findTocEntryById(targetId, this.links); + const sourceContainer: ToCEntry = this._findTocEntryById(sourceId, this.links); - if(!(element && (targetContainer ||((element.type===ToCEntryType.Page) && (targetId === this.ROOT_ID))) && (sourceContainer||((element.type===ToCEntryType.Page) && (sourceId === this.ROOT_ID))))){ + if (!(element && (targetContainer || ((element.type === ToCEntryType.Page) && (targetId === this.ROOT_ID))) && (sourceContainer || ((element.type === ToCEntryType.Page) && (sourceId === this.ROOT_ID))))) { // console.info('Could not find elements'); this.dataNeedsRefresh.emit(); //TODO: angular update //drake.cancel(true); @@ -107,9 +104,9 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn } - switch(element.type){ - case ToCEntryType.FieldSet:{ - if(targetContainer.type != this.tocEntryType.Section){ + switch (element.type) { + case ToCEntryType.FieldSet: { + if (targetContainer.type != this.tocEntryType.Section) { // const message = 'Fieldset can only be child of Subsections'; const message = this.language.instant('DATASET-PROFILE-EDITOR.STEPS.FORM.TABLE-OF-CONTENTS.ERROR-MESSAGES.FIELDSET-MUST-HAVE-PARENT-SECTION'); // console.error(message); @@ -119,7 +116,7 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn } //check if target container has no sections - if((targetContainer.form.get('sections') as UntypedFormArray).length){ + if ((targetContainer.form.get('sections') as UntypedFormArray).length) { // const message = 'Cannot have inputs and sections on the same level'; const message = this.language.instant('DATASET-PROFILE-EDITOR.STEPS.FORM.TABLE-OF-CONTENTS.ERROR-MESSAGES.INPUT-SECTION-SAME-LEVEL'); this.notifyUser(message); @@ -132,72 +129,72 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn const targetFieldsets = targetContainer.form.get('fieldSets') as UntypedFormArray; const sourceFieldsets = sourceContainer.form.get('fieldSets') as UntypedFormArray; - if(!targetFieldsets){ + if (!targetFieldsets) { console.info('Not target fieldsets container found'); this.dataNeedsRefresh.emit(); return; } - let sourceOrdinal=-1; + let sourceOrdinal = -1; let idx = -1; - sourceFieldsets.controls.forEach((elem,index)=>{ - if(elem.get('id').value === elementId){ + sourceFieldsets.controls.forEach((elem, index) => { + if (elem.get('id').value === elementId) { sourceOrdinal = elem.get('ordinal').value; idx = index } }); - if(sourceOrdinal>=0 && idx>=0){ + if (sourceOrdinal >= 0 && idx >= 0) { sourceFieldsets.removeAt(idx); - sourceFieldsets.controls.forEach(control=>{ + sourceFieldsets.controls.forEach(control => { const ordinal = control.get('ordinal'); - if((ordinal.value>= sourceOrdinal) && sourceOrdinal>0){ - const updatedOrdinalVal = ordinal.value -1; + if ((ordinal.value >= sourceOrdinal) && sourceOrdinal > 0) { + const updatedOrdinalVal = ordinal.value - 1; ordinal.setValue(updatedOrdinalVal); } }); sourceFieldsets.controls.sort(this._compareOrdinals); } - let position:number = targetFieldsets.length; + let position: number = targetFieldsets.length; - if(!sibling ||!sibling.id){ + if (!sibling || !sibling.id) { console.info('No sibling Id found'); - }else{ - const siblingId = (sibling.id as string).replace(this.DRAGULA_ITEM_ID_PREFIX,''); + } else { + const siblingId = (sibling.id as string).replace(this.DRAGULA_ITEM_ID_PREFIX, ''); let siblingIndex = -1; - targetFieldsets.controls.forEach((e,idx)=>{ - if(e.get('id').value === siblingId){ + targetFieldsets.controls.forEach((e, idx) => { + if (e.get('id').value === siblingId) { siblingIndex = idx; position = e.get('ordinal').value; } - + }); - if(siblingIndex>=0){ //sibling found - - targetFieldsets.controls.filter(control=> control.get('ordinal').value >= position).forEach(control=>{ + if (siblingIndex >= 0) { //sibling found + + targetFieldsets.controls.filter(control => control.get('ordinal').value >= position).forEach(control => { const ordinal = control.get('ordinal'); - const updatedOrdinalVal = ordinal.value +1; + const updatedOrdinalVal = ordinal.value + 1; ordinal.setValue(updatedOrdinalVal); }) } - + } fieldsetForm.get('ordinal').setValue(position); - targetFieldsets.insert(position,fieldsetForm); + targetFieldsets.insert(position, fieldsetForm); targetFieldsets.controls.sort(this._compareOrdinals); - this.dataNeedsRefresh.emit({draggedItemId: elementId}); + this.dataNeedsRefresh.emit({ draggedItemId: elementId }); break; } - case ToCEntryType.Section:{ + case ToCEntryType.Section: { - if(targetContainer.type == ToCEntryType.Section){ - if((targetContainer.form.get('fieldSets')as UntypedFormArray).length){ + if (targetContainer.type == ToCEntryType.Section) { + if ((targetContainer.form.get('fieldSets') as UntypedFormArray).length) { // const message = 'Cannot have inputs and sections on the same level'; const message = this.language.instant('DATASET-PROFILE-EDITOR.STEPS.FORM.TABLE-OF-CONTENTS.ERROR-MESSAGES.INPUT-SECTION-SAME-LEVEL');; this.notifyUser(message); @@ -210,61 +207,61 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn const elementSectionForm = element.form; const sourceSections = elementSectionForm.parent as UntypedFormArray; - if(!(targetSections && sourceSections && elementSectionForm)){ + if (!(targetSections && sourceSections && elementSectionForm)) { console.info('Could not load sections'); this.dataNeedsRefresh.emit(); return; } let idx = -1; - sourceSections.controls.forEach((section,i)=>{ - if(section.get('id').value === elementId){ + sourceSections.controls.forEach((section, i) => { + if (section.get('id').value === elementId) { idx = i; } }); - if(!(idx>=0)){ + if (!(idx >= 0)) { console.info('Could not find element in Parent container'); this.dataNeedsRefresh.emit(); return; } - sourceSections.controls.filter(control=>control.get('ordinal').value >= elementSectionForm.get('ordinal').value).forEach(control=>{ + sourceSections.controls.filter(control => control.get('ordinal').value >= elementSectionForm.get('ordinal').value).forEach(control => { const ordinal = control.get('ordinal'); - const updatedOrdinalVal = ordinal.value? ordinal.value -1: 0; + const updatedOrdinalVal = ordinal.value ? ordinal.value - 1 : 0; ordinal.setValue(updatedOrdinalVal); }); - + sourceSections.removeAt(idx); let targetOrdinal = targetSections.length; - if(sibling && sibling.id){ - const siblingId = sibling.id.replace(this.DRAGULA_ITEM_ID_PREFIX,''); + if (sibling && sibling.id) { + const siblingId = sibling.id.replace(this.DRAGULA_ITEM_ID_PREFIX, ''); - targetSections.controls.forEach((section,i)=>{ - if(section.get('id').value === siblingId){ + targetSections.controls.forEach((section, i) => { + if (section.get('id').value === siblingId) { targetOrdinal = section.get('ordinal').value; } }) // if(targetOrdinal!=targetSections.length){//mporei na einai idio - // section.get('ordinal').setValue(i+1); - targetSections.controls.filter(control=> control.get('ordinal').value>=targetOrdinal).forEach(control=>{ - const ordinal = control.get('ordinal'); - const updatedOrdinalVal = ordinal.value+1; - ordinal.setValue(updatedOrdinalVal); - }); + // section.get('ordinal').setValue(i+1); + targetSections.controls.filter(control => control.get('ordinal').value >= targetOrdinal).forEach(control => { + const ordinal = control.get('ordinal'); + const updatedOrdinalVal = ordinal.value + 1; + ordinal.setValue(updatedOrdinalVal); + }); // } - }else{ + } else { console.info('no siblings found'); } elementSectionForm.get('ordinal').setValue(targetOrdinal); targetSections.insert(targetOrdinal, elementSectionForm); - }else if(targetContainer.type === ToCEntryType.Page){ + } else if (targetContainer.type === ToCEntryType.Page) { // const pageId = targetContainer.form.get('id').value; const rootform = targetContainer.form.root; @@ -272,23 +269,23 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn const parentSections = sectionForm.parent as UntypedFormArray; let parentIndex = -1; - parentSections.controls.forEach((section,i )=>{ - if(section.get('id').value === elementId){ + parentSections.controls.forEach((section, i) => { + if (section.get('id').value === elementId) { parentIndex = i } }) - - if(parentIndex<0){ + + if (parentIndex < 0) { console.info('could not locate section in parents array'); this.dataNeedsRefresh.emit(); return; } //update parent sections ordinal - parentSections.controls.filter(section=>section.get('ordinal').value >= sectionForm.get('ordinal').value).forEach(section=>{ + parentSections.controls.filter(section => section.get('ordinal').value >= sectionForm.get('ordinal').value).forEach(section => { const ordinal = section.get('ordinal'); - const updatedOrdinalVal = ordinal.value?ordinal.value -1: 0; + const updatedOrdinalVal = ordinal.value ? ordinal.value - 1 : 0; ordinal.setValue(updatedOrdinalVal); }) @@ -297,34 +294,34 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn let position = 0; - if(targetContainer.subEntries){ + if (targetContainer.subEntries) { position = targetContainer.subEntries.length; } //populate sections const targetSectionsArray = rootform.get('sections') as UntypedFormArray; - if(sibling && sibling.id){ - const siblingId= sibling.id.replace(this.DRAGULA_ITEM_ID_PREFIX, ''); + if (sibling && sibling.id) { + const siblingId = sibling.id.replace(this.DRAGULA_ITEM_ID_PREFIX, ''); let indx = -1; - targetContainer.subEntries.forEach((e,i)=>{ - if(e.form.get('id').value === siblingId){ + targetContainer.subEntries.forEach((e, i) => { + if (e.form.get('id').value === siblingId) { indx = i; position = e.form.get('ordinal').value; } }); - if(indx>=0) { - + if (indx >= 0) { + // e.form.get('ordinal').setValue(i+1); - targetContainer.subEntries.filter(e=>e.form.get('ordinal').value >= position).forEach(e=>{ + targetContainer.subEntries.filter(e => e.form.get('ordinal').value >= position).forEach(e => { const ordinal = e.form.get('ordinal'); - const updatedOrdinalVal = ordinal.value +1; + const updatedOrdinalVal = ordinal.value + 1; ordinal.setValue(updatedOrdinalVal); }); } - }else{ + } else { console.info('No sibling found'); } @@ -332,7 +329,7 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn sectionForm.get('page').setValue(targetContainer.id); targetSectionsArray.push(sectionForm); - }else{ + } else { // const message = 'Drag not support to specific container'; const message = this.language.instant('DATASET-PROFILE-EDITOR.STEPS.FORM.TABLE-OF-CONTENTS.ERROR-MESSAGES.DRAG-NOT-SUPPORTED'); this.notifyUser(message); @@ -343,11 +340,11 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn - this.dataNeedsRefresh.emit({draggedItemId: elementId}); + this.dataNeedsRefresh.emit({ draggedItemId: elementId }); break; } - case ToCEntryType.Page:{ - if(targetId != this.ROOT_ID){ + case ToCEntryType.Page: { + if (targetId != this.ROOT_ID) { // const message = 'A page element can only be at top level'; const message = this.language.instant('DATASET-PROFILE-EDITOR.STEPS.FORM.TABLE-OF-CONTENTS.ERROR-MESSAGES.PAGE-ELEMENT-ONLY-TOP-LEVEL'); this.notifyUser(message); @@ -357,7 +354,7 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn } const rootForm = element.form.root; - if(!rootForm){ + if (!rootForm) { console.info('Could not find root!') this.dataNeedsRefresh.emit(); return; @@ -369,13 +366,13 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn let index = -1; - pages.controls.forEach((page,i)=>{ - if(page.get('id').value === elementId){ - index =i; + pages.controls.forEach((page, i) => { + if (page.get('id').value === elementId) { + index = i; } }); - if(index<0){ + if (index < 0) { console.info('Could not locate page on pages'); this.dataNeedsRefresh.emit(); return; @@ -383,21 +380,21 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn //ordinality - pages.controls.filter(page=> page.get('ordinal').value>= pageForm.get('ordinal').value).forEach(page=>{ + pages.controls.filter(page => page.get('ordinal').value >= pageForm.get('ordinal').value).forEach(page => { const ordinal = page.get('ordinal'); - const ordinalVal = ordinal.value? ordinal.value - 1: 0; - ordinal.setValue(ordinalVal); + const ordinalVal = ordinal.value ? ordinal.value - 1 : 0; + ordinal.setValue(ordinalVal); }); pages.removeAt(index); let targetPosition = pages.length; - if(sibling){ + if (sibling) { const siblingId = sibling.id.replace(this.DRAGULA_ITEM_ID_PREFIX, ''); - pages.controls.forEach((page,i)=>{ - if(page.get('id').value === siblingId){ + pages.controls.forEach((page, i) => { + if (page.get('id').value === siblingId) { targetPosition = page.get('ordinal').value; } }); @@ -405,15 +402,15 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn pageForm.get('ordinal').setValue(targetPosition); //update ordinality - pages.controls.filter(page=> page.get('ordinal').value>= targetPosition).forEach(page=>{ + pages.controls.filter(page => page.get('ordinal').value >= targetPosition).forEach(page => { const ordinal = page.get('ordinal'); - const ordinalVal = ordinal.value +1; - ordinal.setValue(ordinalVal); + const ordinalVal = ordinal.value + 1; + ordinal.setValue(ordinalVal); }); pages.insert(targetPosition, pageForm); - this.dataNeedsRefresh.emit({draggedItemId:elementId}); + this.dataNeedsRefresh.emit({ draggedItemId: elementId }); break; } default: @@ -426,8 +423,8 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn }); - drake.on('drag',(el,source)=>{ - this._dragStartedAt = new Date().getTime(); + drake.on('drag', (el, source) => { + this._dragStartedAt = new Date().getTime(); // console.log('drag fired'); this.isDragging = true; this.draggingItemId = (el.id as string).replace(this.DRAGULA_ITEM_ID_PREFIX, ''); @@ -438,20 +435,20 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn // } // }, this.VALID_DROP_TIME); }); - drake.on('over',(el, container, source)=>{ + drake.on('over', (el, container, source) => { try { this.overcontainer = container.id; } catch (error) { this.overcontainer = null; } }); - drake.on('dragend',(el)=>{ + drake.on('dragend', (el) => { this.isDragging = false; this.draggingItemId = null; this.overcontainer = null; }); - + } @@ -462,49 +459,49 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn const tableDiv = document.querySelector('#tocentrytable'); try { - top.addEventListener('mouseover', (e) => {this.scrollTableTop = true; },{ + top.addEventListener('mouseover', (e) => { this.scrollTableTop = true; }, { passive: true - }); - bottom.addEventListener('mouseover', (e) => {this.scrollTableBottom = true; },{ - passive: true - }); - - top.addEventListener('mouseout', (e) => {this.scrollTableTop = false},{ - passive: true - }); - bottom.addEventListener('mouseout', (e) => {this.scrollTableBottom = false;},{ - passive: true - }); - - - this.$clock - .pipe( - takeUntil(this._destroyed), - filter(() => this.scrollTableTop) - ) - .subscribe(()=>{ - try{ - tableDiv.scrollBy(0, -this.pxToScroll); - } catch {} }); - this.$clock - .pipe( - takeUntil(this._destroyed), - filter(() => this.scrollTableBottom) - ) - .subscribe(()=>{ - try{ - tableDiv.scrollBy(0, this.pxToScroll); - } catch {} + bottom.addEventListener('mouseover', (e) => { this.scrollTableBottom = true; }, { + passive: true }); + + top.addEventListener('mouseout', (e) => { this.scrollTableTop = false }, { + passive: true + }); + bottom.addEventListener('mouseout', (e) => { this.scrollTableBottom = false; }, { + passive: true + }); + + + this.$clock + .pipe( + takeUntil(this._destroyed), + filter(() => this.scrollTableTop) + ) + .subscribe(() => { + try { + tableDiv.scrollBy(0, -this.pxToScroll); + } catch { } + }); + this.$clock + .pipe( + takeUntil(this._destroyed), + filter(() => this.scrollTableBottom) + ) + .subscribe(() => { + try { + tableDiv.scrollBy(0, this.pxToScroll); + } catch { } + }); } catch { console.log('could not find scrolling elements'); } - + } - private _scrollIntoDragginItem(id: string){ + private _scrollIntoDragginItem(id: string) { // const table = document.getElementById('tocentrytable'); // if(table){ @@ -524,7 +521,7 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn // const tableRect = table.getBoundingClientRect(); // const elementRect = element.getBoundingClientRect(); - + // console.log('tablerect :',tableRect); // console.log('elementRect :',elementRect); @@ -540,62 +537,62 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn // } } - private _findTocEntryById(id: string, tocentries: ToCEntry[]): ToCEntry{ - if(!tocentries){ + private _findTocEntryById(id: string, tocentries: ToCEntry[]): ToCEntry { + if (!tocentries) { return null; } - let tocEntryFound = tocentries.find(entry=>entry.id === id); + let tocEntryFound = tocentries.find(entry => entry.id === id); - if(tocEntryFound){ + if (tocEntryFound) { return tocEntryFound; - } + } - for(let entry of tocentries){ + for (let entry of tocentries) { const result = this._findTocEntryById(id, entry.subEntries); - if(result){ + if (result) { tocEntryFound = result; break; } } - - return tocEntryFound? tocEntryFound: null; + + return tocEntryFound ? tocEntryFound : null; } ngOnInit(): void { - + } - itemClicked(item: ToCEntry){ + itemClicked(item: ToCEntry) { //leaf node this.itemClick.emit(item); } - + // addNewEntry(tce: ToCEntry){ // this.newEntry.emit(tce); // } - deleteEntry(currentLink: ToCEntry){ + deleteEntry(currentLink: ToCEntry) { this.removeEntry.emit(currentLink); } - createNewEntry(newEntry: NewEntryType){ + createNewEntry(newEntry: NewEntryType) { this.createEntry.emit(newEntry); } - onDataNeedsRefresh(){ + onDataNeedsRefresh() { this.dataNeedsRefresh.emit(); } - notifyUser(message:string){ + notifyUser(message: string) { this.snackbar.open(message, null, this._snackBarConfig); } private _snackBarConfig: MatSnackBarConfig = { - duration:2000 + duration: 2000 } - private _compareOrdinals(a, b){ + private _compareOrdinals(a, b) { const aValue = a.get('ordinal').value as number; const bValue = b.get('ordinal').value as number; diff --git a/dmp-frontend/src/app/ui/admin/description-types/editor/description-type-editor.component.html b/dmp-frontend/src/app/ui/admin/description-types/editor/description-type-editor.component.html index 6c818cfab..e5c13bec2 100644 --- a/dmp-frontend/src/app/ui/admin/description-types/editor/description-type-editor.component.html +++ b/dmp-frontend/src/app/ui/admin/description-types/editor/description-type-editor.component.html @@ -9,7 +9,7 @@
- + diff --git a/dmp-frontend/src/app/ui/admin/description-types/listing/description-types.component.ts b/dmp-frontend/src/app/ui/admin/description-types/listing/description-types.component.ts index 452ad2cb2..2249f6ec6 100644 --- a/dmp-frontend/src/app/ui/admin/description-types/listing/description-types.component.ts +++ b/dmp-frontend/src/app/ui/admin/description-types/listing/description-types.component.ts @@ -1,10 +1,9 @@ import { DataSource } from '@angular/cdk/table'; import { HttpErrorResponse } from '@angular/common/http'; import { Component, EventEmitter, OnInit, ViewChild } from '@angular/core'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; -import { MatLegacyPaginator as MatPaginator } from '@angular/material/legacy-paginator'; +import { MatDialog } from '@angular/material/dialog'; +import { MatPaginator } from '@angular/material/paginator'; import { MatSort } from '@angular/material/sort'; -import { MatLegacyTableDataSource as MatTableDataSource } from '@angular/material/legacy-table'; import { Router } from '@angular/router'; import { DescriptionTemplateType } from '@app/core/model/description-template-type/description-template-type'; import { DescriptionTemplateTypeLookup } from '@app/core/query/description-template/description-template-type.lookup'; @@ -13,7 +12,7 @@ import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/serv import { BaseComponent } from '@common/base/base.component'; import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component'; import { TranslateService } from '@ngx-translate/core'; -import { Observable, merge, of } from 'rxjs'; +import { Observable, merge } from 'rxjs'; import { map, startWith, switchMap, takeUntil } from 'rxjs/operators'; import { nameof } from 'ts-simple-nameof'; diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.ts b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.ts index 762bd5a96..bb0a2d8a0 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.ts +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.ts @@ -23,7 +23,7 @@ import { map, takeUntil } from 'rxjs/operators'; import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; import { HttpClient } from '@angular/common/http'; import { MatomoService } from '@app/core/services/matomo/matomo-service'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component'; import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration'; import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.ts b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.ts index 4fec08bb4..65dea8f6c 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.ts +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.ts @@ -1,4 +1,4 @@ -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { Inject, Component } from '@angular/core'; diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.ts b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.ts index 2c29752da..e80bea6b3 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.ts +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { DmpBlueprintCriteria } from '@app/core/query/dmp/dmp-blueprint-criteria'; import { DmpProfileService } from '@app/core/services/dmp/dmp-profile.service'; import { BaseCriteriaComponent } from '@app/ui/misc/criteria/base-criteria.component'; diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.ts b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.ts index 0b79cc3ba..181a74020 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.ts +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.ts @@ -2,30 +2,28 @@ import { DataSource } from '@angular/cdk/table'; import { HttpClient, HttpErrorResponse } from '@angular/common/http'; import { Component, OnInit, ViewChild } from '@angular/core'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; -import { MatLegacyPaginator as MatPaginator, LegacyPageEvent as PageEvent } from '@angular/material/legacy-paginator'; -import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; +import { MatDialog } from '@angular/material/dialog'; +import { MatPaginator, PageEvent } from '@angular/material/paginator'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { MatSort } from '@angular/material/sort'; import { ActivatedRoute, Params, Router } from '@angular/router'; +import { DmpProfileStatus } from '@app/core/common/enum/dmp-profile-status'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; -import { DmpProfileListing } from '@app/core/model/dmp-profile/dmp-profile-listing'; -import { DmpProfileCriteria } from '@app/core/query/dmp/dmp-profile-criteria'; +import { DmpBlueprintListing } from '@app/core/model/dmp/dmp-blueprint/dmp-blueprint-listing'; +import { DmpBlueprintCriteria } from '@app/core/query/dmp/dmp-blueprint-criteria'; import { DmpProfileService } from '@app/core/services/dmp/dmp-profile.service'; import { MatomoService } from '@app/core/services/matomo/matomo-service'; import { UiNotificationService } from '@app/core/services/notification/ui-notification-service'; import { DmpProfileCriteriaComponent } from '@app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component'; import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item'; import { BaseComponent } from '@common/base/base.component'; +import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component'; import { SnackBarNotificationLevel } from '@common/modules/notification/ui-notification-service'; import { TranslateService } from '@ngx-translate/core'; -import { merge as observableMerge, Observable, of as observableOf } from 'rxjs'; +import * as FileSaver from 'file-saver'; +import { Observable, merge as observableMerge, of as observableOf } from 'rxjs'; import { map, startWith, switchMap, takeUntil } from 'rxjs/operators'; import { DialodConfirmationUploadDmpProfiles } from './criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component'; -import { DmpBlueprintCriteria } from '@app/core/query/dmp/dmp-blueprint-criteria'; -import { DmpBlueprintListing } from '@app/core/model/dmp/dmp-blueprint/dmp-blueprint-listing'; -import { DmpProfileStatus } from '@app/core/common/enum/dmp-profile-status'; -import * as FileSaver from 'file-saver'; -import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component'; @Component({ @@ -124,35 +122,37 @@ export class DmpProfileListingComponent extends BaseComponent implements OnInit deleteTemplate(id: string) { if (id) { - this.dialog.open(ConfirmationDialogComponent,{data:{ - isDeleteConfirmation: true, - confirmButton: this.languageService.instant('DMP-PROFILE-EDITOR.CONFIRM-DELETE-DIALOG.CONFIRM-BUTTON'), - cancelButton: this.languageService.instant("DMP-PROFILE-EDITOR.CONFIRM-DELETE-DIALOG.CANCEL-BUTTON"), - message: this.languageService.instant("DMP-PROFILE-EDITOR.CONFIRM-DELETE-DIALOG.MESSAGE") - }}) - .afterClosed() - .subscribe( - confirmed =>{ - if(confirmed){ - this.dmpProfileService.delete(id) - .pipe(takeUntil(this._destroyed)) - .subscribe( - complete => { - this.uiNotificationService.snackBarNotification(this.languageService.instant('GENERAL.SNACK-BAR.SUCCESSFUL-DMP-BLUEPRINT-DELETE'), SnackBarNotificationLevel.Success); - this.refresh(); - }, - error => { - this.onCallbackError(error); - if (error.error.statusCode == 674) { - this.uiNotificationService.snackBarNotification(this.languageService.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-DMP-BLUEPRINT-DELETE'), SnackBarNotificationLevel.Error); - } else { - this.uiNotificationService.snackBarNotification(this.languageService.instant(error.message), SnackBarNotificationLevel.Error); - } - } - ); - } + this.dialog.open(ConfirmationDialogComponent, { + data: { + isDeleteConfirmation: true, + confirmButton: this.languageService.instant('DMP-PROFILE-EDITOR.CONFIRM-DELETE-DIALOG.CONFIRM-BUTTON'), + cancelButton: this.languageService.instant("DMP-PROFILE-EDITOR.CONFIRM-DELETE-DIALOG.CANCEL-BUTTON"), + message: this.languageService.instant("DMP-PROFILE-EDITOR.CONFIRM-DELETE-DIALOG.MESSAGE") } - ) + }) + .afterClosed() + .subscribe( + confirmed => { + if (confirmed) { + this.dmpProfileService.delete(id) + .pipe(takeUntil(this._destroyed)) + .subscribe( + complete => { + this.uiNotificationService.snackBarNotification(this.languageService.instant('GENERAL.SNACK-BAR.SUCCESSFUL-DMP-BLUEPRINT-DELETE'), SnackBarNotificationLevel.Success); + this.refresh(); + }, + error => { + this.onCallbackError(error); + if (error.error.statusCode == 674) { + this.uiNotificationService.snackBarNotification(this.languageService.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-DMP-BLUEPRINT-DELETE'), SnackBarNotificationLevel.Error); + } else { + this.uiNotificationService.snackBarNotification(this.languageService.instant(error.message), SnackBarNotificationLevel.Error); + } + } + ); + } + } + ) } } @@ -170,11 +170,11 @@ export class DmpProfileListingComponent extends BaseComponent implements OnInit // this.datasetService.makeDatasetPublic(id).pipe(takeUntil(this._destroyed)).subscribe(); // } - parseStatus(value: number): string{ + parseStatus(value: number): string { const stringVal = value.toString() - try{ + try { return this.statuses.find(status => status.value === stringVal).viewValue; - }catch{ + } catch { return stringVal; } } @@ -195,22 +195,22 @@ export class DmpProfileListingComponent extends BaseComponent implements OnInit if (data && data.sucsess && data.name != null && data.file != null) { this.dmpProfileService.uploadFile(data.file, data.name) .pipe(takeUntil(this._destroyed)) - .subscribe(_=>{ + .subscribe(_ => { this.uiNotificationService.snackBarNotification(this.languageService.instant('DMP-PROFILE-LISTING.MESSAGES.TEMPLATE-UPLOAD-SUCCESS'), SnackBarNotificationLevel.Success); this.refresh(); }, - error=>{ - this.uiNotificationService.snackBarNotification(error.message, SnackBarNotificationLevel.Error); - }); + error => { + this.uiNotificationService.snackBarNotification(error.message, SnackBarNotificationLevel.Error); + }); } }); } - getStatusClass(status: number):string{ - - if(status === 1){//finalized + getStatusClass(status: number): string { + + if (status === 1) {//finalized return 'status-chip-finalized' } - if(status === 0){ + if (status === 0) { return 'status-chip-draft'; } return ''; @@ -248,14 +248,14 @@ export class DatasetDataSource extends DataSource { return this._service.getPagedBlueprint(request); }), /*.catch((error: any) => { - this._snackBar.openFromComponent(SnackBarNotificationComponent, { - data: { message: 'GENERAL.SNACK-BAR.FORMS-BAD-REQUEST', language: this._languageService }, - duration: 3000, - extraClasses: ['snackbar-warning'] - }); - //this._criteria.criteria.onCallbackError(error); - return Observable.of(null); - })*/ + this._snackBar.openFromComponent(SnackBarNotificationComponent, { + data: { message: 'GENERAL.SNACK-BAR.FORMS-BAD-REQUEST', language: this._languageService }, + duration: 3000, + extraClasses: ['snackbar-warning'] + }); + //this._criteria.criteria.onCallbackError(error); + return Observable.of(null); + })*/ map(result => { return result; }), diff --git a/dmp-frontend/src/app/ui/admin/user/listing/user-listing.component.ts b/dmp-frontend/src/app/ui/admin/user/listing/user-listing.component.ts index 73127bee2..8ead8986c 100644 --- a/dmp-frontend/src/app/ui/admin/user/listing/user-listing.component.ts +++ b/dmp-frontend/src/app/ui/admin/user/listing/user-listing.component.ts @@ -1,25 +1,24 @@ -import {of as observableOf, merge as observableMerge, Observable } from 'rxjs'; +import { Observable, merge as observableMerge, of as observableOf } from 'rxjs'; -import {map, catchError, switchMap, startWith, takeUntil} from 'rxjs/operators'; import { DataSource } from '@angular/cdk/table'; +import { HttpClient } from '@angular/common/http'; import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core'; -import { MatLegacyPaginator as MatPaginator } from '@angular/material/legacy-paginator'; -import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; +import { MatPaginator } from '@angular/material/paginator'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { MatSort } from '@angular/material/sort'; +import { MatomoService } from '@app/core/services/matomo/matomo-service'; +import { BaseComponent } from '@common/base/base.component'; import { TranslateService } from '@ngx-translate/core'; +import * as FileSaver from 'file-saver'; +import { catchError, map, startWith, switchMap, takeUntil } from 'rxjs/operators'; +import { DataTableRequest } from '../../../../core/model/data-table/data-table-request'; import { UserListingModel } from '../../../../core/model/user/user-listing'; import { UserCriteria } from '../../../../core/query/user/user-criteria'; import { UserService } from '../../../../core/services/user/user.service'; import { SnackBarNotificationComponent } from '../../../../library/notification/snack-bar/snack-bar-notification.component'; -import { DataTableRequest } from '../../../../core/model/data-table/data-table-request'; -import { UserCriteriaComponent } from './criteria/user-criteria.component'; import { BreadcrumbItem } from '../../../misc/breadcrumb/definition/breadcrumb-item'; -import { BaseComponent } from '@common/base/base.component'; -import * as FileSaver from 'file-saver'; -import { MatomoService } from '@app/core/services/matomo/matomo-service'; -import { HttpClient } from '@angular/common/http'; -import { MatLegacyTableDataSource as MatTableDataSource } from '@angular/material/legacy-table'; +import { UserCriteriaComponent } from './criteria/user-criteria.component'; export class UsersDataSource extends DataSource { @@ -147,7 +146,7 @@ export class UserListingComponent extends BaseComponent implements OnInit, After } // Export user mails - exportUsers(){ + exportUsers() { this.userService.downloadCSV() .pipe(takeUntil(this._destroyed)) .subscribe(response => { diff --git a/dmp-frontend/src/app/ui/contact/contact-dialog/contact-dialog.component.ts b/dmp-frontend/src/app/ui/contact/contact-dialog/contact-dialog.component.ts index b28c6acd7..d9b7d36b2 100644 --- a/dmp-frontend/src/app/ui/contact/contact-dialog/contact-dialog.component.ts +++ b/dmp-frontend/src/app/ui/contact/contact-dialog/contact-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { FormGroup } from '@angular/forms'; @Component({ diff --git a/dmp-frontend/src/app/ui/dashboard/dashboard.component.ts b/dmp-frontend/src/app/ui/dashboard/dashboard.component.ts index 728ebfd6a..250fbd3ab 100644 --- a/dmp-frontend/src/app/ui/dashboard/dashboard.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/dashboard.component.ts @@ -25,7 +25,7 @@ import { BreadcrumbItem } from '../misc/breadcrumb/definition/breadcrumb-item'; import { IBreadCrumbComponent } from '../misc/breadcrumb/definition/IBreadCrumbComponent'; import { DmpCriteria } from '@app/core/query/dmp/dmp-criteria'; import { DatasetCriteria } from '@app/core/query/dataset/dataset-criteria'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { StartNewDmpDialogComponent } from '../dmp/start-new-dmp-dialogue/start-new-dmp-dialog.component'; import { StartNewDatasetDialogComponent } from '../dmp/start-new-dataset-dialogue/start-new-dataset-dialog.component'; import { DatasetWizardEditorModel } from '../dataset/dataset-wizard/dataset-wizard-editor.model'; diff --git a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts index d2c740bbd..8ac0c8947 100644 --- a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts @@ -14,7 +14,7 @@ import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog import { DatasetCopyDialogueComponent } from '@app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component'; import {UntypedFormControl, UntypedFormBuilder, UntypedFormGroup} from '@angular/forms'; import { BaseComponent } from '@common/base/base.component'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service'; import { SnackBarNotificationLevel } from '@app/core/services/notification/ui-notification-service'; import * as FileSaver from 'file-saver'; diff --git a/dmp-frontend/src/app/ui/dashboard/quick-wizard-create-add/quick-wizard-create-add.component.ts b/dmp-frontend/src/app/ui/dashboard/quick-wizard-create-add/quick-wizard-create-add.component.ts index a463b5ba5..d64a2de98 100644 --- a/dmp-frontend/src/app/ui/dashboard/quick-wizard-create-add/quick-wizard-create-add.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/quick-wizard-create-add/quick-wizard-create-add.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from "@angular/core"; -import { MatLegacySnackBar as MatSnackBar } from "@angular/material/legacy-snack-bar"; +import { MatSnackBar } from "@angular/material/snack-bar"; import { ActivatedRoute, Router } from "@angular/router"; import { BaseComponent } from '@common/base/base.component'; import { TranslateService } from "@ngx-translate/core"; diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts index ae3119ec0..0cd7ca4fc 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts @@ -1,5 +1,5 @@ import {Component, OnInit, Output, EventEmitter, Input, ViewChild} from '@angular/core'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import {ActivatedRoute, Router} from '@angular/router'; import { RecentActivityType } from '@app/core/common/enum/recent-activity-type'; import { Principal } from '@app/core/model/auth/principal'; diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.ts b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.ts index 34ebce7de..35f7fc046 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.ts @@ -10,7 +10,7 @@ import { TranslateService } from '@ngx-translate/core'; import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; import { UntypedFormControl, UntypedFormBuilder } from '@angular/forms'; import { DatasetCopyDialogueComponent } from '@app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { debounceTime, takeUntil } from 'rxjs/operators'; import {ActivatedRoute, Router} from '@angular/router'; import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service'; diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.ts b/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.ts index b43564d7a..79506428a 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.ts @@ -1,5 +1,5 @@ import {Component, OnInit, Output, EventEmitter, Input, ViewChild} from '@angular/core'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import {ActivatedRoute, Router} from '@angular/router'; import { RecentActivityType } from '@app/core/common/enum/recent-activity-type'; import { Principal } from '@app/core/model/auth/principal'; diff --git a/dmp-frontend/src/app/ui/dataset-create-wizard/dataset-create-wizard.component.ts b/dmp-frontend/src/app/ui/dataset-create-wizard/dataset-create-wizard.component.ts index 52cd5e7b9..4599943a9 100644 --- a/dmp-frontend/src/app/ui/dataset-create-wizard/dataset-create-wizard.component.ts +++ b/dmp-frontend/src/app/ui/dataset-create-wizard/dataset-create-wizard.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { UntypedFormArray, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { MatStepper } from '@angular/material/stepper'; import { Router } from '@angular/router'; import { DatasetStatus } from '@app/core/common/enum/dataset-status'; diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component.ts index c26024b5d..37b53eb00 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component.ts @@ -1,7 +1,7 @@ import { map, filter } from 'rxjs/operators'; import { Component } from "@angular/core"; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from "@angular/material/legacy-dialog"; +import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog"; import { SingleAutoCompleteConfiguration } from "../../../../library/auto-complete/single/single-auto-complete-configuration"; import { Observable } from "rxjs"; import { DataTableRequest } from "../../../../core/model/data-table/data-table-request"; diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.ts index fc0ad46c1..aafb6fe66 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.ts @@ -8,7 +8,7 @@ import { TranslateService } from '@ngx-translate/core'; import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; import { takeUntil } from 'rxjs/operators'; import { DmpProfileService } from '@app/core/services/dmp/dmp-profile.service'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { PopupNotificationDialogComponent } from '@app/library/notification/popup/popup-notification.component'; @Component({ diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts index 03fca64ee..120449716 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts @@ -2,8 +2,8 @@ import { Location } from '@angular/common'; import { HttpClient } from '@angular/common/http'; import { Component, OnInit, ViewChild } from '@angular/core'; import { AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; -import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; +import { MatDialog } from '@angular/material/dialog'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; import { DatasetStatus } from '@app/core/common/enum/dataset-status'; import { DmpStatus } from '@app/core/common/enum/dmp-status'; diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/dataset-external-references-editor.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/dataset-external-references-editor.component.ts index a2ca711c8..cac88b15d 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/dataset-external-references-editor.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/dataset-external-references-editor.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnInit, Output, EventEmitter } from '@angular/core'; import { UntypedFormArray, UntypedFormGroup } from '@angular/forms'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { Router } from '@angular/router'; import { ExternalSourceItemModel } from '@app/core/model/external-sources/external-source-item'; import { ExternalSourcesConfiguration } from '@app/core/model/external-sources/external-sources-configuration'; diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/data-repository/dataset-external-data-repository-dialog-editor.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/data-repository/dataset-external-data-repository-dialog-editor.component.ts index 47a05a141..9c53aa709 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/data-repository/dataset-external-data-repository-dialog-editor.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/data-repository/dataset-external-data-repository-dialog-editor.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { ExternalDataRepositoryService } from '@app/core/services/external-sources/data-repository/extternal-data-repository.service'; import { ExternalDataRepositoryEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; import { BaseComponent } from '@common/base/base.component'; diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/external-dataset/dataset-external-dataset-dialog-editor.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/external-dataset/dataset-external-dataset-dialog-editor.component.ts index 8033c9b1b..676181d56 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/external-dataset/dataset-external-dataset-dialog-editor.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/external-dataset/dataset-external-dataset-dialog-editor.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { ExternalDatasetService } from '@app/core/services/external-sources/dataset/external-dataset.service'; import { ExternalDatasetEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; import { BaseComponent } from '@common/base/base.component'; diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/registry/dataset-external-registry-dialog-editor.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/registry/dataset-external-registry-dialog-editor.component.ts index 22d43bdb1..9179bdbc7 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/registry/dataset-external-registry-dialog-editor.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/registry/dataset-external-registry-dialog-editor.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { ExternalRegistryService } from '@app/core/services/external-sources/registry/external-registry.service'; import { ExternalRegistryEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; import { BaseComponent } from '@common/base/base.component'; diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/service/dataset-external-service-dialog-editor.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/service/dataset-external-service-dialog-editor.component.ts index bb022c662..5da9f1b59 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/service/dataset-external-service-dialog-editor.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/editors/service/dataset-external-service-dialog-editor.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { ExternalServiceService } from '@app/core/services/external-sources/service/external-service.service'; import { ExternalServiceEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; import { BaseComponent } from '@common/base/base.component'; diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component.ts index b0d7951b7..7849631b2 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component.ts @@ -1,17 +1,17 @@ -import {Component, Inject, OnInit} from "@angular/core"; -import {MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA, MatLegacyDialog as MatDialog, MatLegacyDialogRef as MatDialogRef} from "@angular/material/legacy-dialog"; -import {map, takeUntil} from "rxjs/operators"; -import {ProgressIndicationService} from "@app/core/services/progress-indication/progress-indication-service"; -import {BaseComponent} from "@common/base/base.component"; -import {SingleAutoCompleteConfiguration} from "@app/library/auto-complete/single/single-auto-complete-configuration"; -import {Observable, of} from "rxjs"; -import {Prefilling} from "@app/core/model/dataset/prefilling"; -import {PrefillingService} from "@app/core/services/prefilling.service"; -import {UntypedFormBuilder, UntypedFormGroup, Validators} from "@angular/forms"; +import { Component, Inject, OnInit } from "@angular/core"; +import { UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms"; +import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from "@angular/material/dialog"; import { DatasetProfileModel } from "@app/core/model/dataset/dataset-profile"; +import { Prefilling } from "@app/core/model/dataset/prefilling"; import { DmpProfileService } from "@app/core/services/dmp/dmp-profile.service"; +import { PrefillingService } from "@app/core/services/prefilling.service"; +import { ProgressIndicationService } from "@app/core/services/progress-indication/progress-indication-service"; +import { SingleAutoCompleteConfiguration } from "@app/library/auto-complete/single/single-auto-complete-configuration"; import { PopupNotificationDialogComponent } from "@app/library/notification/popup/popup-notification.component"; +import { BaseComponent } from "@common/base/base.component"; import { TranslateService } from "@ngx-translate/core"; +import { Observable } from "rxjs"; +import { map, takeUntil } from "rxjs/operators"; @Component({ selector: 'prefill-dataset-component', @@ -26,13 +26,13 @@ export class PrefillDatasetComponent extends BaseComponent implements OnInit { prefillForm: UntypedFormGroup; constructor(public dialogRef: MatDialogRef, - private prefillingService: PrefillingService, - private dmpProfileService: DmpProfileService, - private dialog: MatDialog, - private language: TranslateService, - private progressIndicationService: ProgressIndicationService, - private fb: UntypedFormBuilder, - @Inject(MAT_DIALOG_DATA) public data: any) { + private prefillingService: PrefillingService, + private dmpProfileService: DmpProfileService, + private dialog: MatDialog, + private language: TranslateService, + private progressIndicationService: ProgressIndicationService, + private fb: UntypedFormBuilder, + @Inject(MAT_DIALOG_DATA) public data: any) { super(); } @@ -45,13 +45,13 @@ export class PrefillDatasetComponent extends BaseComponent implements OnInit { profile: this.fb.control('', Validators.required), prefill: this.fb.control(null, Validators.required) }) - if(this.data.availableProfiles && this.data.availableProfiles.length === 1) { + if (this.data.availableProfiles && this.data.availableProfiles.length === 1) { this.addProfileIfUsedLessThanMax(this.data.availableProfiles[0]); } this.prefillAutoCompleteConfiguration = { filterFn: this.searchDatasets.bind(this), loadDataOnStart: false, - displayFn: (item) => (item['name'].length > 60)?(item['name'].substr(0, 60) + "..." ):item['name'], + displayFn: (item) => (item['name'].length > 60) ? (item['name'].substr(0, 60) + "...") : item['name'], titleFn: (item) => item['name'], subtitleFn: (item) => item['pid'] }; @@ -64,26 +64,26 @@ export class PrefillDatasetComponent extends BaseComponent implements OnInit { .pipe(takeUntil(this._destroyed)) .subscribe(result => { const section = result.definition.sections[dmpSectionIndex]; - if(section.hasTemplates){ + if (section.hasTemplates) { const foundTemplate = section.descriptionTemplates.find(template => template.descriptionTemplateId === profile.id); if (foundTemplate !== undefined) { let count = 0; - if(this.data.datasetFormGroup.get('dmp').value.datasets != null){ - for(let dataset of this.data.datasetFormGroup.get('dmp').value.datasets){ - if(dataset.dmpSectionIndex === dmpSectionIndex && dataset.profile.id === foundTemplate.descriptionTemplateId){ + if (this.data.datasetFormGroup.get('dmp').value.datasets != null) { + for (let dataset of this.data.datasetFormGroup.get('dmp').value.datasets) { + if (dataset.dmpSectionIndex === dmpSectionIndex && dataset.profile.id === foundTemplate.descriptionTemplateId) { count++; } } - if(count < foundTemplate.maxMultiplicity){ + if (count < foundTemplate.maxMultiplicity) { this.prefillForm.get('profile').patchValue(profile); } } } - else{ + else { this.prefillForm.get('profile').patchValue(profile); } } - else{ + else { this.prefillForm.get('profile').patchValue(profile); } }); @@ -97,17 +97,17 @@ export class PrefillDatasetComponent extends BaseComponent implements OnInit { .pipe(takeUntil(this._destroyed)) .subscribe(result => { const section = result.definition.sections[dmpSectionIndex]; - if(section.hasTemplates){ + if (section.hasTemplates) { const foundTemplate = section.descriptionTemplates.find(template => template.descriptionTemplateId === profile.id); if (foundTemplate !== undefined) { let count = 0; - if(this.data.datasetFormGroup.get('dmp').value.datasets != null){ - for(let dataset of this.data.datasetFormGroup.get('dmp').value.datasets){ - if(dataset.dmpSectionIndex === dmpSectionIndex && dataset.profile.id === foundTemplate.descriptionTemplateId){ + if (this.data.datasetFormGroup.get('dmp').value.datasets != null) { + for (let dataset of this.data.datasetFormGroup.get('dmp').value.datasets) { + if (dataset.dmpSectionIndex === dmpSectionIndex && dataset.profile.id === foundTemplate.descriptionTemplateId) { count++; } } - if(count === foundTemplate.maxMultiplicity){ + if (count === foundTemplate.maxMultiplicity) { this.dialog.open(PopupNotificationDialogComponent, { data: { title: this.language.instant('DATASET-EDITOR.MAX-DESCRIPTION-DIALOG.TITLE'), @@ -115,7 +115,7 @@ export class PrefillDatasetComponent extends BaseComponent implements OnInit { }, maxWidth: '30em' }); } - else{ + else { this.prefillForm.get('profile').setValue(profile); } } @@ -136,9 +136,9 @@ export class PrefillDatasetComponent extends BaseComponent implements OnInit { searchDatasets(query: string): Observable { return this.prefillingService.getPrefillingList(query).pipe(map(prefilling => prefilling.sort((a, b) => { - if(a.name > b.name) { + if (a.name > b.name) { return 1; - } else if(a.name < b.name) { + } else if (a.name < b.name) { return -1; } else { return 0; @@ -147,8 +147,8 @@ export class PrefillDatasetComponent extends BaseComponent implements OnInit { } next() { - if(this.isPrefilled) { - if(this.prefillForm.get('prefill').value.data == null) { + if (this.isPrefilled) { + if (this.prefillForm.get('prefill').value.data == null) { this.prefillingService.getPrefillingDataset(this.prefillForm.get('prefill').value.pid, this.prefillForm.get('profile').value.id, this.prefillForm.get('prefill').value.key).subscribe(wizard => { wizard.profile = this.prefillForm.get('profile').value; this.closeDialog(wizard); diff --git a/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria-dialogue/dataset-criteria-dialog.component.ts b/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria-dialogue/dataset-criteria-dialog.component.ts index 9a6fb1900..d640a6d1f 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria-dialogue/dataset-criteria-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria-dialogue/dataset-criteria-dialog.component.ts @@ -1,10 +1,10 @@ -import { Inject, Component, ViewChild, OnInit, Output, EventEmitter } from '@angular/core'; -import { MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA, MatLegacyDialogRef as MatDialogRef } from '@angular/material/legacy-dialog'; +import { HttpClient } from '@angular/common/http'; +import { Component, Inject, OnInit, ViewChild } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { DatasetCriteriaComponent } from '../dataset-criteria.component'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { DatasetCriteria } from '@app/core/query/dataset/dataset-criteria'; import { MatomoService } from '@app/core/services/matomo/matomo-service'; -import { HttpClient } from '@angular/common/http'; +import { DatasetCriteriaComponent } from '../dataset-criteria.component'; @Component({ selector: 'dataset-criteria-dialog-component', diff --git a/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.ts b/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.ts index 62159b8f4..79368187c 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.ts +++ b/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.ts @@ -1,8 +1,8 @@ import { Component, Input, OnInit, Output, EventEmitter } from '@angular/core'; import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; -import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; +import { MatDialog } from '@angular/material/dialog'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { Router } from '@angular/router'; import { DatasetStatus } from '@app/core/common/enum/dataset-status'; import { DataTableData } from '@app/core/model/data-table/data-table-data'; diff --git a/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-upload-dialogue/dataset-upload-dialogue.component.ts b/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-upload-dialogue/dataset-upload-dialogue.component.ts index 2716cbf94..307907fcd 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-upload-dialogue/dataset-upload-dialogue.component.ts +++ b/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-upload-dialogue/dataset-upload-dialogue.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { DataTableData } from '@app/core/model/data-table/data-table-data'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; diff --git a/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.ts b/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.ts index 155ad1476..75800d9cd 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.ts +++ b/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.ts @@ -1,35 +1,35 @@ +import { HttpClient } from '@angular/common/http'; import { Component, OnInit, ViewChild } from '@angular/core'; -import { MatLegacyPaginator as MatPaginator } from '@angular/material/legacy-paginator'; +import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; +import { MatDialog } from '@angular/material/dialog'; +import { MatPaginator } from '@angular/material/paginator'; import { MatSort } from '@angular/material/sort'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { DatasetStatus } from '@app/core/common/enum/dataset-status'; +import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; import { DatasetListingModel } from '@app/core/model/dataset/dataset-listing'; import { DatasetCriteria } from '@app/core/query/dataset/dataset-criteria'; +import { AuthService } from '@app/core/services/auth/auth.service'; import { DatasetService } from '@app/core/services/dataset/dataset.service'; import { DmpService } from '@app/core/services/dmp/dmp.service'; +import { MatomoService } from '@app/core/services/matomo/matomo-service'; +import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; +import { GuidedTour, Orientation } from '@app/library/guided-tour/guided-tour.constants'; +import { GuidedTourService } from '@app/library/guided-tour/guided-tour.service'; import { DatasetCriteriaComponent } from '@app/ui/dataset/listing/criteria/dataset-criteria.component'; -import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item'; +import { StartNewDatasetDialogComponent } from '@app/ui/dmp/start-new-dataset-dialogue/start-new-dataset-dialog.component'; +import { StartNewDmpDialogComponent } from '@app/ui/dmp/start-new-dmp-dialogue/start-new-dmp-dialog.component'; import { IBreadCrumbComponent } from '@app/ui/misc/breadcrumb/definition/IBreadCrumbComponent'; +import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item'; +import { isNullOrUndefined } from '@app/utilities/enhancers/utils'; import { BaseComponent } from '@common/base/base.component'; import { TranslateService } from '@ngx-translate/core'; import { Observable, of as observableOf } from 'rxjs'; import { debounceTime, takeUntil } from 'rxjs/operators'; -import { ExternalTagEditorModel, DatasetWizardEditorModel } from '../dataset-wizard/dataset-wizard-editor.model'; -import { AuthService } from '@app/core/services/auth/auth.service'; -import { isNullOrUndefined } from '@app/utilities/enhancers/utils'; +import { DatasetWizardEditorModel, ExternalTagEditorModel } from '../dataset-wizard/dataset-wizard-editor.model'; import { DatasetCriteriaDialogComponent } from './criteria/dataset-criteria-dialogue/dataset-criteria-dialog.component'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; -import { UntypedFormGroup, UntypedFormBuilder, UntypedFormControl } from '@angular/forms'; -import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order'; -import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; -import { GuidedTourService } from '@app/library/guided-tour/guided-tour.service'; -import { GuidedTour, Orientation } from '@app/library/guided-tour/guided-tour.constants'; -import { StartNewDatasetDialogComponent } from '@app/ui/dmp/start-new-dataset-dialogue/start-new-dataset-dialog.component'; -import { StartNewDmpDialogComponent } from '@app/ui/dmp/start-new-dmp-dialogue/start-new-dmp-dialog.component'; -import { MatomoService } from '@app/core/services/matomo/matomo-service'; -import { HttpClient } from '@angular/common/http'; @Component({ selector: 'app-dataset-listing-component', @@ -152,22 +152,22 @@ export class DatasetListingComponent extends BaseComponent implements OnInit, IB } public dashboardTour: GuidedTour = { - tourId: 'dmp-dataset-tour', - useOrb: true, - steps: [ - { + tourId: 'dmp-dataset-tour', + useOrb: true, + steps: [ + { selector: '.dmp-tour', - content: 'Step 1', + content: 'Step 1', orientation: Orientation.Right, isStepUnique: false - }, - { - selector: '.dataset-tour', - content: 'Step 2', + }, + { + selector: '.dataset-tour', + content: 'Step 2', orientation: Orientation.Right, isStepUnique: false - } - ] + } + ] }; public isAuthenticated(): boolean { @@ -382,17 +382,17 @@ export class DatasetListingComponent extends BaseComponent implements OnInit, IB public setDashboardTourDmpText(): void { this.dmpText = this.language.instant('DMP-LISTING.TEXT-INFO') + '\n\n' + - this.language.instant('DMP-LISTING.TEXT-INFO-QUESTION') + ' ' + - this.language.instant('DMP-LISTING.LINK-ZENODO') + ' ' + - this.language.instant('DMP-LISTING.GET-IDEA'); + this.language.instant('DMP-LISTING.TEXT-INFO-QUESTION') + ' ' + + this.language.instant('DMP-LISTING.LINK-ZENODO') + ' ' + + this.language.instant('DMP-LISTING.GET-IDEA'); this.dashboardTour.steps[0].title = this.dmpText; } public setDashboardTourDatasetText(): void { this.datasetText = this.language.instant('DATASET-LISTING.TEXT-INFO') + - this.language.instant('DATASET-LISTING.LINK-PUBLIC-DATASETS') + ' ' + - this.language.instant('DATASET-LISTING.TEXT-INFO-REST') + '\n\n' + - this.language.instant('DATASET-LISTING.TEXT-INFO-PAR'); + this.language.instant('DATASET-LISTING.LINK-PUBLIC-DATASETS') + ' ' + + this.language.instant('DATASET-LISTING.TEXT-INFO-REST') + '\n\n' + + this.language.instant('DATASET-LISTING.TEXT-INFO-PAR'); this.dashboardTour.steps[1].title = this.datasetText; } diff --git a/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.ts b/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.ts index 4be0b6638..b3bd6ff78 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.ts +++ b/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.ts @@ -8,7 +8,7 @@ import { BaseComponent } from '@common/base/base.component'; import { takeUntil } from 'rxjs/operators'; import * as FileSaver from 'file-saver'; import { DmpInvitationDialogComponent } from '@app/ui/dmp/invitation/dmp-invitation-dialog.component'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { DatasetCopyDialogueComponent } from '../../dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component'; import { UntypedFormControl } from '@angular/forms'; import { TranslateService } from '@ngx-translate/core'; diff --git a/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts b/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts index 02bb5d5c6..05c9dec4e 100644 --- a/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts +++ b/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts @@ -7,7 +7,7 @@ import { ActivatedRoute, Router, Params } from '@angular/router'; import { DatasetService } from '@app/core/services/dataset/dataset.service'; import { TranslateService } from '@ngx-translate/core'; import { AuthService } from '@app/core/services/auth/auth.service'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service'; import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; import { Oauth2DialogService } from '@app/ui/misc/oauth2-dialog/service/oauth2-dialog.service'; diff --git a/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.component.ts index 27f83a507..58b67ae5f 100644 --- a/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.component.ts @@ -1,18 +1,15 @@ import { Component, Inject } from '@angular/core'; -import { MatLegacyDialog as MatDialog, MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; -import { DmpService } from '@app/core/services/dmp/dmp.service'; -import { map, takeUntil } from 'rxjs/operators'; -import { DmpModel } from '@app/core/model/dmp/dmp'; -import { UntypedFormBuilder, UntypedFormArray, UntypedFormControl } from '@angular/forms'; -import { DatasetDescriptionFormEditorModel } from '@app/ui/misc/dataset-description-form/dataset-description-form.model'; -import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration'; -import { Observable } from 'rxjs'; -import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; +import { UntypedFormArray, UntypedFormBuilder, UntypedFormControl } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; +import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; import { DatasetProfileCriteria } from '@app/core/query/dataset-profile/dataset-profile-criteria'; -import { AvailableProfilesComponent } from '../../editor/available-profiles/available-profiles.component'; -import { DatasetPreviewDialogComponent } from '../../dataset-preview/dataset-preview-dialog.component'; +import { DmpService } from '@app/core/services/dmp/dmp.service'; +import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration'; import { BaseComponent } from '@common/base/base.component'; +import { Observable } from 'rxjs'; +import { map, takeUntil } from 'rxjs/operators'; +import { DatasetPreviewDialogComponent } from '../../dataset-preview/dataset-preview-dialog.component'; @Component({ selector: 'app-clone-dialog', diff --git a/dmp-frontend/src/app/ui/dmp/clone/dmp-clone.component.ts b/dmp-frontend/src/app/ui/dmp/clone/dmp-clone.component.ts index f0f9cc1fd..f652b7e4f 100644 --- a/dmp-frontend/src/app/ui/dmp/clone/dmp-clone.component.ts +++ b/dmp-frontend/src/app/ui/dmp/clone/dmp-clone.component.ts @@ -28,7 +28,7 @@ import { DatasetService } from '@app/core/services/dataset/dataset.service'; import { DmpEditorModel } from '../editor/dmp-editor.model'; import { DatasetWizardEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { isNullOrUndefined } from '@app/utilities/enhancers/utils'; import { DmpProfileService } from '@app/core/services/dmp/dmp-profile.service'; import { DmpBlueprintDefinition, SystemFieldType } from '@app/core/model/dmp/dmp-blueprint/dmp-blueprint'; diff --git a/dmp-frontend/src/app/ui/dmp/dataset-preview/dataset-preview-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/dataset-preview/dataset-preview-dialog.component.ts index 2ee1dde41..9cacc9367 100644 --- a/dmp-frontend/src/app/ui/dmp/dataset-preview/dataset-preview-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/dataset-preview/dataset-preview-dialog.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service'; import { ProgressIndicationService } from '@app/core/services/progress-indication/progress-indication-service'; import { DatasetDescriptionFormEditorModel } from '@app/ui/misc/dataset-description-form/dataset-description-form.model'; diff --git a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.ts b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.ts index 52ee05b08..45e838c9d 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.ts +++ b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.ts @@ -24,7 +24,7 @@ import { ExternalSourcesService } from '@app/core/services/external-sources/exte import { Observable, interval } from 'rxjs'; import { ExternalSourceItemModel } from '@app/core/model/external-sources/external-source-item'; import { OrganisationService } from '@app/core/services/organisation/organisation.service'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { AddResearcherComponent } from '../editor/add-researcher/add-researcher.component'; import { AddOrganizationComponent } from '../editor/add-organization/add-organization.component'; import { RequestItem } from '@app/core/query/request-item'; diff --git a/dmp-frontend/src/app/ui/dmp/dmp-to-dataset/dmp-to-dataset-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/dmp-to-dataset/dmp-to-dataset-dialog.component.ts index 24da6d1dd..d23a6295e 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp-to-dataset/dmp-to-dataset-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/dmp-to-dataset/dmp-to-dataset-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject, OnInit } from '@angular/core'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; @Component({ selector: 'app-to-dataset-dialog-component', diff --git a/dmp-frontend/src/app/ui/dmp/editor/add-organization/add-organization.component.ts b/dmp-frontend/src/app/ui/dmp/editor/add-organization/add-organization.component.ts index 7b6b960a9..ed67c5dbd 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/add-organization/add-organization.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/add-organization/add-organization.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core'; import { AbstractControl, AsyncValidatorFn, UntypedFormControl, UntypedFormGroup, ValidationErrors } from '@angular/forms'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service'; import { ExternalResearcherService } from '@app/core/services/external-sources/researcher/external-researcher.service'; import { OrganisationService } from '@app/core/services/organisation/organisation.service'; diff --git a/dmp-frontend/src/app/ui/dmp/editor/add-researcher/add-researcher.component.ts b/dmp-frontend/src/app/ui/dmp/editor/add-researcher/add-researcher.component.ts index 35d66eada..d2c084b9b 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/add-researcher/add-researcher.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/add-researcher/add-researcher.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core'; import { AbstractControl, AsyncValidatorFn, UntypedFormControl, UntypedFormGroup, ValidationErrors } from '@angular/forms'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service'; import { ExternalResearcherService } from '@app/core/services/external-sources/researcher/external-researcher.service'; import { ResearcherEditorModel } from '@app/ui/dmp/editor/add-researcher/add-researcher.model'; diff --git a/dmp-frontend/src/app/ui/dmp/editor/available-profiles/available-profiles.component.ts b/dmp-frontend/src/app/ui/dmp/editor/available-profiles/available-profiles.component.ts index 6760d7772..e61adccd1 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/available-profiles/available-profiles.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/available-profiles/available-profiles.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; import { DatasetProfileCriteria } from '@app/core/query/dataset-profile/dataset-profile-criteria'; diff --git a/dmp-frontend/src/app/ui/dmp/editor/cost-editor/add-cost/add-cost.component.ts b/dmp-frontend/src/app/ui/dmp/editor/cost-editor/add-cost/add-cost.component.ts index 3f888009b..ce9d0e91f 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/cost-editor/add-cost/add-cost.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/cost-editor/add-cost/add-cost.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { ExternalResearcherService } from '@app/core/services/external-sources/researcher/external-researcher.service'; import { BaseComponent } from '@common/base/base.component'; import { takeUntil } from 'rxjs/operators'; diff --git a/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts index ab0ce30c0..9983eb487 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts @@ -4,8 +4,8 @@ import { TranslateService } from '@ngx-translate/core'; import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service'; import { MatChipInputEvent } from '@angular/material/chips'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; -import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; +import { MatDialog } from '@angular/material/dialog'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service'; import { ActivatedRoute, Router } from '@angular/router'; import { DmpService } from '@app/core/services/dmp/dmp.service'; diff --git a/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts index 74c2b0e2f..1d88e6a52 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts @@ -7,7 +7,7 @@ import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/mu import { map, takeUntil } from 'rxjs/operators'; import { Observable } from 'rxjs'; import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; import { DatasetProfileCriteria } from '@app/core/query/dataset-profile/dataset-profile-criteria'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-deposit-dropdown/dmp-deposit-dropdown.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dmp-deposit-dropdown/dmp-deposit-dropdown.component.ts index 2f0905d7d..36a1572a3 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-deposit-dropdown/dmp-deposit-dropdown.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-deposit-dropdown/dmp-deposit-dropdown.component.ts @@ -1,5 +1,5 @@ import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; -import {MatLegacyDialog as MatDialog} from '@angular/material/legacy-dialog'; +import {MatDialog} from '@angular/material/dialog'; import {DepositConfigurationStatus} from '@app/core/common/enum/deposit-configuration-status'; import {DepositConfigurationModel} from '@app/core/model/deposit/deposit-configuration'; import {DmpOverviewModel} from '@app/core/model/dmp/dmp-overview'; diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts index 0e56b3cf0..987a87021 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit} from '@angular/core'; import { UntypedFormGroup, AbstractControl, UntypedFormControl, UntypedFormArray} from '@angular/forms'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { DmpStatus } from '@app/core/common/enum/dmp-status'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-finalize-dialog/dmp-finalize-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dmp-finalize-dialog/dmp-finalize-dialog.component.ts index b707f86fd..d49b4cbb2 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-finalize-dialog/dmp-finalize-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-finalize-dialog/dmp-finalize-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject, OnInit } from '@angular/core'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { Router } from '@angular/router'; import { DatasetStatus } from '@app/core/common/enum/dataset-status'; import { DatasetService } from '@app/core/services/dataset/dataset.service'; diff --git a/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.ts b/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.ts index 4c7d5dc0f..223446719 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.ts @@ -1,7 +1,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { UntypedFormGroup, UntypedFormArray } from '@angular/forms'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; import { DmpProfileDefinition } from '@app/core/model/dmp-profile/dmp-profile'; diff --git a/dmp-frontend/src/app/ui/dmp/editor/license-info/license-info.component.ts b/dmp-frontend/src/app/ui/dmp/editor/license-info/license-info.component.ts index b7918510f..91975a5c5 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/license-info/license-info.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/license-info/license-info.component.ts @@ -6,7 +6,7 @@ import { ExternalSourceItemModel } from '@app/core/model/external-sources/extern import { Observable } from 'rxjs'; import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service'; import { isNullOrUndefined } from '@app/utilities/enhancers/utils'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration'; import { LanguageInfo } from '@app/core/model/language-info'; import { LanguageInfoService } from '@app/core/services/culture/language-info-service'; diff --git a/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.ts b/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.ts index 26f087ffe..1d371c001 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.ts @@ -9,7 +9,7 @@ import { ExternalSourceItemModel } from '@app/core/model/external-sources/extern import { Observable } from 'rxjs'; import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service'; import { isNullOrUndefined } from '@app/utilities/enhancers/utils'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { AddOrganizationComponent } from '../add-organization/add-organization.component'; import { AddResearcherComponent } from '../add-researcher/add-researcher.component'; import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration'; diff --git a/dmp-frontend/src/app/ui/dmp/editor/people-tab/people-tab.component.ts b/dmp-frontend/src/app/ui/dmp/editor/people-tab/people-tab.component.ts index a3b7e116b..749c26ac9 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/people-tab/people-tab.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/people-tab/people-tab.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component'; import { TranslateService } from '@ngx-translate/core'; import { Principal } from '../../../../core/model/auth/principal'; diff --git a/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation-dialog.component.ts index e08b80b8e..27e4e19c3 100644 --- a/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation-dialog.component.ts @@ -3,7 +3,7 @@ import { COMMA, ENTER } from '@angular/cdk/keycodes'; import { Component, Inject, OnInit, ViewChild } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; import { MatChipInputEvent } from '@angular/material/chips'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; import { DmpInvitation } from '@app/core/model/dmp/invitation/dmp-invitation'; import { DmpInvitationUser } from '@app/core/model/dmp/invitation/dmp-invitation-user'; diff --git a/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria-dialog.component.ts index 08190ec01..b17af0e78 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria-dialog.component.ts @@ -1,5 +1,5 @@ import { Inject, Component, ViewChild, OnInit, Output, EventEmitter } from '@angular/core'; -import { MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA, MatLegacyDialogRef as MatDialogRef } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { DmpCriteriaComponent } from './dmp-criteria.component'; import { DmpCriteria } from '@app/core/query/dmp/dmp-criteria'; import { UntypedFormGroup } from '@angular/forms'; diff --git a/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.ts b/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.ts index 9978e4053..0a39cbdcd 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.ts @@ -1,7 +1,7 @@ import { Component, Input, OnInit, Output, EventEmitter } from '@angular/core'; import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; import { GrantListingModel } from '@app/core/model/grant/grant-listing'; import { DatasetProfileCriteria } from '@app/core/query/dataset-profile/dataset-profile-criteria'; diff --git a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts index 4dea4a3a6..6652c3391 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts @@ -1,36 +1,36 @@ +import { HttpClient } from '@angular/common/http'; import { Component, OnInit, ViewChild } from '@angular/core'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; -import { MatLegacyPaginator as MatPaginator } from '@angular/material/legacy-paginator'; +import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; +import { MatDialog } from '@angular/material/dialog'; +import { MatPaginator } from '@angular/material/paginator'; import { MatSort } from '@angular/material/sort'; import { ActivatedRoute, Router } from '@angular/router'; +import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; import { DmpListingModel } from '@app/core/model/dmp/dmp-listing'; import { GrantListingModel } from '@app/core/model/grant/grant-listing'; import { DmpCriteria } from '@app/core/query/dmp/dmp-criteria'; +import { AuthService } from '@app/core/services/auth/auth.service'; import { DmpService } from '@app/core/services/dmp/dmp.service'; +import { GrantService } from "@app/core/services/grant/grant.service"; +import { MatomoService } from '@app/core/services/matomo/matomo-service'; +import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service'; import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; +import { GuidedTour, Orientation } from '@app/library/guided-tour/guided-tour.constants'; +import { GuidedTourService } from '@app/library/guided-tour/guided-tour.service'; import { DmpInvitationDialogComponent } from '@app/ui/dmp/invitation/dmp-invitation-dialog.component'; import { DmpCriteriaComponent } from '@app/ui/dmp/listing/criteria/dmp-criteria.component'; -import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item'; import { IBreadCrumbComponent } from '@app/ui/misc/breadcrumb/definition/IBreadCrumbComponent'; +import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item'; +import { isNullOrUndefined } from '@app/utilities/enhancers/utils'; import { BaseComponent } from '@common/base/base.component'; import { TranslateService } from '@ngx-translate/core'; +import { NgDialogAnimationService } from "ng-dialog-animation"; import { Observable, of as observableOf } from 'rxjs'; import { debounceTime, takeUntil } from 'rxjs/operators'; -import { GrantService } from "@app/core/services/grant/grant.service"; -import { DmpUploadDialogue } from './upload-dialogue/dmp-upload-dialogue.component'; -import { UiNotificationService, SnackBarNotificationLevel } from '@app/core/services/notification/ui-notification-service'; -import { isNullOrUndefined } from '@app/utilities/enhancers/utils'; -import { AuthService } from '@app/core/services/auth/auth.service'; -import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; import { DmpCriteriaDialogComponent } from './criteria/dmp-criteria-dialog.component'; -import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order'; -import { GuidedTourService } from '@app/library/guided-tour/guided-tour.service'; -import { GuidedTour, Orientation } from '@app/library/guided-tour/guided-tour.constants'; -import { NgDialogAnimationService } from "ng-dialog-animation"; -import { HttpClient } from '@angular/common/http'; -import { MatomoService } from '@app/core/services/matomo/matomo-service'; +import { DmpUploadDialogue } from './upload-dialogue/dmp-upload-dialogue.component'; @Component({ selector: 'app-dmp-listing-component', diff --git a/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.ts b/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.ts index 7db452705..3cf55ed81 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.ts @@ -1,6 +1,6 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { DmpListingModel } from '../../../../core/model/dmp/dmp-listing'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { DmpInvitationDialogComponent } from '../../invitation/dmp-invitation-dialog.component'; import { Router, ActivatedRoute } from '@angular/router'; import { DatasetService } from '../../../../core/services/dataset/dataset.service'; diff --git a/dmp-frontend/src/app/ui/dmp/listing/upload-dialogue/dmp-upload-dialogue.component.ts b/dmp-frontend/src/app/ui/dmp/listing/upload-dialogue/dmp-upload-dialogue.component.ts index 7a9f9e7fc..15cd4b718 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/upload-dialogue/dmp-upload-dialogue.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/upload-dialogue/dmp-upload-dialogue.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MatLegacyDialog as MatDialog, MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { DmpService } from '../../../../core/services/dmp/dmp.service'; import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration'; import { map, takeUntil } from 'rxjs/operators'; diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts index 320f89987..723d0aabe 100644 --- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts +++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts @@ -1,5 +1,5 @@ import {Component, ElementRef, OnInit, ViewChild} from '@angular/core'; -import {MatLegacyDialog as MatDialog} from '@angular/material/legacy-dialog'; +import {MatDialog} from '@angular/material/dialog'; import {ActivatedRoute, Params, Router} from '@angular/router'; import {DatasetStatus} from '@app/core/common/enum/dataset-status'; import {DmpStatus} from '@app/core/common/enum/dmp-status'; diff --git a/dmp-frontend/src/app/ui/dmp/start-new-dataset-dialogue/start-new-dataset-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/start-new-dataset-dialogue/start-new-dataset-dialog.component.ts index fc8d14baa..0783b92bf 100644 --- a/dmp-frontend/src/app/ui/dmp/start-new-dataset-dialogue/start-new-dataset-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/start-new-dataset-dialogue/start-new-dataset-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA, MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialogRef, MAT_DIALOG_DATA, MatDialog } from '@angular/material/dialog'; import { BaseComponent } from '@common/base/base.component'; import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration'; import { TranslateService } from '@ngx-translate/core'; diff --git a/dmp-frontend/src/app/ui/dmp/start-new-dmp-dialogue/start-new-dmp-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/start-new-dmp-dialogue/start-new-dmp-dialog.component.ts index eeb994bf1..f9b46a8d4 100644 --- a/dmp-frontend/src/app/ui/dmp/start-new-dmp-dialogue/start-new-dmp-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/start-new-dmp-dialogue/start-new-dmp-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA, MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialogRef, MAT_DIALOG_DATA, MatDialog } from '@angular/material/dialog'; import { Router } from '@angular/router'; import { DmpUploadDialogue } from '../listing/upload-dialogue/dmp-upload-dialogue.component'; import { UiNotificationService, SnackBarNotificationLevel } from '@app/core/services/notification/ui-notification-service'; diff --git a/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard.component.ts b/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard.component.ts index a1cdb06d9..0d3e9ee3a 100644 --- a/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard.component.ts +++ b/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard.component.ts @@ -2,7 +2,7 @@ import { HttpErrorResponse } from '@angular/common/http'; import { Component, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { DmpModel } from '@app/core/model/dmp/dmp'; import { DmpBlueprintDefinition, SystemFieldType } from '@app/core/model/dmp/dmp-blueprint/dmp-blueprint'; diff --git a/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.ts b/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.ts index 3ff161ed0..74767095c 100644 --- a/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.ts +++ b/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.ts @@ -1,7 +1,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; import { ExternalSourceItemModel } from '@app/core/model/external-sources/external-source-item'; diff --git a/dmp-frontend/src/app/ui/dmp/wizard/listing/dmp-wizard-dataset-listing.component.ts b/dmp-frontend/src/app/ui/dmp/wizard/listing/dmp-wizard-dataset-listing.component.ts index 81620a10e..4e840d3ec 100644 --- a/dmp-frontend/src/app/ui/dmp/wizard/listing/dmp-wizard-dataset-listing.component.ts +++ b/dmp-frontend/src/app/ui/dmp/wizard/listing/dmp-wizard-dataset-listing.component.ts @@ -1,8 +1,8 @@ import { SelectionModel } from '@angular/cdk/collections'; import { Component, Input, OnInit, ViewChild } from '@angular/core'; import { UntypedFormArray, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; -import { MatLegacyPaginator as MatPaginator } from '@angular/material/legacy-paginator'; -import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; +import { MatPaginator } from '@angular/material/paginator'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { MatSort } from '@angular/material/sort'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; diff --git a/dmp-frontend/src/app/ui/faq/dialog/faq-dialog.component.ts b/dmp-frontend/src/app/ui/faq/dialog/faq-dialog.component.ts index cd2714b2c..2c3261dad 100644 --- a/dmp-frontend/src/app/ui/faq/dialog/faq-dialog.component.ts +++ b/dmp-frontend/src/app/ui/faq/dialog/faq-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; @Component({ selector: 'app-faq-dialog', diff --git a/dmp-frontend/src/app/ui/glossary/dialog/glossary-dialog.component.ts b/dmp-frontend/src/app/ui/glossary/dialog/glossary-dialog.component.ts index d90592019..bd8ccd72d 100644 --- a/dmp-frontend/src/app/ui/glossary/dialog/glossary-dialog.component.ts +++ b/dmp-frontend/src/app/ui/glossary/dialog/glossary-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; @Component({ selector: 'app-glossary-dialog', diff --git a/dmp-frontend/src/app/ui/language/dialog/language-dialog.component.ts b/dmp-frontend/src/app/ui/language/dialog/language-dialog.component.ts index 5b73b940a..b2f90a4b5 100644 --- a/dmp-frontend/src/app/ui/language/dialog/language-dialog.component.ts +++ b/dmp-frontend/src/app/ui/language/dialog/language-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; @Component({ selector: 'app-language-dialog', diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field-dialog/form-composite-field-dialog.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field-dialog/form-composite-field-dialog.component.ts index ae68f6427..d1a3625cb 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field-dialog/form-composite-field-dialog.component.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field-dialog/form-composite-field-dialog.component.ts @@ -1,5 +1,5 @@ import {Component, Inject} from "@angular/core"; -import {MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA, MatLegacyDialogRef as MatDialogRef} from "@angular/material/legacy-dialog"; +import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; import {VisibilityRulesService} from "@app/ui/misc/dataset-description-form/visibility-rules/visibility-rules.service"; @Component({ diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.ts index 6bb7855f9..0009da801 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.ts @@ -7,7 +7,7 @@ import {VisibilityRulesService} from '../../visibility-rules/visibility-rules.se import { FormCompositeFieldDialogComponent } from "@app/ui/misc/dataset-description-form/components/form-composite-field-dialog/form-composite-field-dialog.component"; -import {MatLegacyDialog as MatDialog} from "@angular/material/legacy-dialog"; +import {MatDialog} from "@angular/material/dialog"; import {cloneAbstractControl} from "@app/utilities/enhancers/utils"; @Component({ diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.ts index c76424be7..c19014f99 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.ts @@ -44,7 +44,7 @@ import { UiNotificationService } from "@app/core/services/notification/ui-notification-service"; import {FormValidationErrorsDialogComponent} from "@common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component"; -import {MatLegacyDialog as MatDialog} from "@angular/material/legacy-dialog"; +import {MatDialog} from "@angular/material/dialog"; import {HttpError} from "@common/modules/errors/error-handling/http-error-handling.service"; import {HttpErrorResponse} from "@angular/common/http"; import * as FileSaver from "file-saver"; diff --git a/dmp-frontend/src/app/ui/misc/navigation/navigation.component.ts b/dmp-frontend/src/app/ui/misc/navigation/navigation.component.ts index ca9691a33..bfd52420f 100644 --- a/dmp-frontend/src/app/ui/misc/navigation/navigation.component.ts +++ b/dmp-frontend/src/app/ui/misc/navigation/navigation.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { UntypedFormControl } from '@angular/forms'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { Router } from '@angular/router'; import { AppRole } from '@app/core/common/enum/app-role'; import { SearchBarItem } from '@app/core/model/dashboard/search-bar-item'; diff --git a/dmp-frontend/src/app/ui/misc/navigation/user-dialog/user-dialog.component.ts b/dmp-frontend/src/app/ui/misc/navigation/user-dialog/user-dialog.component.ts index bc2f1ca0a..aa805814d 100644 --- a/dmp-frontend/src/app/ui/misc/navigation/user-dialog/user-dialog.component.ts +++ b/dmp-frontend/src/app/ui/misc/navigation/user-dialog/user-dialog.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { Router } from '@angular/router'; import { Principal } from '../../../../core/model/auth/principal'; import { AuthService } from '../../../../core/services/auth/auth.service'; diff --git a/dmp-frontend/src/app/ui/misc/oauth2-dialog/oauth2-dialog.component.ts b/dmp-frontend/src/app/ui/misc/oauth2-dialog/oauth2-dialog.component.ts index 41f49bb69..2ec574631 100644 --- a/dmp-frontend/src/app/ui/misc/oauth2-dialog/oauth2-dialog.component.ts +++ b/dmp-frontend/src/app/ui/misc/oauth2-dialog/oauth2-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit, Inject } from '@angular/core'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { ActivatedRoute, Params } from '@angular/router'; import { BaseComponent } from '@common/base/base.component'; import { takeUntil } from 'rxjs/operators'; diff --git a/dmp-frontend/src/app/ui/navbar/navbar.component.ts b/dmp-frontend/src/app/ui/navbar/navbar.component.ts index a8ea20cd2..c701ab0ce 100644 --- a/dmp-frontend/src/app/ui/navbar/navbar.component.ts +++ b/dmp-frontend/src/app/ui/navbar/navbar.component.ts @@ -1,8 +1,8 @@ import { Location } from '@angular/common'; import { HttpClient } from '@angular/common/http'; import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; -import { MatLegacyMenuTrigger as MatMenuTrigger } from '@angular/material/legacy-menu'; +import { MatDialog } from '@angular/material/dialog'; +import { MatMenuTrigger } from '@angular/material/menu'; import { Router } from '@angular/router'; import { AppRole } from '@app/core/common/enum/app-role'; import { UserListingModel } from '@app/core/model/user/user-listing'; diff --git a/dmp-frontend/src/app/ui/quick-wizard/dmp-editor/dmp-editor-wizard.component.ts b/dmp-frontend/src/app/ui/quick-wizard/dmp-editor/dmp-editor-wizard.component.ts index 585636d9f..ce13e98bd 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/dmp-editor/dmp-editor-wizard.component.ts +++ b/dmp-frontend/src/app/ui/quick-wizard/dmp-editor/dmp-editor-wizard.component.ts @@ -1,7 +1,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { UntypedFormArray, UntypedFormGroup } from '@angular/forms'; -import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; import { DatasetProfileCriteria } from '@app/core/query/dataset-profile/dataset-profile-criteria'; diff --git a/dmp-frontend/src/app/ui/quick-wizard/grant-editor/grant-editor-wizard.component.ts b/dmp-frontend/src/app/ui/quick-wizard/grant-editor/grant-editor-wizard.component.ts index 9c4fa0d3d..e2e31863e 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/grant-editor/grant-editor-wizard.component.ts +++ b/dmp-frontend/src/app/ui/quick-wizard/grant-editor/grant-editor-wizard.component.ts @@ -1,7 +1,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { AbstractControl, FormArray, FormControl, UntypedFormGroup } from '@angular/forms'; -import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { Router } from '@angular/router'; import { GrantCriteria } from '@app/core/query/grant/grant-criteria'; import { RequestItem } from '@app/core/query/request-item'; diff --git a/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.ts b/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.ts index e966a2d46..2a1160d60 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.ts +++ b/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.ts @@ -1,8 +1,8 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { AbstractControl, UntypedFormArray, FormControl, UntypedFormGroup } from '@angular/forms'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; -import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; +import { MatDialog } from '@angular/material/dialog'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { MatStepper } from '@angular/material/stepper'; import { Router } from '@angular/router'; import { DatasetStatus } from '@app/core/common/enum/dataset-status'; diff --git a/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.ts b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.ts index 94b278d3e..8ae6ec5ac 100644 --- a/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.ts +++ b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { Router } from '@angular/router'; import { ContactEmailFormModel } from '@app/core/model/contact/contact-email-form-model'; import { ContactSupportService } from '@app/core/services/contact-support/contact-support.service'; diff --git a/dmp-frontend/src/app/ui/sidebar/sidebar.component.ts b/dmp-frontend/src/app/ui/sidebar/sidebar.component.ts index f1f724ca9..48bccf255 100644 --- a/dmp-frontend/src/app/ui/sidebar/sidebar.component.ts +++ b/dmp-frontend/src/app/ui/sidebar/sidebar.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { TranslateService } from '@ngx-translate/core'; import { AuthService } from '../../core/services/auth/auth.service'; import { UserDialogComponent } from '../misc/navigation/user-dialog/user-dialog.component'; diff --git a/dmp-frontend/src/app/ui/user-guide/dialog/user-guide-dialog.component.ts b/dmp-frontend/src/app/ui/user-guide/dialog/user-guide-dialog.component.ts index cbe2ad8a8..8216c4625 100644 --- a/dmp-frontend/src/app/ui/user-guide/dialog/user-guide-dialog.component.ts +++ b/dmp-frontend/src/app/ui/user-guide/dialog/user-guide-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; @Component({ selector: 'app-user-guide-dialog', diff --git a/dmp-frontend/src/app/ui/user-profile/add-account/add-account-dialog.component.ts b/dmp-frontend/src/app/ui/user-profile/add-account/add-account-dialog.component.ts index f6a8f6e36..1a98e1de5 100644 --- a/dmp-frontend/src/app/ui/user-profile/add-account/add-account-dialog.component.ts +++ b/dmp-frontend/src/app/ui/user-profile/add-account/add-account-dialog.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { UserMergeRequestModel } from '@app/core/model/merge/user-merge-request'; import { MergeLoginService } from '@app/ui/auth/login/utilities/merge-login.service'; import { DatasetDescriptionFormEditorModel } from '@app/ui/misc/dataset-description-form/dataset-description-form.model'; diff --git a/dmp-frontend/src/app/ui/user-profile/user-profile.component.ts b/dmp-frontend/src/app/ui/user-profile/user-profile.component.ts index 45df1d11f..d923f2237 100644 --- a/dmp-frontend/src/app/ui/user-profile/user-profile.component.ts +++ b/dmp-frontend/src/app/ui/user-profile/user-profile.component.ts @@ -23,7 +23,7 @@ import { UserProfileEditorModel } from './user-profile-editor.model'; import { RoleOrganizationType } from '@app/core/common/enum/role-organization-type'; import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; import { AddAccountDialogComponent } from './add-account/add-account-dialog.component'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { UserCredentialModel } from '@app/core/model/user/user-credential'; import { AuthProvider } from '@app/core/common/enum/auth-provider'; import { MergeEmailConfirmationService } from '@app/core/services/merge-email-confirmation/merge-email-confirmation.service'; diff --git a/dmp-frontend/src/assets/scss/core/_buttons.scss b/dmp-frontend/src/assets/scss/core/_buttons.scss index d5bc732c7..c59d4a723 100644 --- a/dmp-frontend/src/assets/scss/core/_buttons.scss +++ b/dmp-frontend/src/assets/scss/core/_buttons.scss @@ -14,7 +14,7 @@ cursor: pointer; background-color: transparent; border: 0; - //TODO: angular update border-radius: $border-radius-sm; + border-radius: $border-radius-sm; outline: 0; transition: box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1); will-change: box-shadow, transform; @@ -71,11 +71,11 @@ // Size variations &.btn-lg, .btn-group-lg & { - @include button-size($input-btn-padding-y-lg, $input-btn-padding-x-lg, $bmd-btn-font-size, $btn-lg-line-height, $border-radius-sm); + @include button-size($input-btn-padding-y-lg, $input-btn-padding-x-lg, $bmd-btn-font-size, $btn-lg-line-height, $border-radius-sm); } &.btn-sm, .btn-group-sm & { - @include button-size($input-btn-padding-y-sm, $input-btn-padding-x-sm, $bmd-btn-font-size-sm, $line-height-sm, $border-radius-sm); + @include button-size($input-btn-padding-y-sm, $input-btn-padding-x-sm, $bmd-btn-font-size-sm, $line-height-sm, $border-radius-sm); } &.btn-round { @@ -205,7 +205,7 @@ //} .dropdown-menu { - border-radius: 0 0 $border-radius $border-radius; + border-radius: 0 0 $border-radius $border-radius; } &.btn-group-raised { diff --git a/dmp-frontend/src/assets/scss/core/_forms.scss b/dmp-frontend/src/assets/scss/core/_forms.scss index 9d21503e1..1f810e893 100644 --- a/dmp-frontend/src/assets/scss/core/_forms.scss +++ b/dmp-frontend/src/assets/scss/core/_forms.scss @@ -1,3 +1,5 @@ +@import "_variables.scss"; + form { // ensure enough room at the bottom of any form to display a one-line bmd-help margin-bottom: ($bmd-help-size-ratio * $font-size-base) * $line-height-base; diff --git a/dmp-frontend/src/assets/scss/core/mixins/_buttons.scss b/dmp-frontend/src/assets/scss/core/mixins/_buttons.scss index 32968eb7d..f22c2f8f1 100644 --- a/dmp-frontend/src/assets/scss/core/mixins/_buttons.scss +++ b/dmp-frontend/src/assets/scss/core/mixins/_buttons.scss @@ -175,6 +175,7 @@ $active-background: $focus-background; //$active-background: darken($background, 17%); + $active-border: darken($border, 25%); @include bmd-button-variant($color, @@ -182,8 +183,8 @@ $focus-background, $active-background, $border, - $focus-border, - $active-border); + $focus-border, + $active-border); @include shadow-2dp-color($background); diff --git a/dmp-frontend/src/assets/scss/core/variables/_type.scss b/dmp-frontend/src/assets/scss/core/variables/_type.scss index f1ab356cb..43614bc76 100644 --- a/dmp-frontend/src/assets/scss/core/variables/_type.scss +++ b/dmp-frontend/src/assets/scss/core/variables/_type.scss @@ -11,13 +11,13 @@ $font-family-serif: 'Roboto Slab', 'Times New Roman', serif !default; //$font-family-base: $font-family-sans-serif !default; // Pixel value used to responsively scale all typography. Applied to the `` element. -//$font-size-root: 16px !default; +$font-size-root: 16px !default; // $font-size-base: 1rem !default; -//$font-size-lg: 1.25rem !default; -//$font-size-sm: .875rem !default; -//$font-size-xs: .75rem !default; -// +$font-size-lg: 1.25rem !default; +$font-size-sm: .875rem !default; +$font-size-xs: .75rem !default; + $font-size-h1: 3.3125rem; $font-size-h2: 2.25rem !default; @@ -41,7 +41,7 @@ $display4-size: 2.125rem !default; // md display-1 34px was 3.5rem //$display3-weight: 300 !default; //$display4-weight: 300 !default; // -//$line-height-base: 1.5 !default; +$line-height-base: 1.5 !default; // $headings-margin-bottom: math.div($spacer, 2) !default; //$headings-font-family: inherit !default; diff --git a/dmp-frontend/src/assets/scss/material-dashboard.scss b/dmp-frontend/src/assets/scss/material-dashboard.scss index a052ec24d..8194c858b 100644 --- a/dmp-frontend/src/assets/scss/material-dashboard.scss +++ b/dmp-frontend/src/assets/scss/material-dashboard.scss @@ -48,7 +48,8 @@ $custom-theme: mat.define-light-theme($custom-theme-primary, $custom-theme-accen @import "core/variables"; @import "core/mixins"; //Material-Bootstrap configuration -//TODO: angular update @import "assets/scss/bootstrap-material"; +@import "assets/scss/bootstrap-material"; +@import "/node_modules/bootstrap/scss/bootstrap"; // Core Components @import "core/buttons"; diff --git a/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.ts b/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.ts index 947a9ec6b..ae5dd4916 100644 --- a/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.ts +++ b/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.ts @@ -1,6 +1,6 @@ import { Component, Inject } from '@angular/core'; import { AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { TranslateService } from '@ngx-translate/core'; @Component({ diff --git a/dmp-frontend/src/common/forms/pending-form-changes/pending-form-changes-guard.service.ts b/dmp-frontend/src/common/forms/pending-form-changes/pending-form-changes-guard.service.ts index 1a879c5e4..c8a5166d9 100644 --- a/dmp-frontend/src/common/forms/pending-form-changes/pending-form-changes-guard.service.ts +++ b/dmp-frontend/src/common/forms/pending-form-changes/pending-form-changes-guard.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'; +import { MatDialog } from '@angular/material/dialog'; import { CanDeactivate } from '@angular/router'; import { BasePendingChangesComponent } from '@common/base/base-pending-changes.component'; import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component'; diff --git a/dmp-frontend/src/common/http/interceptors/response-payload.interceptor.ts b/dmp-frontend/src/common/http/interceptors/response-payload.interceptor.ts index 3130b5453..dab8544f8 100644 --- a/dmp-frontend/src/common/http/interceptors/response-payload.interceptor.ts +++ b/dmp-frontend/src/common/http/interceptors/response-payload.interceptor.ts @@ -1,6 +1,6 @@ import { HttpHandler, HttpHeaderResponse, HttpProgressEvent, HttpRequest, HttpResponse, HttpSentEvent, HttpUserEvent } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { BaseInterceptor } from './base.interceptor'; diff --git a/dmp-frontend/src/common/material/material.module.ts b/dmp-frontend/src/common/material/material.module.ts index 302d949b8..ea8ccda39 100644 --- a/dmp-frontend/src/common/material/material.module.ts +++ b/dmp-frontend/src/common/material/material.module.ts @@ -1,36 +1,36 @@ +import { CdkTableModule } from '@angular/cdk/table'; import { NgModule } from '@angular/core'; -import { MatLegacyAutocompleteModule as MatAutocompleteModule } from '@angular/material/legacy-autocomplete'; -import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button'; +import { MatAutocompleteModule } from '@angular/material/autocomplete'; +import { MatButtonModule } from '@angular/material/button'; import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatLegacyCardModule as MatCardModule } from '@angular/material/legacy-card'; -import { MatLegacyCheckboxModule as MatCheckboxModule } from '@angular/material/legacy-checkbox'; -import { MatLegacyChipsModule as MatChipsModule } from '@angular/material/legacy-chips'; -import { MatLegacyOptionModule as MatOptionModule } from '@angular/material/legacy-core'; +import { MatCardModule } from '@angular/material/card'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatChipsModule } from '@angular/material/chips'; +import { MatOptionModule } from '@angular/material/core'; import { MatDatepickerModule } from '@angular/material/datepicker'; -import { MatLegacyDialogModule as MatDialogModule } from '@angular/material/legacy-dialog'; +import { MatDialogModule } from '@angular/material/dialog'; import { MatExpansionModule } from '@angular/material/expansion'; -import { MatLegacyFormFieldModule as MatFormFieldModule } from '@angular/material/legacy-form-field'; +import { MatFormFieldModule } from '@angular/material/form-field'; import { MatGridListModule } from '@angular/material/grid-list'; import { MatIconModule } from '@angular/material/icon'; -import { MatLegacyInputModule as MatInputModule } from '@angular/material/legacy-input'; -import { MatLegacyListModule as MatListModule } from '@angular/material/legacy-list'; -import { MatLegacyMenuModule as MatMenuModule } from '@angular/material/legacy-menu'; -import { MatLegacyPaginatorModule as MatPaginatorModule } from '@angular/material/legacy-paginator'; -import { MatLegacyProgressBarModule as MatProgressBarModule } from '@angular/material/legacy-progress-bar'; -import { MatLegacyProgressSpinnerModule as MatProgressSpinnerModule } from '@angular/material/legacy-progress-spinner'; -import { MatLegacyRadioModule as MatRadioModule } from '@angular/material/legacy-radio'; -import { MatLegacySelectModule as MatSelectModule } from '@angular/material/legacy-select'; +import { MatInputModule } from '@angular/material/input'; +import { MatListModule } from '@angular/material/list'; +import { MatMenuModule } from '@angular/material/menu'; +import { MatPaginatorModule } from '@angular/material/paginator'; +import { MatProgressBarModule } from '@angular/material/progress-bar'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { MatRadioModule } from '@angular/material/radio'; +import { MatSelectModule } from '@angular/material/select'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { MatLegacySlideToggleModule as MatSlideToggleModule } from '@angular/material/legacy-slide-toggle'; -import { MatLegacySliderModule as MatSliderModule } from '@angular/material/legacy-slider'; -import { MatLegacySnackBarModule as MatSnackBarModule } from '@angular/material/legacy-snack-bar'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { MatSliderModule } from '@angular/material/slider'; +import { MatSnackBarModule } from '@angular/material/snack-bar'; import { MatSortModule } from '@angular/material/sort'; import { MatStepperModule } from '@angular/material/stepper'; -import { MatLegacyTableModule as MatTableModule } from '@angular/material/legacy-table'; -import { MatLegacyTabsModule as MatTabsModule } from '@angular/material/legacy-tabs'; +import { MatTableModule } from '@angular/material/table'; +import { MatTabsModule } from '@angular/material/tabs'; import { MatToolbarModule } from '@angular/material/toolbar'; -import { MatLegacyTooltipModule as MatTooltipModule } from '@angular/material/legacy-tooltip'; -import { CdkTableModule } from '@angular/cdk/table'; +import { MatTooltipModule } from '@angular/material/tooltip'; @NgModule({ imports: [ diff --git a/dmp-frontend/src/common/modules/confirmation-dialog/confirmation-dialog.component.ts b/dmp-frontend/src/common/modules/confirmation-dialog/confirmation-dialog.component.ts index e767aac89..6017d85c3 100644 --- a/dmp-frontend/src/common/modules/confirmation-dialog/confirmation-dialog.component.ts +++ b/dmp-frontend/src/common/modules/confirmation-dialog/confirmation-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; @Component({ selector: 'app-confirmation-dialog', diff --git a/dmp-frontend/src/common/modules/multiple-choice-dialog/multiple-choice-dialog.component.ts b/dmp-frontend/src/common/modules/multiple-choice-dialog/multiple-choice-dialog.component.ts index b3a5d35f6..445226bfa 100644 --- a/dmp-frontend/src/common/modules/multiple-choice-dialog/multiple-choice-dialog.component.ts +++ b/dmp-frontend/src/common/modules/multiple-choice-dialog/multiple-choice-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; @Component({ selector: 'app-multiple-choice-dialog', diff --git a/dmp-frontend/src/common/modules/multiple-choice-dialog/multiple-choice-dialog.module.ts b/dmp-frontend/src/common/modules/multiple-choice-dialog/multiple-choice-dialog.module.ts index abecaded6..80a4329c6 100644 --- a/dmp-frontend/src/common/modules/multiple-choice-dialog/multiple-choice-dialog.module.ts +++ b/dmp-frontend/src/common/modules/multiple-choice-dialog/multiple-choice-dialog.module.ts @@ -1,14 +1,13 @@ import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { MultipleChoiceDialogComponent } from './multiple-choice-dialog.component'; -import { CommonUiModule } from '@common/ui/common-ui.module'; import { FormsModule } from '@angular/forms'; +import { CommonUiModule } from '@common/ui/common-ui.module'; +import { MultipleChoiceDialogComponent } from './multiple-choice-dialog.component'; @NgModule({ - imports: [CommonUiModule, FormsModule], - declarations: [MultipleChoiceDialogComponent], - exports: [MultipleChoiceDialogComponent] + imports: [CommonUiModule, FormsModule], + declarations: [MultipleChoiceDialogComponent], + exports: [MultipleChoiceDialogComponent] }) export class MultipleChoiceDialogModule { }