[CST-3088] Fix lint errors

This commit is contained in:
Giuseppe Digilio
2020-07-01 15:35:29 +02:00
parent e0604026c5
commit 81f0391400
9 changed files with 18 additions and 24 deletions

View File

@@ -337,12 +337,6 @@ export const models =
}) })
export class CoreModule { export class CoreModule {
constructor(@Optional() @SkipSelf() parentModule: CoreModule) {
if (isNotEmpty(parentModule)) {
throw new Error('CoreModule is already loaded. Import it in the AppModule only');
}
}
static forRoot(): ModuleWithProviders { static forRoot(): ModuleWithProviders {
return { return {
ngModule: CoreModule, ngModule: CoreModule,
@@ -351,4 +345,10 @@ export class CoreModule {
] ]
}; };
} }
constructor(@Optional() @SkipSelf() parentModule: CoreModule) {
if (isNotEmpty(parentModule)) {
throw new Error('CoreModule is already loaded. Import it in the AppModule only');
}
}
} }

View File

@@ -23,5 +23,4 @@ export class VocabularyEntriesResponseParsingService extends EntriesResponsePars
return VocabularyEntry; return VocabularyEntry;
} }
} }

View File

@@ -31,7 +31,7 @@ export abstract class DsDynamicVocabularyComponent extends DynamicFormControlCom
public abstract pageInfo: PageInfo; public abstract pageInfo: PageInfo;
constructor(protected vocabularyService: VocabularyService, protected constructor(protected vocabularyService: VocabularyService,
protected layoutService: DynamicFormLayoutService, protected layoutService: DynamicFormLayoutService,
protected validationService: DynamicFormValidationService protected validationService: DynamicFormValidationService
) { ) {
@@ -75,7 +75,6 @@ export abstract class DsDynamicVocabularyComponent extends DynamicFormControlCom
return initValue$; return initValue$;
} }
/** /**
* Emits a blur event containing a given value. * Emits a blur event containing a given value.
* @param event The value to emit. * @param event The value to emit.

View File

@@ -22,6 +22,7 @@ export class DynamicListCheckboxGroupModel extends DynamicCheckboxGroupModel {
@serializable() vocabularyOptions: VocabularyOptions; @serializable() vocabularyOptions: VocabularyOptions;
@serializable() repeatable: boolean; @serializable() repeatable: boolean;
@serializable() groupLength: number; @serializable() groupLength: number;
@serializable() _value: VocabularyEntry[];
isListGroup = true; isListGroup = true;
valueUpdates: Subject<any>; valueUpdates: Subject<any>;
@@ -38,7 +39,9 @@ export class DynamicListCheckboxGroupModel extends DynamicCheckboxGroupModel {
this.valueUpdates.next(config.value); this.valueUpdates.next(config.value);
} }
@serializable() _value: VocabularyEntry[]; get hasAuthority(): boolean {
return this.vocabularyOptions && hasValue(this.vocabularyOptions.name);
}
get value() { get value() {
return this._value; return this._value;
@@ -55,8 +58,4 @@ export class DynamicListCheckboxGroupModel extends DynamicCheckboxGroupModel {
} }
} }
} }
get hasAuthority(): boolean {
return this.vocabularyOptions && hasValue(this.vocabularyOptions.name);
}
} }

View File

@@ -16,7 +16,6 @@ import { ConfidenceType } from '../../../../../../core/shared/confidence-type';
import { PaginatedList } from '../../../../../../core/data/paginated-list'; import { PaginatedList } from '../../../../../../core/data/paginated-list';
import { getFirstSucceededRemoteDataPayload } from '../../../../../../core/shared/operators'; import { getFirstSucceededRemoteDataPayload } from '../../../../../../core/shared/operators';
import { DsDynamicVocabularyComponent } from '../dynamic-vocabulary.component'; import { DsDynamicVocabularyComponent } from '../dynamic-vocabulary.component';
import { DynamicLookupModel } from './dynamic-lookup.model';
/** /**
* Component representing a lookup or lookup-name input field * Component representing a lookup or lookup-name input field
@@ -29,7 +28,7 @@ import { DynamicLookupModel } from './dynamic-lookup.model';
export class DsDynamicLookupComponent extends DsDynamicVocabularyComponent implements OnDestroy, OnInit { export class DsDynamicLookupComponent extends DsDynamicVocabularyComponent implements OnDestroy, OnInit {
@Input() bindId = true; @Input() bindId = true;
@Input() group: FormGroup; @Input() group: FormGroup;
@Input() model: DynamicLookupModel | DynamicLookupNameModel; @Input() model: any;
@Output() blur: EventEmitter<any> = new EventEmitter<any>(); @Output() blur: EventEmitter<any> = new EventEmitter<any>();
@Output() change: EventEmitter<any> = new EventEmitter<any>(); @Output() change: EventEmitter<any> = new EventEmitter<any>();
@@ -272,7 +271,7 @@ export class DsDynamicLookupComponent extends DsDynamicVocabularyComponent imple
public setCurrentValue(value: any, init = false) { public setCurrentValue(value: any, init = false) {
if (init) { if (init) {
this.getInitValueFromModel() this.getInitValueFromModel()
.subscribe((value: FormFieldMetadataValueObject) => this.setDisplayInputValue(value.display)); .subscribe((formValue: FormFieldMetadataValueObject) => this.setDisplayInputValue(formValue.display));
} else if (hasValue(value)) { } else if (hasValue(value)) {
if (value instanceof FormFieldMetadataValueObject || value instanceof VocabularyEntry) { if (value instanceof FormFieldMetadataValueObject || value instanceof VocabularyEntry) {
this.setDisplayInputValue(value.display); this.setDisplayInputValue(value.display);

View File

@@ -148,7 +148,7 @@ export class DsDynamicScrollableDropdownComponent extends DsDynamicVocabularyCom
if (init) { if (init) {
result = this.getInitValueFromModel().pipe( result = this.getInitValueFromModel().pipe(
map((value: FormFieldMetadataValueObject) => value.display) map((formValue: FormFieldMetadataValueObject) => formValue.display)
); );
} else { } else {
if (isEmpty(value)) { if (isEmpty(value)) {

View File

@@ -187,8 +187,8 @@ export class DsDynamicTypeaheadComponent extends DsDynamicVocabularyComponent im
let result: string; let result: string;
if (init) { if (init) {
this.getInitValueFromModel() this.getInitValueFromModel()
.subscribe((value: FormFieldMetadataValueObject) => { .subscribe((formValue: FormFieldMetadataValueObject) => {
this.currentValue = value; this.currentValue = formValue;
}); });
} else { } else {
if (isEmpty(value)) { if (isEmpty(value)) {

View File

@@ -7,7 +7,6 @@ import { createSuccessfulRemoteDataObject$ } from '../remote-data.utils';
import { RemoteData } from '../../core/data/remote-data'; import { RemoteData } from '../../core/data/remote-data';
import { VocabularyOptions } from '../../core/submission/vocabularies/models/vocabulary-options.model'; import { VocabularyOptions } from '../../core/submission/vocabularies/models/vocabulary-options.model';
export class VocabularyServiceStub { export class VocabularyServiceStub {
private _payload = [ private _payload = [

View File

@@ -270,7 +270,6 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit {
return isNotEmpty(this.searchText); return isNotEmpty(this.searchText);
} }
/** /**
* Reset tree resulting from a previous search * Reset tree resulting from a previous search
*/ */