forked from hazza/dspace-angular
[DURACOM-191] Remove edit-item-page.module and item-versions.module.ts
This commit is contained in:
@@ -13,16 +13,15 @@ import {
|
|||||||
map,
|
map,
|
||||||
Observable,
|
Observable,
|
||||||
} from 'rxjs';
|
} from 'rxjs';
|
||||||
import {
|
import { getFirstCompletedRemoteData } from 'src/app/core/shared/operators';
|
||||||
getFirstCompletedRemoteData,
|
|
||||||
getPaginatedListPayload,
|
|
||||||
getRemoteDataPayload,
|
|
||||||
} from 'src/app/core/shared/operators';
|
|
||||||
|
|
||||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
||||||
import { FeatureID } from '../../core/data/feature-authorization/feature-id';
|
import { FeatureID } from '../../core/data/feature-authorization/feature-id';
|
||||||
|
import { PaginatedList } from '../../core/data/paginated-list.model';
|
||||||
|
import { RemoteData } from '../../core/data/remote-data';
|
||||||
import { Item } from '../../core/shared/item.model';
|
import { Item } from '../../core/shared/item.model';
|
||||||
import { CorrectionTypeDataService } from '../../core/submission/correctiontype-data.service';
|
import { CorrectionTypeDataService } from '../../core/submission/correctiontype-data.service';
|
||||||
|
import { CorrectionType } from '../../core/submission/models/correctiontype.model';
|
||||||
import { AlertComponent } from '../../shared/alert/alert.component';
|
import { AlertComponent } from '../../shared/alert/alert.component';
|
||||||
import { AlertType } from '../../shared/alert/alert-type';
|
import { AlertType } from '../../shared/alert/alert-type';
|
||||||
import {
|
import {
|
||||||
@@ -73,8 +72,7 @@ export class ItemAlertsComponent {
|
|||||||
showReinstateButton$(): Observable<boolean> {
|
showReinstateButton$(): Observable<boolean> {
|
||||||
const correction$ = this.correctionTypeDataService.findByItem(this.item.uuid, true).pipe(
|
const correction$ = this.correctionTypeDataService.findByItem(this.item.uuid, true).pipe(
|
||||||
getFirstCompletedRemoteData(),
|
getFirstCompletedRemoteData(),
|
||||||
getRemoteDataPayload(),
|
map((correctionTypeRD: RemoteData<PaginatedList<CorrectionType>>) => correctionTypeRD.hasSucceeded ? correctionTypeRD.payload.page : []),
|
||||||
getPaginatedListPayload(),
|
|
||||||
);
|
);
|
||||||
const isAdmin$ = this.authService.isAuthorized(FeatureID.AdministratorOf);
|
const isAdmin$ = this.authService.isAuthorized(FeatureID.AdministratorOf);
|
||||||
return combineLatest([isAdmin$, correction$]).pipe(
|
return combineLatest([isAdmin$, correction$]).pipe(
|
||||||
|
@@ -1,96 +0,0 @@
|
|||||||
import { DragDropModule } from '@angular/cdk/drag-drop';
|
|
||||||
import { CommonModule } from '@angular/common';
|
|
||||||
import { NgModule } from '@angular/core';
|
|
||||||
import {
|
|
||||||
NgbModule,
|
|
||||||
NgbTooltipModule,
|
|
||||||
} from '@ng-bootstrap/ng-bootstrap';
|
|
||||||
|
|
||||||
import { BundleDataService } from '../../core/data/bundle-data.service';
|
|
||||||
import { IdentifierDataService } from '../../core/data/identifier-data.service';
|
|
||||||
import { SearchPageModule } from '../../search-page/search-page.module';
|
|
||||||
import { IdentifierDataComponent } from '../../shared/object-list/identifier-data/identifier-data.component';
|
|
||||||
import { ResourcePoliciesModule } from '../../shared/resource-policies/resource-policies.module';
|
|
||||||
import { ObjectValuesPipe } from '../../shared/utils/object-values-pipe';
|
|
||||||
import { ItemVersionsModule } from '../versions/item-versions.module';
|
|
||||||
import { AbstractItemUpdateComponent } from './abstract-item-update/abstract-item-update.component';
|
|
||||||
import { EditItemPageComponent } from './edit-item-page.component';
|
|
||||||
import { ItemAccessControlComponent } from './item-access-control/item-access-control.component';
|
|
||||||
import { ItemAuthorizationsComponent } from './item-authorizations/item-authorizations.component';
|
|
||||||
import { ItemBitstreamsComponent } from './item-bitstreams/item-bitstreams.component';
|
|
||||||
import { ItemEditBitstreamComponent } from './item-bitstreams/item-edit-bitstream/item-edit-bitstream.component';
|
|
||||||
import { ItemEditBitstreamBundleComponent } from './item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component';
|
|
||||||
import { PaginatedDragAndDropBitstreamListComponent } from './item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component';
|
|
||||||
import { ItemEditBitstreamDragHandleComponent } from './item-bitstreams/item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component';
|
|
||||||
import { ItemCollectionMapperComponent } from './item-collection-mapper/item-collection-mapper.component';
|
|
||||||
import { ItemCurateComponent } from './item-curate/item-curate.component';
|
|
||||||
import { ItemDeleteComponent } from './item-delete/item-delete.component';
|
|
||||||
import { ItemMoveComponent } from './item-move/item-move.component';
|
|
||||||
import { ItemOperationComponent } from './item-operation/item-operation.component';
|
|
||||||
import { ItemPrivateComponent } from './item-private/item-private.component';
|
|
||||||
import { ItemPublicComponent } from './item-public/item-public.component';
|
|
||||||
import { ItemRegisterDoiComponent } from './item-register-doi/item-register-doi.component';
|
|
||||||
import { ItemReinstateComponent } from './item-reinstate/item-reinstate.component';
|
|
||||||
import { EditRelationshipComponent } from './item-relationships/edit-relationship/edit-relationship.component';
|
|
||||||
import { EditRelationshipListComponent } from './item-relationships/edit-relationship-list/edit-relationship-list.component';
|
|
||||||
import { ItemRelationshipsComponent } from './item-relationships/item-relationships.component';
|
|
||||||
import { ItemStatusComponent } from './item-status/item-status.component';
|
|
||||||
import { ThemedItemStatusComponent } from './item-status/themed-item-status.component';
|
|
||||||
import { ItemVersionHistoryComponent } from './item-version-history/item-version-history.component';
|
|
||||||
import { ItemWithdrawComponent } from './item-withdraw/item-withdraw.component';
|
|
||||||
import { AbstractSimpleItemActionComponent } from './simple-item-action/abstract-simple-item-action.component';
|
|
||||||
import { VirtualMetadataComponent } from './virtual-metadata/virtual-metadata.component';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Module that contains all components related to the Edit Item page administrator functionality
|
|
||||||
*/
|
|
||||||
@NgModule({
|
|
||||||
imports: [
|
|
||||||
CommonModule,
|
|
||||||
NgbTooltipModule,
|
|
||||||
SearchPageModule,
|
|
||||||
DragDropModule,
|
|
||||||
ResourcePoliciesModule,
|
|
||||||
NgbModule,
|
|
||||||
ItemVersionsModule,
|
|
||||||
EditItemPageComponent,
|
|
||||||
ItemOperationComponent,
|
|
||||||
AbstractSimpleItemActionComponent,
|
|
||||||
AbstractItemUpdateComponent,
|
|
||||||
ItemWithdrawComponent,
|
|
||||||
ItemReinstateComponent,
|
|
||||||
ItemPrivateComponent,
|
|
||||||
ItemPublicComponent,
|
|
||||||
ItemDeleteComponent,
|
|
||||||
ItemStatusComponent,
|
|
||||||
ThemedItemStatusComponent,
|
|
||||||
ItemRelationshipsComponent,
|
|
||||||
ItemBitstreamsComponent,
|
|
||||||
ItemVersionHistoryComponent,
|
|
||||||
ItemEditBitstreamComponent,
|
|
||||||
ItemEditBitstreamBundleComponent,
|
|
||||||
PaginatedDragAndDropBitstreamListComponent,
|
|
||||||
EditRelationshipComponent,
|
|
||||||
EditRelationshipListComponent,
|
|
||||||
ItemCollectionMapperComponent,
|
|
||||||
ItemMoveComponent,
|
|
||||||
ItemEditBitstreamDragHandleComponent,
|
|
||||||
VirtualMetadataComponent,
|
|
||||||
ItemAuthorizationsComponent,
|
|
||||||
IdentifierDataComponent,
|
|
||||||
ItemRegisterDoiComponent,
|
|
||||||
ItemCurateComponent,
|
|
||||||
ItemAccessControlComponent,
|
|
||||||
],
|
|
||||||
providers: [
|
|
||||||
BundleDataService,
|
|
||||||
IdentifierDataService,
|
|
||||||
ObjectValuesPipe,
|
|
||||||
],
|
|
||||||
exports: [
|
|
||||||
ItemOperationComponent,
|
|
||||||
],
|
|
||||||
})
|
|
||||||
export class EditItemPageModule {
|
|
||||||
|
|
||||||
}
|
|
@@ -1,29 +0,0 @@
|
|||||||
/**
|
|
||||||
* 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 { NgModule } from '@angular/core';
|
|
||||||
|
|
||||||
import { ItemVersionsComponent } from './item-versions.component';
|
|
||||||
import { ItemVersionsNoticeComponent } from './notice/item-versions-notice.component';
|
|
||||||
|
|
||||||
const DECLARATIONS = [
|
|
||||||
ItemVersionsComponent,
|
|
||||||
ItemVersionsNoticeComponent,
|
|
||||||
];
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [
|
|
||||||
...DECLARATIONS,
|
|
||||||
],
|
|
||||||
exports: [
|
|
||||||
...DECLARATIONS,
|
|
||||||
],
|
|
||||||
})
|
|
||||||
export class ItemVersionsModule {
|
|
||||||
|
|
||||||
}
|
|
@@ -1,4 +1,4 @@
|
|||||||
<ds-alert *ngIf="showLatestVersionNotice$ && (showLatestVersionNotice$ | async)"
|
<ds-alert *ngIf="(showLatestVersionNotice$ | async) === true"
|
||||||
[content]="('item.version.notice' | translate:{ destination: getItemPage(((latestVersion$ | async)?.item | async)?.payload) })"
|
[content]="('item.version.notice' | translate:{ destination: getItemPage(((latestVersion$ | async)?.item | async)?.payload) })"
|
||||||
[dismissible]="false"
|
[dismissible]="false"
|
||||||
[type]="AlertTypeEnum.Warning">
|
[type]="AlertTypeEnum.Warning">
|
||||||
|
@@ -8,7 +8,11 @@ import {
|
|||||||
OnInit,
|
OnInit,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { Observable } from 'rxjs';
|
import {
|
||||||
|
EMPTY,
|
||||||
|
Observable,
|
||||||
|
of,
|
||||||
|
} from 'rxjs';
|
||||||
import {
|
import {
|
||||||
map,
|
map,
|
||||||
startWith,
|
startWith,
|
||||||
@@ -20,7 +24,7 @@ import { VersionHistoryDataService } from '../../../core/data/version-history-da
|
|||||||
import { Item } from '../../../core/shared/item.model';
|
import { Item } from '../../../core/shared/item.model';
|
||||||
import {
|
import {
|
||||||
getAllSucceededRemoteData,
|
getAllSucceededRemoteData,
|
||||||
getFirstSucceededRemoteDataPayload,
|
getFirstCompletedRemoteData,
|
||||||
getRemoteDataPayload,
|
getRemoteDataPayload,
|
||||||
} from '../../../core/shared/operators';
|
} from '../../../core/shared/operators';
|
||||||
import { Version } from '../../../core/shared/version.model';
|
import { Version } from '../../../core/shared/version.model';
|
||||||
@@ -97,14 +101,27 @@ export class ItemVersionsNoticeComponent implements OnInit {
|
|||||||
);
|
);
|
||||||
|
|
||||||
this.latestVersion$ = this.versionHistoryRD$.pipe(
|
this.latestVersion$ = this.versionHistoryRD$.pipe(
|
||||||
getFirstSucceededRemoteDataPayload(),
|
getFirstCompletedRemoteData(),
|
||||||
switchMap((vh) => this.versionHistoryService.getLatestVersionFromHistory$(vh)),
|
switchMap((vhRD: RemoteData<VersionHistory>) => {
|
||||||
|
if (vhRD.hasSucceeded) {
|
||||||
|
return this.versionHistoryService.getLatestVersionFromHistory$(vhRD.payload);
|
||||||
|
} else {
|
||||||
|
return EMPTY;
|
||||||
|
}
|
||||||
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
this.showLatestVersionNotice$ = this.versionRD$.pipe(
|
this.showLatestVersionNotice$ = this.versionRD$.pipe(
|
||||||
getFirstSucceededRemoteDataPayload(),
|
getFirstCompletedRemoteData(),
|
||||||
switchMap((version) => this.versionHistoryService.isLatest$(version)),
|
switchMap((versionRD: RemoteData<Version>) => {
|
||||||
map((isLatest) => isLatest != null && !isLatest),
|
if (versionRD.hasSucceeded) {
|
||||||
|
return this.versionHistoryService.isLatest$(versionRD.payload).pipe(
|
||||||
|
map((isLatest) => isLatest != null && !isLatest),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return of(false);
|
||||||
|
}
|
||||||
|
}),
|
||||||
startWith(false),
|
startWith(false),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -13,8 +13,6 @@ import { ScrollToModule } from '@nicky-lenaers/ngx-scroll-to';
|
|||||||
import { IdlePreloadModule } from 'angular-idle-preload';
|
import { IdlePreloadModule } from 'angular-idle-preload';
|
||||||
|
|
||||||
import { AppModule } from '../../app/app.module';
|
import { AppModule } from '../../app/app.module';
|
||||||
import { EditItemPageModule } from '../../app/item-page/edit-item-page/edit-item-page.module';
|
|
||||||
import { ItemVersionsModule } from '../../app/item-page/versions/item-versions.module';
|
|
||||||
import { NavbarModule } from '../../app/navbar/navbar.module';
|
import { NavbarModule } from '../../app/navbar/navbar.module';
|
||||||
import { RegisterEmailFormModule } from '../../app/register-email-form/register-email-form.module';
|
import { RegisterEmailFormModule } from '../../app/register-email-form/register-email-form.module';
|
||||||
import { RootModule } from '../../app/root.module';
|
import { RootModule } from '../../app/root.module';
|
||||||
@@ -205,8 +203,6 @@ const DECLARATIONS = [
|
|||||||
RootModule,
|
RootModule,
|
||||||
CommonModule,
|
CommonModule,
|
||||||
DragDropModule,
|
DragDropModule,
|
||||||
EditItemPageModule,
|
|
||||||
ItemVersionsModule,
|
|
||||||
FormsModule,
|
FormsModule,
|
||||||
HttpClientModule,
|
HttpClientModule,
|
||||||
IdlePreloadModule,
|
IdlePreloadModule,
|
||||||
|
@@ -12,8 +12,6 @@ import { ScrollToModule } from '@nicky-lenaers/ngx-scroll-to';
|
|||||||
import { IdlePreloadModule } from 'angular-idle-preload';
|
import { IdlePreloadModule } from 'angular-idle-preload';
|
||||||
|
|
||||||
import { AppModule } from '../../app/app.module';
|
import { AppModule } from '../../app/app.module';
|
||||||
import { EditItemPageModule } from '../../app/item-page/edit-item-page/edit-item-page.module';
|
|
||||||
import { ItemVersionsModule } from '../../app/item-page/versions/item-versions.module';
|
|
||||||
import { NavbarModule } from '../../app/navbar/navbar.module';
|
import { NavbarModule } from '../../app/navbar/navbar.module';
|
||||||
import { RegisterEmailFormModule } from '../../app/register-email-form/register-email-form.module';
|
import { RegisterEmailFormModule } from '../../app/register-email-form/register-email-form.module';
|
||||||
import { RootModule } from '../../app/root.module';
|
import { RootModule } from '../../app/root.module';
|
||||||
@@ -35,8 +33,6 @@ const DECLARATIONS = [
|
|||||||
RootModule,
|
RootModule,
|
||||||
CommonModule,
|
CommonModule,
|
||||||
DragDropModule,
|
DragDropModule,
|
||||||
EditItemPageModule,
|
|
||||||
ItemVersionsModule,
|
|
||||||
FormsModule,
|
FormsModule,
|
||||||
HttpClientModule,
|
HttpClientModule,
|
||||||
IdlePreloadModule,
|
IdlePreloadModule,
|
||||||
|
Reference in New Issue
Block a user