mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 02:24:11 +00:00
split up submission context
This commit is contained in:
@@ -39,7 +39,8 @@
|
||||
</button>
|
||||
</div>
|
||||
<ds-my-dspace-results [searchResults]="resultsRD$ | async"
|
||||
[searchConfig]="searchOptions$ | async"></ds-my-dspace-results>
|
||||
[searchConfig]="searchOptions$ | async"
|
||||
[context]="context$ | async"></ds-my-dspace-results>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -8,7 +8,7 @@ import {
|
||||
} from '@angular/core';
|
||||
|
||||
import { BehaviorSubject, Observable, Subscription } from 'rxjs';
|
||||
import { switchMap, tap, } from 'rxjs/operators';
|
||||
import { map, switchMap, tap, } from 'rxjs/operators';
|
||||
|
||||
import { PaginatedList } from '../core/data/paginated-list';
|
||||
import { RemoteData } from '../core/data/remote-data';
|
||||
@@ -28,6 +28,7 @@ import { MyDSpaceConfigurationService } from './my-dspace-configuration.service'
|
||||
import { ViewMode } from '../core/shared/view-mode.model';
|
||||
import { MyDSpaceRequest } from '../core/data/request.models';
|
||||
import { SearchResult } from '../+search-page/search-result.model';
|
||||
import { Context } from '../core/shared/context.model';
|
||||
|
||||
export const MYDSPACE_ROUTE = '/mydspace';
|
||||
export const SEARCH_CONFIG_SERVICE: InjectionToken<SearchConfigurationService> = new InjectionToken<SearchConfigurationService>('searchConfigurationService');
|
||||
@@ -95,6 +96,8 @@ export class MyDSpacePageComponent implements OnInit {
|
||||
*/
|
||||
viewModeList = [ViewMode.ListElement, ViewMode.DetailedListElement];
|
||||
|
||||
context$: Observable<Context>;
|
||||
|
||||
constructor(private service: SearchService,
|
||||
private sidebarService: SearchSidebarService,
|
||||
private windowService: HostWindowService,
|
||||
@@ -126,6 +129,17 @@ export class MyDSpacePageComponent implements OnInit {
|
||||
switchMap((scopeId) => this.service.getScopes(scopeId))
|
||||
);
|
||||
|
||||
this.context$ = this.searchConfigService.getCurrentConfiguration('workspace')
|
||||
.pipe(
|
||||
map((configuration: string) => {
|
||||
if (configuration === 'workspace') {
|
||||
return Context.Workspace
|
||||
} else {
|
||||
return Context.Workflow
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -37,7 +37,7 @@ export class MyDSpaceResultsComponent {
|
||||
*/
|
||||
@Input() viewMode: ViewMode;
|
||||
|
||||
context = Context.Submission;
|
||||
@Input() context: Context;
|
||||
/**
|
||||
* A boolean representing if search results entry are separated by a line
|
||||
*/
|
||||
|
@@ -6,7 +6,8 @@ export enum Context {
|
||||
Undefined = 'undefined',
|
||||
ItemPage = 'itemPage',
|
||||
Search = 'search',
|
||||
Submission = 'submission',
|
||||
Workflow = 'workflow',
|
||||
Workspace = 'workspace',
|
||||
AdminMenu = 'adminMenu',
|
||||
SubmissionModal = 'submissionModal',
|
||||
}
|
||||
|
@@ -17,7 +17,8 @@ import { SearchResultListElementComponent } from '../../search-result-list-eleme
|
||||
templateUrl: './item-search-result-list-element-submission.component.html'
|
||||
})
|
||||
|
||||
@listableObjectComponent(ItemSearchResult, ViewMode.ListElement, Context.Submission)
|
||||
@listableObjectComponent(ItemSearchResult, ViewMode.ListElement, Context.Workspace)
|
||||
@listableObjectComponent(ItemSearchResult, ViewMode.ListElement, Context.Workflow)
|
||||
export class ItemSearchResultListElementSubmissionComponent extends SearchResultListElementComponent<ItemSearchResult, Item> implements OnInit {
|
||||
/**
|
||||
* Represent item's status
|
||||
|
Reference in New Issue
Block a user