mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
96252: Extract form-specific code from SharedModule
This commit is contained in:
@@ -9,8 +9,6 @@ import { Action, StoreConfig, StoreModule } from '@ngrx/store';
|
||||
import { MyDSpaceGuard } from '../my-dspace-page/my-dspace.guard';
|
||||
|
||||
import { isNotEmpty } from '../shared/empty.util';
|
||||
import { FormBuilderService } from '../shared/form/builder/form-builder.service';
|
||||
import { FormService } from '../shared/form/form.service';
|
||||
import { HostWindowService } from '../shared/host-window.service';
|
||||
import { MenuService } from '../shared/menu/menu.service';
|
||||
import { EndpointMockingRestService } from '../shared/mocks/dspace-rest/endpoint-mocking-rest.service';
|
||||
@@ -138,9 +136,6 @@ import {
|
||||
import { Registration } from './shared/registration.model';
|
||||
import { MetadataSchemaDataService } from './data/metadata-schema-data.service';
|
||||
import { MetadataFieldDataService } from './data/metadata-field-data.service';
|
||||
import {
|
||||
DsDynamicTypeBindRelationService
|
||||
} from '../shared/form/builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service';
|
||||
import { TokenResponseParsingService } from './auth/token-response-parsing.service';
|
||||
import { SubmissionCcLicenseDataService } from './submission/submission-cc-license-data.service';
|
||||
import { SubmissionCcLicence } from './submission/models/submission-cc-license.model';
|
||||
@@ -150,7 +145,6 @@ import { VocabularyEntry } from './submission/vocabularies/models/vocabulary-ent
|
||||
import { Vocabulary } from './submission/vocabularies/models/vocabulary.model';
|
||||
import { VocabularyEntryDetail } from './submission/vocabularies/models/vocabulary-entry-detail.model';
|
||||
import { VocabularyService } from './submission/vocabularies/vocabulary.service';
|
||||
import { VocabularyTreeviewService } from '../shared/vocabulary-treeview/vocabulary-treeview.service';
|
||||
import { ConfigurationDataService } from './data/configuration-data.service';
|
||||
import { ConfigurationProperty } from './shared/configuration-property.model';
|
||||
import { ReloadGuard } from './reload/reload.guard';
|
||||
@@ -211,12 +205,6 @@ const PROVIDERS = [
|
||||
DSOResponseParsingService,
|
||||
{ provide: MOCK_RESPONSE_MAP, useValue: mockResponseMap },
|
||||
{ provide: DspaceRestService, useFactory: restServiceFactory, deps: [MOCK_RESPONSE_MAP, HttpClient] },
|
||||
DynamicFormLayoutService,
|
||||
DynamicFormService,
|
||||
DynamicFormValidationService,
|
||||
FormBuilderService,
|
||||
SectionFormOperationsService,
|
||||
FormService,
|
||||
EPersonDataService,
|
||||
LinkHeadService,
|
||||
HALEndpointService,
|
||||
@@ -268,7 +256,6 @@ const PROVIDERS = [
|
||||
ClaimedTaskDataService,
|
||||
PoolTaskDataService,
|
||||
BitstreamDataService,
|
||||
DsDynamicTypeBindRelationService,
|
||||
EntityTypeDataService,
|
||||
ContentSourceResponseParsingService,
|
||||
ItemTemplateDataService,
|
||||
@@ -304,7 +291,6 @@ const PROVIDERS = [
|
||||
VocabularyService,
|
||||
VocabularyDataService,
|
||||
VocabularyEntryDetailsDataService,
|
||||
VocabularyTreeviewService,
|
||||
SequenceService,
|
||||
GroupDataService,
|
||||
FeedbackDataService,
|
||||
|
@@ -20,7 +20,7 @@ import { FormFieldMetadataValueObject } from '../../../models/form-field-metadat
|
||||
import { VocabularyEntry } from '../../../../../../core/submission/vocabularies/models/vocabulary-entry.model';
|
||||
import { createTestComponent } from '../../../../../testing/utils.test';
|
||||
import { DynamicLookupNameModel } from './dynamic-lookup-name.model';
|
||||
import { AuthorityConfidenceStateDirective } from '../../../../../authority-confidence/authority-confidence-state.directive';
|
||||
import { AuthorityConfidenceStateDirective } from '../../../../directives/authority-confidence-state.directive';
|
||||
import { ObjNgFor } from '../../../../../utils/object-ngfor.pipe';
|
||||
import {
|
||||
mockDynamicFormLayoutService,
|
||||
|
@@ -21,11 +21,11 @@ import { DsDynamicOneboxComponent } from './dynamic-onebox.component';
|
||||
import { DynamicOneboxModel } from './dynamic-onebox.model';
|
||||
import { FormFieldMetadataValueObject } from '../../../models/form-field-metadata-value.model';
|
||||
import { createTestComponent } from '../../../../../testing/utils.test';
|
||||
import { AuthorityConfidenceStateDirective } from '../../../../../authority-confidence/authority-confidence-state.directive';
|
||||
import { AuthorityConfidenceStateDirective } from '../../../../directives/authority-confidence-state.directive';
|
||||
import { ObjNgFor } from '../../../../../utils/object-ngfor.pipe';
|
||||
import { VocabularyEntry } from '../../../../../../core/submission/vocabularies/models/vocabulary-entry.model';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../../../remote-data.utils';
|
||||
import { VocabularyTreeviewComponent } from '../../../../../vocabulary-treeview/vocabulary-treeview.component';
|
||||
import { VocabularyTreeviewComponent } from '../../../../vocabulary-treeview/vocabulary-treeview.component';
|
||||
import {
|
||||
mockDynamicFormLayoutService,
|
||||
mockDynamicFormValidationService
|
||||
|
@@ -30,7 +30,7 @@ import { VocabularyEntry } from '../../../../../../core/submission/vocabularies/
|
||||
import { PageInfo } from '../../../../../../core/shared/page-info.model';
|
||||
import { DsDynamicVocabularyComponent } from '../dynamic-vocabulary.component';
|
||||
import { Vocabulary } from '../../../../../../core/submission/vocabularies/models/vocabulary.model';
|
||||
import { VocabularyTreeviewComponent } from '../../../../../vocabulary-treeview/vocabulary-treeview.component';
|
||||
import { VocabularyTreeviewComponent } from '../../../../vocabulary-treeview/vocabulary-treeview.component';
|
||||
import { VocabularyEntryDetail } from '../../../../../../core/submission/vocabularies/models/vocabulary-entry-detail.model';
|
||||
|
||||
/**
|
||||
|
@@ -16,7 +16,7 @@ import { FormFieldModel } from '../../../models/form-field.model';
|
||||
import { FormBuilderService } from '../../../form-builder.service';
|
||||
import { FormService } from '../../../../form.service';
|
||||
import { FormComponent } from '../../../../form.component';
|
||||
import { Chips } from '../../../../../chips/models/chips.model';
|
||||
import { Chips } from '../../../../chips/models/chips.model';
|
||||
import { FormFieldMetadataValueObject } from '../../../models/form-field-metadata-value.model';
|
||||
import { DsDynamicInputModel } from '../ds-dynamic-input.model';
|
||||
import { createTestComponent } from '../../../../../testing/utils.test';
|
||||
|
@@ -18,10 +18,10 @@ import { FormBuilderService } from '../../../form-builder.service';
|
||||
import { SubmissionFormsModel } from '../../../../../../core/config/models/config-submission-forms.model';
|
||||
import { FormService } from '../../../../form.service';
|
||||
import { FormComponent } from '../../../../form.component';
|
||||
import { Chips } from '../../../../../chips/models/chips.model';
|
||||
import { Chips } from '../../../../chips/models/chips.model';
|
||||
import { hasValue, isEmpty, isNotEmpty, isNotNull } from '../../../../../empty.util';
|
||||
import { shrinkInOut } from '../../../../../animations/shrink';
|
||||
import { ChipsItem } from '../../../../../chips/models/chips-item.model';
|
||||
import { ChipsItem } from '../../../../chips/models/chips-item.model';
|
||||
import { hasOnlyEmptyProperties } from '../../../../../object.util';
|
||||
import { VocabularyService } from '../../../../../../core/submission/vocabularies/vocabulary.service';
|
||||
import { FormFieldMetadataValueObject } from '../../../models/form-field-metadata-value.model';
|
||||
|
@@ -13,7 +13,7 @@ import { VocabularyService } from '../../../../../../core/submission/vocabularie
|
||||
import { VocabularyServiceStub } from '../../../../../testing/vocabulary-service.stub';
|
||||
import { DsDynamicTagComponent } from './dynamic-tag.component';
|
||||
import { DynamicTagModel } from './dynamic-tag.model';
|
||||
import { Chips } from '../../../../../chips/models/chips.model';
|
||||
import { Chips } from '../../../../chips/models/chips.model';
|
||||
import { FormFieldMetadataValueObject } from '../../../models/form-field-metadata-value.model';
|
||||
import { VocabularyEntry } from '../../../../../../core/submission/vocabularies/models/vocabulary-entry.model';
|
||||
import { createTestComponent } from '../../../../../testing/utils.test';
|
||||
|
@@ -9,7 +9,7 @@ import { isEqual } from 'lodash';
|
||||
|
||||
import { VocabularyService } from '../../../../../../core/submission/vocabularies/vocabulary.service';
|
||||
import { DynamicTagModel } from './dynamic-tag.model';
|
||||
import { Chips } from '../../../../../chips/models/chips.model';
|
||||
import { Chips } from '../../../../chips/models/chips.model';
|
||||
import { hasValue, isNotEmpty } from '../../../../../empty.util';
|
||||
import { environment } from '../../../../../../../environments/environment';
|
||||
import { getFirstSucceededRemoteDataPayload } from '../../../../../../core/shared/operators';
|
||||
|
@@ -3,17 +3,16 @@ import { ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/c
|
||||
import { ComponentFixture, fakeAsync, inject, TestBed, tick, waitForAsync, } from '@angular/core/testing';
|
||||
|
||||
import { Chips } from './models/chips.model';
|
||||
import { UploaderService } from '../uploader/uploader.service';
|
||||
import { ChipsComponent } from './chips.component';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { FormFieldMetadataValueObject } from '../form/builder/models/form-field-metadata-value.model';
|
||||
import { createTestComponent } from '../testing/utils.test';
|
||||
import { AuthorityConfidenceStateDirective } from '../authority-confidence/authority-confidence-state.directive';
|
||||
import { FormFieldMetadataValueObject } from '../builder/models/form-field-metadata-value.model';
|
||||
import { createTestComponent } from '../../testing/utils.test';
|
||||
import { AuthorityConfidenceStateDirective } from '../directives/authority-confidence-state.directive';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ConfidenceType } from '../../core/shared/confidence-type';
|
||||
import { ConfidenceType } from '../../../core/shared/confidence-type';
|
||||
import { SortablejsModule } from 'ngx-sortablejs';
|
||||
import { environment } from '../../../environments/environment';
|
||||
import { environment } from '../../../../environments/environment';
|
||||
|
||||
describe('ChipsComponent test suite', () => {
|
||||
|
||||
@@ -41,7 +40,6 @@ describe('ChipsComponent test suite', () => {
|
||||
providers: [
|
||||
ChangeDetectorRef,
|
||||
ChipsComponent,
|
||||
UploaderService
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
@@ -5,7 +5,7 @@ import { isObject } from 'lodash';
|
||||
|
||||
import { Chips } from './models/chips.model';
|
||||
import { ChipsItem } from './models/chips-item.model';
|
||||
import { UploaderService } from '../uploader/uploader.service';
|
||||
import { DragService } from '../../../core/drag.service';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { Options } from 'sortablejs';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
@@ -33,7 +33,7 @@ export class ChipsComponent implements OnChanges {
|
||||
|
||||
constructor(
|
||||
private cdr: ChangeDetectorRef,
|
||||
private uploaderService: UploaderService,
|
||||
private dragService: DragService,
|
||||
private translate: TranslateService) {
|
||||
|
||||
this.options = {
|
||||
@@ -76,12 +76,12 @@ export class ChipsComponent implements OnChanges {
|
||||
|
||||
onDragStart(index) {
|
||||
this.isDragging.next(true);
|
||||
this.uploaderService.overrideDragOverPage();
|
||||
this.dragService.overrideDragOverPage();
|
||||
this.dragged = index;
|
||||
}
|
||||
|
||||
onDragEnd(event) {
|
||||
this.uploaderService.allowDragOverPage();
|
||||
this.dragService.allowDragOverPage();
|
||||
this.dragged = -1;
|
||||
this.chips.updateOrder();
|
||||
this.isDragging.next(false);
|
@@ -1,5 +1,5 @@
|
||||
import { ChipsItem, ChipsItemIcon } from './chips-item.model';
|
||||
import { FormFieldMetadataValueObject } from '../../form/builder/models/form-field-metadata-value.model';
|
||||
import { FormFieldMetadataValueObject } from '../../builder/models/form-field-metadata-value.model';
|
||||
|
||||
describe('ChipsItem model test suite', () => {
|
||||
let item: ChipsItem;
|
@@ -1,8 +1,8 @@
|
||||
import { isObject, uniqueId } from 'lodash';
|
||||
import { hasValue, isNotEmpty } from '../../empty.util';
|
||||
import { FormFieldMetadataValueObject } from '../../form/builder/models/form-field-metadata-value.model';
|
||||
import { ConfidenceType } from '../../../core/shared/confidence-type';
|
||||
import { PLACEHOLDER_PARENT_METADATA } from '../../form/builder/ds-dynamic-form-ui/ds-dynamic-form-constants';
|
||||
import { hasValue, isNotEmpty } from '../../../empty.util';
|
||||
import { FormFieldMetadataValueObject } from '../../builder/models/form-field-metadata-value.model';
|
||||
import { ConfidenceType } from '../../../../core/shared/confidence-type';
|
||||
import { PLACEHOLDER_PARENT_METADATA } from '../../builder/ds-dynamic-form-ui/ds-dynamic-form-constants';
|
||||
|
||||
export interface ChipsItemIcon {
|
||||
metadata: string;
|
@@ -1,6 +1,6 @@
|
||||
import { Chips } from './chips.model';
|
||||
import { ChipsItem } from './chips-item.model';
|
||||
import { FormFieldMetadataValueObject } from '../../form/builder/models/form-field-metadata-value.model';
|
||||
import { FormFieldMetadataValueObject } from '../../builder/models/form-field-metadata-value.model';
|
||||
|
||||
describe('Chips model test suite', () => {
|
||||
let items: any[];
|
@@ -1,11 +1,11 @@
|
||||
import { findIndex, isEqual, isObject } from 'lodash';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { ChipsItem, ChipsItemIcon } from './chips-item.model';
|
||||
import { hasValue, isNotEmpty } from '../../empty.util';
|
||||
import { MetadataIconConfig } from '../../../../config/submission-config.interface';
|
||||
import { FormFieldMetadataValueObject } from '../../form/builder/models/form-field-metadata-value.model';
|
||||
import { VocabularyEntry } from '../../../core/submission/vocabularies/models/vocabulary-entry.model';
|
||||
import { PLACEHOLDER_PARENT_METADATA } from '../../form/builder/ds-dynamic-form-ui/ds-dynamic-form-constants';
|
||||
import { hasValue, isNotEmpty } from '../../../empty.util';
|
||||
import { MetadataIconConfig } from '../../../../../config/submission-config.interface';
|
||||
import { FormFieldMetadataValueObject } from '../../builder/models/form-field-metadata-value.model';
|
||||
import { VocabularyEntry } from '../../../../core/submission/vocabularies/models/vocabulary-entry.model';
|
||||
import { PLACEHOLDER_PARENT_METADATA } from '../../builder/ds-dynamic-form-ui/ds-dynamic-form-constants';
|
||||
|
||||
export class Chips {
|
||||
chipsItems: BehaviorSubject<ChipsItem[]>;
|
@@ -1,3 +1,11 @@
|
||||
/**
|
||||
* The contents of this file are subject to the license and copyright
|
||||
* detailed in the LICENSE and NOTICE files at the root of the source
|
||||
* tree and available online at
|
||||
*
|
||||
* http://www.dspace.org/license/
|
||||
*/
|
||||
|
||||
import {
|
||||
AfterViewInit,
|
||||
Directive,
|
||||
@@ -13,13 +21,13 @@ import {
|
||||
|
||||
import { findIndex } from 'lodash';
|
||||
|
||||
import { VocabularyEntry } from '../../core/submission/vocabularies/models/vocabulary-entry.model';
|
||||
import { FormFieldMetadataValueObject } from '../form/builder/models/form-field-metadata-value.model';
|
||||
import { ConfidenceType } from '../../core/shared/confidence-type';
|
||||
import { isNotEmpty, isNull } from '../empty.util';
|
||||
import { ConfidenceIconConfig } from '../../../config/submission-config.interface';
|
||||
import { environment } from '../../../environments/environment';
|
||||
import { VocabularyEntryDetail } from '../../core/submission/vocabularies/models/vocabulary-entry-detail.model';
|
||||
import { VocabularyEntry } from '../../../core/submission/vocabularies/models/vocabulary-entry.model';
|
||||
import { FormFieldMetadataValueObject } from '../builder/models/form-field-metadata-value.model';
|
||||
import { ConfidenceType } from '../../../core/shared/confidence-type';
|
||||
import { isNotEmpty, isNull } from '../../empty.util';
|
||||
import { ConfidenceIconConfig } from '../../../../config/submission-config.interface';
|
||||
import { environment } from '../../../../environments/environment';
|
||||
import { VocabularyEntryDetail } from '../../../core/submission/vocabularies/models/vocabulary-entry-detail.model';
|
||||
|
||||
/**
|
||||
* Directive to add to the element a bootstrap utility class based on metadata confidence value
|
@@ -2,10 +2,7 @@ import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormComponent } from './form.component';
|
||||
import { DsDynamicFormComponent } from './builder/ds-dynamic-form-ui/ds-dynamic-form.component';
|
||||
import {
|
||||
DsDynamicFormControlContainerComponent,
|
||||
dsDynamicFormControlMapFn
|
||||
} from './builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component';
|
||||
import { DsDynamicFormControlContainerComponent, dsDynamicFormControlMapFn } from './builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component';
|
||||
import { DsDynamicListComponent } from './builder/ds-dynamic-form-ui/models/list/dynamic-list.component';
|
||||
import { DsDynamicLookupComponent } from './builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component';
|
||||
import { DsDynamicDisabledComponent } from './builder/ds-dynamic-form-ui/models/disabled/dynamic-disabled.component';
|
||||
@@ -24,12 +21,21 @@ import { DsDynamicLookupRelationExternalSourceTabComponent } from './builder/ds-
|
||||
import { SharedModule } from '../shared.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { SearchModule } from '../search/search.module';
|
||||
import { DYNAMIC_FORM_CONTROL_MAP_FN, DynamicFormsCoreModule } from '@ng-dynamic-forms/core';
|
||||
import { DYNAMIC_FORM_CONTROL_MAP_FN, DynamicFormLayoutService, DynamicFormsCoreModule, DynamicFormService, DynamicFormValidationService } from '@ng-dynamic-forms/core';
|
||||
import { ExistingMetadataListElementComponent } from './builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component';
|
||||
import { ExistingRelationListElementComponent } from './builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component';
|
||||
import { ExternalSourceEntryImportModalComponent } from './builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component';
|
||||
import { CustomSwitchComponent } from './builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.component';
|
||||
import { DynamicFormsNGBootstrapUIModule } from '@ng-dynamic-forms/ui-ng-bootstrap';
|
||||
import { ChipsComponent } from './chips/chips.component';
|
||||
import { NumberPickerComponent } from './number-picker/number-picker.component';
|
||||
import { AuthorityConfidenceStateDirective } from './directives/authority-confidence-state.directive';
|
||||
import { SortablejsModule } from 'ngx-sortablejs';
|
||||
import { VocabularyTreeviewComponent } from './vocabulary-treeview/vocabulary-treeview.component';
|
||||
import { VocabularyTreeviewService } from './vocabulary-treeview/vocabulary-treeview.service';
|
||||
import { FormBuilderService } from './builder/form-builder.service';
|
||||
import { DsDynamicTypeBindRelationService } from './builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service';
|
||||
import { FormService } from './form.service';
|
||||
|
||||
const COMPONENTS = [
|
||||
CustomSwitchComponent,
|
||||
@@ -53,12 +59,20 @@ const COMPONENTS = [
|
||||
ExistingMetadataListElementComponent,
|
||||
ExistingRelationListElementComponent,
|
||||
ExternalSourceEntryImportModalComponent,
|
||||
FormComponent
|
||||
FormComponent,
|
||||
ChipsComponent,
|
||||
NumberPickerComponent,
|
||||
VocabularyTreeviewComponent,
|
||||
];
|
||||
|
||||
const DIRECTIVES = [
|
||||
AuthorityConfidenceStateDirective,
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
...COMPONENTS
|
||||
...COMPONENTS,
|
||||
...DIRECTIVES,
|
||||
],
|
||||
imports: [
|
||||
CommonModule,
|
||||
@@ -66,16 +80,25 @@ const COMPONENTS = [
|
||||
DynamicFormsNGBootstrapUIModule,
|
||||
SearchModule,
|
||||
SharedModule,
|
||||
TranslateModule
|
||||
TranslateModule,
|
||||
SortablejsModule,
|
||||
],
|
||||
exports: [
|
||||
...COMPONENTS
|
||||
...COMPONENTS,
|
||||
...DIRECTIVES,
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: DYNAMIC_FORM_CONTROL_MAP_FN,
|
||||
useValue: dsDynamicFormControlMapFn
|
||||
}
|
||||
},
|
||||
VocabularyTreeviewService,
|
||||
DynamicFormLayoutService,
|
||||
DynamicFormService,
|
||||
DynamicFormValidationService,
|
||||
FormBuilderService,
|
||||
DsDynamicTypeBindRelationService,
|
||||
FormService,
|
||||
]
|
||||
})
|
||||
export class FormModule {
|
||||
|
@@ -2,12 +2,11 @@
|
||||
import { ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing';
|
||||
|
||||
import { UploaderService } from '../uploader/uploader.service';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { NumberPickerComponent } from './number-picker.component';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { createTestComponent } from '../testing/utils.test';
|
||||
import { createTestComponent } from '../../testing/utils.test';
|
||||
|
||||
describe('NumberPickerComponent test suite', () => {
|
||||
|
||||
@@ -33,7 +32,6 @@ describe('NumberPickerComponent test suite', () => {
|
||||
providers: [
|
||||
ChangeDetectorRef,
|
||||
NumberPickerComponent,
|
||||
UploaderService
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
@@ -1,6 +1,6 @@
|
||||
import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, SimpleChanges, } from '@angular/core';
|
||||
import { ControlValueAccessor, FormBuilder, NG_VALUE_ACCESSOR } from '@angular/forms';
|
||||
import { isEmpty } from '../empty.util';
|
||||
import { isEmpty } from '../../empty.util';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-number-picker',
|
@@ -1,7 +1,7 @@
|
||||
/* eslint-disable max-classes-per-file */
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { VocabularyEntryDetail } from '../../core/submission/vocabularies/models/vocabulary-entry-detail.model';
|
||||
import { PageInfo } from '../../core/shared/page-info.model';
|
||||
import { VocabularyEntryDetail } from '../../../core/submission/vocabularies/models/vocabulary-entry-detail.model';
|
||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||
|
||||
export const LOAD_MORE = 'LOAD_MORE';
|
||||
export const LOAD_MORE_ROOT = 'LOAD_MORE_ROOT';
|
@@ -8,18 +8,18 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { provideMockStore } from '@ngrx/store/testing';
|
||||
|
||||
import { createTestComponent } from '../testing/utils.test';
|
||||
import { createTestComponent } from '../../testing/utils.test';
|
||||
import { VocabularyTreeviewComponent } from './vocabulary-treeview.component';
|
||||
import { VocabularyTreeviewService } from './vocabulary-treeview.service';
|
||||
import { VocabularyEntryDetail } from '../../core/submission/vocabularies/models/vocabulary-entry-detail.model';
|
||||
import { VocabularyEntryDetail } from '../../../core/submission/vocabularies/models/vocabulary-entry-detail.model';
|
||||
import { TreeviewFlatNode } from './vocabulary-treeview-node.model';
|
||||
import { FormFieldMetadataValueObject } from '../form/builder/models/form-field-metadata-value.model';
|
||||
import { VocabularyOptions } from '../../core/submission/vocabularies/models/vocabulary-options.model';
|
||||
import { PageInfo } from '../../core/shared/page-info.model';
|
||||
import { VocabularyEntry } from '../../core/submission/vocabularies/models/vocabulary-entry.model';
|
||||
import { AuthTokenInfo } from '../../core/auth/models/auth-token-info.model';
|
||||
import { authReducer } from '../../core/auth/auth.reducer';
|
||||
import { storeModuleConfig } from '../../app.reducer';
|
||||
import { FormFieldMetadataValueObject } from '../builder/models/form-field-metadata-value.model';
|
||||
import { VocabularyOptions } from '../../../core/submission/vocabularies/models/vocabulary-options.model';
|
||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||
import { VocabularyEntry } from '../../../core/submission/vocabularies/models/vocabulary-entry.model';
|
||||
import { AuthTokenInfo } from '../../../core/auth/models/auth-token-info.model';
|
||||
import { authReducer } from '../../../core/auth/auth.reducer';
|
||||
import { storeModuleConfig } from '../../../app.reducer';
|
||||
|
||||
describe('VocabularyTreeviewComponent test suite', () => {
|
||||
|
@@ -7,17 +7,17 @@ import { Observable, Subscription } from 'rxjs';
|
||||
import { select, Store } from '@ngrx/store';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
import { VocabularyEntryDetail } from '../../core/submission/vocabularies/models/vocabulary-entry-detail.model';
|
||||
import { hasValue, isEmpty, isNotEmpty } from '../empty.util';
|
||||
import { isAuthenticated } from '../../core/auth/selectors';
|
||||
import { VocabularyEntryDetail } from '../../../core/submission/vocabularies/models/vocabulary-entry-detail.model';
|
||||
import { hasValue, isEmpty, isNotEmpty } from '../../empty.util';
|
||||
import { isAuthenticated } from '../../../core/auth/selectors';
|
||||
import { VocabularyTreeviewService } from './vocabulary-treeview.service';
|
||||
import { LOAD_MORE, LOAD_MORE_ROOT, TreeviewFlatNode, TreeviewNode } from './vocabulary-treeview-node.model';
|
||||
import { VocabularyOptions } from '../../core/submission/vocabularies/models/vocabulary-options.model';
|
||||
import { PageInfo } from '../../core/shared/page-info.model';
|
||||
import { VocabularyEntry } from '../../core/submission/vocabularies/models/vocabulary-entry.model';
|
||||
import { VocabularyOptions } from '../../../core/submission/vocabularies/models/vocabulary-options.model';
|
||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||
import { VocabularyEntry } from '../../../core/submission/vocabularies/models/vocabulary-entry.model';
|
||||
import { VocabularyTreeFlattener } from './vocabulary-tree-flattener';
|
||||
import { VocabularyTreeFlatDataSource } from './vocabulary-tree-flat-data-source';
|
||||
import { CoreState } from '../../core/core-state.model';
|
||||
import { CoreState } from '../../../core/core-state.model';
|
||||
|
||||
/**
|
||||
* Component that show a hierarchical vocabulary in a tree view
|
@@ -5,15 +5,15 @@ import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-transla
|
||||
import { cold, getTestScheduler, hot } from 'jasmine-marbles';
|
||||
|
||||
import { VocabularyTreeviewService } from './vocabulary-treeview.service';
|
||||
import { VocabularyService } from '../../core/submission/vocabularies/vocabulary.service';
|
||||
import { TranslateLoaderMock } from '../mocks/translate-loader.mock';
|
||||
import { VocabularyOptions } from '../../core/submission/vocabularies/models/vocabulary-options.model';
|
||||
import { VocabularyService } from '../../../core/submission/vocabularies/vocabulary.service';
|
||||
import { TranslateLoaderMock } from '../../mocks/translate-loader.mock';
|
||||
import { VocabularyOptions } from '../../../core/submission/vocabularies/models/vocabulary-options.model';
|
||||
import { LOAD_MORE_NODE, LOAD_MORE_ROOT_NODE, TreeviewFlatNode, TreeviewNode } from './vocabulary-treeview-node.model';
|
||||
import { PageInfo } from '../../core/shared/page-info.model';
|
||||
import { VocabularyEntryDetail } from '../../core/submission/vocabularies/models/vocabulary-entry-detail.model';
|
||||
import { buildPaginatedList } from '../../core/data/paginated-list.model';
|
||||
import { createSuccessfulRemoteDataObject } from '../remote-data.utils';
|
||||
import { VocabularyEntry } from '../../core/submission/vocabularies/models/vocabulary-entry.model';
|
||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||
import { VocabularyEntryDetail } from '../../../core/submission/vocabularies/models/vocabulary-entry-detail.model';
|
||||
import { buildPaginatedList } from '../../../core/data/paginated-list.model';
|
||||
import { createSuccessfulRemoteDataObject } from '../../remote-data.utils';
|
||||
import { VocabularyEntry } from '../../../core/submission/vocabularies/models/vocabulary-entry.model';
|
||||
import { expand, map, switchMap } from 'rxjs/operators';
|
||||
import { from as observableFrom } from 'rxjs';
|
||||
|
@@ -10,17 +10,17 @@ import {
|
||||
TreeviewFlatNode,
|
||||
TreeviewNode
|
||||
} from './vocabulary-treeview-node.model';
|
||||
import { VocabularyEntry } from '../../core/submission/vocabularies/models/vocabulary-entry.model';
|
||||
import { VocabularyService } from '../../core/submission/vocabularies/vocabulary.service';
|
||||
import { PageInfo } from '../../core/shared/page-info.model';
|
||||
import { isEmpty, isNotEmpty } from '../empty.util';
|
||||
import { VocabularyOptions } from '../../core/submission/vocabularies/models/vocabulary-options.model';
|
||||
import { VocabularyEntry } from '../../../core/submission/vocabularies/models/vocabulary-entry.model';
|
||||
import { VocabularyService } from '../../../core/submission/vocabularies/vocabulary.service';
|
||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||
import { isEmpty, isNotEmpty } from '../../empty.util';
|
||||
import { VocabularyOptions } from '../../../core/submission/vocabularies/models/vocabulary-options.model';
|
||||
import {
|
||||
getFirstSucceededRemoteDataPayload,
|
||||
getFirstSucceededRemoteListPayload
|
||||
} from '../../core/shared/operators';
|
||||
import { PaginatedList } from '../../core/data/paginated-list.model';
|
||||
import { VocabularyEntryDetail } from '../../core/submission/vocabularies/models/vocabulary-entry-detail.model';
|
||||
} from '../../../core/shared/operators';
|
||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||
import { VocabularyEntryDetail } from '../../../core/submission/vocabularies/models/vocabulary-entry-detail.model';
|
||||
|
||||
/**
|
||||
* A service that provides methods to deal with vocabulary tree
|
@@ -74,8 +74,6 @@ import { TruncatableComponent } from './truncatable/truncatable.component';
|
||||
import { TruncatableService } from './truncatable/truncatable.service';
|
||||
import { TruncatablePartComponent } from './truncatable/truncatable-part/truncatable-part.component';
|
||||
import { UploaderComponent } from './uploader/uploader.component';
|
||||
import { ChipsComponent } from './chips/chips.component';
|
||||
import { NumberPickerComponent } from './number-picker/number-picker.component';
|
||||
import { MockAdminGuard } from './mocks/admin-guard.service.mock';
|
||||
import { AlertComponent } from './alert/alert.component';
|
||||
import {
|
||||
@@ -111,7 +109,6 @@ import { EmphasizePipe } from './utils/emphasize.pipe';
|
||||
import { InputSuggestionsComponent } from './input-suggestions/input-suggestions.component';
|
||||
import { CapitalizePipe } from './utils/capitalize.pipe';
|
||||
import { ObjectKeysPipe } from './utils/object-keys-pipe';
|
||||
import { AuthorityConfidenceStateDirective } from './authority-confidence/authority-confidence-state.directive';
|
||||
import { LangSwitchComponent } from './lang-switch/lang-switch.component';
|
||||
import {
|
||||
PlainTextMetadataListElementComponent
|
||||
@@ -232,7 +229,6 @@ import {
|
||||
ImportableListItemControlComponent
|
||||
} from './object-collection/shared/importable-list-item-control/importable-list-item-control.component';
|
||||
import { ItemVersionsComponent } from './item/item-versions/item-versions.component';
|
||||
import { SortablejsModule } from 'ngx-sortablejs';
|
||||
import { LogInContainerComponent } from './log-in/container/log-in-container.component';
|
||||
import { LogInShibbolethComponent } from './log-in/methods/shibboleth/log-in-shibboleth.component';
|
||||
import { LogInPasswordComponent } from './log-in/methods/password/log-in-password.component';
|
||||
@@ -258,7 +254,6 @@ import { NgForTrackByIdDirective } from './ng-for-track-by-id.directive';
|
||||
import { FileDownloadLinkComponent } from './file-download-link/file-download-link.component';
|
||||
import { CollectionDropdownComponent } from './collection-dropdown/collection-dropdown.component';
|
||||
import { EntityDropdownComponent } from './entity-dropdown/entity-dropdown.component';
|
||||
import { VocabularyTreeviewComponent } from './vocabulary-treeview/vocabulary-treeview.component';
|
||||
import { CurationFormComponent } from '../curation-form/curation-form.component';
|
||||
import {
|
||||
PublicationSidebarSearchListElementComponent
|
||||
@@ -327,7 +322,6 @@ import { GoogleRecaptchaModule } from '../core/google-recaptcha/google-recaptcha
|
||||
|
||||
const MODULES = [
|
||||
CommonModule,
|
||||
SortablejsModule,
|
||||
FileUploadModule,
|
||||
FormsModule,
|
||||
InfiniteScrollModule,
|
||||
@@ -377,7 +371,6 @@ const COMPONENTS = [
|
||||
AuthNavMenuComponent,
|
||||
ThemedAuthNavMenuComponent,
|
||||
UserMenuComponent,
|
||||
ChipsComponent,
|
||||
DsSelectComponent,
|
||||
ErrorComponent,
|
||||
FileSectionComponent,
|
||||
@@ -386,7 +379,6 @@ const COMPONENTS = [
|
||||
ThemedLoadingComponent,
|
||||
LogInComponent,
|
||||
LogOutComponent,
|
||||
NumberPickerComponent,
|
||||
ObjectListComponent,
|
||||
ThemedObjectListComponent,
|
||||
ObjectDetailComponent,
|
||||
@@ -605,7 +597,6 @@ const DIRECTIVES = [
|
||||
DragClickDirective,
|
||||
DebounceDirective,
|
||||
ClickOutsideDirective,
|
||||
AuthorityConfidenceStateDirective,
|
||||
InListValidator,
|
||||
AutoFocusDirective,
|
||||
RoleDirective,
|
||||
|
@@ -9,7 +9,7 @@ import { hasValue, isEmpty, isNotEmpty } from '../../../shared/empty.util';
|
||||
import { normalizeSectionData } from '../../../core/submission/submission-response-parsing.service';
|
||||
import { SubmissionService } from '../../submission.service';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { UploaderOptions } from '../../../shared/uploader/uploader-options.model';
|
||||
import { UploaderOptions } from '../../../shared/upload/uploader/uploader-options.model';
|
||||
import parseSectionErrors from '../../utils/parseSectionErrors';
|
||||
import { SubmissionJsonPatchOperationsService } from '../../../core/submission/submission-json-patch-operations.service';
|
||||
import { WorkspaceItem } from '../../../core/submission/models/workspaceitem.model';
|
||||
|
@@ -63,6 +63,7 @@ import {
|
||||
import {
|
||||
MetadataInformationComponent
|
||||
} from './sections/sherpa-policies/metadata-information/metadata-information.component';
|
||||
import { SectionFormOperationsService } from './sections/form/section-form-operations.service';
|
||||
|
||||
const ENTRY_COMPONENTS = [
|
||||
// put only entry components that use custom decorator
|
||||
@@ -117,13 +118,17 @@ const DECLARATIONS = [
|
||||
NgbAccordionModule
|
||||
],
|
||||
declarations: DECLARATIONS,
|
||||
exports: DECLARATIONS,
|
||||
exports: [
|
||||
...DECLARATIONS,
|
||||
FormModule,
|
||||
],
|
||||
providers: [
|
||||
SectionUploadService,
|
||||
SectionsService,
|
||||
SubmissionUploadsConfigDataService,
|
||||
SubmissionAccessesConfigDataService,
|
||||
SectionAccessesService,
|
||||
SectionFormOperationsService,
|
||||
]
|
||||
})
|
||||
|
||||
|
@@ -3,6 +3,7 @@ import { NgModule } from '@angular/core';
|
||||
import { SharedModule } from '../shared/shared.module';
|
||||
import { SubmitPageRoutingModule } from './submit-page-routing.module';
|
||||
import { SubmissionModule } from '../submission/submission.module';
|
||||
import { FormModule } from '../shared/form/form.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -10,6 +11,7 @@ import { SubmissionModule } from '../submission/submission.module';
|
||||
CommonModule,
|
||||
SharedModule,
|
||||
SubmissionModule,
|
||||
FormModule,
|
||||
],
|
||||
})
|
||||
/**
|
||||
|
Reference in New Issue
Block a user