diff --git a/src/app/browse-by/browse-by-date/browse-by-date.component.ts b/src/app/browse-by/browse-by-date/browse-by-date.component.ts index bb2ea93fe4..d6202145e7 100644 --- a/src/app/browse-by/browse-by-date/browse-by-date.component.ts +++ b/src/app/browse-by/browse-by-date/browse-by-date.component.ts @@ -9,7 +9,6 @@ import { hasValue, isNotEmpty } from '../../shared/empty.util'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { BrowseService } from '../../core/browse/browse.service'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; -import { StartsWithType } from '../../shared/starts-with/starts-with-decorator'; import { PaginationService } from '../../core/pagination/pagination.service'; import { map } from 'rxjs/operators'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; @@ -37,6 +36,7 @@ import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.comp import { ThemedBrowseByComponent } from 'src/app/shared/browse-by/themed-browse-by.component'; import { rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator'; import { BrowseByDataType } from '../browse-by-switcher/browse-by-data-type'; +import { StartsWithType } from '../../shared/starts-with/starts-with-type'; @Component({ selector: 'ds-browse-by-date', diff --git a/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts b/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts index 7bbf48e3fe..0df408d947 100644 --- a/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts +++ b/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts @@ -18,7 +18,6 @@ import { Item } from '../../core/shared/item.model'; import { BrowseEntrySearchOptions } from '../../core/browse/browse-entry-search-options.model'; import { getFirstSucceededRemoteData } from '../../core/shared/operators'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; -import { StartsWithType } from '../../shared/starts-with/starts-with-decorator'; import { PaginationService } from '../../core/pagination/pagination.service'; import { map } from 'rxjs/operators'; import { APP_CONFIG, AppConfig } from '../../../config/app-config.interface'; @@ -42,6 +41,7 @@ import { ThemedBrowseByComponent } from 'src/app/shared/browse-by/themed-browse- import { rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator'; import { BrowseByDataType } from '../browse-by-switcher/browse-by-data-type'; import { Context } from '../../core/shared/context.model'; +import { StartsWithType } from '../../shared/starts-with/starts-with-type'; export const BBM_PAGINATION_ID = 'bbm'; diff --git a/src/app/item-page/field-components/metadata-values/metadata-values.component.ts b/src/app/item-page/field-components/metadata-values/metadata-values.component.ts index 28cc9f126c..1edf194a26 100644 --- a/src/app/item-page/field-components/metadata-values/metadata-values.component.ts +++ b/src/app/item-page/field-components/metadata-values/metadata-values.component.ts @@ -9,7 +9,7 @@ import { MarkdownPipe as MarkdownPipe_1 } from '../../../shared/utils/markdown.p import { RouterLink } from '@angular/router'; import { NgFor, NgTemplateOutlet, NgIf, AsyncPipe } from '@angular/common'; import { MetadataFieldWrapperComponent } from '../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; -import { ImageField } from '../../simple/field-components/specific-field/item-page-field.component'; +import { ImageField } from '../../simple/field-components/specific-field/image-field'; import { environment } from '../../../../environments/environment'; /** diff --git a/src/app/item-page/simple/field-components/specific-field/image-field.ts b/src/app/item-page/simple/field-components/specific-field/image-field.ts new file mode 100644 index 0000000000..796fa51701 --- /dev/null +++ b/src/app/item-page/simple/field-components/specific-field/image-field.ts @@ -0,0 +1,18 @@ + +/** + * Interface that encapsulate Image configuration for this component. + */ +export interface ImageField { + /** + * URI that is used to retrieve the image. + */ + URI: string; + /** + * i18n Key that represents the alt text to display + */ + alt: string; + /** + * CSS variable that contains the height of the inline image. + */ + heightVar: string; +} diff --git a/src/app/item-page/simple/field-components/specific-field/img/item-page-img-field.component.spec.ts b/src/app/item-page/simple/field-components/specific-field/img/item-page-img-field.component.spec.ts index 31077276c5..3b0b2309b5 100644 --- a/src/app/item-page/simple/field-components/specific-field/img/item-page-img-field.component.spec.ts +++ b/src/app/item-page/simple/field-components/specific-field/img/item-page-img-field.component.spec.ts @@ -12,7 +12,7 @@ import { MetadataValuesComponent } from '../../../../field-components/metadata-v import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core'; import { mockItemWithMetadataFieldsAndValue } from '../item-page-field.component.spec'; import { By } from '@angular/platform-browser'; -import { ImageField } from '../item-page-field.component'; +import { ImageField } from '../image-field'; let component: ItemPageImgFieldComponent; let fixture: ComponentFixture; diff --git a/src/app/item-page/simple/field-components/specific-field/img/item-page-img-field.component.ts b/src/app/item-page/simple/field-components/specific-field/img/item-page-img-field.component.ts index 186605e148..b5f5123c6f 100644 --- a/src/app/item-page/simple/field-components/specific-field/img/item-page-img-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/img/item-page-img-field.component.ts @@ -1,8 +1,9 @@ import { Component, Input } from '@angular/core'; -import { ImageField, ItemPageFieldComponent } from '../item-page-field.component'; +import { ItemPageFieldComponent } from '../item-page-field.component'; import { Item } from '../../../../../core/shared/item.model'; import { MetadataValuesComponent } from '../../../../field-components/metadata-values/metadata-values.component'; import { AsyncPipe } from '@angular/common'; +import { ImageField } from '../image-field'; @Component({ selector: 'ds-item-page-img-field', diff --git a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts index 5822e6ca85..943f19eb64 100644 --- a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts @@ -7,24 +7,7 @@ import { BrowseDefinitionDataService } from '../../../../core/browse/browse-defi import { getRemoteDataPayload } from '../../../../core/shared/operators'; import { MetadataValuesComponent } from '../../../field-components/metadata-values/metadata-values.component'; import { AsyncPipe } from '@angular/common'; - -/** - * Interface that encapsulate Image configuration for this component. - */ -export interface ImageField { - /** - * URI that is used to retrieve the image. - */ - URI: string; - /** - * i18n Key that represents the alt text to display - */ - alt: string; - /** - * CSS variable that contains the height of the inline image. - */ - heightVar: string; -} +import { ImageField } from './image-field'; /** diff --git a/src/app/notifications/suggestion-actions/suggestion-actions.component.ts b/src/app/notifications/suggestion-actions/suggestion-actions.component.ts index fb1ec127dc..3d240233c5 100644 --- a/src/app/notifications/suggestion-actions/suggestion-actions.component.ts +++ b/src/app/notifications/suggestion-actions/suggestion-actions.component.ts @@ -6,10 +6,10 @@ import { Collection } from '../../core/shared/collection.model'; import { take } from 'rxjs/operators'; import { CreateItemParentSelectorComponent } from '../../shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component'; import { Suggestion } from '../../core/notifications/models/suggestion.model'; -import { SuggestionApproveAndImport } from '../suggestion-list-element/suggestion-list-element.component'; import { EntityDropdownComponent } from '../../shared/entity-dropdown/entity-dropdown.component'; import { TranslateModule } from '@ngx-translate/core'; import { NgIf } from '@angular/common'; +import { SuggestionApproveAndImport } from '../suggestion-list-element/suggestion-approve-and-import'; /** * Show and trigger the actions to submit for a suggestion diff --git a/src/app/notifications/suggestion-list-element/suggestion-approve-and-import.ts b/src/app/notifications/suggestion-list-element/suggestion-approve-and-import.ts new file mode 100644 index 0000000000..e85b6ec4d0 --- /dev/null +++ b/src/app/notifications/suggestion-list-element/suggestion-approve-and-import.ts @@ -0,0 +1,9 @@ +import { Suggestion } from '../../core/notifications/models/suggestion.model'; + +/** + * A simple interface to unite a specific suggestion and the id of the chosen collection + */ +export interface SuggestionApproveAndImport { + suggestion: Suggestion; + collectionId: string; +} diff --git a/src/app/notifications/suggestion-list-element/suggestion-list-element.component.ts b/src/app/notifications/suggestion-list-element/suggestion-list-element.component.ts index 71c844df2f..09771afba1 100644 --- a/src/app/notifications/suggestion-list-element/suggestion-list-element.component.ts +++ b/src/app/notifications/suggestion-list-element/suggestion-list-element.component.ts @@ -11,17 +11,9 @@ import { } from '../../../themes/custom/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; import { SuggestionActionsComponent } from '../suggestion-actions/suggestion-actions.component'; import { SuggestionEvidencesComponent } from './suggestion-evidences/suggestion-evidences.component'; +import { SuggestionApproveAndImport } from './suggestion-approve-and-import'; - -/** - * A simple interface to unite a specific suggestion and the id of the chosen collection - */ -export interface SuggestionApproveAndImport { - suggestion: Suggestion; - collectionId: string; -} - /** * Show all the suggestions by researcher */ diff --git a/src/app/shared/browse-by/browse-by.component.ts b/src/app/shared/browse-by/browse-by.component.ts index b0a4360660..177a32db09 100644 --- a/src/app/shared/browse-by/browse-by.component.ts +++ b/src/app/shared/browse-by/browse-by.component.ts @@ -6,7 +6,6 @@ import { SortDirection, SortOptions } from '../../core/cache/models/sort-options import { fadeIn, fadeInOut } from '../animations/fade'; import { BehaviorSubject, combineLatest as observableCombineLatest, Observable, Subscription } from 'rxjs'; import { ListableObject } from '../object-collection/shared/listable-object.model'; -import { StartsWithType } from '../starts-with/starts-with-decorator'; import { PaginationService } from '../../core/pagination/pagination.service'; import { ViewMode } from '../../core/shared/view-mode.model'; import { RouteService } from '../../core/services/route.service'; @@ -20,6 +19,7 @@ import { ThemedResultsBackButtonComponent } from '../results-back-button/themed- import { NgClass, NgComponentOutlet, NgIf, AsyncPipe } from '@angular/common'; import { VarDirective } from '../utils/var.directive'; import { StartsWithLoaderComponent } from '../starts-with/starts-with-loader.component'; +import { StartsWithType } from '../starts-with/starts-with-type'; @Component({ selector: 'ds-browse-by', diff --git a/src/app/shared/browse-by/themed-browse-by.component.ts b/src/app/shared/browse-by/themed-browse-by.component.ts index f852d85902..5e7ae7d6a5 100644 --- a/src/app/shared/browse-by/themed-browse-by.component.ts +++ b/src/app/shared/browse-by/themed-browse-by.component.ts @@ -7,7 +7,7 @@ import { PaginatedList } from '../../core/data/paginated-list.model'; import { ListableObject } from '../object-collection/shared/listable-object.model'; import { PaginationComponentOptions } from '../pagination/pagination-component-options.model'; import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model'; -import { StartsWithType } from '../starts-with/starts-with-decorator'; +import { StartsWithType } from '../starts-with/starts-with-type'; /** * Themed wrapper for {@link BrowseByComponent} diff --git a/src/app/shared/starts-with/date/starts-with-date.component.ts b/src/app/shared/starts-with/date/starts-with-date.component.ts index 3950c1e413..92cb418f0a 100644 --- a/src/app/shared/starts-with/date/starts-with-date.component.ts +++ b/src/app/shared/starts-with/date/starts-with-date.component.ts @@ -1,9 +1,6 @@ -import { Component, OnInit, Inject } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { renderStartsWithFor, StartsWithType } from '../starts-with-decorator'; +import { Component, OnInit } from '@angular/core'; import { StartsWithAbstractComponent } from '../starts-with-abstract.component'; import { hasValue } from '../../empty.util'; -import { PaginationService } from '../../../core/pagination/pagination.service'; import { TranslateModule } from '@ngx-translate/core'; import { NgFor } from '@angular/common'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; diff --git a/src/app/shared/starts-with/starts-with-abstract.component.ts b/src/app/shared/starts-with/starts-with-abstract.component.ts index 22e069e2fb..8fa258350e 100644 --- a/src/app/shared/starts-with/starts-with-abstract.component.ts +++ b/src/app/shared/starts-with/starts-with-abstract.component.ts @@ -1,10 +1,10 @@ -import { Component, OnDestroy, OnInit, Input } from '@angular/core'; +import { Component, Input, OnDestroy, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { Subscription } from 'rxjs'; import { UntypedFormControl, UntypedFormGroup } from '@angular/forms'; import { hasValue } from '../empty.util'; import { PaginationService } from '../../core/pagination/pagination.service'; -import { StartsWithType } from './starts-with-decorator'; +import { StartsWithType } from './starts-with-type'; /** * An abstract component to render StartsWith options diff --git a/src/app/shared/starts-with/starts-with-decorator.spec.ts b/src/app/shared/starts-with/starts-with-decorator.spec.ts index 0ba72d8ac4..8c394d91a3 100644 --- a/src/app/shared/starts-with/starts-with-decorator.spec.ts +++ b/src/app/shared/starts-with/starts-with-decorator.spec.ts @@ -1,4 +1,5 @@ -import { renderStartsWithFor, StartsWithType } from './starts-with-decorator'; +import { renderStartsWithFor } from './starts-with-decorator'; +import { StartsWithType } from './starts-with-type'; describe('BrowseByStartsWithDecorator', () => { const textDecorator = renderStartsWithFor(StartsWithType.text); diff --git a/src/app/shared/starts-with/starts-with-decorator.ts b/src/app/shared/starts-with/starts-with-decorator.ts index a847e3acea..068eb94d60 100644 --- a/src/app/shared/starts-with/starts-with-decorator.ts +++ b/src/app/shared/starts-with/starts-with-decorator.ts @@ -1,13 +1,7 @@ import { StartsWithDateComponent } from './date/starts-with-date.component'; +import { StartsWithType } from './starts-with-type'; import { StartsWithTextComponent } from './text/starts-with-text.component'; -/** - * An enum that defines the type of StartsWith options - */ -export enum StartsWithType { - text = 'Text', - date = 'Date' -} type StartsWithComponentType = typeof StartsWithDateComponent | typeof StartsWithTextComponent; export const STARTS_WITH_DECORATOR_MAP = new Map([ diff --git a/src/app/shared/starts-with/starts-with-loader.component.spec.ts b/src/app/shared/starts-with/starts-with-loader.component.spec.ts index 71d33c7502..f2deb6b31a 100644 --- a/src/app/shared/starts-with/starts-with-loader.component.spec.ts +++ b/src/app/shared/starts-with/starts-with-loader.component.spec.ts @@ -8,10 +8,10 @@ import { Router, ActivatedRoute } from '@angular/router'; import { RouterStub } from '../testing/router.stub'; import { ThemeService } from '../theme-support/theme.service'; import { getMockThemeService } from '../mocks/theme-service.mock'; -import { StartsWithType } from './starts-with-decorator'; import { ActivatedRouteStub } from '../testing/active-router.stub'; import { PaginationService } from '../../core/pagination/pagination.service'; import { PaginationServiceStub } from '../testing/pagination-service.stub'; +import { StartsWithType } from './starts-with-type'; describe('StartsWithLoaderComponent', () => { let comp: StartsWithLoaderComponent; diff --git a/src/app/shared/starts-with/starts-with-loader.component.ts b/src/app/shared/starts-with/starts-with-loader.component.ts index 599c91874d..3a24173256 100644 --- a/src/app/shared/starts-with/starts-with-loader.component.ts +++ b/src/app/shared/starts-with/starts-with-loader.component.ts @@ -1,8 +1,9 @@ import { Component, Input, } from '@angular/core'; import { AbstractComponentLoaderComponent } from '../abstract-component-loader/abstract-component-loader.component'; import { GenericConstructor } from '../../core/shared/generic-constructor'; -import { getStartsWithComponent, StartsWithType } from './starts-with-decorator'; +import { getStartsWithComponent } from './starts-with-decorator'; import { StartsWithAbstractComponent } from './starts-with-abstract.component'; +import { StartsWithType } from './starts-with-type'; /** * Component for loading a {@link StartsWithAbstractComponent} depending on the "type" input diff --git a/src/app/shared/starts-with/starts-with-type.ts b/src/app/shared/starts-with/starts-with-type.ts new file mode 100644 index 0000000000..693f7cc491 --- /dev/null +++ b/src/app/shared/starts-with/starts-with-type.ts @@ -0,0 +1,8 @@ + +/** + * An enum that defines the type of StartsWith options + */ +export enum StartsWithType { + text = 'Text', + date = 'Date' +} diff --git a/src/app/submission/sections/section-coar-notify/section-coar-notify.component.ts b/src/app/submission/sections/section-coar-notify/section-coar-notify.component.ts index 18b73d38ea..a786741cd2 100644 --- a/src/app/submission/sections/section-coar-notify/section-coar-notify.component.ts +++ b/src/app/submission/sections/section-coar-notify/section-coar-notify.component.ts @@ -1,8 +1,6 @@ import { ChangeDetectorRef, Component, Inject } from '@angular/core'; import { Observable, Subscription } from 'rxjs'; import { SectionModelComponent } from '../models/section.model'; -import { renderSectionFor } from '../sections-decorator'; -import { SectionsType } from '../sections-type'; import { JsonPatchOperationPathCombiner } from '../../../core/json-patch/builder/json-patch-operation-path-combiner'; import { JsonPatchOperationsBuilder } from '../../../core/json-patch/builder/json-patch-operations-builder'; import { SectionsService } from '../sections.service'; @@ -10,7 +8,11 @@ import { SectionDataObject } from '../models/section-data.model'; import { hasValue, isEmpty, isNotEmpty } from '../../../shared/empty.util'; -import { getFirstCompletedRemoteData, getPaginatedListPayload, getRemoteDataPayload } from '../../../core/shared/operators'; +import { + getFirstCompletedRemoteData, + getPaginatedListPayload, + getRemoteDataPayload +} from '../../../core/shared/operators'; import { LdnServicesService } from '../../../admin/admin-ldn-services/ldn-services-data/ldn-services-data.service'; import { LdnService, @@ -44,7 +46,6 @@ import { InfiniteScrollModule } from 'ngx-infinite-scroll'; ], providers: [NgbDropdown] }) -@renderSectionFor(SectionsType.CoarNotify) export class SubmissionSectionCoarNotifyComponent extends SectionModelComponent { hasSectionData = false; diff --git a/src/app/suggestions-page/suggestions-page.component.spec.ts b/src/app/suggestions-page/suggestions-page.component.spec.ts index 1ca989142a..2b9e2852bd 100644 --- a/src/app/suggestions-page/suggestions-page.component.spec.ts +++ b/src/app/suggestions-page/suggestions-page.component.spec.ts @@ -29,11 +29,11 @@ import { SuggestionEvidencesComponent } from '../notifications/suggestion-list-element/suggestion-evidences/suggestion-evidences.component'; import { - SuggestionApproveAndImport, SuggestionListElementComponent } from '../notifications/suggestion-list-element/suggestion-list-element.component'; import { SuggestionsService } from '../notifications/suggestions.service'; import { SuggestionTargetsStateService } from '../notifications/suggestion-targets/suggestion-targets.state.service'; +import { SuggestionApproveAndImport } from '../notifications/suggestion-list-element/suggestion-approve-and-import'; describe('SuggestionPageComponent', () => { let component: SuggestionsPageComponent; diff --git a/src/app/suggestions-page/suggestions-page.component.ts b/src/app/suggestions-page/suggestions-page.component.ts index 6df081f8cf..e8b42b0a56 100644 --- a/src/app/suggestions-page/suggestions-page.component.ts +++ b/src/app/suggestions-page/suggestions-page.component.ts @@ -15,17 +15,14 @@ import { NotificationsService } from '../shared/notifications/notifications.serv import { WorkspaceitemDataService } from '../core/submission/workspaceitem-data.service'; import { PaginationService } from '../core/pagination/pagination.service'; import { WorkspaceItem } from '../core/submission/models/workspaceitem.model'; -import {FindListOptions} from '../core/data/find-list-options.model'; -import {redirectOn4xx} from '../core/shared/authorized.operators'; -import { - getWorkspaceItemEditRoute -} from '../workflowitems-edit-page/workflowitems-edit-page-routing-paths'; +import { FindListOptions } from '../core/data/find-list-options.model'; +import { redirectOn4xx } from '../core/shared/authorized.operators'; +import { getWorkspaceItemEditRoute } from '../workflowitems-edit-page/workflowitems-edit-page-routing-paths'; import { Suggestion } from '../core/notifications/models/suggestion.model'; import { SuggestionTarget } from '../core/notifications/models/suggestion-target.model'; import { SuggestionBulkResult, SuggestionsService } from '../notifications/suggestions.service'; import { SuggestionTargetsStateService } from '../notifications/suggestion-targets/suggestion-targets.state.service'; import { - SuggestionApproveAndImport, SuggestionListElementComponent } from '../notifications/suggestion-list-element/suggestion-list-element.component'; import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; @@ -33,6 +30,7 @@ import { VarDirective } from '../shared/utils/var.directive'; import { SuggestionActionsComponent } from '../notifications/suggestion-actions/suggestion-actions.component'; import { LoadingComponent } from '../shared/loading/loading.component'; import { PaginationComponent } from '../shared/pagination/pagination.component'; +import { SuggestionApproveAndImport } from '../notifications/suggestion-list-element/suggestion-approve-and-import'; @Component({ selector: 'ds-suggestion-page',