angular 16 update

This commit is contained in:
Diamantis Tziotzios 2023-10-05 22:42:47 +03:00
parent 96c2940eb0
commit 5a46345f15
25 changed files with 571 additions and 567 deletions

View File

@ -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"
],

View File

@ -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"
}
}

View File

@ -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';

View File

@ -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,

View File

@ -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);
}
});
}
});

View File

@ -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) {

View File

@ -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 });
}
}

View File

@ -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<void>
) {
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<void>());
fm.monitor(elRef.nativeElement, true).pipe(takeUntil(this._destroyed)).subscribe((origin) => {
this.focused = !!origin;

View File

@ -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<void>
) { 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<void>());
fm.monitor(elRef.nativeElement, true).pipe(takeUntil(this._destroyed)).subscribe((origin) => {
this.focused = !!origin;

View File

@ -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 { 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,29 +21,41 @@ 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 { 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 {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 { EditorCustomValidators } from '../../custom-validators/editor-custom-validators';
import { ViewStyleType } from '../field/view-style-enum';
@Component({
selector: 'app-dataset-profile-editor-composite-field-component',
@ -263,8 +263,10 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i
description: formValue.description,
hasCommentField: formValue.hasCommentField,
commentFieldValue: '',
multiplicity: {max: formValue.multiplicity.max, min: formValue.multiplicity.min,
placeholder: formValue.multiplicity.placeholder, tableView: formValue.multiplicity.tableView},
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);

View File

@ -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 { 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';
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 { 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 {FieldEditorModel} from '../../../admin/field-editor-model';
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 { 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',
@ -91,7 +91,8 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
public datasetProfileService: DatasetProfileService,
private dialog: MatDialog,
private configurationService: ConfigurationService
) { super();
) {
super();
}

View File

@ -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<BreadcrumbItem[]>;
@ViewChild('stepper') stepper: MatHorizontalStepper;
@ViewChild('stepper') stepper: MatStepper;
viewOnly = false;
nestedCount: number[] = [];
nestedIndex: number = 0;

View File

@ -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;
}

View File

@ -1,68 +1,66 @@
import {ChangeDetectorRef, Component, OnInit, ViewChild} from '@angular/core';
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 { 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 { 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 { 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 { 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 { 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 { Observable, interval, 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';
@Component({
selector: 'app-dataset-wizard-component',

View File

@ -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';

View File

@ -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';

View File

@ -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';

View File

@ -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';

View File

@ -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[] = [];

View File

@ -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;

View File

@ -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;

View File

@ -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";

View File

@ -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);
}

View File

@ -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';

View File

@ -2,15 +2,15 @@
@import "@angular/material/theming"; // @import '../node_modules/@angular/material/theming';
@import "@angular/material/prebuilt-themes/indigo-pink.css";
@import "~bootstrap/dist/css/bootstrap.css";
//Material-Bootstrap configuration
@import "~bootstrap/scss/bootstrap";
@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;