mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 23:43:01 +00:00
fixed compilation issues
This commit is contained in:
@@ -103,15 +103,16 @@ describe('DsDynamicFormControlContainerComponent test suite', () => {
|
||||
new DynamicSwitchModel({ id: 'switch' }),
|
||||
new DynamicTextAreaModel({ id: 'textarea' }),
|
||||
new DynamicTimePickerModel({ id: 'timepicker' }),
|
||||
new DynamicTypeaheadModel({ id: 'typeahead', metadataFields: [], repeatable: false, submissionId: '1234' }),
|
||||
new DynamicTypeaheadModel({ id: 'typeahead', metadataFields: [], repeatable: false, submissionId: '1234', hasSelectableMetadata: false }),
|
||||
new DynamicScrollableDropdownModel({
|
||||
id: 'scrollableDropdown',
|
||||
authorityOptions: authorityOptions,
|
||||
metadataFields: [],
|
||||
repeatable: false,
|
||||
submissionId: '1234'
|
||||
submissionId: '1234',
|
||||
hasSelectableMetadata: false
|
||||
}),
|
||||
new DynamicTagModel({ id: 'tag', metadataFields: [], repeatable: false, submissionId: '1234' }),
|
||||
new DynamicTagModel({ id: 'tag', metadataFields: [], repeatable: false, submissionId: '1234', hasSelectableMetadata: false }),
|
||||
new DynamicListCheckboxGroupModel({
|
||||
id: 'checkboxList',
|
||||
authorityOptions: authorityOptions,
|
||||
@@ -132,11 +133,12 @@ describe('DsDynamicFormControlContainerComponent test suite', () => {
|
||||
scopeUUID: '',
|
||||
submissionScope: '',
|
||||
repeatable: false,
|
||||
metadataFields: []
|
||||
metadataFields: [],
|
||||
hasSelectableMetadata: false
|
||||
}),
|
||||
new DynamicDsDatePickerModel({ id: 'datepicker' }),
|
||||
new DynamicLookupModel({ id: 'lookup', metadataFields: [], repeatable: false, submissionId: '1234' }),
|
||||
new DynamicLookupNameModel({ id: 'lookupName', metadataFields: [], repeatable: false, submissionId: '1234' }),
|
||||
new DynamicLookupModel({ id: 'lookup', metadataFields: [], repeatable: false, submissionId: '1234', hasSelectableMetadata: false }),
|
||||
new DynamicLookupNameModel({ id: 'lookupName', metadataFields: [], repeatable: false, submissionId: '1234', hasSelectableMetadata: false}),
|
||||
new DynamicQualdropModel({ id: 'combobox', readOnly: false, required: false })
|
||||
];
|
||||
const testModel = formModel[8];
|
||||
|
@@ -1,20 +1,12 @@
|
||||
import { CdkDragDrop } from '@angular/cdk/drag-drop';
|
||||
import {
|
||||
ChangeDetectorRef,
|
||||
Component,
|
||||
EventEmitter,
|
||||
Input,
|
||||
NgZone,
|
||||
OnInit,
|
||||
Output,
|
||||
QueryList
|
||||
} from '@angular/core';
|
||||
import { ChangeDetectorRef, Component, EventEmitter, Input, NgZone, OnInit, Output, QueryList } from '@angular/core';
|
||||
import { AbstractControl, FormControl, FormGroup } from '@angular/forms';
|
||||
import {
|
||||
DynamicFormArrayComponent,
|
||||
DynamicFormArrayGroupModel,
|
||||
DynamicFormControlCustomEvent,
|
||||
DynamicFormControlEvent, DynamicFormControlEventType,
|
||||
DynamicFormControlEvent,
|
||||
DynamicFormControlEventType,
|
||||
DynamicFormLayout,
|
||||
DynamicFormLayoutService,
|
||||
DynamicFormService,
|
||||
@@ -22,25 +14,18 @@ import {
|
||||
DynamicTemplateDirective
|
||||
} from '@ng-dynamic-forms/core';
|
||||
import { combineLatest as observableCombineLatest, Observable, of as observableOf } from 'rxjs';
|
||||
import { map, switchMap, take, tap, filter } from 'rxjs/operators';
|
||||
import { filter, map, switchMap, take } from 'rxjs/operators';
|
||||
import { RelationshipService } from '../../../../../../core/data/relationship.service';
|
||||
import { RemoteData } from '../../../../../../core/data/remote-data';
|
||||
import { Relationship } from '../../../../../../core/shared/item-relationships/relationship.model';
|
||||
import { Item } from '../../../../../../core/shared/item.model';
|
||||
import { MetadataValue } from '../../../../../../core/shared/metadata.models';
|
||||
import {
|
||||
getRemoteDataPayload,
|
||||
getSucceededRemoteData
|
||||
} from '../../../../../../core/shared/operators';
|
||||
import { getRemoteDataPayload, getSucceededRemoteData } from '../../../../../../core/shared/operators';
|
||||
import { SubmissionObject } from '../../../../../../core/submission/models/submission-object.model';
|
||||
import { SubmissionObjectDataService } from '../../../../../../core/submission/submission-object-data.service';
|
||||
import { hasValue, isNotEmpty } from '../../../../../empty.util';
|
||||
import { FormFieldMetadataValueObject } from '../../../models/form-field-metadata-value.model';
|
||||
import {
|
||||
Reorderable,
|
||||
ReorderableFormFieldMetadataValue,
|
||||
ReorderableRelationship
|
||||
} from '../../existing-metadata-list-element/existing-metadata-list-element.component';
|
||||
import { Reorderable, ReorderableFormFieldMetadataValue, ReorderableRelationship } from '../../existing-metadata-list-element/existing-metadata-list-element.component';
|
||||
import { DynamicConcatModel } from '../ds-dynamic-concat.model';
|
||||
import { DynamicRowArrayModel } from '../ds-dynamic-row-array-model';
|
||||
import { Store } from '@ngrx/store';
|
||||
@@ -181,13 +166,10 @@ export class DsDynamicFormArrayComponent extends DynamicFormArrayComponent imple
|
||||
this.reorderables = reorderables;
|
||||
|
||||
if (shouldPropagateChanges) {
|
||||
const movedReoRels: Array<Reorderable> = [];
|
||||
const movedReoRels: Reorderable[] = [];
|
||||
let hasMetadataField = false;
|
||||
this.reorderables.forEach((reorderable: Reorderable, index: number) => {
|
||||
if (reorderable.hasMoved) {
|
||||
const prevIndex = reorderable.oldIndex;
|
||||
const updatedReorderable = reorderable.update().pipe(take(1));
|
||||
updatedReorderables.push(updatedReorderable);
|
||||
if (reorderable instanceof ReorderableFormFieldMetadataValue) {
|
||||
const prevIndex = reorderable.oldIndex;
|
||||
hasMetadataField = true;
|
||||
|
@@ -15,7 +15,7 @@ describe('DsDynamicDisabledComponent', () => {
|
||||
let model;
|
||||
|
||||
function init() {
|
||||
model = new DynamicDisabledModel({ value: 'test', repeatable: false, metadataFields: [], submissionId: '1234', id: '1' });
|
||||
model = new DynamicDisabledModel({ value: 'test', repeatable: false, metadataFields: [], submissionId: '1234', id: '1', hasSelectableMetadata: false });
|
||||
}
|
||||
|
||||
beforeEach(async(() => {
|
||||
|
@@ -15,7 +15,7 @@ import { DynamicFormsNGBootstrapUIModule } from '@ng-dynamic-forms/ui-ng-bootstr
|
||||
import { AuthorityService } from '../../../../../../core/integration/authority.service';
|
||||
import { AuthorityServiceStub } from '../../../../../testing/authority-service-stub';
|
||||
import { DsDynamicLookupComponent } from './dynamic-lookup.component';
|
||||
import { DynamicLookupModel } from './dynamic-lookup.model';
|
||||
import { DynamicLookupModel, DynamicLookupModelConfig } from './dynamic-lookup.model';
|
||||
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { FormFieldMetadataValueObject } from '../../../models/form-field-metadata-value.model';
|
||||
@@ -30,7 +30,7 @@ import { MOCK_SUBMISSION_CONFIG } from '../../../../../testing/mock-submission-c
|
||||
import { WorkspaceitemsEditPageModule } from '../../../../../../+workspaceitems-edit-page/workspaceitems-edit-page.module';
|
||||
import { WorkspaceItem } from '../../../../../../core/submission/models/workspaceitem.model';
|
||||
|
||||
let LOOKUP_TEST_MODEL_CONFIG = {
|
||||
let LOOKUP_TEST_MODEL_CONFIG: DynamicLookupModelConfig = {
|
||||
authorityOptions: {
|
||||
closed: false,
|
||||
metadata: 'lookup',
|
||||
@@ -47,11 +47,11 @@ let LOOKUP_TEST_MODEL_CONFIG = {
|
||||
readOnly: false,
|
||||
required: true,
|
||||
repeatable: true,
|
||||
separator: ',',
|
||||
validators: { required: null },
|
||||
value: undefined,
|
||||
metadataFields: [],
|
||||
submissionId: '1234'
|
||||
submissionId: '1234',
|
||||
hasSelectableMetadata: false
|
||||
};
|
||||
|
||||
let LOOKUP_NAME_TEST_MODEL_CONFIG = {
|
||||
@@ -71,11 +71,11 @@ let LOOKUP_NAME_TEST_MODEL_CONFIG = {
|
||||
readOnly: false,
|
||||
required: true,
|
||||
repeatable: true,
|
||||
separator: ',',
|
||||
validators: { required: null },
|
||||
value: undefined,
|
||||
metadataFields: [],
|
||||
submissionId: '1234'
|
||||
submissionId: '1234',
|
||||
hasSelectableMetadata: false
|
||||
};
|
||||
|
||||
let LOOKUP_TEST_GROUP = new FormGroup({
|
||||
@@ -104,11 +104,11 @@ describe('Dynamic Lookup component', () => {
|
||||
readOnly: false,
|
||||
required: true,
|
||||
repeatable: true,
|
||||
separator: ',',
|
||||
validators: { required: null },
|
||||
value: undefined,
|
||||
metadataFields: [],
|
||||
submissionId: '1234'
|
||||
submissionId: '1234',
|
||||
hasSelectableMetadata: false
|
||||
};
|
||||
|
||||
LOOKUP_NAME_TEST_MODEL_CONFIG = {
|
||||
@@ -128,11 +128,11 @@ describe('Dynamic Lookup component', () => {
|
||||
readOnly: false,
|
||||
required: true,
|
||||
repeatable: true,
|
||||
separator: ',',
|
||||
validators: { required: null },
|
||||
value: undefined,
|
||||
metadataFields: [],
|
||||
submissionId: '1234'
|
||||
submissionId: '1234',
|
||||
hasSelectableMetadata: false
|
||||
};
|
||||
|
||||
LOOKUP_TEST_GROUP = new FormGroup({
|
||||
|
@@ -82,7 +82,8 @@ function init() {
|
||||
submissionScope: undefined,
|
||||
validators: { required: null },
|
||||
repeatable: false,
|
||||
metadataFields: []
|
||||
metadataFields: [],
|
||||
hasSelectableMetadata: false
|
||||
} as DynamicRelationGroupModelConfig;
|
||||
|
||||
FORM_GROUP_TEST_GROUP = new FormGroup({
|
||||
|
@@ -40,7 +40,8 @@ export const SD_TEST_MODEL_CONFIG = {
|
||||
repeatable: false,
|
||||
value: undefined,
|
||||
metadataFields: [],
|
||||
submissionId: '1234'
|
||||
submissionId: '1234',
|
||||
hasSelectableMetadata: false
|
||||
};
|
||||
|
||||
describe('Dynamic Dynamic Scrollable Dropdown component', () => {
|
||||
|
@@ -63,7 +63,7 @@ describe('DsDynamicLookupRelationModalComponent', () => {
|
||||
listID = '6b0c8221-fcb4-47a8-b483-ca32363fffb3';
|
||||
selection$ = observableOf([searchResult1, searchResult2]);
|
||||
selectableListService = { getSelectableList: () => selection$ };
|
||||
relationship = { filter: 'filter', relationshipType: 'isAuthorOfPublication', nameVariants: true } as RelationshipOptions;
|
||||
relationship = Object.assign(new RelationshipOptions(), { filter: 'filter', relationshipType: 'isAuthorOfPublication', nameVariants: true, searchConfiguration: 'personConfig' });
|
||||
nameVariant = 'Doe, J.';
|
||||
metadataField = 'dc.contributor.author';
|
||||
pSearchOptions = new PaginatedSearchOptions({});
|
||||
|
@@ -39,7 +39,7 @@ describe('DsDynamicLookupRelationSearchTabComponent', () => {
|
||||
let lookupRelationService;
|
||||
|
||||
function init() {
|
||||
relationship = { filter: 'filter', relationshipType: 'isAuthorOfPublication', nameVariants: true } as RelationshipOptions;
|
||||
relationship = Object.assign(new RelationshipOptions(), { filter: 'filter', relationshipType: 'isAuthorOfPublication', nameVariants: true, searchConfiguration: 'personConfig' });
|
||||
pSearchOptions = new PaginatedSearchOptions({});
|
||||
item1 = Object.assign(new Item(), { uuid: 'e1c51c69-896d-42dc-8221-1d5f2ad5516e' });
|
||||
item2 = Object.assign(new Item(), { uuid: 'c8279647-1acc-41ae-b036-951d5f65649b' });
|
||||
|
Reference in New Issue
Block a user