mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
[DURACOM-191] migrate components to standalone
This commit is contained in:
@@ -5,11 +5,12 @@ import { AbstractComponentLoaderComponent } from '../../shared/abstract-componen
|
|||||||
import { BrowseByDataType } from './browse-by-data-type';
|
import { BrowseByDataType } from './browse-by-data-type';
|
||||||
import { Context } from '../../core/shared/context.model';
|
import { Context } from '../../core/shared/context.model';
|
||||||
import { AsyncPipe, NgComponentOutlet } from '@angular/common';
|
import { AsyncPipe, NgComponentOutlet } from '@angular/common';
|
||||||
|
import { DynamicComponentLoaderDirective } from './dynamic-component-loader.directive';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-browse-by-switcher',
|
selector: 'ds-browse-by-switcher',
|
||||||
templateUrl: '../../shared/abstract-component-loader/abstract-component-loader.component.html',
|
templateUrl: '../../shared/abstract-component-loader/abstract-component-loader.component.html',
|
||||||
imports: [AsyncPipe, NgComponentOutlet],
|
imports: [AsyncPipe, NgComponentOutlet, DynamicComponentLoaderDirective],
|
||||||
standalone: true
|
standalone: true
|
||||||
})
|
})
|
||||||
export class BrowseBySwitcherComponent extends AbstractComponentLoaderComponent<Component> {
|
export class BrowseBySwitcherComponent extends AbstractComponentLoaderComponent<Component> {
|
||||||
|
@@ -33,6 +33,10 @@ import { ErrorComponent } from '../../shared/error/error.component';
|
|||||||
import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component';
|
import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { NotifyInfoService } from 'src/app/core/coar-notify/notify-info/notify-info.service';
|
import { NotifyInfoService } from 'src/app/core/coar-notify/notify-info/notify-info.service';
|
||||||
|
import {
|
||||||
|
NotifyRequestsStatusComponent
|
||||||
|
} from './notify-requests-status/notify-requests-status-component/notify-requests-status.component';
|
||||||
|
import { QaEventNotificationComponent } from './qa-event-notification/qa-event-notification.component';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component renders a simple item page.
|
* This component renders a simple item page.
|
||||||
@@ -57,7 +61,9 @@ import { NotifyInfoService } from 'src/app/core/coar-notify/notify-info/notify-i
|
|||||||
ThemedLoadingComponent,
|
ThemedLoadingComponent,
|
||||||
TranslateModule,
|
TranslateModule,
|
||||||
AsyncPipe,
|
AsyncPipe,
|
||||||
NgIf
|
NgIf,
|
||||||
|
NotifyRequestsStatusComponent,
|
||||||
|
QaEventNotificationComponent
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class ItemPageComponent implements OnInit, OnDestroy {
|
export class ItemPageComponent implements OnInit, OnDestroy {
|
||||||
|
@@ -16,11 +16,21 @@ import {
|
|||||||
getRemoteDataPayload,
|
getRemoteDataPayload,
|
||||||
} from '../../../../core/shared/operators';
|
} from '../../../../core/shared/operators';
|
||||||
import { hasValue } from '../../../../shared/empty.util';
|
import { hasValue } from '../../../../shared/empty.util';
|
||||||
|
import { RequestStatusAlertBoxComponent } from '../request-status-alert-box/request-status-alert-box.component';
|
||||||
|
import { AsyncPipe, KeyValuePipe, NgForOf, NgIf } from '@angular/common';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-notify-requests-status',
|
selector: 'ds-notify-requests-status',
|
||||||
templateUrl: './notify-requests-status.component.html',
|
templateUrl: './notify-requests-status.component.html',
|
||||||
styleUrls: ['./notify-requests-status.component.scss'],
|
styleUrls: ['./notify-requests-status.component.scss'],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
RequestStatusAlertBoxComponent,
|
||||||
|
AsyncPipe,
|
||||||
|
KeyValuePipe,
|
||||||
|
NgForOf,
|
||||||
|
NgIf
|
||||||
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -6,12 +6,23 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { NotifyStatuses } from '../notify-requests-status.model';
|
import { NotifyStatuses } from '../notify-requests-status.model';
|
||||||
import { RequestStatusEnum } from '../notify-status.enum';
|
import { RequestStatusEnum } from '../notify-status.enum';
|
||||||
|
import { TruncatablePartComponent } from '../../../../shared/truncatable/truncatable-part/truncatable-part.component';
|
||||||
|
import { TruncatableComponent } from '../../../../shared/truncatable/truncatable.component';
|
||||||
|
import { NgForOf } from '@angular/common';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-request-status-alert-box',
|
selector: 'ds-request-status-alert-box',
|
||||||
templateUrl: './request-status-alert-box.component.html',
|
templateUrl: './request-status-alert-box.component.html',
|
||||||
styleUrls: ['./request-status-alert-box.component.scss'],
|
styleUrls: ['./request-status-alert-box.component.scss'],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
TruncatablePartComponent,
|
||||||
|
TruncatableComponent,
|
||||||
|
NgForOf,
|
||||||
|
TranslateModule
|
||||||
|
]
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* Represents a component that displays the status of a request.
|
* Represents a component that displays the status of a request.
|
||||||
|
@@ -10,13 +10,26 @@ import { catchError, map } from 'rxjs/operators';
|
|||||||
import { RemoteData } from '../../../core/data/remote-data';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
import { getNotificatioQualityAssuranceRoute } from '../../../admin/admin-routing-paths';
|
import { getNotificatioQualityAssuranceRoute } from '../../../admin/admin-routing-paths';
|
||||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||||
|
import { AsyncPipe, NgForOf, NgIf } from '@angular/common';
|
||||||
|
import { RouterLink } from '@angular/router';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
import { SplitPipe } from '../../../shared/utils/split.pipe';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-qa-event-notification',
|
selector: 'ds-qa-event-notification',
|
||||||
templateUrl: './qa-event-notification.component.html',
|
templateUrl: './qa-event-notification.component.html',
|
||||||
styleUrls: ['./qa-event-notification.component.scss'],
|
styleUrls: ['./qa-event-notification.component.scss'],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
providers: [QualityAssuranceSourceDataService]
|
providers: [QualityAssuranceSourceDataService],
|
||||||
|
imports: [
|
||||||
|
NgIf,
|
||||||
|
NgForOf,
|
||||||
|
AsyncPipe,
|
||||||
|
RouterLink,
|
||||||
|
TranslateModule,
|
||||||
|
SplitPipe
|
||||||
|
],
|
||||||
|
standalone: true
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* Component for displaying quality assurance event notifications for an item.
|
* Component for displaying quality assurance event notifications for an item.
|
||||||
|
@@ -16,6 +16,12 @@ import { ThemedSearchComponent } from '../shared/search/themed-search.component'
|
|||||||
import { MyDSpaceNewSubmissionComponent } from './my-dspace-new-submission/my-dspace-new-submission.component';
|
import { MyDSpaceNewSubmissionComponent } from './my-dspace-new-submission/my-dspace-new-submission.component';
|
||||||
import { AsyncPipe, NgIf } from '@angular/common';
|
import { AsyncPipe, NgIf } from '@angular/common';
|
||||||
import { RoleDirective } from '../shared/roles/role.directive';
|
import { RoleDirective } from '../shared/roles/role.directive';
|
||||||
|
import {
|
||||||
|
SuggestionsNotificationComponent
|
||||||
|
} from '../notifications/suggestions-notification/suggestions-notification.component';
|
||||||
|
import {
|
||||||
|
MyDspaceQaEventsNotificationsComponent
|
||||||
|
} from './my-dspace-qa-events-notifications/my-dspace-qa-events-notifications.component';
|
||||||
|
|
||||||
export const MYDSPACE_ROUTE = '/mydspace';
|
export const MYDSPACE_ROUTE = '/mydspace';
|
||||||
|
|
||||||
@@ -38,7 +44,9 @@ export const MYDSPACE_ROUTE = '/mydspace';
|
|||||||
MyDSpaceNewSubmissionComponent,
|
MyDSpaceNewSubmissionComponent,
|
||||||
AsyncPipe,
|
AsyncPipe,
|
||||||
RoleDirective,
|
RoleDirective,
|
||||||
NgIf
|
NgIf,
|
||||||
|
SuggestionsNotificationComponent,
|
||||||
|
MyDspaceQaEventsNotificationsComponent
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true
|
||||||
})
|
})
|
||||||
|
@@ -4,12 +4,23 @@ import { getFirstCompletedRemoteData, getPaginatedListPayload, getRemoteDataPayl
|
|||||||
import { Observable, of, tap } from 'rxjs';
|
import { Observable, of, tap } from 'rxjs';
|
||||||
import { getNotificatioQualityAssuranceRoute } from '../../admin/admin-routing-paths';
|
import { getNotificatioQualityAssuranceRoute } from '../../admin/admin-routing-paths';
|
||||||
import { QualityAssuranceSourceObject } from 'src/app/core/notifications/qa/models/quality-assurance-source.model';
|
import { QualityAssuranceSourceObject } from 'src/app/core/notifications/qa/models/quality-assurance-source.model';
|
||||||
|
import { AsyncPipe, NgForOf, NgIf } from '@angular/common';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
import { RouterLink } from '@angular/router';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-my-dspace-qa-events-notifications',
|
selector: 'ds-my-dspace-qa-events-notifications',
|
||||||
templateUrl: './my-dspace-qa-events-notifications.component.html',
|
templateUrl: './my-dspace-qa-events-notifications.component.html',
|
||||||
styleUrls: ['./my-dspace-qa-events-notifications.component.scss'],
|
styleUrls: ['./my-dspace-qa-events-notifications.component.scss'],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
|
imports: [
|
||||||
|
AsyncPipe,
|
||||||
|
NgForOf,
|
||||||
|
TranslateModule,
|
||||||
|
RouterLink,
|
||||||
|
NgIf
|
||||||
|
],
|
||||||
|
standalone: true
|
||||||
})
|
})
|
||||||
export class MyDspaceQaEventsNotificationsComponent implements OnInit {
|
export class MyDspaceQaEventsNotificationsComponent implements OnInit {
|
||||||
|
|
||||||
|
@@ -40,6 +40,7 @@ import { NgIf, NgFor, AsyncPipe } from '@angular/common';
|
|||||||
import { AlertComponent } from '../../../shared/alert/alert.component';
|
import { AlertComponent } from '../../../shared/alert/alert.component';
|
||||||
import { getItemPageRoute } from '../../../item-page/item-page-routing-paths';
|
import { getItemPageRoute } from '../../../item-page/item-page-routing-paths';
|
||||||
import { ItemDataService } from '../../../core/data/item-data.service';
|
import { ItemDataService } from '../../../core/data/item-data.service';
|
||||||
|
import { EPersonDataComponent } from './ePerson-data/ePerson-data.component';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component to display the Quality Assurance event list.
|
* Component to display the Quality Assurance event list.
|
||||||
@@ -49,7 +50,7 @@ import { ItemDataService } from '../../../core/data/item-data.service';
|
|||||||
templateUrl: './quality-assurance-events.component.html',
|
templateUrl: './quality-assurance-events.component.html',
|
||||||
styleUrls: ['./quality-assurance-events.component.scss'],
|
styleUrls: ['./quality-assurance-events.component.scss'],
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [AlertComponent, NgIf, LoadingComponent, PaginationComponent, NgFor, RouterLink, NgbTooltipModule, AsyncPipe, TranslateModule]
|
imports: [AlertComponent, NgIf, LoadingComponent, PaginationComponent, NgFor, RouterLink, NgbTooltipModule, AsyncPipe, TranslateModule, EPersonDataComponent]
|
||||||
})
|
})
|
||||||
export class QualityAssuranceEventsComponent implements OnInit, OnDestroy {
|
export class QualityAssuranceEventsComponent implements OnInit, OnDestroy {
|
||||||
/**
|
/**
|
||||||
|
@@ -19,6 +19,7 @@ import { ObjectCollectionComponent } from '../object-collection/object-collectio
|
|||||||
import { ThemedResultsBackButtonComponent } from '../results-back-button/themed-results-back-button.component';
|
import { ThemedResultsBackButtonComponent } from '../results-back-button/themed-results-back-button.component';
|
||||||
import { NgClass, NgComponentOutlet, NgIf, AsyncPipe } from '@angular/common';
|
import { NgClass, NgComponentOutlet, NgIf, AsyncPipe } from '@angular/common';
|
||||||
import { VarDirective } from '../utils/var.directive';
|
import { VarDirective } from '../utils/var.directive';
|
||||||
|
import { StartsWithLoaderComponent } from '../starts-with/starts-with-loader.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-browse-by',
|
selector: 'ds-browse-by',
|
||||||
@@ -29,7 +30,7 @@ import { VarDirective } from '../utils/var.directive';
|
|||||||
fadeInOut
|
fadeInOut
|
||||||
],
|
],
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [VarDirective, NgClass, NgComponentOutlet, NgIf, ThemedResultsBackButtonComponent, ObjectCollectionComponent, ThemedLoadingComponent, ErrorComponent, AsyncPipe, TranslateModule]
|
imports: [VarDirective, NgClass, NgComponentOutlet, NgIf, ThemedResultsBackButtonComponent, ObjectCollectionComponent, ThemedLoadingComponent, ErrorComponent, AsyncPipe, TranslateModule, StartsWithLoaderComponent]
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* Component to display a browse-by page for any ListableObject
|
* Component to display a browse-by page for any ListableObject
|
||||||
|
@@ -4,11 +4,18 @@ import { BrowseByDataType } from '../../../../browse-by/browse-by-switcher/brows
|
|||||||
import { ActivatedRoute, Data } from '@angular/router';
|
import { ActivatedRoute, Data } from '@angular/router';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import { BrowseDefinition } from '../../../../core/shared/browse-definition.model';
|
import { BrowseDefinition } from '../../../../core/shared/browse-definition.model';
|
||||||
|
import { BrowseBySwitcherComponent } from '../../../../browse-by/browse-by-switcher/browse-by-switcher.component';
|
||||||
|
import { AsyncPipe } from '@angular/common';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-comcol-browse-by',
|
selector: 'ds-comcol-browse-by',
|
||||||
templateUrl: './comcol-browse-by.component.html',
|
templateUrl: './comcol-browse-by.component.html',
|
||||||
styleUrls: ['./comcol-browse-by.component.scss'],
|
styleUrls: ['./comcol-browse-by.component.scss'],
|
||||||
|
imports: [
|
||||||
|
BrowseBySwitcherComponent,
|
||||||
|
AsyncPipe
|
||||||
|
],
|
||||||
|
standalone: true
|
||||||
})
|
})
|
||||||
export class ComcolBrowseByComponent implements OnInit {
|
export class ComcolBrowseByComponent implements OnInit {
|
||||||
|
|
||||||
|
@@ -1,14 +1,16 @@
|
|||||||
import { Component, OnInit, Inject } from '@angular/core';
|
import { Component, Inject, OnInit } from '@angular/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { ActivatedRoute, Data } from '@angular/router';
|
import { ActivatedRoute, Data } from '@angular/router';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component';
|
|
||||||
import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service';
|
import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service';
|
||||||
import { RemoteData } from '../../../../core/data/remote-data';
|
import { RemoteData } from '../../../../core/data/remote-data';
|
||||||
import { Community } from '../../../../core/shared/community.model';
|
import { Community } from '../../../../core/shared/community.model';
|
||||||
import { Collection } from '../../../../core/shared/collection.model';
|
import { Collection } from '../../../../core/shared/collection.model';
|
||||||
import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interface';
|
import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interface';
|
||||||
import { hasValue } from '../../../empty.util';
|
import { hasValue } from '../../../empty.util';
|
||||||
|
import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-configuration.service';
|
||||||
|
import { ThemedSearchComponent } from '../../../search/themed-search.component';
|
||||||
|
import { AsyncPipe } from '@angular/common';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The search tab on community & collection pages
|
* The search tab on community & collection pages
|
||||||
@@ -23,6 +25,11 @@ import { hasValue } from '../../../empty.util';
|
|||||||
useClass: SearchConfigurationService,
|
useClass: SearchConfigurationService,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
imports: [
|
||||||
|
ThemedSearchComponent,
|
||||||
|
AsyncPipe
|
||||||
|
],
|
||||||
|
standalone: true
|
||||||
})
|
})
|
||||||
export class ComcolSearchSectionComponent implements OnInit {
|
export class ComcolSearchSectionComponent implements OnInit {
|
||||||
|
|
||||||
|
@@ -6,7 +6,9 @@ import {
|
|||||||
import { METADATA_REPRESENTATION_COMPONENT_FACTORY } from './metadata-representation.decorator';
|
import { METADATA_REPRESENTATION_COMPONENT_FACTORY } from './metadata-representation.decorator';
|
||||||
import { Context } from '../../core/shared/context.model';
|
import { Context } from '../../core/shared/context.model';
|
||||||
import { GenericConstructor } from '../../core/shared/generic-constructor';
|
import { GenericConstructor } from '../../core/shared/generic-constructor';
|
||||||
import { MetadataRepresentationListElementComponent } from '../object-list/metadata-representation-list-element/metadata-representation-list-element.component';
|
import {
|
||||||
|
MetadataRepresentationListElementComponent
|
||||||
|
} from '../object-list/metadata-representation-list-element/metadata-representation-list-element.component';
|
||||||
import { ThemeService } from '../theme-support/theme.service';
|
import { ThemeService } from '../theme-support/theme.service';
|
||||||
import { AbstractComponentLoaderComponent } from '../abstract-component-loader/abstract-component-loader.component';
|
import { AbstractComponentLoaderComponent } from '../abstract-component-loader/abstract-component-loader.component';
|
||||||
|
|
||||||
@@ -14,7 +16,6 @@ import { AbstractComponentLoaderComponent } from '../abstract-component-loader/a
|
|||||||
selector: 'ds-metadata-representation-loader',
|
selector: 'ds-metadata-representation-loader',
|
||||||
templateUrl: '../abstract-component-loader/abstract-component-loader.component.html',
|
templateUrl: '../abstract-component-loader/abstract-component-loader.component.html',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [MetadataRepresentationDirective]
|
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* Component for determining what component to use depending on the item's entity type (dspace.entity.type), its metadata representation and, optionally, its context
|
* Component for determining what component to use depending on the item's entity type (dspace.entity.type), its metadata representation and, optionally, its context
|
||||||
|
@@ -10,6 +10,7 @@ import { StartsWithAbstractComponent } from './starts-with-abstract.component';
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-starts-with-loader',
|
selector: 'ds-starts-with-loader',
|
||||||
templateUrl: '../abstract-component-loader/abstract-component-loader.component.html',
|
templateUrl: '../abstract-component-loader/abstract-component-loader.component.html',
|
||||||
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class StartsWithLoaderComponent extends AbstractComponentLoaderComponent<StartsWithAbstractComponent> {
|
export class StartsWithLoaderComponent extends AbstractComponentLoaderComponent<StartsWithAbstractComponent> {
|
||||||
|
|
||||||
|
@@ -6,7 +6,8 @@ import { Pipe, PipeTransform } from '@angular/core';
|
|||||||
* @returns An array of substrings.
|
* @returns An array of substrings.
|
||||||
*/
|
*/
|
||||||
@Pipe({
|
@Pipe({
|
||||||
name: 'dsSplit'
|
name: 'dsSplit',
|
||||||
|
standalone: true
|
||||||
})
|
})
|
||||||
export class SplitPipe implements PipeTransform {
|
export class SplitPipe implements PipeTransform {
|
||||||
transform(value: string, separator: string): string[] {
|
transform(value: string, separator: string): string[] {
|
||||||
|
Reference in New Issue
Block a user