mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
113938: Added missing comcol structure to workspace/workflow item breadcrumbs
This commit is contained in:
@@ -180,6 +180,7 @@ import { OrcidHistory } from './orcid/model/orcid-history.model';
|
|||||||
import { OrcidAuthService } from './orcid/orcid-auth.service';
|
import { OrcidAuthService } from './orcid/orcid-auth.service';
|
||||||
import { VocabularyDataService } from './submission/vocabularies/vocabulary.data.service';
|
import { VocabularyDataService } from './submission/vocabularies/vocabulary.data.service';
|
||||||
import { VocabularyEntryDetailsDataService } from './submission/vocabularies/vocabulary-entry-details.data.service';
|
import { VocabularyEntryDetailsDataService } from './submission/vocabularies/vocabulary-entry-details.data.service';
|
||||||
|
import { SubmissionParentBreadcrumbsService } from './submission/submission-parent-breadcrumb.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When not in production, endpoint responses can be mocked for testing purposes
|
* When not in production, endpoint responses can be mocked for testing purposes
|
||||||
@@ -250,6 +251,7 @@ const PROVIDERS = [
|
|||||||
NotificationsService,
|
NotificationsService,
|
||||||
WorkspaceitemDataService,
|
WorkspaceitemDataService,
|
||||||
WorkflowItemDataService,
|
WorkflowItemDataService,
|
||||||
|
SubmissionParentBreadcrumbsService,
|
||||||
UploaderService,
|
UploaderService,
|
||||||
DSpaceObjectDataService,
|
DSpaceObjectDataService,
|
||||||
ConfigurationDataService,
|
ConfigurationDataService,
|
||||||
|
@@ -0,0 +1,14 @@
|
|||||||
|
import { followLink, FollowLinkConfig } from '../../../shared/utils/follow-link-config.model';
|
||||||
|
import { WorkflowItem } from '../models/workflowitem.model';
|
||||||
|
import { WorkspaceItem } from '../models/workspaceitem.model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The self links defined in this list are expected to be requested somewhere in the near future
|
||||||
|
* Requesting them as embeds will limit the number of requests
|
||||||
|
*
|
||||||
|
* Needs to be in a separate file to prevent circular dependencies in webpack.
|
||||||
|
*/
|
||||||
|
export const SUBMISSION_LINKS_TO_FOLLOW: FollowLinkConfig<WorkflowItem | WorkspaceItem>[] = [
|
||||||
|
followLink('item'),
|
||||||
|
followLink('collection'),
|
||||||
|
];
|
@@ -1,12 +1,11 @@
|
|||||||
import { followLink } from '../../../shared/utils/follow-link-config.model';
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
|
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { Store } from '@ngrx/store';
|
|
||||||
import { switchMap } from 'rxjs/operators';
|
import { switchMap } from 'rxjs/operators';
|
||||||
import { RemoteData } from '../../data/remote-data';
|
import { RemoteData } from '../../data/remote-data';
|
||||||
import { getFirstCompletedRemoteData } from '../../shared/operators';
|
import { getFirstCompletedRemoteData } from '../../shared/operators';
|
||||||
import { IdentifiableDataService } from '../../data/base/identifiable-data.service';
|
import { IdentifiableDataService } from '../../data/base/identifiable-data.service';
|
||||||
|
import { SUBMISSION_LINKS_TO_FOLLOW } from './submission-links-to-follow';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class represents a resolver that requests a specific item before the route is activated
|
* This class represents a resolver that requests a specific item before the route is activated
|
||||||
@@ -15,7 +14,6 @@ import { IdentifiableDataService } from '../../data/base/identifiable-data.servi
|
|||||||
export class SubmissionObjectResolver<T> implements Resolve<RemoteData<T>> {
|
export class SubmissionObjectResolver<T> implements Resolve<RemoteData<T>> {
|
||||||
constructor(
|
constructor(
|
||||||
protected dataService: IdentifiableDataService<any>,
|
protected dataService: IdentifiableDataService<any>,
|
||||||
protected store: Store<any>,
|
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,7 +28,7 @@ export class SubmissionObjectResolver<T> implements Resolve<RemoteData<T>> {
|
|||||||
const itemRD$ = this.dataService.findById(route.params.id,
|
const itemRD$ = this.dataService.findById(route.params.id,
|
||||||
true,
|
true,
|
||||||
false,
|
false,
|
||||||
followLink('item'),
|
...SUBMISSION_LINKS_TO_FOLLOW,
|
||||||
).pipe(
|
).pipe(
|
||||||
getFirstCompletedRemoteData(),
|
getFirstCompletedRemoteData(),
|
||||||
switchMap((wfiRD: RemoteData<any>) => wfiRD.payload.item as Observable<RemoteData<T>>),
|
switchMap((wfiRD: RemoteData<any>) => wfiRD.payload.item as Observable<RemoteData<T>>),
|
||||||
|
@@ -0,0 +1,43 @@
|
|||||||
|
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { map } from 'rxjs/operators';
|
||||||
|
import { getFirstCompletedRemoteData, getRemoteDataPayload } from '../../shared/operators';
|
||||||
|
import { IdentifiableDataService } from '../../data/base/identifiable-data.service';
|
||||||
|
import { BreadcrumbConfig } from '../../../breadcrumbs/breadcrumb/breadcrumb-config.model';
|
||||||
|
import { SubmissionParentBreadcrumbsService } from '../submission-parent-breadcrumb.service';
|
||||||
|
import { SUBMISSION_LINKS_TO_FOLLOW } from './submission-links-to-follow';
|
||||||
|
import { SubmissionObject } from '../models/submission-object.model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class represents a resolver that requests a specific item before the route is activated
|
||||||
|
*/
|
||||||
|
export abstract class SubmissionParentBreadcrumbResolver implements Resolve<BreadcrumbConfig<SubmissionObject>> {
|
||||||
|
|
||||||
|
protected constructor(
|
||||||
|
protected dataService: IdentifiableDataService<any>,
|
||||||
|
protected breadcrumbService: SubmissionParentBreadcrumbsService,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method for resolving an item based on the parameters in the current route
|
||||||
|
* @param {ActivatedRouteSnapshot} route The current ActivatedRouteSnapshot
|
||||||
|
* @param {RouterStateSnapshot} state The current RouterStateSnapshot
|
||||||
|
* @returns Observable<<RemoteData<Item>> Emits the found item based on the parameters in the current route,
|
||||||
|
* or an error if something went wrong
|
||||||
|
*/
|
||||||
|
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<BreadcrumbConfig<SubmissionObject>> {
|
||||||
|
return this.dataService.findById(route.params.id,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
...SUBMISSION_LINKS_TO_FOLLOW,
|
||||||
|
).pipe(
|
||||||
|
getFirstCompletedRemoteData(),
|
||||||
|
getRemoteDataPayload(),
|
||||||
|
map((submissionObject: SubmissionObject) => ({
|
||||||
|
provider: this.breadcrumbService,
|
||||||
|
key: submissionObject,
|
||||||
|
} as BreadcrumbConfig<SubmissionObject>)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,59 @@
|
|||||||
|
import { BreadcrumbsProviderService } from '../breadcrumbs/breadcrumbsProviderService';
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Observable, switchMap, combineLatest, of as observableOf } from 'rxjs';
|
||||||
|
import { Breadcrumb } from '../../breadcrumbs/breadcrumb/breadcrumb.model';
|
||||||
|
import { getFirstCompletedRemoteData, getRemoteDataPayload } from '../shared/operators';
|
||||||
|
import { Collection } from '../shared/collection.model';
|
||||||
|
import { DSONameService } from '../breadcrumbs/dso-name.service';
|
||||||
|
import { SubmissionObject } from './models/submission-object.model';
|
||||||
|
import { RemoteData } from '../data/remote-data';
|
||||||
|
import { DSOBreadcrumbsService } from '../breadcrumbs/dso-breadcrumbs.service';
|
||||||
|
import { getDSORoute } from '../../app-routing-paths';
|
||||||
|
import { SubmissionService } from '../../submission/submission.service';
|
||||||
|
import { CollectionDataService } from '../data/collection-data.service';
|
||||||
|
import { hasValue } from '../../shared/empty.util';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Service to calculate the parent {@link DSpaceObject} breadcrumbs for a {@link SubmissionObject}
|
||||||
|
*/
|
||||||
|
@Injectable()
|
||||||
|
export class SubmissionParentBreadcrumbsService implements BreadcrumbsProviderService<SubmissionObject> {
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
protected dsoNameService: DSONameService,
|
||||||
|
protected dsoBreadcrumbsService: DSOBreadcrumbsService,
|
||||||
|
protected submissionService: SubmissionService,
|
||||||
|
protected collectionService: CollectionDataService,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates the parent breadcrumb structure for {@link SubmissionObject}s. It also automatically recreates the
|
||||||
|
* parent breadcrumb structure when you change a {@link SubmissionObject}'s by dispatching a
|
||||||
|
* {@link ChangeSubmissionCollectionAction}.
|
||||||
|
*
|
||||||
|
* @param submissionObject The {@link SubmissionObject} for which the parent breadcrumb structure needs to be created
|
||||||
|
*/
|
||||||
|
getBreadcrumbs(submissionObject: SubmissionObject): Observable<Breadcrumb[]> {
|
||||||
|
return combineLatest([
|
||||||
|
(submissionObject.collection as Observable<RemoteData<Collection>>).pipe(
|
||||||
|
getFirstCompletedRemoteData(),
|
||||||
|
getRemoteDataPayload(),
|
||||||
|
),
|
||||||
|
this.submissionService.getSubmissionCollectionId(submissionObject.id),
|
||||||
|
]).pipe(
|
||||||
|
switchMap(([collection, latestCollectionId]: [Collection, string]) => {
|
||||||
|
if (hasValue(latestCollectionId)) {
|
||||||
|
return this.collectionService.findById(latestCollectionId).pipe(
|
||||||
|
getFirstCompletedRemoteData(),
|
||||||
|
getRemoteDataPayload(),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return observableOf(collection);
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
switchMap((collection: Collection) => this.dsoBreadcrumbsService.getBreadcrumbs(collection, getDSORoute(collection))),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -4,7 +4,7 @@ import { Router } from '@angular/router';
|
|||||||
|
|
||||||
import { Observable, of as observableOf, Subscription, timer as observableTimer } from 'rxjs';
|
import { Observable, of as observableOf, Subscription, timer as observableTimer } from 'rxjs';
|
||||||
import { catchError, concatMap, distinctUntilChanged, filter, find, map, startWith, take, tap } from 'rxjs/operators';
|
import { catchError, concatMap, distinctUntilChanged, filter, find, map, startWith, take, tap } from 'rxjs/operators';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store, MemoizedSelector, createSelector, select } from '@ngrx/store';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { submissionSelector, SubmissionState } from './submission.reducers';
|
import { submissionSelector, SubmissionState } from './submission.reducers';
|
||||||
@@ -47,6 +47,20 @@ import { SubmissionJsonPatchOperationsService } from '../core/submission/submiss
|
|||||||
import { SubmissionSectionObject } from './objects/submission-section-object.model';
|
import { SubmissionSectionObject } from './objects/submission-section-object.model';
|
||||||
import { SubmissionError } from './objects/submission-error.model';
|
import { SubmissionError } from './objects/submission-error.model';
|
||||||
|
|
||||||
|
function getSubmissionSelector(submissionId: string): MemoizedSelector<SubmissionState, SubmissionObjectEntry> {
|
||||||
|
return createSelector(
|
||||||
|
submissionSelector,
|
||||||
|
(state: SubmissionState) => state.objects[submissionId],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSubmissionCollectionIdSelector(submissionId: string): MemoizedSelector<SubmissionState, string> {
|
||||||
|
return createSelector(
|
||||||
|
getSubmissionSelector(submissionId),
|
||||||
|
(submission: SubmissionObjectEntry) => submission?.collection,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A service that provides methods used in submission process.
|
* A service that provides methods used in submission process.
|
||||||
*/
|
*/
|
||||||
@@ -96,10 +110,19 @@ export class SubmissionService {
|
|||||||
* @param collectionId
|
* @param collectionId
|
||||||
* The collection id
|
* The collection id
|
||||||
*/
|
*/
|
||||||
changeSubmissionCollection(submissionId, collectionId) {
|
changeSubmissionCollection(submissionId: string, collectionId: string): void {
|
||||||
this.store.dispatch(new ChangeSubmissionCollectionAction(submissionId, collectionId));
|
this.store.dispatch(new ChangeSubmissionCollectionAction(submissionId, collectionId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Listen to collection changes for a certain {@link SubmissionObject}
|
||||||
|
*
|
||||||
|
* @param submissionId The submission id
|
||||||
|
*/
|
||||||
|
getSubmissionCollectionId(submissionId: string): Observable<string> {
|
||||||
|
return this.store.pipe(select(getSubmissionCollectionIdSelector(submissionId)));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform a REST call to create a new workspaceitem and return response
|
* Perform a REST call to create a new workspaceitem and return response
|
||||||
*
|
*
|
||||||
|
@@ -0,0 +1,22 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Resolve } from '@angular/router';
|
||||||
|
import { WorkflowItemDataService } from '../core/submission/workflowitem-data.service';
|
||||||
|
import { SubmissionParentBreadcrumbResolver } from '../core/submission/resolver/submission-parent-breadcrumb.resolver';
|
||||||
|
import { BreadcrumbConfig } from '../breadcrumbs/breadcrumb/breadcrumb-config.model';
|
||||||
|
import { SubmissionParentBreadcrumbsService } from '../core/submission/submission-parent-breadcrumb.service';
|
||||||
|
import { SubmissionObject } from '../core/submission/models/submission-object.model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class represents a resolver that retrieves the breadcrumbs of the workflow item
|
||||||
|
*/
|
||||||
|
@Injectable()
|
||||||
|
export class ItemFromWorkflowBreadcrumbResolver extends SubmissionParentBreadcrumbResolver implements Resolve<BreadcrumbConfig<SubmissionObject>> {
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
protected dataService: WorkflowItemDataService,
|
||||||
|
protected breadcrumbService: SubmissionParentBreadcrumbsService,
|
||||||
|
) {
|
||||||
|
super(dataService, breadcrumbService);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -19,7 +19,7 @@ describe('ItemFromWorkflowResolver', () => {
|
|||||||
wfiService = {
|
wfiService = {
|
||||||
findById: (id: string) => createSuccessfulRemoteDataObject$(wfi)
|
findById: (id: string) => createSuccessfulRemoteDataObject$(wfi)
|
||||||
} as any;
|
} as any;
|
||||||
resolver = new ItemFromWorkflowResolver(wfiService, null);
|
resolver = new ItemFromWorkflowResolver(wfiService);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should resolve a an item from from the workflow item with the correct id', (done) => {
|
it('should resolve a an item from from the workflow item with the correct id', (done) => {
|
||||||
|
@@ -2,7 +2,6 @@ import { Injectable } from '@angular/core';
|
|||||||
import { Resolve } from '@angular/router';
|
import { Resolve } from '@angular/router';
|
||||||
import { RemoteData } from '../core/data/remote-data';
|
import { RemoteData } from '../core/data/remote-data';
|
||||||
import { Item } from '../core/shared/item.model';
|
import { Item } from '../core/shared/item.model';
|
||||||
import { Store } from '@ngrx/store';
|
|
||||||
import { WorkflowItemDataService } from '../core/submission/workflowitem-data.service';
|
import { WorkflowItemDataService } from '../core/submission/workflowitem-data.service';
|
||||||
import { SubmissionObjectResolver } from '../core/submission/resolver/submission-object.resolver';
|
import { SubmissionObjectResolver } from '../core/submission/resolver/submission-object.resolver';
|
||||||
|
|
||||||
@@ -10,12 +9,12 @@ import { SubmissionObjectResolver } from '../core/submission/resolver/submission
|
|||||||
* This class represents a resolver that requests a specific item before the route is activated
|
* This class represents a resolver that requests a specific item before the route is activated
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ItemFromWorkflowResolver extends SubmissionObjectResolver<Item> implements Resolve<RemoteData<Item>> {
|
export class ItemFromWorkflowResolver extends SubmissionObjectResolver<Item> implements Resolve<RemoteData<Item>> {
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private workflowItemService: WorkflowItemDataService,
|
protected dataService: WorkflowItemDataService,
|
||||||
protected store: Store<any>
|
|
||||||
) {
|
) {
|
||||||
super(workflowItemService, store);
|
super(dataService);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -15,13 +15,17 @@ import { ThemedWorkflowItemSendBackComponent } from './workflow-item-send-back/t
|
|||||||
import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
|
import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||||
import { ItemFromWorkflowResolver } from './item-from-workflow.resolver';
|
import { ItemFromWorkflowResolver } from './item-from-workflow.resolver';
|
||||||
import { ThemedFullItemPageComponent } from '../item-page/full/themed-full-item-page.component';
|
import { ThemedFullItemPageComponent } from '../item-page/full/themed-full-item-page.component';
|
||||||
|
import { ItemFromWorkflowBreadcrumbResolver } from './item-from-workflow-breadcrumb.resolver';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
RouterModule.forChild([
|
RouterModule.forChild([
|
||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
resolve: { wfi: WorkflowItemPageResolver },
|
resolve: {
|
||||||
|
breadcrumb: ItemFromWorkflowBreadcrumbResolver,
|
||||||
|
wfi: WorkflowItemPageResolver,
|
||||||
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
canActivate: [AuthenticatedGuard],
|
canActivate: [AuthenticatedGuard],
|
||||||
@@ -64,7 +68,11 @@ import { ThemedFullItemPageComponent } from '../item-page/full/themed-full-item-
|
|||||||
}]
|
}]
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
providers: [WorkflowItemPageResolver, ItemFromWorkflowResolver]
|
providers: [
|
||||||
|
ItemFromWorkflowBreadcrumbResolver,
|
||||||
|
ItemFromWorkflowResolver,
|
||||||
|
WorkflowItemPageResolver,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* This module defines the default component to load when navigating to the workflowitems edit page path.
|
* This module defines the default component to load when navigating to the workflowitems edit page path.
|
||||||
|
@@ -0,0 +1,22 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Resolve } from '@angular/router';
|
||||||
|
import { WorkspaceitemDataService } from '../core/submission/workspaceitem-data.service';
|
||||||
|
import { SubmissionParentBreadcrumbResolver } from '../core/submission/resolver/submission-parent-breadcrumb.resolver';
|
||||||
|
import { BreadcrumbConfig } from '../breadcrumbs/breadcrumb/breadcrumb-config.model';
|
||||||
|
import { SubmissionParentBreadcrumbsService } from '../core/submission/submission-parent-breadcrumb.service';
|
||||||
|
import { SubmissionObject } from '../core/submission/models/submission-object.model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class represents a resolver that retrieves the breadcrumbs of the workspace item
|
||||||
|
*/
|
||||||
|
@Injectable()
|
||||||
|
export class ItemFromWorkspaceBreadcrumbResolver extends SubmissionParentBreadcrumbResolver implements Resolve<BreadcrumbConfig<SubmissionObject>> {
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
protected dataService: WorkspaceitemDataService,
|
||||||
|
protected breadcrumbService: SubmissionParentBreadcrumbsService,
|
||||||
|
) {
|
||||||
|
super(dataService, breadcrumbService);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -19,7 +19,7 @@ describe('ItemFromWorkspaceResolver', () => {
|
|||||||
wfiService = {
|
wfiService = {
|
||||||
findById: (id: string) => createSuccessfulRemoteDataObject$(wfi)
|
findById: (id: string) => createSuccessfulRemoteDataObject$(wfi)
|
||||||
} as any;
|
} as any;
|
||||||
resolver = new ItemFromWorkspaceResolver(wfiService, null);
|
resolver = new ItemFromWorkspaceResolver(wfiService);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should resolve a an item from from the workflow item with the correct id', (done) => {
|
it('should resolve a an item from from the workflow item with the correct id', (done) => {
|
||||||
|
@@ -2,7 +2,6 @@ import { Injectable } from '@angular/core';
|
|||||||
import { Resolve } from '@angular/router';
|
import { Resolve } from '@angular/router';
|
||||||
import { RemoteData } from '../core/data/remote-data';
|
import { RemoteData } from '../core/data/remote-data';
|
||||||
import { Item } from '../core/shared/item.model';
|
import { Item } from '../core/shared/item.model';
|
||||||
import { Store } from '@ngrx/store';
|
|
||||||
import { SubmissionObjectResolver } from '../core/submission/resolver/submission-object.resolver';
|
import { SubmissionObjectResolver } from '../core/submission/resolver/submission-object.resolver';
|
||||||
import { WorkspaceitemDataService } from '../core/submission/workspaceitem-data.service';
|
import { WorkspaceitemDataService } from '../core/submission/workspaceitem-data.service';
|
||||||
|
|
||||||
@@ -10,12 +9,12 @@ import { WorkspaceitemDataService } from '../core/submission/workspaceitem-data.
|
|||||||
* This class represents a resolver that requests a specific item before the route is activated
|
* This class represents a resolver that requests a specific item before the route is activated
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ItemFromWorkspaceResolver extends SubmissionObjectResolver<Item> implements Resolve<RemoteData<Item>> {
|
export class ItemFromWorkspaceResolver extends SubmissionObjectResolver<Item> implements Resolve<RemoteData<Item>> {
|
||||||
constructor(
|
|
||||||
private workspaceItemService: WorkspaceitemDataService,
|
constructor(
|
||||||
protected store: Store<any>
|
protected dataService: WorkspaceitemDataService,
|
||||||
) {
|
) {
|
||||||
super(workspaceItemService, store);
|
super(dataService);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -7,6 +7,7 @@ import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.reso
|
|||||||
import { ThemedFullItemPageComponent } from '../item-page/full/themed-full-item-page.component';
|
import { ThemedFullItemPageComponent } from '../item-page/full/themed-full-item-page.component';
|
||||||
import { ItemFromWorkspaceResolver } from './item-from-workspace.resolver';
|
import { ItemFromWorkspaceResolver } from './item-from-workspace.resolver';
|
||||||
import { WorkspaceItemPageResolver } from './workspace-item-page.resolver';
|
import { WorkspaceItemPageResolver } from './workspace-item-page.resolver';
|
||||||
|
import { ItemFromWorkspaceBreadcrumbResolver } from './item-from-workspace-breadcrumb.resolver';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -14,7 +15,10 @@ import { WorkspaceItemPageResolver } from './workspace-item-page.resolver';
|
|||||||
{ path: '', redirectTo: '/home', pathMatch: 'full' },
|
{ path: '', redirectTo: '/home', pathMatch: 'full' },
|
||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
resolve: { wsi: WorkspaceItemPageResolver },
|
resolve: {
|
||||||
|
breadcrumb: ItemFromWorkspaceBreadcrumbResolver,
|
||||||
|
wsi: WorkspaceItemPageResolver,
|
||||||
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
canActivate: [AuthenticatedGuard],
|
canActivate: [AuthenticatedGuard],
|
||||||
@@ -39,7 +43,11 @@ import { WorkspaceItemPageResolver } from './workspace-item-page.resolver';
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
],
|
],
|
||||||
providers: [WorkspaceItemPageResolver, ItemFromWorkspaceResolver]
|
providers: [
|
||||||
|
ItemFromWorkspaceBreadcrumbResolver,
|
||||||
|
ItemFromWorkspaceResolver,
|
||||||
|
WorkspaceItemPageResolver,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* This module defines the default component to load when navigating to the workspaceitems edit page path
|
* This module defines the default component to load when navigating to the workspaceitems edit page path
|
||||||
|
Reference in New Issue
Block a user