forked from hazza/dspace-angular
added missing decorator for classes that use Angular features
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { OnInit, Directive } from '@angular/core';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { map, switchMap, take } from 'rxjs/operators';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
@@ -15,7 +15,10 @@ import { isEmpty } from '../shared/empty.util';
|
||||
/**
|
||||
* Abstract component representing a page to perform an action on a workflow item
|
||||
*/
|
||||
@Directive()
|
||||
@Component({
|
||||
selector: 'ds-workflowitem-action-page',
|
||||
template: ''
|
||||
})
|
||||
export abstract class WorkflowItemActionPageComponent implements OnInit {
|
||||
public type;
|
||||
public wfi$: Observable<WorkflowItem>;
|
||||
|
@@ -1,9 +1,12 @@
|
||||
import { EventEmitter, Input, Output, Directive } from '@angular/core';
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
|
||||
/**
|
||||
* Abstract class that represents value input components
|
||||
*/
|
||||
@Directive()
|
||||
@Component({
|
||||
selector: 'ds-value-input',
|
||||
template: ''
|
||||
})
|
||||
export abstract class ValueInputComponent<T> {
|
||||
@Input() index: number;
|
||||
/**
|
||||
|
@@ -1,8 +1,9 @@
|
||||
import { Component, Inject, Input, OnInit } from '@angular/core';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import {
|
||||
DynamicFormControlModel,
|
||||
DynamicFormValueControlModel,
|
||||
DynamicInputModel, DynamicSelectModel
|
||||
DynamicInputModel,
|
||||
DynamicSelectModel
|
||||
} from '@ng-dynamic-forms/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { EPerson } from '../../core/eperson/models/eperson.model';
|
||||
@@ -124,7 +125,7 @@ export class ProfilePageMetadataFormComponent implements OnInit {
|
||||
*/
|
||||
setFormValues() {
|
||||
this.formModel.forEach(
|
||||
(fieldModel: DynamicInputModel | DynamicSelectModel<string>) => {
|
||||
(fieldModel: any) => {
|
||||
if (fieldModel.name === 'email') {
|
||||
fieldModel.value = this.user.email;
|
||||
} else {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { Injectable, Input, OnInit, Directive } from '@angular/core';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, ActivatedRouteSnapshot } from '@angular/router';
|
||||
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
@@ -15,9 +15,10 @@ export enum SelectorActionType {
|
||||
/**
|
||||
* Abstract base class that represents a wrapper for modal content used to select a DSpace Object
|
||||
*/
|
||||
|
||||
@Directive()
|
||||
@Injectable()
|
||||
@Component({
|
||||
selector: 'ds-dso-selector-modal',
|
||||
template: ''
|
||||
})
|
||||
export abstract class DSOSelectorModalWrapperComponent implements OnInit {
|
||||
/**
|
||||
* The current page's DSO
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { EventEmitter, Input, Output, Directive } from '@angular/core';
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
|
||||
import {
|
||||
@@ -19,7 +19,10 @@ import { PageInfo } from '../../../../../core/shared/page-info.model';
|
||||
/**
|
||||
* An abstract class to be extended by form components that handle vocabulary
|
||||
*/
|
||||
@Directive()
|
||||
@Component({
|
||||
selector: 'ds-dynamic-vocabulary',
|
||||
template: ''
|
||||
})
|
||||
export abstract class DsDynamicVocabularyComponent extends DynamicFormControlComponent {
|
||||
|
||||
@Input() abstract group: FormGroup;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { Directive, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.model';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { ClaimedTaskDataService } from '../../../../core/tasks/claimed-task-data.service';
|
||||
@@ -11,7 +11,10 @@ import { ProcessTaskResponse } from '../../../../core/tasks/models/process-task-
|
||||
* - Add a @rendersWorkflowTaskOption annotation to your component providing the same enum value
|
||||
* - Optionally overwrite createBody if the request body requires more than just the option
|
||||
*/
|
||||
@Directive()
|
||||
@Component({
|
||||
selector: 'ds-calim-task-action-abstract',
|
||||
template: ''
|
||||
})
|
||||
export abstract class ClaimedTaskActionsAbstractComponent {
|
||||
/**
|
||||
* The workflow task option the child component represents
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Router } from '@angular/router';
|
||||
import { Injector, Input, Directive } from '@angular/core';
|
||||
import { Component, Injector, Input } from '@angular/core';
|
||||
|
||||
import { find, take, tap } from 'rxjs/operators';
|
||||
|
||||
@@ -18,7 +18,10 @@ import { SearchService } from '../../core/shared/search/search.service';
|
||||
/**
|
||||
* Abstract class for all different representations of mydspace actions
|
||||
*/
|
||||
@Directive()
|
||||
@Component({
|
||||
selector: 'ds-mydspace-actions-abstract',
|
||||
template: ''
|
||||
})
|
||||
export abstract class MyDSpaceActionsComponent<T extends DSpaceObject, TService extends DataService<T>> {
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { EventEmitter, Input, OnDestroy, OnInit, Output, Directive } from '@angular/core';
|
||||
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
|
||||
import { take } from 'rxjs/operators';
|
||||
import { Observable } from 'rxjs';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
@@ -10,7 +10,10 @@ import { SortOptions } from '../../../core/cache/models/sort-options.model';
|
||||
/**
|
||||
* An abstract component used to select DSpaceObjects from a specific list and returning the UUIDs of the selected DSpaceObjects
|
||||
*/
|
||||
@Directive()
|
||||
@Component({
|
||||
selector: 'ds-object-select-abstract',
|
||||
template: ''
|
||||
})
|
||||
export abstract class ObjectSelectComponent<TDomain> implements OnInit, OnDestroy {
|
||||
|
||||
/**
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { AbstractPaginatedDragAndDropListComponent } from './abstract-paginated-drag-and-drop-list.component';
|
||||
import { DSpaceObject } from '../../core/shared/dspace-object.model';
|
||||
import { ObjectUpdatesService } from '../../core/data/object-updates/object-updates.service';
|
||||
import { Directive, ElementRef } from '@angular/core';
|
||||
import { Component, ElementRef } from '@angular/core';
|
||||
import { BehaviorSubject, Observable, of as observableOf } from 'rxjs';
|
||||
import { PaginatedList } from '../../core/data/paginated-list';
|
||||
import { RemoteData } from '../../core/data/remote-data';
|
||||
@@ -12,7 +12,10 @@ import { createSuccessfulRemoteDataObject } from '../remote-data.utils';
|
||||
import { createPaginatedList } from '../testing/utils.test';
|
||||
import { ObjectValuesPipe } from '../utils/object-values-pipe';
|
||||
|
||||
@Directive()
|
||||
@Component({
|
||||
selector: 'ds-mock-paginated-drag-drop-abstract',
|
||||
template: ''
|
||||
})
|
||||
class MockAbstractPaginatedDragAndDropListComponent extends AbstractPaginatedDragAndDropListComponent<DSpaceObject> {
|
||||
|
||||
constructor(protected objectUpdatesService: ObjectUpdatesService,
|
||||
|
@@ -9,7 +9,7 @@ import { hasValue } from '../empty.util';
|
||||
import { paginatedListToArray } from '../../core/shared/operators';
|
||||
import { DSpaceObject } from '../../core/shared/dspace-object.model';
|
||||
import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';
|
||||
import { Directive, ElementRef, EventEmitter, OnDestroy, Output, ViewChild } from '@angular/core';
|
||||
import { Component, ElementRef, EventEmitter, OnDestroy, Output, ViewChild } from '@angular/core';
|
||||
import { PaginationComponent } from '../pagination/pagination.component';
|
||||
import { ObjectValuesPipe } from '../utils/object-values-pipe';
|
||||
import { compareArraysUsing } from '../../+item-page/simple/item-types/shared/item-relationships-utils';
|
||||
@@ -36,7 +36,10 @@ export const compareArraysUsingFieldUuids = () =>
|
||||
*
|
||||
* An example component extending from this abstract component: PaginatedDragAndDropBitstreamListComponent
|
||||
*/
|
||||
@Directive()
|
||||
@Component({
|
||||
selector: 'ds-paginated-drag-drop-abstract',
|
||||
template: ''
|
||||
})
|
||||
export abstract class AbstractPaginatedDragAndDropListComponent<T extends DSpaceObject> implements OnDestroy {
|
||||
/**
|
||||
* A view on the child pagination component
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { Directive, Inject, OnDestroy, OnInit } from '@angular/core';
|
||||
import { Component, Inject, OnDestroy, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { FormControl, FormGroup } from '@angular/forms';
|
||||
@@ -7,8 +7,11 @@ import { hasValue } from '../empty.util';
|
||||
/**
|
||||
* An abstract component to render StartsWith options
|
||||
*/
|
||||
@Directive()
|
||||
export class StartsWithAbstractComponent implements OnInit, OnDestroy {
|
||||
@Component({
|
||||
selector: 'ds-start-with-abstract',
|
||||
template: ''
|
||||
})
|
||||
export abstract class StartsWithAbstractComponent implements OnInit, OnDestroy {
|
||||
/**
|
||||
* The currently selected startsWith in string format
|
||||
*/
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { OnInit, Directive } from '@angular/core';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { combineLatest, Observable } from 'rxjs';
|
||||
import { UsageReportService } from '../../core/statistics/usage-report-data.service';
|
||||
import { map, switchMap } from 'rxjs/operators';
|
||||
@@ -12,7 +12,10 @@ import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
|
||||
/**
|
||||
* Class representing an abstract statistics page component.
|
||||
*/
|
||||
@Directive()
|
||||
@Component({
|
||||
selector: 'ds-statistics-page',
|
||||
templateUrl: ''
|
||||
})
|
||||
export abstract class StatisticsPageComponent<T extends DSpaceObject> implements OnInit {
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { Inject, OnDestroy, OnInit, Directive } from '@angular/core';
|
||||
import { Component, Inject, OnDestroy, OnInit } from '@angular/core';
|
||||
|
||||
import { Observable, Subscription } from 'rxjs';
|
||||
import { filter, startWith } from 'rxjs/operators';
|
||||
@@ -14,7 +14,10 @@ export interface SectionDataModel {
|
||||
/**
|
||||
* An abstract model class for a submission edit form section.
|
||||
*/
|
||||
@Directive()
|
||||
@Component({
|
||||
selector: 'ds-section-model',
|
||||
template: ''
|
||||
})
|
||||
export abstract class SectionModelComponent implements OnDestroy, OnInit, SectionDataModel {
|
||||
protected abstract sectionService: SectionsService;
|
||||
|
||||
|
Reference in New Issue
Block a user