Skip to content
Snippets Groups Projects
Commit 3a37f9be authored by Ben Bosman's avatar Ben Bosman
Browse files

submit to this collection

parent feced9f8
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,7 @@ import { CreateCollectionParentSelectorComponent } from '../../shared/dso-select
import { EditItemSelectorComponent } from '../../shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component';
import { EditCommunitySelectorComponent } from '../../shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component';
import { EditCollectionSelectorComponent } from '../../shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component';
import {CreateItemParentSelectorComponent} from '../../shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component';
/**
* Component representing the admin sidebar
......@@ -137,18 +138,18 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
parentID: 'new',
active: false,
visible: true,
// model: {
// type: MenuItemType.ONCLICK,
// text: 'menu.section.new_item',
// function: () => {
// this.modalService.open(CreateItemParentSelectorComponent);
// }
// } as OnClickMenuItemModel,
model: {
type: MenuItemType.LINK,
type: MenuItemType.ONCLICK,
text: 'menu.section.new_item',
link: '/submit'
} as LinkMenuItemModel,
function: () => {
this.modalService.open(CreateItemParentSelectorComponent);
}
} as OnClickMenuItemModel,
// model: {
// type: MenuItemType.LINK,
// text: 'menu.section.new_item',
// link: '/submit'
// } as LinkMenuItemModel,
},
{
id: 'new_item_version',
......
......@@ -32,13 +32,6 @@
</ds-comcol-page-content>
</header>
<div class="add">
<a class="btn btn-lg btn-primary mt-1 ml-2" [routerLink]="['/submit']" [queryParams]="{collection:collection.id}" role="button">
<i class="fa fa-plus-circle" aria-hidden="true"></i> {{'mydspace.new-submission' | translate}}
</a>
</div>
<section class="comcol-page-browse-section">
<!-- Browse-By Links -->
<ds-comcol-page-browse-by
......
......@@ -72,7 +72,7 @@ export class SubmissionRestService {
protected getEndpointByIDHref(endpoint, resourceID, collectionId?: string): string {
let url = isNotEmpty(resourceID) ? `${endpoint}/${resourceID}` : `${endpoint}`;
if (collectionId) {
url = new URLCombiner(url, '?owningCollection=' + collectionId).toString();
url = new URLCombiner(url, `?owningCollection=${collectionId}`).toString();
}
return url;
}
......
......@@ -59,9 +59,8 @@ describe('CreateItemParentSelectorComponent', () => {
});
it('should call navigate on the router with the correct create path when navigate is called', () => {
/* TODO when there is a specific submission path */
// component.navigate(item);
// expect(router.navigate).toHaveBeenCalledWith([createPath]);
component.navigate(collection);
expect(router.navigate).toHaveBeenCalledWith(['/submit'], { queryParams: { collection: collection.uuid } });
});
});
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.model';
import { DSpaceObject } from '../../../../core/shared/dspace-object.model';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
......@@ -28,6 +28,11 @@ export class CreateItemParentSelectorComponent extends DSOSelectorModalWrapperCo
* Navigate to the item create page
*/
navigate(dso: DSpaceObject) {
// There's no submit path per collection yet...
const navigationExtras: NavigationExtras = {
queryParams: {
['collection']: dso.uuid,
}
};
this.router.navigate(['/submit'], navigationExtras);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment