Merge branch 'dmp-refactoring' of https://code-repo.d4science.org/MaDgiK-CITE/argos into dmp-refactoring
This commit is contained in:
commit
0bb4c7ca15
|
@ -26,6 +26,7 @@
|
||||||
!.vscode/extensions.json
|
!.vscode/extensions.json
|
||||||
|
|
||||||
# misc
|
# misc
|
||||||
|
/.angular/cache
|
||||||
/.sass-cache
|
/.sass-cache
|
||||||
/connect.lock
|
/connect.lock
|
||||||
/coverage
|
/coverage
|
||||||
|
|
|
@ -123,18 +123,6 @@
|
||||||
{ "glob": "**/*", "input": "node_modules/tinymce/plugins", "output": "/tinymce/plugins/" }
|
{ "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",
|
"protractorConfig": "./protractor.conf.js",
|
||||||
"devServerTarget": "dmp-frontend:serve"
|
"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": {
|
||||||
"@schematics/angular:component": {
|
"@schematics/angular:component": {
|
||||||
"prefix": "app",
|
"prefix": "app",
|
||||||
|
|
|
@ -12,61 +12,62 @@
|
||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "^12.2.7",
|
"@angular/animations": "^16.2.8",
|
||||||
"@angular/common": "^12.2.7",
|
"@angular/common": "^16.2.8",
|
||||||
"@angular/compiler": "^12.2.7",
|
"@angular/compiler": "^16.2.8",
|
||||||
"@angular/core": "^12.2.7",
|
"@angular/core": "^16.2.8",
|
||||||
"@angular/forms": "^12.2.7",
|
"@angular/forms": "^16.2.8",
|
||||||
"@angular/material-moment-adapter": "^12.2.7",
|
"@angular/material-moment-adapter": "^16.2.7",
|
||||||
"@angular/platform-browser": "^12.2.7",
|
"@angular/platform-browser": "^16.2.8",
|
||||||
"@kolkov/angular-editor": "^1.2.0",
|
"@kolkov/angular-editor": "^2.1.0",
|
||||||
"@ngx-translate/core": "^13.0.0",
|
"@ngx-translate/core": "^15.0.0",
|
||||||
"@ngx-translate/http-loader": "^6.0.0",
|
"@ngx-translate/http-loader": "^8.0.0",
|
||||||
"@swimlane/ngx-datatable": "^20.0.0",
|
"@swimlane/ngx-datatable": "^20.1.0",
|
||||||
"@tinymce/tinymce-angular": "^4.2.4",
|
"@tinymce/tinymce-angular": "^7.0.0",
|
||||||
"@w11k/angular-sticky-things": "^1.3.2",
|
"@w11k/angular-sticky-things": "^1.5.2",
|
||||||
"bootstrap": "^4.3.1",
|
"bootstrap": "^4.6.0",
|
||||||
"cookieconsent": "^3.1.1",
|
"cookieconsent": "^3.1.1",
|
||||||
"core-js": "^2.5.5",
|
"core-js": "^3.33.0",
|
||||||
|
"dragula": "^3.7.3",
|
||||||
"file-saver": "^2.0.5",
|
"file-saver": "^2.0.5",
|
||||||
"moment": "^2.29.1",
|
"moment": "^2.29.4",
|
||||||
"moment-timezone": "^0.5.33",
|
"moment-timezone": "^0.5.43",
|
||||||
"ng-dialog-animation": "^9.0.4",
|
"ng-dialog-animation": "^9.0.4",
|
||||||
"ng2-dragula": "^2.1.1",
|
"ng2-dragula": "^5.0.1",
|
||||||
"ngx-cookie-service": "^12.0.3",
|
"ngx-cookie-service": "^16.0.1",
|
||||||
"ngx-cookieconsent": "^2.2.3",
|
"ngx-cookieconsent": "^4.0.2",
|
||||||
"ngx-dropzone": "^3.0.0",
|
"ngx-dropzone": "^3.0.0",
|
||||||
"ngx-guided-tour": "^1.1.11",
|
"ngx-guided-tour": "^2.0.1",
|
||||||
"ngx-matomo": "^0.1.4",
|
"ngx-matomo-client": "^5.0.4",
|
||||||
"pako": "^1.0.11",
|
"pako": "^1.0.11",
|
||||||
"rxjs": "^6.3.2",
|
"rxjs": "^6.3.2",
|
||||||
"tinymce": "^5.9.2",
|
"tinymce": "^6.7.0",
|
||||||
"ts-simple-nameof": "^1.3.1",
|
"ts-simple-nameof": "^1.3.1",
|
||||||
"tslib": "^2.0.0",
|
"tslib": "^2.6.2",
|
||||||
"web-animations-js": "^2.3.2",
|
"zone.js": "~0.13.0"
|
||||||
"zone.js": "~0.11.4"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular-devkit/build-angular": "~12.2.7",
|
"@angular-devkit/build-angular": "^16.2.5",
|
||||||
"@angular/cdk": "^12.2.7",
|
"@angular/cdk": "^16.2.7",
|
||||||
"@angular/cli": "12.2.7",
|
"@angular/cli": "16.2.5",
|
||||||
"@angular/compiler-cli": "^12.2.7",
|
"@angular/compiler-cli": "^16.2.8",
|
||||||
"@angular/language-service": "^12.2.7",
|
"@angular/language-service": "^16.2.8",
|
||||||
"@angular/material": "^12.2.7",
|
"@angular/material": "^16.2.7",
|
||||||
"@angular/platform-browser-dynamic": "^12.2.7",
|
"@angular/platform-browser-dynamic": "^16.2.8",
|
||||||
"@angular/router": "^12.2.7",
|
"@angular/router": "^16.2.8",
|
||||||
"@types/facebook-js-sdk": "^3.3.5",
|
"@types/dragula": "^3.7.2",
|
||||||
"@types/file-saver": "^2.0.3",
|
"@types/facebook-js-sdk": "^3.3.7",
|
||||||
"@types/gapi": "^0.0.41",
|
"@types/file-saver": "^2.0.5",
|
||||||
"@types/gapi.auth2": "^0.0.55",
|
"@types/gapi": "^0.0.45",
|
||||||
"@types/jasmine": "~3.9.1",
|
"@types/gapi.auth2": "^0.0.58",
|
||||||
"@types/jasminewd2": "~2.0.10",
|
"@types/jasmine": "~5.1.0",
|
||||||
|
"@types/jasminewd2": "~2.0.11",
|
||||||
"@types/moment-timezone": "^0.5.13",
|
"@types/moment-timezone": "^0.5.13",
|
||||||
"@types/node": "^12.11.1",
|
"@types/node": "^20.8.2",
|
||||||
"@types/pako": "^1.0.3",
|
"@types/pako": "^1.0.3",
|
||||||
"codelyzer": "^6.0.2",
|
"codelyzer": "^0.0.28",
|
||||||
"ts-node": "~10.2.1",
|
"ts-node": "~10.9.1",
|
||||||
"tslint": "~6.1.0",
|
"tslint": "~6.1.0",
|
||||||
"typescript": "4.3.5"
|
"typescript": "^4.9.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -273,7 +273,7 @@ const appRoutes: Routes = [
|
||||||
];
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [RouterModule.forRoot(appRoutes, { relativeLinkResolution: 'legacy' })],
|
imports: [RouterModule.forRoot(appRoutes, {})],
|
||||||
exports: [RouterModule],
|
exports: [RouterModule],
|
||||||
})
|
})
|
||||||
export class AppRoutingModule { }
|
export class AppRoutingModule { }
|
||||||
|
|
|
@ -16,7 +16,6 @@ import { LanguageService } from './core/services/language/language.service';
|
||||||
import { ConfigurationService } from './core/services/configuration/configuration.service';
|
import { ConfigurationService } from './core/services/configuration/configuration.service';
|
||||||
|
|
||||||
import { Location } from '@angular/common';
|
import { Location } from '@angular/common';
|
||||||
import { MatomoInjector } from 'ngx-matomo';
|
|
||||||
import { MatomoService } from './core/services/matomo/matomo-service';
|
import { MatomoService } from './core/services/matomo/matomo-service';
|
||||||
import { SideNavService } from './core/services/sidenav/side-nav.sevice';
|
import { SideNavService } from './core/services/sidenav/side-nav.sevice';
|
||||||
import { MatSidenav } from '@angular/material/sidenav';
|
import { MatSidenav } from '@angular/material/sidenav';
|
||||||
|
|
|
@ -2,9 +2,9 @@ import { OverlayModule } from '@angular/cdk/overlay';
|
||||||
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
||||||
import { LOCALE_ID, NgModule } from '@angular/core';
|
import { LOCALE_ID, NgModule } from '@angular/core';
|
||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
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 { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';
|
||||||
import { MatFormFieldDefaultOptions, MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
|
import { MAT_FORM_FIELD_DEFAULT_OPTIONS, MatFormFieldDefaultOptions } from '@angular/material/form-field';
|
||||||
import { BrowserModule, Title } from '@angular/platform-browser';
|
import { BrowserModule, Title } from '@angular/platform-browser';
|
||||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
import { AppRoutingModule } from '@app/app-routing.module';
|
import { AppRoutingModule } from '@app/app-routing.module';
|
||||||
|
@ -26,14 +26,14 @@ import { TranslateCompiler, TranslateLoader, TranslateModule } from '@ngx-transl
|
||||||
import { DragulaModule } from 'ng2-dragula';
|
import { DragulaModule } from 'ng2-dragula';
|
||||||
import { CookieService } from 'ngx-cookie-service';
|
import { CookieService } from 'ngx-cookie-service';
|
||||||
import { NgcCookieConsentConfig, NgcCookieConsentModule } from 'ngx-cookieconsent';
|
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 { ConfigurationService } from './core/services/configuration/configuration.service';
|
||||||
import { CultureService } from './core/services/culture/culture-service';
|
import { CultureService } from './core/services/culture/culture-service';
|
||||||
import { TranslateServerLoader } from './core/services/language/server.loader';
|
import { TranslateServerLoader } from './core/services/language/server.loader';
|
||||||
import { MatomoService } from './core/services/matomo/matomo-service';
|
import { MatomoService } from './core/services/matomo/matomo-service';
|
||||||
import { GuidedTourModule } from './library/guided-tour/guided-tour.module';
|
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 { 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
|
// AoT requires an exported function for factories
|
||||||
export function HttpLoaderFactory(http: HttpClient, appConfig: ConfigurationService) {
|
export function HttpLoaderFactory(http: HttpClient, appConfig: ConfigurationService) {
|
||||||
|
@ -97,7 +97,6 @@ const appearance: MatFormFieldDefaultOptions = {
|
||||||
CommonHttpModule,
|
CommonHttpModule,
|
||||||
MatMomentDateModule,
|
MatMomentDateModule,
|
||||||
LoginModule,
|
LoginModule,
|
||||||
MatomoModule,
|
|
||||||
//Ui
|
//Ui
|
||||||
NotificationModule,
|
NotificationModule,
|
||||||
NavigationModule,
|
NavigationModule,
|
||||||
|
@ -111,7 +110,10 @@ const appearance: MatFormFieldDefaultOptions = {
|
||||||
NgcCookieConsentModule.forRoot(cookieConfig),
|
NgcCookieConsentModule.forRoot(cookieConfig),
|
||||||
Oauth2DialogModule,
|
Oauth2DialogModule,
|
||||||
GuidedTourModule.forRoot(),
|
GuidedTourModule.forRoot(),
|
||||||
DragulaModule.forRoot()
|
DragulaModule.forRoot(),
|
||||||
|
NgxMatomoModule.forRoot({
|
||||||
|
mode: MatomoInitializationMode.AUTO_DEFERRED,
|
||||||
|
})
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
AppComponent,
|
AppComponent,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { FormBuilder } from '@angular/forms';
|
import { UntypedFormBuilder } from '@angular/forms';
|
||||||
export abstract class BaseFormModel {
|
export abstract class BaseFormModel {
|
||||||
public formBuilder: FormBuilder = new FormBuilder();
|
public formBuilder: UntypedFormBuilder = new UntypedFormBuilder();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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';
|
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
|
||||||
|
|
||||||
export interface ContactEmail {
|
export interface ContactEmail {
|
||||||
|
@ -17,8 +17,8 @@ export class ContactEmailFormModel {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
buildForm(): FormGroup {
|
buildForm(): UntypedFormGroup {
|
||||||
const formGroup = new FormBuilder().group({
|
const formGroup = new UntypedFormBuilder().group({
|
||||||
subject: [this.subject, [Validators.required]],
|
subject: [this.subject, [Validators.required]],
|
||||||
description: [this.description, [Validators.required]]
|
description: [this.description, [Validators.required]]
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { FormGroup, FormBuilder } from '@angular/forms';
|
import { UntypedFormGroup, UntypedFormBuilder } from '@angular/forms';
|
||||||
import { isNullOrUndefined } from '@app/utilities/enhancers/utils';
|
import { isNullOrUndefined } from '@app/utilities/enhancers/utils';
|
||||||
|
|
||||||
export class DatasetIdModel {
|
export class DatasetIdModel {
|
||||||
|
@ -25,8 +25,8 @@ export class DatasetIdModel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buildForm(): FormGroup {
|
buildForm(): UntypedFormGroup {
|
||||||
return new FormBuilder().group({
|
return new UntypedFormBuilder().group({
|
||||||
identifier: [this.identifier],
|
identifier: [this.identifier],
|
||||||
type: [this.type]
|
type: [this.type]
|
||||||
});
|
});
|
||||||
|
|
|
@ -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 { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile';
|
||||||
import { DmpModel } from '@app/core/model/dmp/dmp';
|
import { DmpModel } from '@app/core/model/dmp/dmp';
|
||||||
import { BackendErrorValidator } from '@common/forms/validation/custom-validator';
|
import { BackendErrorValidator } from '@common/forms/validation/custom-validator';
|
||||||
|
@ -17,9 +17,9 @@ export class DmpCreateWizardFormModel {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
buildForm(context: ValidationContext = null): FormGroup {
|
buildForm(context: ValidationContext = null): UntypedFormGroup {
|
||||||
if (context == null) { context = this.createValidationContext(); }
|
if (context == null) { context = this.createValidationContext(); }
|
||||||
const formBuilder = new FormBuilder();
|
const formBuilder = new UntypedFormBuilder();
|
||||||
const formGroup = formBuilder.group({
|
const formGroup = formBuilder.group({
|
||||||
dmp: [this.dmp, context.getValidation('dmp').validators],
|
dmp: [this.dmp, context.getValidation('dmp').validators],
|
||||||
datasetProfile: [this.datasetProfile, context.getValidation('datasetProfile').validators],
|
datasetProfile: [this.datasetProfile, context.getValidation('datasetProfile').validators],
|
||||||
|
|
|
@ -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 { BackendErrorValidator } from "@common/forms/validation/custom-validator";
|
||||||
import { ValidationErrorModel } from "@common/forms/validation/error-model/validation-error-model";
|
import { ValidationErrorModel } from "@common/forms/validation/error-model/validation-error-model";
|
||||||
import { ValidationContext } from "@common/forms/validation/validation-context";
|
import { ValidationContext } from "@common/forms/validation/validation-context";
|
||||||
|
@ -12,9 +12,9 @@ export class DmpDatasetProfileSectionsFormModel {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup {
|
buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup {
|
||||||
if (context == null) { context = this.createValidationContext(); }
|
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],
|
language: [{ value: this.dmpSectionIndex, disabled: disabled }, context.getValidation('dmpSectionIndex').validators],
|
||||||
});
|
});
|
||||||
return formGroup;
|
return formGroup;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||||
import { Serializable } from '@common/types/json/serializable';
|
import { Serializable } from '@common/types/json/serializable';
|
||||||
|
|
||||||
export class DmpInvitationUser implements Serializable<DmpInvitationUser> {
|
export class DmpInvitationUser implements Serializable<DmpInvitationUser> {
|
||||||
|
@ -14,8 +14,8 @@ export class DmpInvitationUser implements Serializable<DmpInvitationUser> {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
buildForm(): FormGroup {
|
buildForm(): UntypedFormGroup {
|
||||||
return new FormBuilder().group({
|
return new UntypedFormBuilder().group({
|
||||||
id: [this.id],
|
id: [this.id],
|
||||||
email: [this.email],
|
email: [this.email],
|
||||||
name: [this.name]
|
name: [this.name]
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||||
import { DmpInvitationUser } from './dmp-invitation-user';
|
import { DmpInvitationUser } from './dmp-invitation-user';
|
||||||
|
|
||||||
export class DmpInvitation {
|
export class DmpInvitation {
|
||||||
|
@ -7,8 +7,8 @@ export class DmpInvitation {
|
||||||
public users = new Array<DmpInvitationUser>();
|
public users = new Array<DmpInvitationUser>();
|
||||||
public role: number;
|
public role: number;
|
||||||
|
|
||||||
buildForm(): FormGroup {
|
buildForm(): UntypedFormGroup {
|
||||||
const formGroup = new FormBuilder().group({
|
const formGroup = new UntypedFormBuilder().group({
|
||||||
dataManagementPlan: [this.dataManagementPlan],
|
dataManagementPlan: [this.dataManagementPlan],
|
||||||
users: [this.users],
|
users: [this.users],
|
||||||
role: [this.role]
|
role: [this.role]
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import { Pipe, PipeTransform } from "@angular/core";
|
import { Pipe, PipeTransform } from "@angular/core";
|
||||||
import { FormGroup } from "@angular/forms";
|
import { UntypedFormGroup } from "@angular/forms";
|
||||||
|
|
||||||
@Pipe({
|
@Pipe({
|
||||||
name: 'datasetInSection'
|
name: 'datasetInSection'
|
||||||
})
|
})
|
||||||
export class DatasetInSectioPipe implements PipeTransform{
|
export class DatasetInSectioPipe implements PipeTransform{
|
||||||
|
|
||||||
transform(datasets: FormGroup[], args: string): FormGroup[] {
|
transform(datasets: UntypedFormGroup[], args: string): UntypedFormGroup[] {
|
||||||
let values = [];
|
let values = [];
|
||||||
for(var dataset of datasets){
|
for(var dataset of datasets){
|
||||||
if(dataset.get('dmpSectionIndex').value == args){
|
if(dataset.get('dmpSectionIndex').value == args){
|
||||||
|
|
|
@ -48,7 +48,7 @@ export class CultureService {
|
||||||
|
|
||||||
const newCulture = this.cultureValues.get(newCultureName);
|
const newCulture = this.cultureValues.get(newCultureName);
|
||||||
if (!newCulture) {
|
if (!newCulture) {
|
||||||
console.error(`unsupported culture given: ${newCultureName}`); //TODO: throw error?
|
this.logger.error(`unsupported culture given: ${newCultureName}`); //TODO: throw error?
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.currentCulture = newCulture;
|
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
|
// 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).
|
// use the culture with the specialization (ex en-US), and if not exists we import the base culture (first part).
|
||||||
let locale = newCulture.name;
|
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);
|
this.logger.error('Could not load locale: ' + locale);
|
||||||
}).then(selectedLocale => {
|
}).then(selectedLocale => {
|
||||||
if (selectedLocale) {
|
if (selectedLocale) {
|
||||||
registerLocaleData(selectedLocale.default);
|
registerLocaleData(selectedLocale.default);
|
||||||
} else {
|
} else {
|
||||||
locale = newCulture.name.split('-')[0];
|
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);
|
this.logger.error('Could not load locale: ' + locale);
|
||||||
}).then(selectedDefaultLocale => {
|
}).then(selectedDefaultLocale => {
|
||||||
if (selectedDefaultLocale !== undefined) {
|
registerLocaleData(selectedDefaultLocale.default);
|
||||||
registerLocaleData(selectedDefaultLocale.default);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -49,7 +49,7 @@ export class LanguageInfoService {
|
||||||
|
|
||||||
const newLanguageInfo = this.languageInfoValues.get(newLanguageInfoName);
|
const newLanguageInfo = this.languageInfoValues.get(newLanguageInfoName);
|
||||||
if (!newLanguageInfo) {
|
if (!newLanguageInfo) {
|
||||||
console.error(`unsupported language given: ${newLanguageInfoName}`); //TODO: throw error?
|
this.logger.error(`unsupported culture given: ${newLanguageInfo}`); //TODO: throw error?
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.currentLanguageInfo = newLanguageInfo;
|
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
|
// 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).
|
// use the culture with the specialization (ex en-US), and if not exists we import the base culture (first part).
|
||||||
let locale = newLanguageInfo.code;
|
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);
|
this.logger.error('Could not load locale: ' + locale);
|
||||||
}).then(selectedLocale => {
|
}).then(selectedLocale => {
|
||||||
if (selectedLocale) {
|
if (selectedLocale) {
|
||||||
registerLocaleData(selectedLocale.default);
|
registerLocaleData(selectedLocale.default);
|
||||||
} else {
|
} else {
|
||||||
// locale = newCulture.code.split('-')[0];
|
// 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);
|
this.logger.error('Could not load locale: ' + locale);
|
||||||
}).then(selectedDefaultLocale => {
|
}).then(selectedDefaultLocale => {
|
||||||
if (selectedDefaultLocale !== undefined) {
|
if (selectedDefaultLocale !== undefined) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Injectable } from '@angular/core';
|
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 { AuthService } from '../auth/auth.service';
|
||||||
import { ConfigurationService } from '../configuration/configuration.service';
|
import { ConfigurationService } from '../configuration/configuration.service';
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ export class MatomoService {
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private configurationService: ConfigurationService,
|
private configurationService: ConfigurationService,
|
||||||
private matomoInjector: MatomoInjector,
|
private matomoInitializerService: MatomoInitializerService,
|
||||||
private matomoTracker: MatomoTracker,
|
private matomoTracker: MatomoTracker,
|
||||||
private authService: AuthService
|
private authService: AuthService
|
||||||
) {
|
) {
|
||||||
|
@ -17,7 +17,7 @@ export class MatomoService {
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
if (this.configurationService.matomoEnabled) {
|
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) {
|
if (this.configurationService.matomoEnabled) {
|
||||||
var principal = this.authService.current();
|
var principal = this.authService.current();
|
||||||
if (principal != null) { this.matomoTracker.setUserId(principal.id); }
|
if (principal != null) { this.matomoTracker.setUserId(principal.id); }
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import {FocusMonitor} from '@angular/cdk/a11y';
|
import { FocusMonitor } from '@angular/cdk/a11y';
|
||||||
import {BACKSPACE, ENTER} from '@angular/cdk/keycodes';
|
import { BACKSPACE, ENTER } from '@angular/cdk/keycodes';
|
||||||
import {
|
import {
|
||||||
Component,
|
Component,
|
||||||
DoCheck,
|
DoCheck,
|
||||||
|
@ -16,26 +16,27 @@ import {
|
||||||
TemplateRef,
|
TemplateRef,
|
||||||
ViewChild
|
ViewChild
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import {ControlValueAccessor, FormGroupDirective, NgControl, NgForm} from '@angular/forms';
|
import { ControlValueAccessor, FormGroupDirective, NgControl, NgForm } from '@angular/forms';
|
||||||
import {MatChipInputEvent} from '@angular/material/chips';
|
import { MatAutocomplete, MatAutocompleteSelectedEvent, MatAutocompleteTrigger } from '@angular/material/autocomplete';
|
||||||
import {ErrorStateMatcher, mixinErrorState} from '@angular/material/core';
|
import { MatChipInputEvent } from '@angular/material/chips';
|
||||||
import {MatAutocomplete, MatAutocompleteSelectedEvent, MatAutocompleteTrigger} from '@angular/material/autocomplete';
|
import { ErrorStateMatcher, mixinErrorState } from '@angular/material/core';
|
||||||
import {MatFormFieldControl} from '@angular/material/form-field';
|
import { MatFormFieldControl } from '@angular/material/form-field';
|
||||||
import {AutoCompleteGroup} from '@app/library/auto-complete/auto-complete-group';
|
import { AutoCompleteGroup } from '@app/library/auto-complete/auto-complete-group';
|
||||||
import {
|
import {
|
||||||
MultipleAutoCompleteConfiguration
|
MultipleAutoCompleteConfiguration
|
||||||
} from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration';
|
} from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration';
|
||||||
import {BaseComponent} from '@common/base/base.component';
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
import {isNullOrUndefined} from '@swimlane/ngx-datatable';
|
import { isNullOrUndefined } from '@swimlane/ngx-datatable';
|
||||||
import {BehaviorSubject, combineLatest, Observable, of as observableOf, Subject, Subscription} from 'rxjs';
|
import { BehaviorSubject, Observable, Subject, Subscription, combineLatest, of as observableOf } from 'rxjs';
|
||||||
import {debounceTime, distinctUntilChanged, map, startWith, takeUntil, switchMap, tap} from 'rxjs/operators';
|
import { debounceTime, distinctUntilChanged, map, startWith, switchMap, takeUntil, tap } from 'rxjs/operators';
|
||||||
|
|
||||||
export class CustomComponentBase extends BaseComponent {
|
export class CustomComponentBase extends BaseComponent {
|
||||||
constructor(
|
constructor(
|
||||||
public _defaultErrorStateMatcher: ErrorStateMatcher,
|
public _defaultErrorStateMatcher: ErrorStateMatcher,
|
||||||
public _parentForm: NgForm,
|
public _parentForm: NgForm,
|
||||||
public _parentFormGroup: FormGroupDirective,
|
public _parentFormGroup: FormGroupDirective,
|
||||||
public ngControl: NgControl
|
public ngControl: NgControl,
|
||||||
|
public stateChanges: Subject<void>
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
@ -47,14 +48,14 @@ export const _CustomComponentMixinBase = mixinErrorState(CustomComponentBase);
|
||||||
selector: 'app-multiple-auto-complete',
|
selector: 'app-multiple-auto-complete',
|
||||||
templateUrl: './multiple-auto-complete.component.html',
|
templateUrl: './multiple-auto-complete.component.html',
|
||||||
styleUrls: ['./multiple-auto-complete.component.scss'],
|
styleUrls: ['./multiple-auto-complete.component.scss'],
|
||||||
providers: [{provide: MatFormFieldControl, useExisting: MultipleAutoCompleteComponent}]
|
providers: [{ provide: MatFormFieldControl, useExisting: MultipleAutoCompleteComponent }]
|
||||||
})
|
})
|
||||||
export class MultipleAutoCompleteComponent extends _CustomComponentMixinBase implements OnInit, MatFormFieldControl<string>, ControlValueAccessor, OnDestroy, DoCheck, OnChanges {
|
export class MultipleAutoCompleteComponent extends _CustomComponentMixinBase implements OnInit, MatFormFieldControl<string>, ControlValueAccessor, OnDestroy, DoCheck, OnChanges {
|
||||||
|
|
||||||
static nextId = 0;
|
static nextId = 0;
|
||||||
@ViewChild('autocomplete', {static: true}) autocomplete: MatAutocomplete;
|
@ViewChild('autocomplete', { static: true }) autocomplete: MatAutocomplete;
|
||||||
@ViewChild('autocompleteTrigger', {static: true}) autocompleteTrigger: MatAutocompleteTrigger;
|
@ViewChild('autocompleteTrigger', { static: true }) autocompleteTrigger: MatAutocompleteTrigger;
|
||||||
@ViewChild('autocompleteInput', {static: true}) autocompleteInput: ElementRef;
|
@ViewChild('autocompleteInput', { static: true }) autocompleteInput: ElementRef;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
get configuration(): MultipleAutoCompleteConfiguration {
|
get configuration(): MultipleAutoCompleteConfiguration {
|
||||||
|
@ -166,7 +167,7 @@ export class MultipleAutoCompleteComponent extends _CustomComponentMixinBase imp
|
||||||
@Optional() _parentFormGroup: FormGroupDirective,
|
@Optional() _parentFormGroup: FormGroupDirective,
|
||||||
_defaultErrorStateMatcher: ErrorStateMatcher
|
_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) => {
|
fm.monitor(elRef.nativeElement, true).pipe(takeUntil(this._destroyed)).subscribe((origin) => {
|
||||||
this.focused = !!origin;
|
this.focused = !!origin;
|
||||||
|
|
|
@ -8,8 +8,8 @@ import { MatFormFieldControl } from '@angular/material/form-field';
|
||||||
import { AutoCompleteGroup } from '@app/library/auto-complete/auto-complete-group';
|
import { AutoCompleteGroup } from '@app/library/auto-complete/auto-complete-group';
|
||||||
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 { BaseComponent } from '@common/base/base.component';
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
import { Observable, of as observableOf, Subject } from 'rxjs';
|
import { Observable, Subject, of as observableOf } from 'rxjs';
|
||||||
import {debounceTime, distinctUntilChanged, map, mergeMap, startWith, takeUntil, switchMap, tap} from 'rxjs/operators';
|
import { debounceTime, distinctUntilChanged, map, startWith, switchMap, takeUntil, tap } from 'rxjs/operators';
|
||||||
|
|
||||||
|
|
||||||
export class CustomComponentBase extends BaseComponent {
|
export class CustomComponentBase extends BaseComponent {
|
||||||
|
@ -17,7 +17,8 @@ export class CustomComponentBase extends BaseComponent {
|
||||||
public _defaultErrorStateMatcher: ErrorStateMatcher,
|
public _defaultErrorStateMatcher: ErrorStateMatcher,
|
||||||
public _parentForm: NgForm,
|
public _parentForm: NgForm,
|
||||||
public _parentFormGroup: FormGroupDirective,
|
public _parentFormGroup: FormGroupDirective,
|
||||||
public ngControl: NgControl
|
public ngControl: NgControl,
|
||||||
|
public stateChanges: Subject<void>
|
||||||
) { super(); }
|
) { super(); }
|
||||||
}
|
}
|
||||||
export const _CustomComponentMixinBase = mixinErrorState(CustomComponentBase);
|
export const _CustomComponentMixinBase = mixinErrorState(CustomComponentBase);
|
||||||
|
@ -110,7 +111,7 @@ export class SingleAutoCompleteComponent extends _CustomComponentMixinBase imple
|
||||||
@Optional() _parentFormGroup: FormGroupDirective,
|
@Optional() _parentFormGroup: FormGroupDirective,
|
||||||
_defaultErrorStateMatcher: ErrorStateMatcher
|
_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) => {
|
fm.monitor(elRef.nativeElement, true).pipe(takeUntil(this._destroyed)).subscribe((origin) => {
|
||||||
this.focused = !!origin;
|
this.focused = !!origin;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, OnInit, Inject } from '@angular/core';
|
import { Component, OnInit, Inject } from '@angular/core';
|
||||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
|
|
@ -3,10 +3,9 @@ import { ExportMethodDialogComponent } from '@app/library/export-method-dialog/e
|
||||||
import { CommonUiModule } from '@common/ui/common-ui.module';
|
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [CommonUiModule],
|
imports: [CommonUiModule],
|
||||||
declarations: [ExportMethodDialogComponent],
|
declarations: [ExportMethodDialogComponent],
|
||||||
exports: [ExportMethodDialogComponent],
|
exports: [ExportMethodDialogComponent]
|
||||||
entryComponents: [ExportMethodDialogComponent]
|
|
||||||
})
|
})
|
||||||
export class ExportMethodDialogModule {
|
export class ExportMethodDialogModule {
|
||||||
constructor() { }
|
constructor() { }
|
||||||
|
|
|
@ -5,11 +5,10 @@ import { CommonModule } from '@angular/common';
|
||||||
import { WindowRefService } from './windowref.service';
|
import { WindowRefService } from './windowref.service';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [GuidedTourComponent],
|
declarations: [GuidedTourComponent],
|
||||||
imports: [CommonModule],
|
imports: [CommonModule],
|
||||||
providers: [WindowRefService],
|
providers: [WindowRefService],
|
||||||
exports: [GuidedTourComponent],
|
exports: [GuidedTourComponent]
|
||||||
entryComponents: [GuidedTourComponent],
|
|
||||||
})
|
})
|
||||||
export class GuidedTourModule {
|
export class GuidedTourModule {
|
||||||
public static forRoot(): ModuleWithProviders<GuidedTourModule> {
|
public static forRoot(): ModuleWithProviders<GuidedTourModule> {
|
||||||
|
|
|
@ -5,21 +5,17 @@ import { SnackBarNotificationComponent } from '@app/library/notification/snack-b
|
||||||
import { CommonUiModule } from '@common/ui/common-ui.module';
|
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonUiModule
|
CommonUiModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
NotificationComponent,
|
NotificationComponent,
|
||||||
SnackBarNotificationComponent,
|
SnackBarNotificationComponent,
|
||||||
PopupNotificationDialogComponent,
|
PopupNotificationDialogComponent,
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
NotificationComponent
|
NotificationComponent
|
||||||
],
|
]
|
||||||
entryComponents: [
|
|
||||||
SnackBarNotificationComponent,
|
|
||||||
PopupNotificationDialogComponent,
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
export class NotificationModule {
|
export class NotificationModule {
|
||||||
constructor() { }
|
constructor() { }
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Inject } from '@angular/core';
|
import { Component, Inject } from '@angular/core';
|
||||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||||
import { PopupNotification } from '../../../core/services/notification/ui-notification-service';
|
import { PopupNotification } from '../../../core/services/notification/ui-notification-service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {Component, Input} from "@angular/core";
|
import {Component, Input} from "@angular/core";
|
||||||
import {AngularEditorConfig} from "@kolkov/angular-editor";
|
import {AngularEditorConfig} from "@kolkov/angular-editor";
|
||||||
import {FormControl} from "@angular/forms";
|
import {UntypedFormControl} from "@angular/forms";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'rich-text-editor-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);
|
return this.parentFormGroup.get(this.controlName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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 { DefaultValue } from '../../../../core/model/admin/dataset-profile/dataset-profile';
|
||||||
import { BaseFormModel } from '../../../../core/model/base-form-model';
|
import { BaseFormModel } from '../../../../core/model/base-form-model';
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ export class DefaultValueEditorModel extends BaseFormModel {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('DefaultValueEditorModel.type')) }],
|
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('DefaultValueEditorModel.type')) }],
|
||||||
value: [{ value: this.value, disabled: (disabled && !skipDisable.includes('DefaultValueEditorModel.value')) }]
|
value: [{ value: this.value, disabled: (disabled && !skipDisable.includes('DefaultValueEditorModel.value')) }]
|
||||||
|
|
|
@ -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 { DatasetProfileComboBoxType } from '../../../../../core/common/enum/dataset-profile-combo-box-type';
|
||||||
import { AutoCompleteFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
import { AutoCompleteFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
||||||
import { FieldDataEditorModel } from './field-data-editor-model';
|
import { FieldDataEditorModel } from './field-data-editor-model';
|
||||||
|
@ -12,17 +12,17 @@ export class AutoCompleteFieldDataEditorModel extends FieldDataEditorModel<AutoC
|
||||||
public autoCompleteSingleDataList: Array<AutoCompleteSingleDataEditorModel> = new Array<AutoCompleteSingleDataEditorModel>();
|
public autoCompleteSingleDataList: Array<AutoCompleteSingleDataEditorModel> = new Array<AutoCompleteSingleDataEditorModel>();
|
||||||
//public multiAutoCompleteOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel();
|
//public multiAutoCompleteOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel();
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('AutoCompleteFieldDataEditorModel.label')) }],
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('AutoCompleteFieldDataEditorModel.label')) }],
|
||||||
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('AutoCompleteFieldDataEditorModel.type')) }],
|
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('AutoCompleteFieldDataEditorModel.type')) }],
|
||||||
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('AutoCompleteFieldDataEditorModel.multiAutoComplete')) }]
|
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('AutoCompleteFieldDataEditorModel.multiAutoComplete')) }]
|
||||||
});
|
});
|
||||||
|
|
||||||
const autocompleteFormArray = new Array<FormGroup>();
|
const autocompleteFormArray = new Array<UntypedFormGroup>();
|
||||||
if (this.autoCompleteSingleDataList) {
|
if (this.autoCompleteSingleDataList) {
|
||||||
this.autoCompleteSingleDataList.forEach(item => {
|
this.autoCompleteSingleDataList.forEach(item => {
|
||||||
const form: FormGroup = item.buildForm(disabled, skipDisable);
|
const form: UntypedFormGroup = item.buildForm(disabled, skipDisable);
|
||||||
autocompleteFormArray.push(form);
|
autocompleteFormArray.push(form);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { FieldDataEditorModel } from './field-data-editor-model';
|
import { FieldDataEditorModel } from './field-data-editor-model';
|
||||||
import { DatasetProfileComboBoxType } from '@app/core/common/enum/dataset-profile-combo-box-type';
|
import { DatasetProfileComboBoxType } from '@app/core/common/enum/dataset-profile-combo-box-type';
|
||||||
import { FieldDataOptionEditorModel } from './field-data-option-editor-model';
|
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';
|
import { AutoCompleteFieldData, AutoCompleteSingleData } from '@app/core/model/dataset-profile-definition/field-data/field-data';
|
||||||
|
|
||||||
export class AutoCompleteSingleDataEditorModel extends FieldDataEditorModel<AutoCompleteSingleDataEditorModel> {
|
export class AutoCompleteSingleDataEditorModel extends FieldDataEditorModel<AutoCompleteSingleDataEditorModel> {
|
||||||
|
@ -13,7 +13,7 @@ export class AutoCompleteSingleDataEditorModel extends FieldDataEditorModel<Auto
|
||||||
public autoCompleteType: number;
|
public autoCompleteType: number;
|
||||||
//public multiAutoCompleteOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel();
|
//public multiAutoCompleteOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel();
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('AutoCompleteSingleDataEditorModel.label')) }],
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('AutoCompleteSingleDataEditorModel.label')) }],
|
||||||
url: [{ value: this.url, disabled: (disabled && !skipDisable.includes('AutoCompleteSingleDataEditorModel.url')) },[Validators.required]],
|
url: [{ value: this.url, disabled: (disabled && !skipDisable.includes('AutoCompleteSingleDataEditorModel.url')) },[Validators.required]],
|
||||||
|
|
|
@ -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 { BooleanDecisionFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
||||||
import { FieldDataEditorModel } from './field-data-editor-model';
|
import { FieldDataEditorModel } from './field-data-editor-model';
|
||||||
|
|
||||||
export class BooleanDecisionFieldDataEditorModel extends FieldDataEditorModel<BooleanDecisionFieldDataEditorModel> {
|
export class BooleanDecisionFieldDataEditorModel extends FieldDataEditorModel<BooleanDecisionFieldDataEditorModel> {
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('BooleanDecisionFieldDataEditorModel.label')) }]
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('BooleanDecisionFieldDataEditorModel.label')) }]
|
||||||
});
|
});
|
||||||
|
|
|
@ -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 { CheckBoxFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
||||||
import { FieldDataEditorModel } from './field-data-editor-model';
|
import { FieldDataEditorModel } from './field-data-editor-model';
|
||||||
|
|
||||||
export class CheckBoxFieldDataEditorModel extends FieldDataEditorModel<CheckBoxFieldDataEditorModel> {
|
export class CheckBoxFieldDataEditorModel extends FieldDataEditorModel<CheckBoxFieldDataEditorModel> {
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('CheckBoxFieldDataEditorModel.label')) }]
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('CheckBoxFieldDataEditorModel.label')) }]
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { FormGroup } from '@angular/forms';
|
import { UntypedFormGroup } from '@angular/forms';
|
||||||
import { FieldDataEditorModel } from './field-data-editor-model';
|
import { FieldDataEditorModel } from './field-data-editor-model';
|
||||||
import { CurrencyFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
import { CurrencyFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
||||||
|
|
||||||
export class CurrencyDataEditorModel extends FieldDataEditorModel<CurrencyDataEditorModel> {
|
export class CurrencyDataEditorModel extends FieldDataEditorModel<CurrencyDataEditorModel> {
|
||||||
public label: string;
|
public label: string;
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('CurrencyDataEditorModel.label')) }]
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('CurrencyDataEditorModel.label')) }]
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { FormGroup } from '@angular/forms';
|
import { UntypedFormGroup } from '@angular/forms';
|
||||||
import { FieldDataEditorModel } from './field-data-editor-model';
|
import { FieldDataEditorModel } from './field-data-editor-model';
|
||||||
import { DataRepositoriesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
import { DataRepositoriesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ export class DataRepositoriesDataEditorModel extends FieldDataEditorModel<DataRe
|
||||||
public label: string;
|
public label: string;
|
||||||
public multiAutoComplete: boolean;
|
public multiAutoComplete: boolean;
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
|
||||||
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }]
|
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }]
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { FormGroup } from '@angular/forms';
|
import { UntypedFormGroup } from '@angular/forms';
|
||||||
import { FieldDataEditorModel } from './field-data-editor-model';
|
import { FieldDataEditorModel } from './field-data-editor-model';
|
||||||
import { DatasetIdentifierFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
import { DatasetIdentifierFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
||||||
|
|
||||||
export class DatasetIdentifierDataEditorModel extends FieldDataEditorModel<DatasetIdentifierDataEditorModel> {
|
export class DatasetIdentifierDataEditorModel extends FieldDataEditorModel<DatasetIdentifierDataEditorModel> {
|
||||||
public label: string;
|
public label: string;
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DatasetIdentifierDataEditorModel.label')) }]
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DatasetIdentifierDataEditorModel.label')) }]
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { FieldDataEditorModel } from "./field-data-editor-model";
|
||||||
import { DatasetProfileInternalDmpEntitiesType } from "../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type";
|
import { DatasetProfileInternalDmpEntitiesType } from "../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type";
|
||||||
import { FieldDataOptionEditorModel } from "./field-data-option-editor-model";
|
import { FieldDataOptionEditorModel } from "./field-data-option-editor-model";
|
||||||
import { DatasetsAutoCompleteFieldData } from "../../../../../core/model/dataset-profile-definition/field-data/field-data";
|
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<DatasetsAutoCompleteFieldDataEditorModel> {
|
export class DatasetsAutoCompleteFieldDataEditorModel extends FieldDataEditorModel<DatasetsAutoCompleteFieldDataEditorModel> {
|
||||||
public type: DatasetProfileInternalDmpEntitiesType = DatasetProfileInternalDmpEntitiesType.Datasets;
|
public type: DatasetProfileInternalDmpEntitiesType = DatasetProfileInternalDmpEntitiesType.Datasets;
|
||||||
|
@ -10,7 +10,7 @@ export class DatasetsAutoCompleteFieldDataEditorModel extends FieldDataEditorMod
|
||||||
public autoCompleteOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel();
|
public autoCompleteOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel();
|
||||||
public autoCompleteType: number;
|
public autoCompleteType: number;
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DatasetsAutoCompleteFieldDataEditorModel.label')) }],
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DatasetsAutoCompleteFieldDataEditorModel.label')) }],
|
||||||
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('DatasetsAutoCompleteFieldDataEditorModel.type')) }],
|
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('DatasetsAutoCompleteFieldDataEditorModel.type')) }],
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { FormGroup } from '@angular/forms';
|
import { UntypedFormGroup } from '@angular/forms';
|
||||||
import { FieldDataEditorModel } from './field-data-editor-model';
|
import { FieldDataEditorModel } from './field-data-editor-model';
|
||||||
import { DatePickerFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
import { DatePickerFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
||||||
|
|
||||||
export class DatePickerDataEditorModel extends FieldDataEditorModel<DatePickerDataEditorModel> {
|
export class DatePickerDataEditorModel extends FieldDataEditorModel<DatePickerDataEditorModel> {
|
||||||
public label: string;
|
public label: string;
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DatePickerDataEditorModel.label')) }]
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DatePickerDataEditorModel.label')) }]
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,14 +2,14 @@ import { FieldDataEditorModel } from "./field-data-editor-model";
|
||||||
import { DatasetProfileInternalDmpEntitiesType } from "../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type";
|
import { DatasetProfileInternalDmpEntitiesType } from "../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type";
|
||||||
import { FieldDataOptionEditorModel } from "./field-data-option-editor-model";
|
import { FieldDataOptionEditorModel } from "./field-data-option-editor-model";
|
||||||
import { DmpsAutoCompleteFieldData } from "../../../../../core/model/dataset-profile-definition/field-data/field-data";
|
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<DmpsAutoCompleteFieldDataEditorModel> {
|
export class DmpsAutoCompleteFieldDataEditorModel extends FieldDataEditorModel<DmpsAutoCompleteFieldDataEditorModel> {
|
||||||
public type: DatasetProfileInternalDmpEntitiesType = DatasetProfileInternalDmpEntitiesType.Dmps;
|
public type: DatasetProfileInternalDmpEntitiesType = DatasetProfileInternalDmpEntitiesType.Dmps;
|
||||||
public multiAutoComplete: boolean = false;
|
public multiAutoComplete: boolean = false;
|
||||||
public autoCompleteOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel();
|
public autoCompleteOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel();
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DmpsAutoCompleteFieldDataEditorModel.label')) }],
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DmpsAutoCompleteFieldDataEditorModel.label')) }],
|
||||||
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('DmpsAutoCompleteFieldDataEditorModel.type')) }],
|
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('DmpsAutoCompleteFieldDataEditorModel.type')) }],
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { FormGroup } from '@angular/forms';
|
import { UntypedFormGroup } from '@angular/forms';
|
||||||
import { FieldDataEditorModel } from './field-data-editor-model';
|
import { FieldDataEditorModel } from './field-data-editor-model';
|
||||||
import { ExternalDatasetsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
import { ExternalDatasetsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
||||||
import { ExternalDatasetTypeEnum } from '@app/core/common/enum/external-dataset-type-enum';
|
import { ExternalDatasetTypeEnum } from '@app/core/common/enum/external-dataset-type-enum';
|
||||||
|
@ -8,7 +8,7 @@ export class ExternalDatasetsDataEditorModel extends FieldDataEditorModel<Extern
|
||||||
public multiAutoComplete: boolean;
|
public multiAutoComplete: boolean;
|
||||||
public type: ExternalDatasetTypeEnum;
|
public type: ExternalDatasetTypeEnum;
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ExternalDatasetsDataEditorModel.label')) }],
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ExternalDatasetsDataEditorModel.label')) }],
|
||||||
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ExternalDatasetsDataEditorModel.multiAutoComplete')) }],
|
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ExternalDatasetsDataEditorModel.multiAutoComplete')) }],
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { FormGroup } from '@angular/forms';
|
import { UntypedFormGroup } from '@angular/forms';
|
||||||
import { BaseFormModel } from '../../../../../core/model/base-form-model';
|
import { BaseFormModel } from '../../../../../core/model/base-form-model';
|
||||||
|
|
||||||
export abstract class FieldDataEditorModel<T> extends BaseFormModel {
|
export abstract class FieldDataEditorModel<T> extends BaseFormModel {
|
||||||
|
|
||||||
public label: string;
|
public label: string;
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
throw new Error('Build Form Is not not correctly overriden');
|
throw new Error('Build Form Is not not correctly overriden');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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 { FieldDataOption } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
||||||
import { FieldDataEditorModel } from './field-data-editor-model';
|
import { FieldDataEditorModel } from './field-data-editor-model';
|
||||||
|
|
||||||
|
@ -7,8 +7,8 @@ export class FieldDataOptionEditorModel extends FieldDataEditorModel<FieldDataOp
|
||||||
public value: string;
|
public value: string;
|
||||||
public source: string;
|
public source: string;
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
return new FormBuilder().group({
|
return new UntypedFormBuilder().group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('FieldDataOptionEditorModel.label')) },[Validators.required]],
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('FieldDataOptionEditorModel.label')) },[Validators.required]],
|
||||||
value: [{ value: this.value, disabled: (disabled && !skipDisable.includes('FieldDataOptionEditorModel.value')) },[Validators.required]],
|
value: [{ value: this.value, disabled: (disabled && !skipDisable.includes('FieldDataOptionEditorModel.value')) },[Validators.required]],
|
||||||
source: [{ value: this.source, disabled: (disabled && !skipDisable.includes('FieldDataOptionEditorModel.source')) }]
|
source: [{ value: this.source, disabled: (disabled && !skipDisable.includes('FieldDataOptionEditorModel.source')) }]
|
||||||
|
|
|
@ -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 { FreeTextFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
||||||
import { FieldDataEditorModel } from './field-data-editor-model';
|
import { FieldDataEditorModel } from './field-data-editor-model';
|
||||||
|
|
||||||
export class FreeTextFieldDataEditorModel extends FieldDataEditorModel<FreeTextFieldDataEditorModel> {
|
export class FreeTextFieldDataEditorModel extends FieldDataEditorModel<FreeTextFieldDataEditorModel> {
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('FreeTextFieldDataEditorModel.label')) }]
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('FreeTextFieldDataEditorModel.label')) }]
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { FormGroup } from '@angular/forms';
|
import { UntypedFormGroup } from '@angular/forms';
|
||||||
import { FieldDataEditorModel } from './field-data-editor-model';
|
import { FieldDataEditorModel } from './field-data-editor-model';
|
||||||
import { LicensesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
import { LicensesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
||||||
export class LicensesDataEditorModel extends FieldDataEditorModel<LicensesDataEditorModel> {
|
export class LicensesDataEditorModel extends FieldDataEditorModel<LicensesDataEditorModel> {
|
||||||
public label: string;
|
public label: string;
|
||||||
public multiAutoComplete: boolean;
|
public multiAutoComplete: boolean;
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
|
||||||
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }]
|
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }]
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { FormGroup } from '@angular/forms';
|
import { UntypedFormGroup } from '@angular/forms';
|
||||||
import { FieldDataEditorModel } from './field-data-editor-model';
|
import { FieldDataEditorModel } from './field-data-editor-model';
|
||||||
import { OrganizationsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
import { OrganizationsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ export class OrganizationsDataEditorModel extends FieldDataEditorModel<Organizat
|
||||||
public label: string;
|
public label: string;
|
||||||
public multiAutoComplete: boolean = false;
|
public multiAutoComplete: boolean = false;
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('OrganizationsDataEditorModel.label')) }],
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('OrganizationsDataEditorModel.label')) }],
|
||||||
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('OrganizationsDataEditorModel.multiAutoComplete')) }]
|
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('OrganizationsDataEditorModel.multiAutoComplete')) }]
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { FormGroup } from '@angular/forms';
|
import { UntypedFormGroup } from '@angular/forms';
|
||||||
import { FieldDataEditorModel } from './field-data-editor-model';
|
import { FieldDataEditorModel } from './field-data-editor-model';
|
||||||
import { PublicationsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
import { PublicationsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
||||||
export class PublicationsDataEditorModel extends FieldDataEditorModel<PublicationsDataEditorModel> {
|
export class PublicationsDataEditorModel extends FieldDataEditorModel<PublicationsDataEditorModel> {
|
||||||
public label: string;
|
public label: string;
|
||||||
public multiAutoComplete: boolean;
|
public multiAutoComplete: boolean;
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
|
||||||
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }]
|
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }]
|
||||||
|
|
|
@ -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 { RadioBoxFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
||||||
import { FieldDataEditorModel } from './field-data-editor-model';
|
import { FieldDataEditorModel } from './field-data-editor-model';
|
||||||
import { FieldDataOptionEditorModel } from './field-data-option-editor-model';
|
import { FieldDataOptionEditorModel } from './field-data-option-editor-model';
|
||||||
|
@ -7,14 +7,14 @@ export class RadioBoxFieldDataEditorModel extends FieldDataEditorModel<RadioBoxF
|
||||||
|
|
||||||
public options: Array<FieldDataOptionEditorModel> = [];
|
public options: Array<FieldDataOptionEditorModel> = [];
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('RadioBoxFieldDataEditorModel.label')) }]
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('RadioBoxFieldDataEditorModel.label')) }]
|
||||||
});
|
});
|
||||||
const optionsFormArray = new Array<FormGroup>();
|
const optionsFormArray = new Array<UntypedFormGroup>();
|
||||||
if (this.options) {
|
if (this.options) {
|
||||||
this.options.forEach(item => {
|
this.options.forEach(item => {
|
||||||
const form: FormGroup = item.buildForm(disabled, skipDisable);
|
const form: UntypedFormGroup = item.buildForm(disabled, skipDisable);
|
||||||
optionsFormArray.push(form);
|
optionsFormArray.push(form);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { FormGroup } from '@angular/forms';
|
import { UntypedFormGroup } from '@angular/forms';
|
||||||
import { FieldDataEditorModel } from './field-data-editor-model';
|
import { FieldDataEditorModel } from './field-data-editor-model';
|
||||||
import { RegistriesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
import { RegistriesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ export class RegistriesDataEditorModel extends FieldDataEditorModel<RegistriesDa
|
||||||
public label: string;
|
public label: string;
|
||||||
public multiAutoComplete: boolean;
|
public multiAutoComplete: boolean;
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('RegistriesDataEditorModel.label')) }],
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('RegistriesDataEditorModel.label')) }],
|
||||||
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('RegistriesDataEditorModel.multiAutoComplete')) }]
|
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('RegistriesDataEditorModel.multiAutoComplete')) }]
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { FieldDataEditorModel } from "./field-data-editor-model";
|
import { FieldDataEditorModel } from "./field-data-editor-model";
|
||||||
import { DatasetProfileInternalDmpEntitiesType } from "../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type";
|
import { DatasetProfileInternalDmpEntitiesType } from "../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type";
|
||||||
import { FieldDataOptionEditorModel } from "./field-data-option-editor-model";
|
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";
|
import { ResearchersAutoCompleteFieldData } from "../../../../../core/model/dataset-profile-definition/field-data/field-data";
|
||||||
|
|
||||||
export class ResearchersAutoCompleteFieldDataEditorModel extends FieldDataEditorModel<ResearchersAutoCompleteFieldDataEditorModel> {
|
export class ResearchersAutoCompleteFieldDataEditorModel extends FieldDataEditorModel<ResearchersAutoCompleteFieldDataEditorModel> {
|
||||||
|
@ -10,7 +10,7 @@ export class ResearchersAutoCompleteFieldDataEditorModel extends FieldDataEditor
|
||||||
public multiAutoComplete: boolean = false;
|
public multiAutoComplete: boolean = false;
|
||||||
public autoCompleteOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel();
|
public autoCompleteOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel();
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ResearchersAutoCompleteFieldDataEditorModel.label')) }],
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ResearchersAutoCompleteFieldDataEditorModel.label')) }],
|
||||||
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('ResearchersAutoCompleteFieldDataEditorModel.type')) }],
|
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('ResearchersAutoCompleteFieldDataEditorModel.type')) }],
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { FormGroup } from '@angular/forms';
|
import { UntypedFormGroup } from '@angular/forms';
|
||||||
import { FieldDataEditorModel } from './field-data-editor-model';
|
import { FieldDataEditorModel } from './field-data-editor-model';
|
||||||
import { ResearchersFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
import { ResearchersFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
||||||
|
|
||||||
export class ResearchersDataEditorModel extends FieldDataEditorModel<ResearchersDataEditorModel> {
|
export class ResearchersDataEditorModel extends FieldDataEditorModel<ResearchersDataEditorModel> {
|
||||||
public label: string;
|
public label: string;
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ResearchersDataEditorModel.label')) }]
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ResearchersDataEditorModel.label')) }]
|
||||||
});
|
});
|
||||||
|
|
|
@ -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 { RichTextAreaFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
||||||
import { FieldDataEditorModel } from './field-data-editor-model';
|
import { FieldDataEditorModel } from './field-data-editor-model';
|
||||||
|
|
||||||
export class RichTextAreaFieldDataEditorModel extends FieldDataEditorModel<RichTextAreaFieldDataEditorModel> {
|
export class RichTextAreaFieldDataEditorModel extends FieldDataEditorModel<RichTextAreaFieldDataEditorModel> {
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('RichTextAreaFieldDataEditorModel.label')) }]
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('RichTextAreaFieldDataEditorModel.label')) }]
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { FormGroup } from '@angular/forms';
|
import { UntypedFormGroup } from '@angular/forms';
|
||||||
import { FieldDataEditorModel } from './field-data-editor-model';
|
import { FieldDataEditorModel } from './field-data-editor-model';
|
||||||
import { ServicesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
import { ServicesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ export class ServicesDataEditorModel extends FieldDataEditorModel<ServicesDataEd
|
||||||
public label: string;
|
public label: string;
|
||||||
public multiAutoComplete: boolean;
|
public multiAutoComplete: boolean;
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
|
||||||
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }]
|
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }]
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { FormGroup } from '@angular/forms';
|
import { UntypedFormGroup } from '@angular/forms';
|
||||||
import { FieldDataEditorModel } from './field-data-editor-model';
|
import { FieldDataEditorModel } from './field-data-editor-model';
|
||||||
import { TagsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
import { TagsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
||||||
|
|
||||||
export class TagsDataEditorModel extends FieldDataEditorModel<TagsDataEditorModel> {
|
export class TagsDataEditorModel extends FieldDataEditorModel<TagsDataEditorModel> {
|
||||||
public label: string;
|
public label: string;
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('TagsDataEditorModel.label')) }]
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('TagsDataEditorModel.label')) }]
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { FormGroup } from '@angular/forms';
|
import { UntypedFormGroup } from '@angular/forms';
|
||||||
import { FieldDataEditorModel } from './field-data-editor-model';
|
import { FieldDataEditorModel } from './field-data-editor-model';
|
||||||
import {TaxonomiesFieldData} from "@app/core/model/dataset-profile-definition/field-data/field-data";
|
import {TaxonomiesFieldData} from "@app/core/model/dataset-profile-definition/field-data/field-data";
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ export class TaxonomiesDataEditorModel extends FieldDataEditorModel<TaxonomiesDa
|
||||||
public label: string;
|
public label: string;
|
||||||
public multiAutoComplete: boolean;
|
public multiAutoComplete: boolean;
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
|
||||||
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }]
|
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }]
|
||||||
|
|
|
@ -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 { TextAreaFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
||||||
import { FieldDataEditorModel } from './field-data-editor-model';
|
import { FieldDataEditorModel } from './field-data-editor-model';
|
||||||
|
|
||||||
export class TextAreaFieldDataEditorModel extends FieldDataEditorModel<TextAreaFieldDataEditorModel> {
|
export class TextAreaFieldDataEditorModel extends FieldDataEditorModel<TextAreaFieldDataEditorModel> {
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('TextAreaFieldDataEditorModel.label')) }]
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('TextAreaFieldDataEditorModel.label')) }]
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { FormGroup } from '@angular/forms';
|
import { UntypedFormGroup } from '@angular/forms';
|
||||||
import {
|
import {
|
||||||
FieldDataOption,
|
FieldDataOption,
|
||||||
UploadFieldData
|
UploadFieldData
|
||||||
|
@ -10,16 +10,16 @@ export class UploadFieldDataEditorModel extends FieldDataEditorModel<UploadField
|
||||||
public types: Array<FieldDataOptionEditorModel> = [];
|
public types: Array<FieldDataOptionEditorModel> = [];
|
||||||
public maxFileSizeInMB: number;
|
public maxFileSizeInMB: number;
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('UploadFieldDataEditorModel.label')) }],
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('UploadFieldDataEditorModel.label')) }],
|
||||||
maxFileSizeInMB: [{ value: this.maxFileSizeInMB, disabled: (disabled && !skipDisable.includes('UploadFieldDataEditorModel.maxFileSizeInMB')) }],
|
maxFileSizeInMB: [{ value: this.maxFileSizeInMB, disabled: (disabled && !skipDisable.includes('UploadFieldDataEditorModel.maxFileSizeInMB')) }],
|
||||||
// types: [{ value: this.types, disabled: (disabled && !skipDisable.includes('UploadFieldDataEditorModel.types')) }]
|
// types: [{ value: this.types, disabled: (disabled && !skipDisable.includes('UploadFieldDataEditorModel.types')) }]
|
||||||
});
|
});
|
||||||
const optionsFormArray = new Array<FormGroup>();
|
const optionsFormArray = new Array<UntypedFormGroup>();
|
||||||
if (this.types) {
|
if (this.types) {
|
||||||
this.types.forEach(item => {
|
this.types.forEach(item => {
|
||||||
const form: FormGroup = item.buildForm(disabled, skipDisable);
|
const form: UntypedFormGroup = item.buildForm(disabled, skipDisable);
|
||||||
optionsFormArray.push(form);
|
optionsFormArray.push(form);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { FormGroup } from '@angular/forms';
|
import { UntypedFormGroup } from '@angular/forms';
|
||||||
import { FieldDataEditorModel } from './field-data-editor-model';
|
import { FieldDataEditorModel } from './field-data-editor-model';
|
||||||
import { ValidationFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
import { ValidationFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
||||||
|
|
||||||
export class ValidationDataEditorModel extends FieldDataEditorModel<ValidationDataEditorModel> {
|
export class ValidationDataEditorModel extends FieldDataEditorModel<ValidationDataEditorModel> {
|
||||||
public label: string;
|
public label: string;
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ValidationDataEditorModel.label')) }]
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ValidationDataEditorModel.label')) }]
|
||||||
});
|
});
|
||||||
|
|
|
@ -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 { DatasetProfileComboBoxType } from '../../../../../core/common/enum/dataset-profile-combo-box-type';
|
||||||
import { WordListFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
import { WordListFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
||||||
import { FieldDataEditorModel } from './field-data-editor-model';
|
import { FieldDataEditorModel } from './field-data-editor-model';
|
||||||
|
@ -9,16 +9,16 @@ export class WordListFieldDataEditorModel extends FieldDataEditorModel<WordListF
|
||||||
public options: Array<FieldDataOptionEditorModel>;
|
public options: Array<FieldDataOptionEditorModel>;
|
||||||
public multipleList: boolean;
|
public multipleList: boolean;
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('WordListFieldDataEditorModel.type')) }],
|
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('WordListFieldDataEditorModel.type')) }],
|
||||||
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('WordListFieldDataEditorModel.label')) }],
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('WordListFieldDataEditorModel.label')) }],
|
||||||
multiList: [{ value: this.multipleList, disabled: (disabled && !skipDisable.includes('WordListFieldDataEditorModel.multipleList'))}]
|
multiList: [{ value: this.multipleList, disabled: (disabled && !skipDisable.includes('WordListFieldDataEditorModel.multipleList'))}]
|
||||||
});
|
});
|
||||||
const optionsFormArray = new Array<FormGroup>();
|
const optionsFormArray = new Array<UntypedFormGroup>();
|
||||||
if (this.options) {
|
if (this.options) {
|
||||||
this.options.forEach(item => {
|
this.options.forEach(item => {
|
||||||
const form: FormGroup = item.buildForm(disabled, skipDisable);
|
const form: UntypedFormGroup = item.buildForm(disabled, skipDisable);
|
||||||
optionsFormArray.push(form);
|
optionsFormArray.push(form);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 { ValidationType } from '../../../../core/common/enum/validation-type';
|
||||||
import { Field } from '../../../../core/model/admin/dataset-profile/dataset-profile';
|
import { Field } from '../../../../core/model/admin/dataset-profile/dataset-profile';
|
||||||
import { BaseFormModel } from '../../../../core/model/base-form-model';
|
import { BaseFormModel } from '../../../../core/model/base-form-model';
|
||||||
|
@ -98,7 +98,7 @@ export class FieldEditorModel extends BaseFormModel {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
id: [{ value: this.id, disabled: (disabled && !skipDisable.includes('FieldEditorModel.id')) }, [Validators.required, Validators.pattern('^[^<_>]+$')]],
|
id: [{ value: this.id, disabled: (disabled && !skipDisable.includes('FieldEditorModel.id')) }, [Validators.required, Validators.pattern('^[^<_>]+$')]],
|
||||||
// title: [this.title],
|
// 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;
|
const renderStyleValue = formGroup.get('viewStyle').get('renderStyle').value;
|
||||||
if(renderStyleValue === 'checkBox'){
|
if(renderStyleValue === 'checkBox'){
|
||||||
formGroup.get('defaultValue').get('value').setValidators(Validators.required);
|
formGroup.get('defaultValue').get('value').setValidators(Validators.required);
|
||||||
|
|
|
@ -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 { FieldSet } from '../../../../core/model/admin/dataset-profile/dataset-profile';
|
||||||
import { BaseFormModel } from '../../../../core/model/base-form-model';
|
import { BaseFormModel } from '../../../../core/model/base-form-model';
|
||||||
import { FieldEditorModel } from './field-editor-model';
|
import { FieldEditorModel } from './field-editor-model';
|
||||||
|
@ -31,7 +31,7 @@ export class FieldSetEditorModel extends BaseFormModel {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
id: [{ value: this.id, disabled: (disabled && !skipDisable.includes('FieldSetEditorModel.id')) }, [Validators.required, Validators.pattern('^[^<_>]+$')]],
|
id: [{ value: this.id, disabled: (disabled && !skipDisable.includes('FieldSetEditorModel.id')) }, [Validators.required, Validators.pattern('^[^<_>]+$')]],
|
||||||
ordinal: [{ value: this.ordinal, disabled: (disabled && !skipDisable.includes('FieldSetEditorModel.ordinal')) }],
|
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')) }],
|
additionalInformation: [{ value: this.additionalInformation, disabled: (disabled && !skipDisable.includes('FieldSetEditorModel.additionalInformation')) }],
|
||||||
hasCommentField: [{ value: this.hasCommentField, disabled: (disabled && !skipDisable.includes('FieldSetEditorModel.hasCommentField')) }]
|
hasCommentField: [{ value: this.hasCommentField, disabled: (disabled && !skipDisable.includes('FieldSetEditorModel.hasCommentField')) }]
|
||||||
});
|
});
|
||||||
const fieldsFormArray = new Array<FormGroup>();
|
const fieldsFormArray = new Array<UntypedFormGroup>();
|
||||||
this.fields.forEach(item => {
|
this.fields.forEach(item => {
|
||||||
const form: FormGroup = item.buildForm(disabled, skipDisable);
|
const form: UntypedFormGroup = item.buildForm(disabled, skipDisable);
|
||||||
fieldsFormArray.push(form);
|
fieldsFormArray.push(form);
|
||||||
});
|
});
|
||||||
formGroup.addControl('fields', this.formBuilder.array(fieldsFormArray));
|
formGroup.addControl('fields', this.formBuilder.array(fieldsFormArray));
|
||||||
|
|
|
@ -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 {Multiplicity} from '../../../../core/model/admin/dataset-profile/dataset-profile';
|
||||||
import {BaseFormModel} from '../../../../core/model/base-form-model';
|
import {BaseFormModel} from '../../../../core/model/base-form-model';
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ export class MultiplicityEditorModel extends BaseFormModel {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
return this.formBuilder.group({
|
return this.formBuilder.group({
|
||||||
min: [{value: this.min, disabled: (disabled && !skipDisable.includes('MultiplicityEditorModel.min'))}],
|
min: [{value: this.min, disabled: (disabled && !skipDisable.includes('MultiplicityEditorModel.min'))}],
|
||||||
max: [{value: this.max, disabled: (disabled && !skipDisable.includes('MultiplicityEditorModel.max'))}],
|
max: [{value: this.max, disabled: (disabled && !skipDisable.includes('MultiplicityEditorModel.max'))}],
|
||||||
|
|
|
@ -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 { Page } from '@app/core/model/admin/dataset-profile/dataset-profile';
|
||||||
import { BaseFormModel } from '@app/core/model/base-form-model';
|
import { BaseFormModel } from '@app/core/model/base-form-model';
|
||||||
import { Guid } from '@common/types/guid';
|
import { Guid } from '@common/types/guid';
|
||||||
|
@ -21,7 +21,7 @@ export class PageEditorModel extends BaseFormModel {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
title: [{ value: this.title, disabled: (disabled && !skipDisable.includes('PageEditorModel.title')) }, [Validators.required]],
|
title: [{ value: this.title, disabled: (disabled && !skipDisable.includes('PageEditorModel.title')) }, [Validators.required]],
|
||||||
id: [{ value: this.id, disabled: (disabled && !skipDisable.includes('PageEditorModel.id')) }, [Validators.required]],
|
id: [{ value: this.id, disabled: (disabled && !skipDisable.includes('PageEditorModel.id')) }, [Validators.required]],
|
||||||
|
|
|
@ -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 { Rule } from "../../../../core/model/admin/dataset-profile/dataset-profile";
|
||||||
import { BaseFormModel } from "../../../../core/model/base-form-model";
|
import { BaseFormModel } from "../../../../core/model/base-form-model";
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ export class RuleEditorModel extends BaseFormModel {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
// sourceField: [this.sourceField],
|
// sourceField: [this.sourceField],
|
||||||
target: [{ value: this.target, disabled: (disabled && !skipDisable.includes('RuleEditorModel.target')) }, [Validators.required]],
|
target: [{ value: this.target, disabled: (disabled && !skipDisable.includes('RuleEditorModel.target')) }, [Validators.required]],
|
||||||
|
|
|
@ -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 { Section } from '../../../../core/model/admin/dataset-profile/dataset-profile';
|
||||||
import { BaseFormModel } from '../../../../core/model/base-form-model';
|
import { BaseFormModel } from '../../../../core/model/base-form-model';
|
||||||
import { EditorCustomValidators } from '../editor/custom-validators/editor-custom-validators';
|
import { EditorCustomValidators } from '../editor/custom-validators/editor-custom-validators';
|
||||||
|
@ -26,8 +26,8 @@ export class SectionEditorModel extends BaseFormModel {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup: FormGroup = new FormBuilder().group({
|
const formGroup: UntypedFormGroup = new UntypedFormBuilder().group({
|
||||||
id: [{ value: this.id, disabled: (disabled && !skipDisable.includes('SectionEditorModel.id')) }, [Validators.required, Validators.pattern('^[^<_>]+$')]],
|
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]],
|
page: [{ value: this.page, disabled: (disabled && !skipDisable.includes('SectionEditorModel.page')) }, [Validators.required]],
|
||||||
title: [{ value: this.title, disabled: (disabled && !skipDisable.includes('SectionEditorModel.title')) } , [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]],
|
ordinal: [{ value: this.ordinal, disabled: (disabled && !skipDisable.includes('SectionEditorModel.ordinal')) }, [Validators.required]],
|
||||||
defaultVisibility: [{ value: this.defaultVisibility, disabled: (disabled && !skipDisable.includes('SectionEditorModel.defaultVisibility')) }]
|
defaultVisibility: [{ value: this.defaultVisibility, disabled: (disabled && !skipDisable.includes('SectionEditorModel.defaultVisibility')) }]
|
||||||
});
|
});
|
||||||
const sectionsFormArray = new Array<FormGroup>();
|
const sectionsFormArray = new Array<UntypedFormGroup>();
|
||||||
if (this.sections) {
|
if (this.sections) {
|
||||||
this.sections.forEach(item => {
|
this.sections.forEach(item => {
|
||||||
const form: FormGroup = item.buildForm(disabled, skipDisable);
|
const form: UntypedFormGroup = item.buildForm(disabled, skipDisable);
|
||||||
sectionsFormArray.push(form);
|
sectionsFormArray.push(form);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const compositeFieldsFormArray = new Array<FormGroup>();
|
const compositeFieldsFormArray = new Array<UntypedFormGroup>();
|
||||||
if (this.fieldSets) {
|
if (this.fieldSets) {
|
||||||
this.fieldSets.forEach(item => {
|
this.fieldSets.forEach(item => {
|
||||||
const form: FormGroup = item.buildForm(disabled, skipDisable);
|
const form: UntypedFormGroup = item.buildForm(disabled, skipDisable);
|
||||||
compositeFieldsFormArray.push(form);
|
compositeFieldsFormArray.push(form);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 { ViewStyle } from "../../../../core/model/admin/dataset-profile/dataset-profile";
|
||||||
import { BaseFormModel } from "../../../../core/model/base-form-model";
|
import { BaseFormModel } from "../../../../core/model/base-form-model";
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ export class ViewStyleEditorModel extends BaseFormModel {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
cssClass: [{ value: this.cssClass, disabled: (disabled && !skipDisable.includes('ViewStyleEditorModel.cssClass')) }],
|
cssClass: [{ value: this.cssClass, disabled: (disabled && !skipDisable.includes('ViewStyleEditorModel.cssClass')) }],
|
||||||
renderStyle: [{ value: this.renderStyle, disabled: (disabled && !skipDisable.includes('ViewStyleEditorModel.renderStyle')) }, Validators.required]
|
renderStyle: [{ value: this.renderStyle, disabled: (disabled && !skipDisable.includes('ViewStyleEditorModel.renderStyle')) }, Validators.required]
|
||||||
|
|
|
@ -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 { Visibility } from '../../../../core/model/admin/dataset-profile/dataset-profile';
|
||||||
import { BaseFormModel } from '../../../../core/model/base-form-model';
|
import { BaseFormModel } from '../../../../core/model/base-form-model';
|
||||||
import { RuleEditorModel } from './rule-editor-model';
|
import { RuleEditorModel } from './rule-editor-model';
|
||||||
|
@ -15,15 +15,15 @@ export class VisibilityEditorModel extends BaseFormModel {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
style: [{ value: this.style, disabled: (disabled && !skipDisable.includes('VisibilityEditorModel.style')) }]
|
style: [{ value: this.style, disabled: (disabled && !skipDisable.includes('VisibilityEditorModel.style')) }]
|
||||||
});
|
});
|
||||||
|
|
||||||
const rulesFormArray = new Array<FormGroup>();
|
const rulesFormArray = new Array<UntypedFormGroup>();
|
||||||
if (this.rules) {
|
if (this.rules) {
|
||||||
this.rules.forEach(rule => {
|
this.rules.forEach(rule => {
|
||||||
const form: FormGroup = rule.buildForm(disabled, skipDisable);
|
const form: UntypedFormGroup = rule.buildForm(disabled, skipDisable);
|
||||||
rulesFormArray.push(form);
|
rulesFormArray.push(form);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,75 +66,72 @@ import {DatasetProfileEditorUploadFieldComponent} from "@app/ui/admin/dataset-pr
|
||||||
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonUiModule,
|
CommonUiModule,
|
||||||
CommonFormsModule,
|
CommonFormsModule,
|
||||||
FormattingModule,
|
FormattingModule,
|
||||||
DatasetProfileRoutingModule,
|
DatasetProfileRoutingModule,
|
||||||
ConfirmationDialogModule,
|
ConfirmationDialogModule,
|
||||||
NgxDropzoneModule,
|
NgxDropzoneModule,
|
||||||
FormProgressIndicationModule,
|
FormProgressIndicationModule,
|
||||||
DatasetModule,
|
DatasetModule,
|
||||||
AngularStickyThingsModule,
|
AngularStickyThingsModule,
|
||||||
DragDropModule,
|
DragDropModule,
|
||||||
MatBadgeModule,
|
MatBadgeModule,
|
||||||
DragulaModule,
|
DragulaModule,
|
||||||
AutoCompleteModule,
|
AutoCompleteModule,
|
||||||
TransitionGroupModule,
|
TransitionGroupModule,
|
||||||
RichTextEditorModule,
|
RichTextEditorModule,
|
||||||
// TableEditorModule
|
// TableEditorModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
DatasetProfileListingComponent,
|
DatasetProfileListingComponent,
|
||||||
DatasetProfileCriteriaComponent,
|
DatasetProfileCriteriaComponent,
|
||||||
DatasetProfileEditorComponent,
|
DatasetProfileEditorComponent,
|
||||||
DatasetProfileEditorSectionComponent,
|
DatasetProfileEditorSectionComponent,
|
||||||
DatasetProfileEditorCompositeFieldComponent,
|
DatasetProfileEditorCompositeFieldComponent,
|
||||||
DatasetProfileEditorFieldComponent,
|
DatasetProfileEditorFieldComponent,
|
||||||
DatasetProfileEditorPageComponent,
|
DatasetProfileEditorPageComponent,
|
||||||
DatasetProfileEditorRuleComponent,
|
DatasetProfileEditorRuleComponent,
|
||||||
DatasetProfileEditorAutoCompleteFieldComponent,
|
DatasetProfileEditorAutoCompleteFieldComponent,
|
||||||
DatasetProfileEditorBooleanDecisionFieldComponent,
|
DatasetProfileEditorBooleanDecisionFieldComponent,
|
||||||
DatasetProfileEditorCheckboxFieldComponent,
|
DatasetProfileEditorCheckboxFieldComponent,
|
||||||
DatasetProfileEditorComboBoxFieldComponent,
|
DatasetProfileEditorComboBoxFieldComponent,
|
||||||
DatasetProfileEditorFreeTextFieldComponent,
|
DatasetProfileEditorFreeTextFieldComponent,
|
||||||
DatasetProfileEditorRadioBoxFieldComponent,
|
DatasetProfileEditorRadioBoxFieldComponent,
|
||||||
DatasetProfileEditorTextAreaFieldComponent,
|
DatasetProfileEditorTextAreaFieldComponent,
|
||||||
DatasetProfileEditorRichTextAreaFieldComponent,
|
DatasetProfileEditorRichTextAreaFieldComponent,
|
||||||
DatasetProfileEditorUploadFieldComponent,
|
DatasetProfileEditorUploadFieldComponent,
|
||||||
// DatasetProfileEditorTableFieldComponent,
|
// DatasetProfileEditorTableFieldComponent,
|
||||||
DatasetProfileEditorDatePickerFieldComponent,
|
DatasetProfileEditorDatePickerFieldComponent,
|
||||||
DatasetProfileEditorWordListFieldComponent,
|
DatasetProfileEditorWordListFieldComponent,
|
||||||
DatasetProfileEditorDefaultValueComponent,
|
DatasetProfileEditorDefaultValueComponent,
|
||||||
DialogConfirmationUploadDatasetProfiles,
|
DialogConfirmationUploadDatasetProfiles,
|
||||||
DatasetProfileEditorInternalDmpEntitiesFieldComponent,
|
DatasetProfileEditorInternalDmpEntitiesFieldComponent,
|
||||||
DatasetProfileEditorResearchersAutoCompleteFieldComponent,
|
DatasetProfileEditorResearchersAutoCompleteFieldComponent,
|
||||||
DatasetProfileEditorDatasetsAutoCompleteFieldComponent,
|
DatasetProfileEditorDatasetsAutoCompleteFieldComponent,
|
||||||
DatasetProfileEditorDmpsAutoCompleteFieldComponent,
|
DatasetProfileEditorDmpsAutoCompleteFieldComponent,
|
||||||
ParseStatus,
|
ParseStatus,
|
||||||
DatasetProfileEditorExternalDatasetsFieldComponent,
|
DatasetProfileEditorExternalDatasetsFieldComponent,
|
||||||
DatasetProfileEditorDataRepositoriesFieldComponent,
|
DatasetProfileEditorDataRepositoriesFieldComponent,
|
||||||
DatasetProfileEditorPubRepositoriesFieldComponent,
|
DatasetProfileEditorPubRepositoriesFieldComponent,
|
||||||
DatasetProfileEditorJournalRepositoriesFieldComponent,
|
DatasetProfileEditorJournalRepositoriesFieldComponent,
|
||||||
DatasetProfileEditorTaxonomiesFieldComponent,
|
DatasetProfileEditorTaxonomiesFieldComponent,
|
||||||
DatasetProfileEditorLicensesFieldComponent,
|
DatasetProfileEditorLicensesFieldComponent,
|
||||||
DatasetProfileEditorPublicationsFieldComponent,
|
DatasetProfileEditorPublicationsFieldComponent,
|
||||||
DatasetProfileEditorRegistriesFieldComponent,
|
DatasetProfileEditorRegistriesFieldComponent,
|
||||||
DatasetProfileEditorServicesFieldComponent,
|
DatasetProfileEditorServicesFieldComponent,
|
||||||
DatasetProfileEditorTagsFieldComponent,
|
DatasetProfileEditorTagsFieldComponent,
|
||||||
DatasetProfileEditorResearchersFieldComponent,
|
DatasetProfileEditorResearchersFieldComponent,
|
||||||
DatasetProfileEditorOrganizationsFieldComponent,
|
DatasetProfileEditorOrganizationsFieldComponent,
|
||||||
DatasetProfileEditorDatasetIdentifierFieldComponent,
|
DatasetProfileEditorDatasetIdentifierFieldComponent,
|
||||||
DatasetProfileEditorCurrencyFieldComponent,
|
DatasetProfileEditorCurrencyFieldComponent,
|
||||||
DatasetProfileEditorValidatorFieldComponent,
|
DatasetProfileEditorValidatorFieldComponent,
|
||||||
DatasetProfileTableOfContents,
|
DatasetProfileTableOfContents,
|
||||||
DatasetProfileTableOfContentsInternalSection,
|
DatasetProfileTableOfContentsInternalSection,
|
||||||
DatasetProfileEditorSectionFieldSetComponent,
|
DatasetProfileEditorSectionFieldSetComponent,
|
||||||
FinalPreviewComponent
|
FinalPreviewComponent
|
||||||
],
|
]
|
||||||
entryComponents: [
|
|
||||||
DialogConfirmationUploadDatasetProfiles
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
export class DatasetProfileModule { }
|
export class DatasetProfileModule { }
|
||||||
|
|
||||||
|
|
|
@ -65,11 +65,11 @@
|
||||||
{{numbering}}
|
{{numbering}}
|
||||||
</div>
|
</div>
|
||||||
</div> -->
|
</div> -->
|
||||||
<mat-form-field appearance="none" class="numbering-label" [ngStyle]="calculateLabelWidth(numbering)">
|
<mat-form-field class="numbering-label" [ngStyle]="calculateLabelWidth(numbering)">
|
||||||
<input [ngClass]="{'text-danger':form.get('title').invalid &&form.get('title').touched}" matInput type="text" [value]="numbering" disabled>
|
<input [ngClass]="{'text-danger':form.get('title').invalid &&form.get('title').touched}" matInput type="text" [value]="numbering" disabled>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<!-- [appearance]="titleControl.focused? 'legacy':'none'" floatLabel="never" -->
|
<!-- [appearance]="titleControl.focused? 'legacy':'none'" floatLabel="never" -->
|
||||||
<mat-form-field class="col field-title" [appearance]="'none'" floatLabel="never">
|
<mat-form-field class="col field-title" floatLabel="never">
|
||||||
<textarea matInput type="text" [placeholder]="('DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.UNTITLED' |translate)+' '+('DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.QUESTION'| translate)" #titleControl="matInput"
|
<textarea matInput type="text" [placeholder]="('DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.UNTITLED' |translate)+' '+('DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.QUESTION'| translate)" #titleControl="matInput"
|
||||||
[formControl]="this.form.get('title')"></textarea>
|
[formControl]="this.form.get('title')"></textarea>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
@ -91,20 +91,20 @@
|
||||||
</rich-text-editor-component>
|
</rich-text-editor-component>
|
||||||
</div>
|
</div>
|
||||||
<div class="row" *ngIf="showAdditionalInfo">
|
<div class="row" *ngIf="showAdditionalInfo">
|
||||||
<mat-form-field class="col p-0 underline-line-field" appearance="legacy">
|
<mat-form-field class="col p-0 underline-line-field">
|
||||||
<input matInput type="text" placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.ADDITIONAL-INFORMATION' | translate}}"
|
<input matInput type="text" placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.ADDITIONAL-INFORMATION' | translate}}"
|
||||||
[formControl]="this.form.get('additionalInformation')"/>
|
[formControl]="this.form.get('additionalInformation')"/>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<mat-form-field *ngIf="isMultiplicityEnabled" class="col pl-0 underline-line-field" appearance="legacy">
|
<mat-form-field *ngIf="isMultiplicityEnabled" class="col pl-0 underline-line-field">
|
||||||
<input matInput placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.MULTIPLICITY-MIN' | translate}}"
|
<input matInput placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.MULTIPLICITY-MIN' | translate}}"
|
||||||
type="number" [formControl]="form.get('multiplicity').get('min')" required>
|
type="number" [formControl]="form.get('multiplicity').get('min')" required>
|
||||||
<mat-error *ngIf="form.get('multiplicity').get('min').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
|
<mat-error *ngIf="form.get('multiplicity').get('min').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
|
||||||
</mat-error>
|
</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field *ngIf="isMultiplicityEnabled" class="col pr-0 underline-line-field" appearance="legacy">
|
<mat-form-field *ngIf="isMultiplicityEnabled" class="col pr-0 underline-line-field">
|
||||||
<input matInput placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.MULTIPLICITY-MAX' | translate}}"
|
<input matInput placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.MULTIPLICITY-MAX' | translate}}"
|
||||||
type="number" [formControl]="this.form.get('multiplicity').get('max')" required>
|
type="number" [formControl]="this.form.get('multiplicity').get('max')" required>
|
||||||
<mat-error *ngIf="form.get('multiplicity').get('max').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
|
<mat-error *ngIf="form.get('multiplicity').get('max').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
|
||||||
|
@ -112,13 +112,13 @@
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<mat-form-field *ngIf="isMultiplicityEnabled" class="col pl-0 underline-line-field" appearance="legacy">
|
<mat-form-field *ngIf="isMultiplicityEnabled" class="col pl-0 underline-line-field">
|
||||||
<input matInput placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.MULTIPLICITY-PLACEHOLDER' | translate}}"
|
<input matInput placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.MULTIPLICITY-PLACEHOLDER' | translate}}"
|
||||||
type="text" [formControl]="form.get('multiplicity').get('placeholder')">
|
type="text" [formControl]="form.get('multiplicity').get('placeholder')">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<mat-checkbox *ngIf="isMultiplicityEnabled" appearance="legacy" class="col pl-0 underline-line-field fieldset-checkbox-action-dataset-profile-editor"
|
<mat-checkbox *ngIf="isMultiplicityEnabled" class="col pl-0 underline-line-field fieldset-checkbox-action-dataset-profile-editor"
|
||||||
[formControl]="form.get('multiplicity').get('tableView')">
|
[formControl]="form.get('multiplicity').get('tableView')">
|
||||||
{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.MULTIPLICITY-TABLEVIEW' | translate}}
|
{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.MULTIPLICITY-TABLEVIEW' | translate}}
|
||||||
</mat-checkbox>
|
</mat-checkbox>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
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 { DatasetProfileComboBoxType } from '../../../../../../core/common/enum/dataset-profile-combo-box-type';
|
||||||
import { DatasetProfileFieldViewStyle } from '../../../../../../core/common/enum/dataset-profile-field-view-style';
|
import { DatasetProfileFieldViewStyle } from '../../../../../../core/common/enum/dataset-profile-field-view-style';
|
||||||
import { DatasetProfileInternalDmpEntitiesType } from '../../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type';
|
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 {
|
export class DatasetProfileEditorDefaultValueComponent implements OnInit {
|
||||||
|
|
||||||
@Input() viewStyle: DatasetProfileFieldViewStyle;
|
@Input() viewStyle: DatasetProfileFieldViewStyle;
|
||||||
@Input() form: FormControl;
|
@Input() form: UntypedFormControl;
|
||||||
@Input() formArrayOptions: FormArray;
|
@Input() formArrayOptions: UntypedFormArray;
|
||||||
@Input() comboBoxType: DatasetProfileComboBoxType;
|
@Input() comboBoxType: DatasetProfileComboBoxType;
|
||||||
@Input() internalDmpEntitiesType: DatasetProfileInternalDmpEntitiesType;
|
@Input() internalDmpEntitiesType: DatasetProfileInternalDmpEntitiesType;
|
||||||
@Input() placeHolder: String;
|
@Input() placeHolder: String;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
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 { DatasetProfileComboBoxType } from '../../../../../../../core/common/enum/dataset-profile-combo-box-type';
|
||||||
import { AutoCompleteFieldDataEditorModel } from '../../../../admin/field-data/auto-complete-field-data-editor-model';
|
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';
|
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 {
|
export class DatasetProfileEditorAutoCompleteFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: AutoCompleteFieldDataEditorModel = new AutoCompleteFieldDataEditorModel();
|
private data: AutoCompleteFieldDataEditorModel = new AutoCompleteFieldDataEditorModel();
|
||||||
multiForm: FormArray;
|
multiForm: UntypedFormArray;
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.multiForm = (<FormArray>this.form.get('data').get('autoCompleteSingleDataList'));
|
this.multiForm = (<UntypedFormArray>this.form.get('data').get('autoCompleteSingleDataList'));
|
||||||
this.data.type = DatasetProfileComboBoxType.Autocomplete;
|
this.data.type = DatasetProfileComboBoxType.Autocomplete;
|
||||||
}
|
}
|
||||||
|
|
||||||
addSource() {
|
addSource() {
|
||||||
(<FormArray>this.multiForm).push(new AutoCompleteSingleDataEditorModel().buildForm());
|
(<UntypedFormArray>this.multiForm).push(new AutoCompleteSingleDataEditorModel().buildForm());
|
||||||
}
|
}
|
||||||
|
|
||||||
removeSource(index: number) {
|
removeSource(index: number) {
|
||||||
(<FormArray>this.multiForm).removeAt(index);
|
(<UntypedFormArray>this.multiForm).removeAt(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
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';
|
import { BooleanDecisionFieldDataEditorModel } from '../../../../admin/field-data/boolean-decision-field-data-editor-model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -10,7 +10,7 @@ import { BooleanDecisionFieldDataEditorModel } from '../../../../admin/field-dat
|
||||||
})
|
})
|
||||||
export class DatasetProfileEditorBooleanDecisionFieldComponent implements OnInit {
|
export class DatasetProfileEditorBooleanDecisionFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: BooleanDecisionFieldDataEditorModel = new BooleanDecisionFieldDataEditorModel();
|
private data: BooleanDecisionFieldDataEditorModel = new BooleanDecisionFieldDataEditorModel();
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
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';
|
import { CheckBoxFieldDataEditorModel } from '../../../../admin/field-data/check-box-field-data-editor-model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -9,7 +9,7 @@ import { CheckBoxFieldDataEditorModel } from '../../../../admin/field-data/check
|
||||||
})
|
})
|
||||||
export class DatasetProfileEditorCheckboxFieldComponent implements OnInit {
|
export class DatasetProfileEditorCheckboxFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: CheckBoxFieldDataEditorModel = new CheckBoxFieldDataEditorModel();
|
private data: CheckBoxFieldDataEditorModel = new CheckBoxFieldDataEditorModel();
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
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 { DatasetProfileComboBoxType } from '@app/core/common/enum/dataset-profile-combo-box-type';
|
||||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
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';
|
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 {
|
export class DatasetProfileEditorComboBoxFieldComponent extends BaseComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
options = DatasetProfileComboBoxType;
|
options = DatasetProfileComboBoxType;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
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 { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -9,7 +9,7 @@ import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/a
|
||||||
})
|
})
|
||||||
export class DatasetProfileEditorCurrencyFieldComponent implements OnInit {
|
export class DatasetProfileEditorCurrencyFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel();
|
private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel();
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
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 { 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 { 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';
|
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 {
|
export class DatasetProfileEditorDataRepositoriesFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel();
|
private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel();
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { FormGroup } from '@angular/forms';
|
import { UntypedFormGroup } from '@angular/forms';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { DatasetIdentifierDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/dataset-identifier-data-editor-models';
|
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 {
|
export class DatasetProfileEditorDatasetIdentifierFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: DatasetIdentifierDataEditorModel = new DatasetIdentifierDataEditorModel();
|
private data: DatasetIdentifierDataEditorModel = new DatasetIdentifierDataEditorModel();
|
||||||
|
|
||||||
constructor(private router: Router) {}
|
constructor(private router: Router) {}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { OnInit, Input, Component } from "@angular/core";
|
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 { DatasetProfileInternalDmpEntitiesType } from "../../../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type";
|
||||||
import { DatasetsAutoCompleteFieldDataEditorModel } from "../../../../admin/field-data/datasets-autocomplete-field-data-editor-mode";
|
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 {
|
export class DatasetProfileEditorDatasetsAutoCompleteFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: DatasetsAutoCompleteFieldDataEditorModel = new DatasetsAutoCompleteFieldDataEditorModel();
|
private data: DatasetsAutoCompleteFieldDataEditorModel = new DatasetsAutoCompleteFieldDataEditorModel();
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
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 { DatePickerDataEditorModel } from '../../../../admin/field-data/date-picker-data-editor-models';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -9,7 +9,7 @@ import { DatePickerDataEditorModel } from '../../../../admin/field-data/date-pic
|
||||||
})
|
})
|
||||||
export class DatasetProfileEditorDatePickerFieldComponent implements OnInit {
|
export class DatasetProfileEditorDatePickerFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: DatePickerDataEditorModel = new DatePickerDataEditorModel();
|
private data: DatePickerDataEditorModel = new DatePickerDataEditorModel();
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { OnInit, Input, Component } from "@angular/core";
|
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 { DatasetProfileInternalDmpEntitiesType } from "../../../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type";
|
||||||
import { DatasetsAutoCompleteFieldDataEditorModel } from "../../../../admin/field-data/datasets-autocomplete-field-data-editor-mode";
|
import { DatasetsAutoCompleteFieldDataEditorModel } from "../../../../admin/field-data/datasets-autocomplete-field-data-editor-mode";
|
||||||
import { DmpsAutoCompleteFieldDataEditorModel } from "../../../../admin/field-data/dmps-autocomplete-field-data-editor-model";
|
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 {
|
export class DatasetProfileEditorDmpsAutoCompleteFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: DmpsAutoCompleteFieldDataEditorModel = new DatasetsAutoCompleteFieldDataEditorModel();
|
private data: DmpsAutoCompleteFieldDataEditorModel = new DatasetsAutoCompleteFieldDataEditorModel();
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
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 { 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 { 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';
|
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 {
|
export class DatasetProfileEditorExternalDatasetsFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: ExternalDatasetsDataEditorModel = new ExternalDatasetsDataEditorModel();
|
private data: ExternalDatasetsDataEditorModel = new ExternalDatasetsDataEditorModel();
|
||||||
|
|
||||||
externalDatasetTypes = [
|
externalDatasetTypes = [
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
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';
|
import { FreeTextFieldDataEditorModel } from '../../../../admin/field-data/free-text-field-data-editor-model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -9,7 +9,7 @@ import { FreeTextFieldDataEditorModel } from '../../../../admin/field-data/free-
|
||||||
})
|
})
|
||||||
export class DatasetProfileEditorFreeTextFieldComponent implements OnInit {
|
export class DatasetProfileEditorFreeTextFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: FreeTextFieldDataEditorModel = new FreeTextFieldDataEditorModel();
|
private data: FreeTextFieldDataEditorModel = new FreeTextFieldDataEditorModel();
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
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 { DatasetProfileInternalDmpEntitiesType } from '@app/core/common/enum/dataset-profile-internal-dmp-entities-type';
|
||||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
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';
|
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'
|
templateUrl: './dataset-profile-editor-internal-dmp-entities-field.component.html'
|
||||||
})
|
})
|
||||||
export class DatasetProfileEditorInternalDmpEntitiesFieldComponent extends BaseComponent implements OnInit {
|
export class DatasetProfileEditorInternalDmpEntitiesFieldComponent extends BaseComponent implements OnInit {
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
options = DatasetProfileInternalDmpEntitiesType;
|
options = DatasetProfileInternalDmpEntitiesType;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
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 { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models';
|
||||||
import { FormControl } from '@angular/forms';
|
import { FormControl } from '@angular/forms';
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import { FormControl } from '@angular/forms';
|
||||||
})
|
})
|
||||||
export class DatasetProfileEditorJournalRepositoriesFieldComponent implements OnInit {
|
export class DatasetProfileEditorJournalRepositoriesFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel();
|
private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel();
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import {Component, Input, OnInit} from '@angular/core';
|
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";
|
import {LicensesDataEditorModel} from "@app/ui/admin/dataset-profile/admin/field-data/licenses-data-editor-models";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -9,7 +9,7 @@ import {LicensesDataEditorModel} from "@app/ui/admin/dataset-profile/admin/field
|
||||||
})
|
})
|
||||||
export class DatasetProfileEditorLicensesFieldComponent implements OnInit {
|
export class DatasetProfileEditorLicensesFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: LicensesDataEditorModel = new LicensesDataEditorModel();
|
private data: LicensesDataEditorModel = new LicensesDataEditorModel();
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
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 { 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 { 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';
|
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 {
|
export class DatasetProfileEditorOrganizationsFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: OrganizationsDataEditorModel = new OrganizationsDataEditorModel();
|
private data: OrganizationsDataEditorModel = new OrganizationsDataEditorModel();
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
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 { 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 { 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';
|
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 {
|
export class DatasetProfileEditorPubRepositoriesFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel();
|
private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel();
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import {Component, Input, OnInit} from '@angular/core';
|
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";
|
import {PublicationsDataEditorModel} from "@app/ui/admin/dataset-profile/admin/field-data/publications-data-editor-models";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -9,7 +9,7 @@ import {PublicationsDataEditorModel} from "@app/ui/admin/dataset-profile/admin/f
|
||||||
})
|
})
|
||||||
export class DatasetProfileEditorPublicationsFieldComponent implements OnInit {
|
export class DatasetProfileEditorPublicationsFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: PublicationsDataEditorModel = new PublicationsDataEditorModel();
|
private data: PublicationsDataEditorModel = new PublicationsDataEditorModel();
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
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 { FieldDataOptionEditorModel } from '../../../../admin/field-data/field-data-option-editor-model';
|
||||||
import { RadioBoxFieldDataEditorModel } from '../../../../admin/field-data/radio-box-field-data-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 {
|
export class DatasetProfileEditorRadioBoxFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: RadioBoxFieldDataEditorModel = new RadioBoxFieldDataEditorModel();
|
private data: RadioBoxFieldDataEditorModel = new RadioBoxFieldDataEditorModel();
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@ -19,11 +19,11 @@ export class DatasetProfileEditorRadioBoxFieldComponent implements OnInit {
|
||||||
|
|
||||||
addNewRow() {
|
addNewRow() {
|
||||||
const radioListOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel();
|
const radioListOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel();
|
||||||
if (!this.form.get('data').get('options')) { (<FormGroup>this.form.get('data')).addControl('options', new FormBuilder().array([])); }
|
if (!this.form.get('data').get('options')) { (<UntypedFormGroup>this.form.get('data')).addControl('options', new UntypedFormBuilder().array([])); }
|
||||||
(<FormArray>this.form.get('data').get('options')).push(radioListOptions.buildForm());
|
(<UntypedFormArray>this.form.get('data').get('options')).push(radioListOptions.buildForm());
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteRow(intex: number) {
|
deleteRow(intex: number) {
|
||||||
if (this.form.get('data').get('options')) { (<FormArray>this.form.get('data').get('options')).removeAt(intex); }
|
if (this.form.get('data').get('options')) { (<UntypedFormArray>this.form.get('data').get('options')).removeAt(intex); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
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 { 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 { 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';
|
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 {
|
export class DatasetProfileEditorRegistriesFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: RegistriesDataEditorModel = new RegistriesDataEditorModel();
|
private data: RegistriesDataEditorModel = new RegistriesDataEditorModel();
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { ResearchersAutoCompleteFieldDataEditorModel } from "../../../../admin/field-data/researchers-auto-complete-field-data-editor-model";
|
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 { Input, Component, OnInit } from "@angular/core";
|
||||||
import { DatasetProfileInternalDmpEntitiesType } from "../../../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type";
|
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 {
|
export class DatasetProfileEditorResearchersAutoCompleteFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: ResearchersAutoCompleteFieldDataEditorModel = new ResearchersAutoCompleteFieldDataEditorModel();
|
private data: ResearchersAutoCompleteFieldDataEditorModel = new ResearchersAutoCompleteFieldDataEditorModel();
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
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 { 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 { 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';
|
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 {
|
export class DatasetProfileEditorResearchersFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: ResearchersDataEditorModel = new ResearchersDataEditorModel();
|
private data: ResearchersDataEditorModel = new ResearchersDataEditorModel();
|
||||||
|
|
||||||
constructor(private router: Router) {}
|
constructor(private router: Router) {}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
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';
|
import { RichTextAreaFieldDataEditorModel } from '../../../../admin/field-data/rich-text-area-field-data-editor-model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -9,7 +9,7 @@ import { RichTextAreaFieldDataEditorModel } from '../../../../admin/field-data/r
|
||||||
})
|
})
|
||||||
export class DatasetProfileEditorRichTextAreaFieldComponent implements OnInit {
|
export class DatasetProfileEditorRichTextAreaFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: RichTextAreaFieldDataEditorModel = new RichTextAreaFieldDataEditorModel();
|
private data: RichTextAreaFieldDataEditorModel = new RichTextAreaFieldDataEditorModel();
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
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 { 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 { 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';
|
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 {
|
export class DatasetProfileEditorServicesFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: ServicesDataEditorModel = new ServicesDataEditorModel();
|
private data: ServicesDataEditorModel = new ServicesDataEditorModel();
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
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 { 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 { 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';
|
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 {
|
export class DatasetProfileEditorTagsFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: TagsDataEditorModel = new TagsDataEditorModel();
|
private data: TagsDataEditorModel = new TagsDataEditorModel();
|
||||||
|
|
||||||
constructor(private router: Router) {}
|
constructor(private router: Router) {}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import {Component, Input, OnInit} from '@angular/core';
|
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";
|
import {TaxonomiesDataEditorModel} from "@app/ui/admin/dataset-profile/admin/field-data/taxonomies-data-editor-models";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -9,7 +9,7 @@ import {TaxonomiesDataEditorModel} from "@app/ui/admin/dataset-profile/admin/fie
|
||||||
})
|
})
|
||||||
export class DatasetProfileEditorTaxonomiesFieldComponent implements OnInit {
|
export class DatasetProfileEditorTaxonomiesFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: TaxonomiesDataEditorModel = new TaxonomiesDataEditorModel();
|
private data: TaxonomiesDataEditorModel = new TaxonomiesDataEditorModel();
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
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';
|
import { TextAreaFieldDataEditorModel } from '../../../../admin/field-data/text-area-field-data-editor-model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -9,7 +9,7 @@ import { TextAreaFieldDataEditorModel } from '../../../../admin/field-data/text-
|
||||||
})
|
})
|
||||||
export class DatasetProfileEditorTextAreaFieldComponent implements OnInit {
|
export class DatasetProfileEditorTextAreaFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: TextAreaFieldDataEditorModel = new TextAreaFieldDataEditorModel();
|
private data: TextAreaFieldDataEditorModel = new TextAreaFieldDataEditorModel();
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
import {Component, Input, OnInit, ViewChild} from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import {FormArray, FormBuilder, FormControl, FormGroup, Validators} from '@angular/forms';
|
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 { 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 {ConfigurationService} from "@app/core/services/configuration/configuration.service";
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dataset-profile-editor-upload-field-component',
|
selector: 'app-dataset-profile-editor-upload-field-component',
|
||||||
|
@ -14,49 +13,49 @@ import {ConfigurationService} from "@app/core/services/configuration/configurati
|
||||||
export class DatasetProfileEditorUploadFieldComponent implements OnInit {
|
export class DatasetProfileEditorUploadFieldComponent implements OnInit {
|
||||||
types: Array<FieldDataOption> = [
|
types: Array<FieldDataOption> = [
|
||||||
// images
|
// images
|
||||||
{label: "Animated Portable Network Graphics (APNG)", value: "image/apng", source: ""},
|
{ label: "Animated Portable Network Graphics (APNG)", value: "image/apng", source: "" },
|
||||||
{label: "AV1 Image File Format (AVIF)", value: "image/avif", source: ""},
|
{ label: "AV1 Image File Format (AVIF)", value: "image/avif", source: "" },
|
||||||
{label: "Graphics Interchange Format (GIF)", value: "image/gif", source: ""},
|
{ label: "Graphics Interchange Format (GIF)", value: "image/gif", source: "" },
|
||||||
{label: "Joint Photographic Expert Group image (JPEG)", value: "image/jpeg", source: ""},
|
{ label: "Joint Photographic Expert Group image (JPEG)", value: "image/jpeg", source: "" },
|
||||||
{label: "Portable Network Graphics (PNG)", value: "image/png", source: ""},
|
{ label: "Portable Network Graphics (PNG)", value: "image/png", source: "" },
|
||||||
{label: "Scalable Vector Graphics (SVG)", value: "image/svg+xml", source: ""},
|
{ label: "Scalable Vector Graphics (SVG)", value: "image/svg+xml", source: "" },
|
||||||
{label: "Web Picture format (WEBP)", value: "image/webp", source: ""},
|
{ label: "Web Picture format (WEBP)", value: "image/webp", source: "" },
|
||||||
{label: "Tagged Image File Format (TIFF)", value: "image/tiff", source: ""},
|
{ label: "Tagged Image File Format (TIFF)", value: "image/tiff", source: "" },
|
||||||
|
|
||||||
// office word
|
// office word
|
||||||
{label: "Microsoft Word 97-2003", value: "application/msword", source: ""}, // .doc, .dot
|
{ 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: "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: "OpenDocument Text", value: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", source: "" }, // .odt
|
||||||
|
|
||||||
// office excel
|
// office excel
|
||||||
{label: "Microsoft Excel 97-2003", value: "application/vnd.ms-excel", source: ""}, // .xls, .xlt, .xla
|
{ 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: "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: "OpenDocument Spreadsheet", value: "application/vnd.oasis.opendocument.spreadsheet", source: "" }, // .ods
|
||||||
|
|
||||||
// office powerpoint
|
// office powerpoint
|
||||||
{label: "Microsoft PowerPoint 97-2003", value: "application/vnd.ms-powerpoint", source: ""}, // .ppt, .pot, .pps, .ppa
|
{ 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: "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: "OpenDocument Presentation", value: "application/vnd.oasis.opendocument.presentation", source: "" }, // .odp
|
||||||
|
|
||||||
|
|
||||||
{label: "Comma-Seperated Values (CSV)", value: "text/csv", source: ""},
|
{ label: "Comma-Seperated Values (CSV)", value: "text/csv", source: "" },
|
||||||
{label: "Adobe Portable Document Format (PDF)", value: "application/pdf", source: ""}
|
{ label: "Adobe Portable Document Format (PDF)", value: "application/pdf", source: "" }
|
||||||
];
|
];
|
||||||
|
|
||||||
selected: string[] = [];
|
selected: string[] = [];
|
||||||
public typesFormControl = new FormControl();
|
public typesFormControl = new UntypedFormControl();
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: UploadFieldDataEditorModel = new UploadFieldDataEditorModel();
|
private data: UploadFieldDataEditorModel = new UploadFieldDataEditorModel();
|
||||||
|
|
||||||
constructor(private configurationService: ConfigurationService) {}
|
constructor(private configurationService: ConfigurationService) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
let typeValues: string[] = this.types.map(type => type.value);
|
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.addControl('data', this.data.buildForm()); }
|
||||||
if(this.form.get('data') && this.form.get('data').get('types')) {
|
if (this.form.get('data') && this.form.get('data').get('types')) {
|
||||||
for(let type of this.form.get('data').get('types').value) {
|
for (let type of this.form.get('data').get('types').value) {
|
||||||
if(typeValues.indexOf(type.value) != -1) {
|
if (typeValues.indexOf(type.value) != -1) {
|
||||||
this.selected.push(type.value);
|
this.selected.push(type.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,15 +85,15 @@ export class DatasetProfileEditorUploadFieldComponent implements OnInit {
|
||||||
|
|
||||||
addNewRow(type: FieldDataOption = null) {
|
addNewRow(type: FieldDataOption = null) {
|
||||||
const typeListOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel();
|
const typeListOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel();
|
||||||
if(type != null) {
|
if (type != null) {
|
||||||
typeListOptions.fromModel(type);
|
typeListOptions.fromModel(type);
|
||||||
}
|
}
|
||||||
(<FormGroup>this.form.get('data')).addControl('types', new FormBuilder().array([]));
|
(<UntypedFormGroup>this.form.get('data')).addControl('types', new UntypedFormBuilder().array([]));
|
||||||
(<FormArray>this.form.get('data').get('types')).push(typeListOptions.buildForm());
|
(<UntypedFormArray>this.form.get('data').get('types')).push(typeListOptions.buildForm());
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteRow(index: number) {
|
deleteRow(index: number) {
|
||||||
if (this.form.get('data').get('types')) { (<FormArray>this.form.get('data').get('types')).removeAt(index); }
|
if (this.form.get('data').get('types')) { (<UntypedFormArray>this.form.get('data').get('types')).removeAt(index); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public getConfiguration() {
|
public getConfiguration() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
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 { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -9,7 +9,7 @@ import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/a
|
||||||
})
|
})
|
||||||
export class DatasetProfileEditorValidatorFieldComponent implements OnInit {
|
export class DatasetProfileEditorValidatorFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel();
|
private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel();
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
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 { DatasetProfileComboBoxType } from '../../../../../../../core/common/enum/dataset-profile-combo-box-type';
|
||||||
import { FieldDataOptionEditorModel } from '../../../../admin/field-data/field-data-option-editor-model';
|
import { FieldDataOptionEditorModel } from '../../../../admin/field-data/field-data-option-editor-model';
|
||||||
import { WordListFieldDataEditorModel } from '../../../../admin/field-data/word-list-field-data-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 {
|
export class DatasetProfileEditorWordListFieldComponent implements OnInit {
|
||||||
|
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
private data: WordListFieldDataEditorModel = new WordListFieldDataEditorModel();
|
private data: WordListFieldDataEditorModel = new WordListFieldDataEditorModel();
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@ -20,10 +20,10 @@ export class DatasetProfileEditorWordListFieldComponent implements OnInit {
|
||||||
|
|
||||||
addNewRow() {
|
addNewRow() {
|
||||||
const wordListOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel();
|
const wordListOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel();
|
||||||
(<FormArray>this.form.get('data').get('options')).push(wordListOptions.buildForm());
|
(<UntypedFormArray>this.form.get('data').get('options')).push(wordListOptions.buildForm());
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteRow(intex: number) {
|
deleteRow(intex: number) {
|
||||||
if (this.form.get('data').get('options')) { (<FormArray>this.form.get('data').get('options')).removeAt(intex); }
|
if (this.form.get('data').get('options')) { (<UntypedFormArray>this.form.get('data').get('options')).removeAt(intex); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,14 @@
|
||||||
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
|
import { COMMA, ENTER } from '@angular/cdk/keycodes';
|
||||||
import {FormArray, FormControl, FormGroup, FormGroupDirective, NgForm,} from '@angular/forms';
|
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||||
import {DatasetProfileFieldViewStyle} from '@app/core/common/enum/dataset-profile-field-view-style';
|
import { FormGroupDirective, NgForm, UntypedFormArray, UntypedFormControl, UntypedFormGroup, } from '@angular/forms';
|
||||||
import {ValidationType} from '@app/core/common/enum/validation-type';
|
import { ErrorStateMatcher } from '@angular/material/core';
|
||||||
import {DatasetProfileService} from '@app/core/services/dataset-profile/dataset-profile.service';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import {EnumUtils} from '@app/core/services/utilities/enum-utils.service';
|
import { MatSlideToggleChange } from '@angular/material/slide-toggle';
|
||||||
import {RuleEditorModel} from '@app/ui/admin/dataset-profile/admin/rule-editor-model';
|
import { DatasetProfileComboBoxType } from '@app/core/common/enum/dataset-profile-combo-box-type';
|
||||||
import {BaseComponent} from '@common/base/base.component';
|
import { DatasetProfileFieldViewStyle } from '@app/core/common/enum/dataset-profile-field-view-style';
|
||||||
import {Observable, Subscription} from 'rxjs';
|
import { DatasetProfileInternalDmpEntitiesType } from '@app/core/common/enum/dataset-profile-internal-dmp-entities-type';
|
||||||
import {ViewStyleType} from './view-style-enum';
|
import { ValidationType } from '@app/core/common/enum/validation-type';
|
||||||
import {DatasetProfileComboBoxType} from '@app/core/common/enum/dataset-profile-combo-box-type';
|
import { DefaultValue, Field } from '@app/core/model/admin/dataset-profile/dataset-profile';
|
||||||
import {ErrorStateMatcher} from '@angular/material/core';
|
|
||||||
import {MatDialog} from '@angular/material/dialog';
|
|
||||||
import {MatSlideToggleChange} from '@angular/material/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 {
|
import {
|
||||||
AutoCompleteFieldData,
|
AutoCompleteFieldData,
|
||||||
BooleanDecisionFieldData,
|
BooleanDecisionFieldData,
|
||||||
|
@ -34,19 +28,25 @@ import {
|
||||||
RegistriesFieldData,
|
RegistriesFieldData,
|
||||||
ResearchersAutoCompleteFieldData,
|
ResearchersAutoCompleteFieldData,
|
||||||
RichTextAreaFieldData,
|
RichTextAreaFieldData,
|
||||||
UploadFieldData,
|
|
||||||
ServicesFieldData,
|
ServicesFieldData,
|
||||||
// TableFieldData,
|
// TableFieldData,
|
||||||
TagsFieldData,
|
TagsFieldData,
|
||||||
TaxonomiesFieldData,
|
TaxonomiesFieldData,
|
||||||
TextAreaFieldData,
|
TextAreaFieldData,
|
||||||
|
UploadFieldData,
|
||||||
ValidationFieldData,
|
ValidationFieldData,
|
||||||
WordListFieldData
|
WordListFieldData
|
||||||
} from '@app/core/model/dataset-profile-definition/field-data/field-data';
|
} 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 { 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 { 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({
|
@Component({
|
||||||
selector: 'app-dataset-profile-editor-field-component',
|
selector: 'app-dataset-profile-editor-field-component',
|
||||||
|
@ -55,7 +55,7 @@ import { COMMA, ENTER } from '@angular/cdk/keycodes';
|
||||||
})
|
})
|
||||||
export class DatasetProfileEditorFieldComponent extends BaseComponent implements OnInit, ErrorStateMatcher {
|
export class DatasetProfileEditorFieldComponent extends BaseComponent implements OnInit, ErrorStateMatcher {
|
||||||
@Input() viewOnly: boolean;
|
@Input() viewOnly: boolean;
|
||||||
@Input() form: FormGroup;
|
@Input() form: UntypedFormGroup;
|
||||||
@Input() showOrdinal = true;
|
@Input() showOrdinal = true;
|
||||||
@Input() indexPath: string;
|
@Input() indexPath: string;
|
||||||
validationTypeEnum = ValidationType;
|
validationTypeEnum = ValidationType;
|
||||||
|
@ -63,13 +63,13 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
// isFieldMultiplicityEnabled = false;
|
// isFieldMultiplicityEnabled = false;
|
||||||
|
|
||||||
viewType: ViewStyleType;
|
viewType: ViewStyleType;
|
||||||
viewTypeEnum = ViewStyleType;
|
viewTypeEnum = ViewStyleType;
|
||||||
// private subject$:Subject<DatasetDescriptionFieldEditorModel> = new Subject<DatasetDescriptionFieldEditorModel>();
|
// private subject$:Subject<DatasetDescriptionFieldEditorModel> = new Subject<DatasetDescriptionFieldEditorModel>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Input() expandView: boolean = true;
|
@Input() expandView: boolean = true;
|
||||||
@Input() canBeDeleted:boolean = true;
|
@Input() canBeDeleted: boolean = true;
|
||||||
|
|
||||||
@Output() delete = new EventEmitter<void>();
|
@Output() delete = new EventEmitter<void>();
|
||||||
|
|
||||||
|
@ -85,20 +85,21 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
filterSemantics(value: string): Observable<String[]> {
|
filterSemantics(value: string): Observable<String[]> {
|
||||||
return this.datasetProfileService.searchSemantics(value);
|
return this.datasetProfileService.searchSemantics(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public enumUtils: EnumUtils,
|
public enumUtils: EnumUtils,
|
||||||
public datasetProfileService: DatasetProfileService,
|
public datasetProfileService: DatasetProfileService,
|
||||||
private dialog: MatDialog,
|
private dialog: MatDialog,
|
||||||
private configurationService: ConfigurationService
|
private configurationService: ConfigurationService
|
||||||
) { super();
|
) {
|
||||||
|
super();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
isErrorState(control: FormControl, form: FormGroupDirective | NgForm): boolean {
|
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;
|
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;
|
const renderStyle = this.form.get('viewStyle').get('renderStyle').value;
|
||||||
if(renderStyle){
|
if (renderStyle) {
|
||||||
|
|
||||||
// this.matcher.setReference(this.form);
|
// this.matcher.setReference(this.form);
|
||||||
const type = this.form.get('viewStyle').get('renderStyle').value;
|
const type = this.form.get('viewStyle').get('renderStyle').value;
|
||||||
|
|
||||||
switch(type){
|
switch (type) {
|
||||||
case DatasetProfileFieldViewStyle.BooleanDecision:
|
case DatasetProfileFieldViewStyle.BooleanDecision:
|
||||||
this.viewType = this.viewTypeEnum.BooleanDecision;
|
this.viewType = this.viewTypeEnum.BooleanDecision;
|
||||||
break;
|
break;
|
||||||
|
@ -133,9 +134,9 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
case DatasetProfileFieldViewStyle.ComboBox:
|
case DatasetProfileFieldViewStyle.ComboBox:
|
||||||
|
|
||||||
const comboType = this.form.get('data').get('type').value;
|
const comboType = this.form.get('data').get('type').value;
|
||||||
if(comboType === DatasetProfileComboBoxType.Autocomplete){
|
if (comboType === DatasetProfileComboBoxType.Autocomplete) {
|
||||||
this.viewType = this.viewTypeEnum.Other;
|
this.viewType = this.viewTypeEnum.Other;
|
||||||
}else if(comboType === DatasetProfileComboBoxType.WordList){
|
} else if (comboType === DatasetProfileComboBoxType.WordList) {
|
||||||
this.viewType = this.viewTypeEnum.Select;
|
this.viewType = this.viewTypeEnum.Select;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -209,7 +210,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
this.viewType = this.viewTypeEnum.Validation;
|
this.viewType = this.viewTypeEnum.Validation;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(this.viewType !== this.viewTypeEnum.FreeText) {
|
if (this.viewType !== this.viewTypeEnum.FreeText) {
|
||||||
this.setValidator(ValidationType.URL, false);
|
this.setValidator(ValidationType.URL, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -336,11 +337,11 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
|
|
||||||
addNewRule() {
|
addNewRule() {
|
||||||
const rule: RuleEditorModel = new RuleEditorModel();
|
const rule: RuleEditorModel = new RuleEditorModel();
|
||||||
(<FormArray>this.form.get('visible').get('rules')).push(rule.buildForm());
|
(<UntypedFormArray>this.form.get('visible').get('rules')).push(rule.buildForm());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private _formChangesSubscription:Subscription;
|
private _formChangesSubscription: Subscription;
|
||||||
private _showPreview: boolean = false;
|
private _showPreview: boolean = false;
|
||||||
|
|
||||||
// get showPreview(): boolean{
|
// 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.TextArea:
|
||||||
case this.viewTypeEnum.RichTextArea:
|
case this.viewTypeEnum.RichTextArea:
|
||||||
case this.viewTypeEnum.Upload:
|
case this.viewTypeEnum.Upload:
|
||||||
|
@ -472,7 +473,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
|
|
||||||
|
|
||||||
// }
|
// }
|
||||||
onInputTypeChange(){
|
onInputTypeChange() {
|
||||||
|
|
||||||
|
|
||||||
const x = this.viewType;
|
const x = this.viewType;
|
||||||
|
@ -484,7 +485,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
const field: Field = this.form.getRawValue();
|
const field: Field = this.form.getRawValue();
|
||||||
// field.defaultValue = {type:null, value: null};
|
// field.defaultValue = {type:null, value: null};
|
||||||
field.defaultValue = undefined;
|
field.defaultValue = undefined;
|
||||||
if(!this.canApplyVisibility){
|
if (!this.canApplyVisibility) {
|
||||||
field.visible.rules = [];
|
field.visible.rules = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -499,14 +500,14 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
// this.form.addControl('defaultValue',defaultValueModel.buildForm());
|
// this.form.addControl('defaultValue',defaultValueModel.buildForm());
|
||||||
|
|
||||||
switch (x) {
|
switch (x) {
|
||||||
case this.viewTypeEnum.BooleanDecision:{
|
case this.viewTypeEnum.BooleanDecision: {
|
||||||
|
|
||||||
|
|
||||||
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.BooleanDecision)
|
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.BooleanDecision)
|
||||||
// this.form.addControl('data', new BooleanDecisionFieldDataEditorModel().buildForm());
|
// this.form.addControl('data', new BooleanDecisionFieldDataEditorModel().buildForm());
|
||||||
|
|
||||||
const data: BooleanDecisionFieldData = {
|
const data: BooleanDecisionFieldData = {
|
||||||
label:""
|
label: ""
|
||||||
}
|
}
|
||||||
|
|
||||||
field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.BooleanDecision;
|
field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.BooleanDecision;
|
||||||
|
@ -514,14 +515,14 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case this.viewTypeEnum.CheckBox:{
|
case this.viewTypeEnum.CheckBox: {
|
||||||
|
|
||||||
|
|
||||||
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.CheckBox)
|
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.CheckBox)
|
||||||
// this.form.addControl('data', new CheckBoxFieldDataEditorModel().buildForm());
|
// this.form.addControl('data', new CheckBoxFieldDataEditorModel().buildForm());
|
||||||
|
|
||||||
const data: CheckBoxFieldData = {
|
const data: CheckBoxFieldData = {
|
||||||
label:''
|
label: ''
|
||||||
}
|
}
|
||||||
const defaultValue: DefaultValue = {
|
const defaultValue: DefaultValue = {
|
||||||
type: '',
|
type: '',
|
||||||
|
@ -534,7 +535,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case this.viewTypeEnum.Select:{
|
case this.viewTypeEnum.Select: {
|
||||||
|
|
||||||
|
|
||||||
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.ComboBox)
|
// 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').setValidators(EditorCustomValidators.atLeastOneElementListValidator('options'));
|
||||||
// this.form.get('data').updateValueAndValidity();
|
// this.form.get('data').updateValueAndValidity();
|
||||||
const option1 = {label:'', value:''} as FieldDataOption;
|
const option1 = { label: '', value: '' } as FieldDataOption;
|
||||||
|
|
||||||
const data:WordListFieldData = {
|
const data: WordListFieldData = {
|
||||||
label:'',
|
label: '',
|
||||||
multiList:false,
|
multiList: false,
|
||||||
options:[option1],
|
options: [option1],
|
||||||
type:DatasetProfileComboBoxType.WordList
|
type: DatasetProfileComboBoxType.WordList
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -557,7 +558,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case this.viewTypeEnum.Other:{
|
case this.viewTypeEnum.Other: {
|
||||||
|
|
||||||
|
|
||||||
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.ComboBox)
|
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.ComboBox)
|
||||||
|
@ -567,9 +568,9 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
// this.form.get('data').updateValueAndValidity();
|
// this.form.get('data').updateValueAndValidity();
|
||||||
|
|
||||||
const data: AutoCompleteFieldData = {
|
const data: AutoCompleteFieldData = {
|
||||||
autoCompleteSingleDataList:[],
|
autoCompleteSingleDataList: [],
|
||||||
multiAutoComplete: false,
|
multiAutoComplete: false,
|
||||||
label:'',
|
label: '',
|
||||||
type: DatasetProfileComboBoxType.Autocomplete
|
type: DatasetProfileComboBoxType.Autocomplete
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -578,14 +579,14 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case this.viewTypeEnum.InternalDmpEntities:{
|
case this.viewTypeEnum.InternalDmpEntities: {
|
||||||
|
|
||||||
|
|
||||||
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.InternalDmpEntities)
|
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.InternalDmpEntities)
|
||||||
// this.form.addControl('data', new ResearchersAutoCompleteFieldDataEditorModel().buildForm());//TODO TO SEE
|
// this.form.addControl('data', new ResearchersAutoCompleteFieldDataEditorModel().buildForm());//TODO TO SEE
|
||||||
|
|
||||||
const data: DmpsAutoCompleteFieldData = {
|
const data: DmpsAutoCompleteFieldData = {
|
||||||
label:'',
|
label: '',
|
||||||
multiAutoComplete: false,
|
multiAutoComplete: false,
|
||||||
type: DatasetProfileInternalDmpEntitiesType.Dmps
|
type: DatasetProfileInternalDmpEntitiesType.Dmps
|
||||||
}
|
}
|
||||||
|
@ -595,14 +596,14 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case this.viewTypeEnum.FreeText:{
|
case this.viewTypeEnum.FreeText: {
|
||||||
|
|
||||||
|
|
||||||
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.FreeText)
|
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.FreeText)
|
||||||
// this.form.addControl('data', new FreeTextFieldDataEditorModel().buildForm());
|
// this.form.addControl('data', new FreeTextFieldDataEditorModel().buildForm());
|
||||||
|
|
||||||
const data: FreeTextFieldData = {
|
const data: FreeTextFieldData = {
|
||||||
label:''
|
label: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.FreeText;
|
field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.FreeText;
|
||||||
|
@ -610,7 +611,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case this.viewTypeEnum.RadioBox:{
|
case this.viewTypeEnum.RadioBox: {
|
||||||
|
|
||||||
|
|
||||||
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.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').setValidators(EditorCustomValidators.atLeastOneElementListValidator('options'));
|
||||||
// this.form.get('data').updateValueAndValidity();
|
// this.form.get('data').updateValueAndValidity();
|
||||||
|
|
||||||
const data: RadioBoxFieldData= {
|
const data: RadioBoxFieldData = {
|
||||||
label:'',
|
label: '',
|
||||||
options: []
|
options: []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -630,14 +631,14 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case this.viewTypeEnum.TextArea:{
|
case this.viewTypeEnum.TextArea: {
|
||||||
|
|
||||||
|
|
||||||
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.TextArea)
|
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.TextArea)
|
||||||
// this.form.addControl('data', new TextAreaFieldDataEditorModel().buildForm());
|
// this.form.addControl('data', new TextAreaFieldDataEditorModel().buildForm());
|
||||||
|
|
||||||
const data: TextAreaFieldData = {
|
const data: TextAreaFieldData = {
|
||||||
label:''
|
label: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -645,9 +646,9 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
field.data = data;
|
field.data = data;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case this.viewTypeEnum.RichTextArea:{
|
case this.viewTypeEnum.RichTextArea: {
|
||||||
const data: RichTextAreaFieldData = {
|
const data: RichTextAreaFieldData = {
|
||||||
label:''
|
label: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -655,9 +656,9 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
field.data = data;
|
field.data = data;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case this.viewTypeEnum.Upload:{
|
case this.viewTypeEnum.Upload: {
|
||||||
const data: UploadFieldData = {
|
const data: UploadFieldData = {
|
||||||
label:'',
|
label: '',
|
||||||
types: [],
|
types: [],
|
||||||
maxFileSizeInMB: this.configurationService.maxFileSizeInMB
|
maxFileSizeInMB: this.configurationService.maxFileSizeInMB
|
||||||
}
|
}
|
||||||
|
@ -677,14 +678,14 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
// field.data = data;
|
// field.data = data;
|
||||||
// break;
|
// break;
|
||||||
// }
|
// }
|
||||||
case this.viewTypeEnum.DatePicker:{
|
case this.viewTypeEnum.DatePicker: {
|
||||||
|
|
||||||
|
|
||||||
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.DatePicker)
|
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.DatePicker)
|
||||||
// this.form.addControl('data', new DatePickerDataEditorModel().buildForm());
|
// this.form.addControl('data', new DatePickerDataEditorModel().buildForm());
|
||||||
|
|
||||||
const data: DatePickerFieldData = {
|
const data: DatePickerFieldData = {
|
||||||
label:''
|
label: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.DatePicker;
|
field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.DatePicker;
|
||||||
|
@ -692,12 +693,12 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case this.viewTypeEnum.ExternalDatasets:{
|
case this.viewTypeEnum.ExternalDatasets: {
|
||||||
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.ExternalDatasets)
|
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.ExternalDatasets)
|
||||||
// this.form.addControl('data', new ExternalDatasetsDataEditorModel().buildForm());
|
// this.form.addControl('data', new ExternalDatasetsDataEditorModel().buildForm());
|
||||||
|
|
||||||
const data: ExternalDatasetsFieldData = {
|
const data: ExternalDatasetsFieldData = {
|
||||||
label:'',
|
label: '',
|
||||||
multiAutoComplete: false
|
multiAutoComplete: false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -707,7 +708,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case this.viewTypeEnum.DataRepositories:{
|
case this.viewTypeEnum.DataRepositories: {
|
||||||
|
|
||||||
|
|
||||||
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.DataRepositories)
|
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.DataRepositories)
|
||||||
|
@ -723,7 +724,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case this.viewTypeEnum.PubRepositories:{
|
case this.viewTypeEnum.PubRepositories: {
|
||||||
|
|
||||||
const data: DataRepositoriesFieldData = {
|
const data: DataRepositoriesFieldData = {
|
||||||
label: '',
|
label: '',
|
||||||
|
@ -735,7 +736,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case this.viewTypeEnum.JournalRepositories:{
|
case this.viewTypeEnum.JournalRepositories: {
|
||||||
|
|
||||||
const data: DataRepositoriesFieldData = {
|
const data: DataRepositoriesFieldData = {
|
||||||
label: '',
|
label: '',
|
||||||
|
@ -747,7 +748,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case this.viewTypeEnum.Taxonomies:{
|
case this.viewTypeEnum.Taxonomies: {
|
||||||
|
|
||||||
const data: TaxonomiesFieldData = {
|
const data: TaxonomiesFieldData = {
|
||||||
label: '',
|
label: '',
|
||||||
|
@ -759,7 +760,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case this.viewTypeEnum.Licenses:{
|
case this.viewTypeEnum.Licenses: {
|
||||||
|
|
||||||
const data: LicensesFieldData = {
|
const data: LicensesFieldData = {
|
||||||
label: '',
|
label: '',
|
||||||
|
@ -771,7 +772,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case this.viewTypeEnum.Publications:{
|
case this.viewTypeEnum.Publications: {
|
||||||
|
|
||||||
const data: PublicationsFieldData = {
|
const data: PublicationsFieldData = {
|
||||||
label: '',
|
label: '',
|
||||||
|
@ -783,13 +784,13 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case this.viewTypeEnum.Registries:{
|
case this.viewTypeEnum.Registries: {
|
||||||
|
|
||||||
|
|
||||||
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Registries)
|
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Registries)
|
||||||
// this.form.addControl('data', new RegistriesDataEditorModel().buildForm());
|
// this.form.addControl('data', new RegistriesDataEditorModel().buildForm());
|
||||||
|
|
||||||
const data:RegistriesFieldData = {
|
const data: RegistriesFieldData = {
|
||||||
label: '',
|
label: '',
|
||||||
multiAutoComplete: false
|
multiAutoComplete: false
|
||||||
}
|
}
|
||||||
|
@ -799,14 +800,14 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case this.viewTypeEnum.Services:{
|
case this.viewTypeEnum.Services: {
|
||||||
|
|
||||||
|
|
||||||
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Services)
|
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Services)
|
||||||
// this.form.addControl('data', new ServicesDataEditorModel().buildForm());
|
// this.form.addControl('data', new ServicesDataEditorModel().buildForm());
|
||||||
|
|
||||||
const data:ServicesFieldData = {
|
const data: ServicesFieldData = {
|
||||||
label:'',
|
label: '',
|
||||||
multiAutoComplete: false
|
multiAutoComplete: false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -815,12 +816,12 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case this.viewTypeEnum.Tags:{
|
case this.viewTypeEnum.Tags: {
|
||||||
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Tags)
|
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Tags)
|
||||||
// this.form.addControl('data', new TagsDataEditorModel().buildForm());
|
// this.form.addControl('data', new TagsDataEditorModel().buildForm());
|
||||||
|
|
||||||
const data: TagsFieldData = {
|
const data: TagsFieldData = {
|
||||||
label:''
|
label: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.Tags;
|
field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.Tags;
|
||||||
|
@ -829,7 +830,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case this.viewTypeEnum.Researchers:{
|
case this.viewTypeEnum.Researchers: {
|
||||||
|
|
||||||
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Researchers)
|
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Researchers)
|
||||||
// // this.form.addControl('data', new ResearchersDataEditorModel().buildForm()); //TODO TO ASK
|
// // 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;
|
// field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.Researchers;
|
||||||
|
|
||||||
const data : ResearchersAutoCompleteFieldData = {
|
const data: ResearchersAutoCompleteFieldData = {
|
||||||
label:'',
|
label: '',
|
||||||
multiAutoComplete: false,
|
multiAutoComplete: false,
|
||||||
type: DatasetProfileInternalDmpEntitiesType.Researchers
|
type: DatasetProfileInternalDmpEntitiesType.Researchers
|
||||||
}
|
}
|
||||||
|
@ -850,15 +851,15 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case this.viewTypeEnum.Organizations:{
|
case this.viewTypeEnum.Organizations: {
|
||||||
|
|
||||||
|
|
||||||
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Organizations)
|
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Organizations)
|
||||||
// this.form.addControl('data', new OrganizationsDataEditorModel().buildForm());
|
// this.form.addControl('data', new OrganizationsDataEditorModel().buildForm());
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
autoCompleteSingleDataList:[],
|
autoCompleteSingleDataList: [],
|
||||||
label:'',
|
label: '',
|
||||||
multiAutoComplete: false,
|
multiAutoComplete: false,
|
||||||
|
|
||||||
} as OrganizationsFieldData; //TODO
|
} as OrganizationsFieldData; //TODO
|
||||||
|
@ -868,14 +869,14 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case this.viewTypeEnum.DatasetIdentifier:{
|
case this.viewTypeEnum.DatasetIdentifier: {
|
||||||
|
|
||||||
|
|
||||||
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.DatasetIdentifier)
|
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.DatasetIdentifier)
|
||||||
// this.form.addControl('data', new DatasetIdentifierDataEditorModel().buildForm());
|
// this.form.addControl('data', new DatasetIdentifierDataEditorModel().buildForm());
|
||||||
|
|
||||||
const data : DatasetIdentifierFieldData = {
|
const data: DatasetIdentifierFieldData = {
|
||||||
label:''
|
label: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.DatasetIdentifier;
|
field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.DatasetIdentifier;
|
||||||
|
@ -883,28 +884,28 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case this.viewTypeEnum.Currency:{
|
case this.viewTypeEnum.Currency: {
|
||||||
|
|
||||||
|
|
||||||
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Currency)
|
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Currency)
|
||||||
// this.form.addControl('data', new CurrencyDataEditorModel().buildForm());
|
// this.form.addControl('data', new CurrencyDataEditorModel().buildForm());
|
||||||
|
|
||||||
const data: CurrencyFieldData = {
|
const data: CurrencyFieldData = {
|
||||||
label:''
|
label: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.Currency;
|
field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.Currency;
|
||||||
field.data = data;
|
field.data = data;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case this.viewTypeEnum.Validation:{
|
case this.viewTypeEnum.Validation: {
|
||||||
|
|
||||||
|
|
||||||
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Validation)
|
// this.form.get('viewStyle').get('renderStyle').setValue(DatasetProfileFieldViewStyle.Validation)
|
||||||
// this.form.addControl('data', new ValidationDataEditorModel().buildForm());
|
// this.form.addControl('data', new ValidationDataEditorModel().buildForm());
|
||||||
|
|
||||||
const data:ValidationFieldData = {
|
const data: ValidationFieldData = {
|
||||||
label:''
|
label: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.Validation;
|
field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.Validation;
|
||||||
|
@ -922,15 +923,15 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
const form = (new FieldEditorModel).fromModel(field).buildForm();
|
const form = (new FieldEditorModel).fromModel(field).buildForm();
|
||||||
|
|
||||||
|
|
||||||
const fields = this.form.parent as FormArray;
|
const fields = this.form.parent as UntypedFormArray;
|
||||||
let index = -1;
|
let index = -1;
|
||||||
|
|
||||||
fields.controls.forEach((control,i)=>{
|
fields.controls.forEach((control, i) => {
|
||||||
if(this.form.get('id').value === control.get('id').value){
|
if (this.form.get('id').value === control.get('id').value) {
|
||||||
index = i
|
index = i
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if(index>=0){
|
if (index >= 0) {
|
||||||
fields.removeAt(index);
|
fields.removeAt(index);
|
||||||
fields.insert(index, form);
|
fields.insert(index, form);
|
||||||
this.form = form;
|
this.form = form;
|
||||||
|
@ -944,44 +945,44 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
toggleRequired(event:MatSlideToggleChange){
|
toggleRequired(event: MatSlideToggleChange) {
|
||||||
this.setValidator(ValidationType.Required, event.checked);
|
this.setValidator(ValidationType.Required, event.checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleURL(event:MatSlideToggleChange){
|
toggleURL(event: MatSlideToggleChange) {
|
||||||
this.setValidator(ValidationType.URL, event.checked);
|
this.setValidator(ValidationType.URL, event.checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
private setValidator(validationType: ValidationType, add: boolean) {
|
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<ValidationType> = validationsControl.value;
|
let validations: Array<ValidationType> = validationsControl.value;
|
||||||
|
|
||||||
if(add){
|
if (add) {
|
||||||
if(!validations.includes(validationType)){
|
if (!validations.includes(validationType)) {
|
||||||
validations.push(validationType);
|
validations.push(validationType);
|
||||||
validationsControl.updateValueAndValidity();
|
validationsControl.updateValueAndValidity();
|
||||||
}
|
}
|
||||||
} else{
|
} else {
|
||||||
validationsControl.setValue(validations.filter(validator=> validator != validationType));
|
validationsControl.setValue(validations.filter(validator => validator != validationType));
|
||||||
validationsControl.updateValueAndValidity();
|
validationsControl.updateValueAndValidity();
|
||||||
}
|
}
|
||||||
this.form.markAsDirty();//deactivate guard
|
this.form.markAsDirty();//deactivate guard
|
||||||
}
|
}
|
||||||
|
|
||||||
get isRequired(){
|
get isRequired() {
|
||||||
let validationsControl = this.form.get('validations') as FormControl;
|
let validationsControl = this.form.get('validations') as UntypedFormControl;
|
||||||
let validations: Array<ValidationType> = validationsControl.value;
|
let validations: Array<ValidationType> = validationsControl.value;
|
||||||
return validations.includes(ValidationType.Required);
|
return validations.includes(ValidationType.Required);
|
||||||
}
|
}
|
||||||
|
|
||||||
get isURL(){
|
get isURL() {
|
||||||
let validationsControl = this.form.get('validations') as FormControl;
|
let validationsControl = this.form.get('validations') as UntypedFormControl;
|
||||||
let validations: Array<ValidationType> = validationsControl.value;
|
let validations: Array<ValidationType> = validationsControl.value;
|
||||||
return validations.includes(ValidationType.URL);
|
return validations.includes(ValidationType.URL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
onDelete(){
|
onDelete() {
|
||||||
this.delete.emit();
|
this.delete.emit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input } from '@angular/core';
|
import { Component, Input } from '@angular/core';
|
||||||
import { FormArray } from '@angular/forms';
|
import { UntypedFormArray } from '@angular/forms';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dataset-profile-editor-page-component',
|
selector: 'app-dataset-profile-editor-page-component',
|
||||||
|
@ -8,10 +8,10 @@ import { FormArray } from '@angular/forms';
|
||||||
})
|
})
|
||||||
export class DatasetProfileEditorPageComponent {
|
export class DatasetProfileEditorPageComponent {
|
||||||
|
|
||||||
@Input() form: FormArray;
|
@Input() form: UntypedFormArray;
|
||||||
@Input() viewOnly: boolean;
|
@Input() viewOnly: boolean;
|
||||||
|
|
||||||
removePage(index) {
|
removePage(index) {
|
||||||
(<FormArray>this.form).removeAt(index);
|
(<UntypedFormArray>this.form).removeAt(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';
|
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 { DatasetProfileFieldViewStyle } from '../../../../../../core/common/enum/dataset-profile-field-view-style';
|
||||||
import { DatasetProfileComboBoxType } from '../../../../../../core/common/enum/dataset-profile-combo-box-type';
|
import { DatasetProfileComboBoxType } from '../../../../../../core/common/enum/dataset-profile-combo-box-type';
|
||||||
import { ToCEntryType } from '../../../table-of-contents/table-of-contents-entry';
|
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 {
|
export class DatasetProfileEditorRuleComponent implements OnInit {
|
||||||
|
|
||||||
|
|
||||||
@Input() form: FormArray;
|
@Input() form: UntypedFormArray;
|
||||||
|
|
||||||
@Input() viewStyleForCheck: DatasetProfileFieldViewStyle;
|
@Input() viewStyleForCheck: DatasetProfileFieldViewStyle;
|
||||||
@Input() formControlForCheck: FormControl;
|
@Input() formControlForCheck: UntypedFormControl;
|
||||||
@Input() formArrayOptionsForCheck: FormArray;
|
@Input() formArrayOptionsForCheck: UntypedFormArray;
|
||||||
@Input() comboBoxTypeForCheck: DatasetProfileComboBoxType;
|
@Input() comboBoxTypeForCheck: DatasetProfileComboBoxType;
|
||||||
@Input() viewOnly: boolean;
|
@Input() viewOnly: boolean;
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ export class DatasetProfileEditorRuleComponent implements OnInit {
|
||||||
private _buildHiddenBy(fo:OptionItem){
|
private _buildHiddenBy(fo:OptionItem){
|
||||||
try{
|
try{
|
||||||
this.fieldOptions.forEach(foption=>{
|
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);
|
const targets = rules.map(rule=>rule.target);
|
||||||
targets.forEach(target=>{
|
targets.forEach(target=>{
|
||||||
if(fo.parentsIds.includes(target) && !fo.hiddenBy.includes(foption.id)){
|
if(fo.parentsIds.includes(target) && !fo.hiddenBy.includes(foption.id)){
|
||||||
|
@ -114,11 +114,11 @@ export class DatasetProfileEditorRuleComponent implements OnInit {
|
||||||
|
|
||||||
const result:OptionItem[] =[];
|
const result:OptionItem[] =[];
|
||||||
|
|
||||||
const sections = rootForm.get('sections') as FormArray;
|
const sections = rootForm.get('sections') as UntypedFormArray;
|
||||||
|
|
||||||
if(sections){
|
if(sections){
|
||||||
sections.controls.forEach(section=>{
|
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);
|
result.push(...subResult);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -131,11 +131,11 @@ export class DatasetProfileEditorRuleComponent implements OnInit {
|
||||||
return [];
|
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 sections = form.get('sections') as UntypedFormArray;
|
||||||
const fieldSets = form.get('fieldSets') as FormArray;
|
const fieldSets = form.get('fieldSets') as UntypedFormArray;
|
||||||
const fields = form.get('fields') as FormArray;
|
const fields = form.get('fields') as UntypedFormArray;
|
||||||
|
|
||||||
const result:OptionItem[] = [];
|
const result:OptionItem[] = [];
|
||||||
|
|
||||||
|
@ -153,17 +153,17 @@ export class DatasetProfileEditorRuleComponent implements OnInit {
|
||||||
|
|
||||||
if(sections){
|
if(sections){
|
||||||
sections.controls.forEach(section=>{
|
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){
|
if(fieldSets){
|
||||||
fieldSets.controls.forEach(fieldset=>{
|
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){
|
if(fields){
|
||||||
fields.controls.forEach(field=>{
|
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,
|
label: string,
|
||||||
type: ToCEntryType,
|
type: ToCEntryType,
|
||||||
parentsIds: string[],
|
parentsIds: string[],
|
||||||
form:FormGroup,
|
form:UntypedFormGroup,
|
||||||
hiddenBy:string[]
|
hiddenBy:string[]
|
||||||
}
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue