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