[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 {
constructor(@Optional() @SkipSelf() parentModule: CoreModule) {
if (isNotEmpty(parentModule)) {
throw new Error('CoreModule is already loaded. Import it in the AppModule only');
}
}
static forRoot(): ModuleWithProviders {
return {
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;
}
}

View File

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

View File

@@ -22,6 +22,7 @@ export class DynamicListCheckboxGroupModel extends DynamicCheckboxGroupModel {
@serializable() vocabularyOptions: VocabularyOptions;
@serializable() repeatable: boolean;
@serializable() groupLength: number;
@serializable() _value: VocabularyEntry[];
isListGroup = true;
valueUpdates: Subject<any>;
@@ -38,7 +39,9 @@ export class DynamicListCheckboxGroupModel extends DynamicCheckboxGroupModel {
this.valueUpdates.next(config.value);
}
@serializable() _value: VocabularyEntry[];
get hasAuthority(): boolean {
return this.vocabularyOptions && hasValue(this.vocabularyOptions.name);
}
get 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 { getFirstSucceededRemoteDataPayload } from '../../../../../../core/shared/operators';
import { DsDynamicVocabularyComponent } from '../dynamic-vocabulary.component';
import { DynamicLookupModel } from './dynamic-lookup.model';
/**
* 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 {
@Input() bindId = true;
@Input() group: FormGroup;
@Input() model: DynamicLookupModel | DynamicLookupNameModel;
@Input() model: any;
@Output() blur: 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) {
if (init) {
this.getInitValueFromModel()
.subscribe((value: FormFieldMetadataValueObject) => this.setDisplayInputValue(value.display));
.subscribe((formValue: FormFieldMetadataValueObject) => this.setDisplayInputValue(formValue.display));
} else if (hasValue(value)) {
if (value instanceof FormFieldMetadataValueObject || value instanceof VocabularyEntry) {
this.setDisplayInputValue(value.display);

View File

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

View File

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

View File

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

View File

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