mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-09 19:13:08 +00:00
refactored, started tests
This commit is contained in:
@@ -10,9 +10,10 @@ module.exports = {
|
|||||||
// The REST API server settings.
|
// The REST API server settings.
|
||||||
rest: {
|
rest: {
|
||||||
ssl: true,
|
ssl: true,
|
||||||
host: 'dspace7-internal.atmire.com',
|
host: 'dspace7.4science.it',
|
||||||
port: 443,
|
port: 443,
|
||||||
nameSpace: '/rest/api'
|
// NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
|
||||||
|
nameSpace: '/dspace-spring-rest/api'
|
||||||
},
|
},
|
||||||
// Caching settings
|
// Caching settings
|
||||||
cache: {
|
cache: {
|
||||||
|
@@ -642,5 +642,31 @@
|
|||||||
},
|
},
|
||||||
"chips": {
|
"chips": {
|
||||||
"remove": "Remove chip"
|
"remove": "Remove chip"
|
||||||
|
},
|
||||||
|
"dso-selector": {
|
||||||
|
"create": {
|
||||||
|
"community": {
|
||||||
|
"head": "New community",
|
||||||
|
"sub-level": "Create a new community in",
|
||||||
|
"top-level": "Create a new top-level community"
|
||||||
|
},
|
||||||
|
"collection": {
|
||||||
|
"head": "New collection"
|
||||||
|
},
|
||||||
|
"item": {
|
||||||
|
"head": "New item"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"edit": {
|
||||||
|
"community": {
|
||||||
|
"head": "Edit community"
|
||||||
|
},
|
||||||
|
"collection": {
|
||||||
|
"head": "Edit collection"
|
||||||
|
},
|
||||||
|
"item": {
|
||||||
|
"head": "Edit item"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,9 +15,9 @@ import { OnClickMenuItemModel } from '../../shared/menu/menu-item/models/onclick
|
|||||||
import { CreateCommunityParentSelectorComponent } from '../../shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component';
|
import { CreateCommunityParentSelectorComponent } from '../../shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component';
|
||||||
import { CreateItemParentSelectorComponent } from '../../shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component';
|
import { CreateItemParentSelectorComponent } from '../../shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component';
|
||||||
import { CreateCollectionParentSelectorComponent } from '../../shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component';
|
import { CreateCollectionParentSelectorComponent } from '../../shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component';
|
||||||
import { EditCollectionParentSelectorComponent } from '../../shared/dso-selector/modal-wrappers/edit-collection-parent-selector/edit-collection-parent-selector.component';
|
import { EditItemSelectorComponent } from '../../shared/dso-selector/modal-wrappers/edit-item-parent-selector/edit-item-selector.component';
|
||||||
import { EditItemParentSelectorComponent } from '../../shared/dso-selector/modal-wrappers/edit-item-parent-selector/edit-item-parent-selector.component';
|
import { EditCommunitySelectorComponent } from '../../shared/dso-selector/modal-wrappers/edit-community-parent-selector/edit-community-selector.component';
|
||||||
import { EditCommunityParentSelectorComponent } from '../../shared/dso-selector/modal-wrappers/edit-community-parent-selector/edit-community-parent-selector.component';
|
import { EditCollectionSelectorComponent } from '../../shared/dso-selector/modal-wrappers/edit-collection-parent-selector/edit-collection-selector.component';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component representing the admin sidebar
|
* Component representing the admin sidebar
|
||||||
@@ -179,7 +179,7 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
|
|||||||
type: MenuItemType.ONCLICK,
|
type: MenuItemType.ONCLICK,
|
||||||
text: 'menu.section.edit_community',
|
text: 'menu.section.edit_community',
|
||||||
function: () => {
|
function: () => {
|
||||||
this.modalService.open(EditCommunityParentSelectorComponent);
|
this.modalService.open(EditCommunitySelectorComponent);
|
||||||
}
|
}
|
||||||
} as OnClickMenuItemModel,
|
} as OnClickMenuItemModel,
|
||||||
},
|
},
|
||||||
@@ -192,7 +192,7 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
|
|||||||
type: MenuItemType.ONCLICK,
|
type: MenuItemType.ONCLICK,
|
||||||
text: 'menu.section.edit_collection',
|
text: 'menu.section.edit_collection',
|
||||||
function: () => {
|
function: () => {
|
||||||
this.modalService.open(EditCollectionParentSelectorComponent);
|
this.modalService.open(EditCollectionSelectorComponent);
|
||||||
}
|
}
|
||||||
} as OnClickMenuItemModel,
|
} as OnClickMenuItemModel,
|
||||||
},
|
},
|
||||||
@@ -205,7 +205,7 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
|
|||||||
type: MenuItemType.ONCLICK,
|
type: MenuItemType.ONCLICK,
|
||||||
text: 'menu.section.edit_item',
|
text: 'menu.section.edit_item',
|
||||||
function: () => {
|
function: () => {
|
||||||
this.modalService.open(EditItemParentSelectorComponent);
|
this.modalService.open(EditItemSelectorComponent);
|
||||||
}
|
}
|
||||||
} as OnClickMenuItemModel,
|
} as OnClickMenuItemModel,
|
||||||
},
|
},
|
||||||
|
@@ -11,7 +11,6 @@ import { CommunitySearchResultListElementComponent } from '../shared/object-list
|
|||||||
import { ItemSearchResultGridElementComponent } from '../shared/object-grid/search-result-grid-element/item-search-result/item-search-result-grid-element.component';
|
import { ItemSearchResultGridElementComponent } from '../shared/object-grid/search-result-grid-element/item-search-result/item-search-result-grid-element.component';
|
||||||
import { CommunitySearchResultGridElementComponent } from '../shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component'
|
import { CommunitySearchResultGridElementComponent } from '../shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component'
|
||||||
import { CollectionSearchResultGridElementComponent } from '../shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component';
|
import { CollectionSearchResultGridElementComponent } from '../shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component';
|
||||||
import { SearchService } from './search-service/search.service';
|
|
||||||
import { SearchSidebarComponent } from './search-sidebar/search-sidebar.component';
|
import { SearchSidebarComponent } from './search-sidebar/search-sidebar.component';
|
||||||
import { SearchSidebarService } from './search-sidebar/search-sidebar.service';
|
import { SearchSidebarService } from './search-sidebar/search-sidebar.service';
|
||||||
import { SearchSidebarEffects } from './search-sidebar/search-sidebar.effects';
|
import { SearchSidebarEffects } from './search-sidebar/search-sidebar.effects';
|
||||||
@@ -46,13 +45,12 @@ const effects = [
|
|||||||
SearchResultsComponent,
|
SearchResultsComponent,
|
||||||
SearchSidebarComponent,
|
SearchSidebarComponent,
|
||||||
SearchSettingsComponent,
|
SearchSettingsComponent,
|
||||||
ItemSearchResultListElementComponent,
|
// ItemSearchResultListElementComponent,
|
||||||
CollectionSearchResultListElementComponent,
|
// CollectionSearchResultListElementComponent,
|
||||||
CommunitySearchResultListElementComponent,
|
// CommunitySearchResultListElementComponent,
|
||||||
ItemSearchResultGridElementComponent,
|
ItemSearchResultGridElementComponent,
|
||||||
CollectionSearchResultGridElementComponent,
|
CollectionSearchResultGridElementComponent,
|
||||||
CommunitySearchResultGridElementComponent,
|
CommunitySearchResultGridElementComponent,
|
||||||
CommunitySearchResultListElementComponent,
|
|
||||||
SearchFiltersComponent,
|
SearchFiltersComponent,
|
||||||
SearchFilterComponent,
|
SearchFilterComponent,
|
||||||
SearchFacetFilterComponent,
|
SearchFacetFilterComponent,
|
||||||
@@ -70,9 +68,9 @@ const effects = [
|
|||||||
SearchConfigurationService
|
SearchConfigurationService
|
||||||
],
|
],
|
||||||
entryComponents: [
|
entryComponents: [
|
||||||
ItemSearchResultListElementComponent,
|
// ItemSearchResultListElementComponent,
|
||||||
CollectionSearchResultListElementComponent,
|
// CollectionSearchResultListElementComponent,
|
||||||
CommunitySearchResultListElementComponent,
|
// CommunitySearchResultListElementComponent,
|
||||||
ItemSearchResultGridElementComponent,
|
ItemSearchResultGridElementComponent,
|
||||||
CollectionSearchResultGridElementComponent,
|
CollectionSearchResultGridElementComponent,
|
||||||
CommunitySearchResultGridElementComponent,
|
CommunitySearchResultGridElementComponent,
|
||||||
|
@@ -6,20 +6,14 @@
|
|||||||
[formControl]="input">
|
[formControl]="input">
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<div class="scrollable-menu" #entryList>
|
<div class="scrollable-menu list-group">
|
||||||
<button class="dropdown-item disabled" *ngIf="(listEntries$ | async)?.length == 0">
|
<button class="list-group-item list-group-item-action border-0 disabled" *ngIf="(listEntries$ | async)?.length == 0">
|
||||||
{{'submission.sections.general.no-collection' | translate}}
|
{{'submission.sections.general.no-collection' | translate}}
|
||||||
</button>
|
</button>
|
||||||
<button *ngFor="let listEntry of (listEntries$ | async)"
|
<button *ngFor="let listEntry of (listEntries$ | async)?.payload.page"
|
||||||
class="dropdown-item list-entry"
|
class="list-group-item list-group-item-action border-0 list-entry"
|
||||||
title="{{ listEntry.dso.name }}"
|
title="{{ listEntry.dspaceObject.name }}"
|
||||||
(click)="onSelect.emit(listEntry.dso)" #listEntryElement>
|
(click)="onSelect.emit(listEntry.dspaceObject)" #listEntryElement>
|
||||||
<ul class="list-unstyled mb-0">
|
<ds-wrapper-list-element [object]="listEntry"></ds-wrapper-list-element>
|
||||||
<li class="list-item text-truncate text-secondary"
|
|
||||||
*ngFor="let parent of listEntry.parents">
|
|
||||||
{{ parent.name }} <i class="fa fa-level-down" aria-hidden="true"></i>
|
|
||||||
</li>
|
|
||||||
<li class="list-item text-truncate text-primary font-weight-bold">{{ listEntry.dso.name }}</li>
|
|
||||||
</ul>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
@@ -0,0 +1,65 @@
|
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
|
import { DSOSelectorComponent } from './dso-selector.component';
|
||||||
|
import { SearchService } from '../../../+search-page/search-service/search.service';
|
||||||
|
import { DSpaceObjectType } from '../../../core/shared/dspace-object-type.model';
|
||||||
|
import { PaginatedSearchOptions } from '../../../+search-page/paginated-search-options.model';
|
||||||
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
|
import { ItemSearchResult } from '../../object-collection/shared/item-search-result.model';
|
||||||
|
import { Item } from '../../../core/shared/item.model';
|
||||||
|
import { of as observableOf } from 'rxjs';
|
||||||
|
import { PaginatedList } from '../../../core/data/paginated-list';
|
||||||
|
|
||||||
|
fdescribe('DSOSelectorComponent', () => {
|
||||||
|
let component: DSOSelectorComponent;
|
||||||
|
let fixture: ComponentFixture<DSOSelectorComponent>;
|
||||||
|
let debugElement: DebugElement;
|
||||||
|
|
||||||
|
const currentDSOId = 'test-uuid-ford-sose';
|
||||||
|
const type = DSpaceObjectType.ITEM;
|
||||||
|
const searchResult = new ItemSearchResult();
|
||||||
|
const item = new Item();
|
||||||
|
item.metadata = { 'dc.title': [{ value: 'Item title', language: undefined }] };
|
||||||
|
searchResult.dspaceObject = item;
|
||||||
|
searchResult.hitHighlights = {};
|
||||||
|
const searchService = jasmine.createSpyObj('searchService', {
|
||||||
|
search: observableOf(new RemoteData(false, false, true, undefined, new PaginatedList(undefined, [searchResult])))
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
imports: [TranslateModule.forRoot()],
|
||||||
|
declarations: [DSOSelectorComponent],
|
||||||
|
providers: [
|
||||||
|
{ provide: SearchService, useValue: searchService },
|
||||||
|
],
|
||||||
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(DSOSelectorComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
debugElement = fixture.debugElement;
|
||||||
|
component.currentDSOId = currentDSOId;
|
||||||
|
component.type = type;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should initially call the search method on the SearchService with the given DSO uuid', () => {
|
||||||
|
const searchOptions = new PaginatedSearchOptions({
|
||||||
|
query: currentDSOId,
|
||||||
|
dsoType: type,
|
||||||
|
pagination: (component as any).defaultPagination
|
||||||
|
});
|
||||||
|
expect(searchService.search).toHaveBeenCalledWith(searchOptions);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
@@ -21,32 +21,60 @@ import { PaginatedList } from '../../../core/data/paginated-list';
|
|||||||
import { SearchResult } from '../../../+search-page/search-result.model';
|
import { SearchResult } from '../../../+search-page/search-result.model';
|
||||||
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
|
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
|
||||||
|
|
||||||
interface DSOSelectListEntry {
|
|
||||||
parents: DSpaceObject[],
|
|
||||||
dso: DSpaceObject
|
|
||||||
}
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-dso-selector',
|
selector: 'ds-dso-selector',
|
||||||
// styleUrls: ['./dso-selector.component.scss'],
|
// styleUrls: ['./dso-selector.component.scss'],
|
||||||
templateUrl: './dso-selector.component.html'
|
templateUrl: './dso-selector.component.html'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Component to render a list of DSO's of which one can be selected
|
||||||
|
* The user can search the list by using the input field
|
||||||
|
*/
|
||||||
export class DSOSelectorComponent implements OnInit, AfterViewInit {
|
export class DSOSelectorComponent implements OnInit, AfterViewInit {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The initially selected DSO's uuid
|
||||||
|
*/
|
||||||
@Input() currentDSOId: string;
|
@Input() currentDSOId: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type of DSpace objects this components shows a list of
|
||||||
|
*/
|
||||||
@Input() type: DSpaceObjectType;
|
@Input() type: DSpaceObjectType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Emits the selected Object when a user selects it in the list
|
||||||
|
*/
|
||||||
@Output() onSelect: EventEmitter<DSpaceObject> = new EventEmitter();
|
@Output() onSelect: EventEmitter<DSpaceObject> = new EventEmitter();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Input form control to query the list
|
||||||
|
*/
|
||||||
public input: FormControl = new FormControl();
|
public input: FormControl = new FormControl();
|
||||||
// private subs: Subscription[] = [];
|
|
||||||
|
/**
|
||||||
|
* Default pagination for this feature
|
||||||
|
*/
|
||||||
private defaultPagination = { id: 'dso-selector', currentPage: 1, pageSize: 5 } as any;
|
private defaultPagination = { id: 'dso-selector', currentPage: 1, pageSize: 5 } as any;
|
||||||
listEntries$: Observable<DSOSelectListEntry[]>;
|
|
||||||
|
/**
|
||||||
|
* List with search results of DSpace objects for the current query
|
||||||
|
*/
|
||||||
|
listEntries$: Observable<RemoteData<PaginatedList<SearchResult<DSpaceObject>>>>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of element references to all elements
|
||||||
|
*/
|
||||||
@ViewChildren('listEntryElement') listElements: QueryList<ElementRef>;
|
@ViewChildren('listEntryElement') listElements: QueryList<ElementRef>;
|
||||||
|
|
||||||
constructor(private searchService: SearchService) {
|
constructor(private searchService: SearchService) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fills the listEntries$ variable with search results based on the input field's current value
|
||||||
|
* The search will always start with the initial currentDSOId value
|
||||||
|
*/
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.listEntries$ = this.input.valueChanges
|
this.listEntries$ = this.input.valueChanges
|
||||||
.pipe(
|
.pipe(
|
||||||
@@ -60,21 +88,13 @@ export class DSOSelectorComponent implements OnInit, AfterViewInit {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
),
|
)
|
||||||
map((searchResultsRD: RemoteData<PaginatedList<SearchResult<DSpaceObject>>>) => {
|
|
||||||
return searchResultsRD.payload.page.map(
|
|
||||||
(searchResult: SearchResult<DSpaceObject>) => {
|
|
||||||
let dso = searchResult.dspaceObject;
|
|
||||||
return {
|
|
||||||
parents: this.retrieveParentList(dso),
|
|
||||||
dso
|
|
||||||
} as DSOSelectListEntry
|
|
||||||
}
|
|
||||||
)
|
|
||||||
})
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make sure to set focus on the first list element when the initial search (with currentDSOId) emits a single value
|
||||||
|
*/
|
||||||
ngAfterViewInit(): void {
|
ngAfterViewInit(): void {
|
||||||
this.listElements.changes.pipe(
|
this.listElements.changes.pipe(
|
||||||
take(1)
|
take(1)
|
||||||
@@ -84,17 +104,4 @@ export class DSOSelectorComponent implements OnInit, AfterViewInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
retrieveParentList(dso: DSpaceObject, parents: DSpaceObject[] = []) {
|
|
||||||
return [{ name: 'Test Community' } as any];
|
|
||||||
// if (hasValue(dso.owner)) {
|
|
||||||
// dso.owner.pipe(
|
|
||||||
// first(),
|
|
||||||
// ).subscribe((parentRD) => {
|
|
||||||
// const newDSO: DSpaceObject = parentRD.payload;
|
|
||||||
// parents = [...this.retrieveParentList(newDSO, parents), newDSO];
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// return parents;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -1,11 +0,0 @@
|
|||||||
<div>
|
|
||||||
<div class="modal-header">New Collection
|
|
||||||
<button type="button" class="close" (click)="close()" aria-label="Close">
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
<ds-dso-selector [currentDSOId]="(communityRD$ | async)?.payload.uuid" [type]="type"
|
|
||||||
(onSelect)="createCollection($event)"></ds-dso-selector>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@@ -5,39 +5,34 @@ import { RemoteData } from '../../../../core/data/remote-data';
|
|||||||
import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.model';
|
import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.model';
|
||||||
import { DSpaceObject } from '../../../../core/shared/dspace-object.model';
|
import { DSpaceObject } from '../../../../core/shared/dspace-object.model';
|
||||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { map } from 'rxjs/operators';
|
import {
|
||||||
import { Observable } from 'rxjs';
|
COLLECTION_PARENT_PARAMETER,
|
||||||
import { COLLECTION_PARENT_PARAMETER } from '../../../../+collection-page/collection-page-routing.module';
|
getCollectionCreatePath
|
||||||
|
} from '../../../../+collection-page/collection-page-routing.module';
|
||||||
|
import {
|
||||||
|
DSOSelectorModalWrapperComponent,
|
||||||
|
SelectorActionType
|
||||||
|
} from '../dso-selector-modal-wrapper.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-create-collection-parent-selector',
|
selector: 'ds-create-collection-parent-selector',
|
||||||
// styleUrls: ['./create-collection-parent-selector.component.scss'],
|
templateUrl: '../dso-selector-modal-wrapper.component.html',
|
||||||
templateUrl: './create-collection-parent-selector.component.html',
|
|
||||||
})
|
})
|
||||||
export class CreateCollectionParentSelectorComponent implements OnInit {
|
export class CreateCollectionParentSelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit {
|
||||||
@Input() communityRD$: Observable<RemoteData<Community>>;
|
objectType = DSpaceObjectType.COLLECTION;
|
||||||
type = DSpaceObjectType.COMMUNITY;
|
selectorType = DSpaceObjectType.COMMUNITY;
|
||||||
|
action = SelectorActionType.CREATE;
|
||||||
|
|
||||||
private createPath = '/collections/create';
|
constructor(protected activeModal: NgbActiveModal, protected route: ActivatedRoute, private router: Router) {
|
||||||
|
super(activeModal, route);
|
||||||
constructor(private activeModal: NgbActiveModal, private route: ActivatedRoute, private router: Router) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
navigate(dso: DSpaceObject) {
|
||||||
this.communityRD$ = this.route.root.firstChild.firstChild.data.pipe(map(data => data.community));
|
|
||||||
}
|
|
||||||
|
|
||||||
createCollection(dso: DSpaceObject) {
|
|
||||||
this.close();
|
|
||||||
let navigationExtras: NavigationExtras = {
|
let navigationExtras: NavigationExtras = {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
[COLLECTION_PARENT_PARAMETER]: dso.uuid,
|
[COLLECTION_PARENT_PARAMETER]: dso.uuid,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.router.navigate([this.createPath], navigationExtras);
|
this.router.navigate([getCollectionCreatePath()], navigationExtras);
|
||||||
}
|
|
||||||
|
|
||||||
close() {
|
|
||||||
this.activeModal.close();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,19 +1,19 @@
|
|||||||
<div>
|
<div>
|
||||||
<div class="modal-header">New Community
|
<div class="modal-header">{{'dso-selector.'+ action + '.' + objectType.toString().toLowerCase() + '.head' | translate}}
|
||||||
<button type="button" class="close" (click)="close()" aria-label="Close">
|
<button type="button" class="close" (click)="close()" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<button class="btn btn-outline-primary btn-lg btn-block" (click)="createCommunity()">Create a new top-level community</button>
|
<button class="btn btn-outline-primary btn-lg btn-block" (click)="selectObject(undefined)">{{'dso-selector.create.community.top-level' | translate}}</button>
|
||||||
<h3 class="position-relative py-1 my-3 font-weight-normal">
|
<h3 class="position-relative py-1 my-3 font-weight-normal">
|
||||||
<hr>
|
<hr>
|
||||||
<div id="create-community-or-separator" class="text-center position-absolute w-100">
|
<div id="create-community-or-separator" class="text-center position-absolute w-100">
|
||||||
<span class="px-4 bg-white">or</span>
|
<span class="px-4 bg-white">or</span>
|
||||||
</div>
|
</div>
|
||||||
</h3>
|
</h3>
|
||||||
<h5 class="px-2">Create a new community in</h5>
|
|
||||||
<ds-dso-selector [currentDSOId]="(communityRD$ | async)?.payload.uuid" [type]="type"
|
<h5 class="px-2">{{'dso-selector.create.community.sub-level' | translate}}</h5>
|
||||||
(onSelect)="createCommunity($event)"></ds-dso-selector>
|
<ds-dso-selector [currentDSOId]="(dsoRD$ | async)?.payload.uuid" [type]="selectorType" (onSelect)="selectObject($event)"></ds-dso-selector>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
@@ -8,28 +8,30 @@ import { hasValue } from '../../../empty.util';
|
|||||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { COMMUNITY_PARENT_PARAMETER } from '../../../../+community-page/community-page-routing.module';
|
import {
|
||||||
|
COMMUNITY_PARENT_PARAMETER,
|
||||||
|
getCommunityCreatePath
|
||||||
|
} from '../../../../+community-page/community-page-routing.module';
|
||||||
|
import {
|
||||||
|
DSOSelectorModalWrapperComponent,
|
||||||
|
SelectorActionType
|
||||||
|
} from '../dso-selector-modal-wrapper.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-create-community-parent-selector',
|
selector: 'ds-create-community-parent-selector',
|
||||||
styleUrls: ['./create-community-parent-selector.component.scss'],
|
styleUrls: ['./create-community-parent-selector.component.scss'],
|
||||||
templateUrl: './create-community-parent-selector.component.html',
|
templateUrl: './create-community-parent-selector.component.html',
|
||||||
})
|
})
|
||||||
export class CreateCommunityParentSelectorComponent implements OnInit {
|
export class CreateCommunityParentSelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit {
|
||||||
@Input() communityRD$: Observable<RemoteData<Community>>;
|
objectType = DSpaceObjectType.COMMUNITY;
|
||||||
type = DSpaceObjectType.COMMUNITY;
|
selectorType = DSpaceObjectType.COMMUNITY;
|
||||||
|
action = SelectorActionType.CREATE;
|
||||||
|
|
||||||
private createPath = '/communities/create';
|
constructor(protected activeModal: NgbActiveModal, protected route: ActivatedRoute, private router: Router) {
|
||||||
|
super(activeModal, route);
|
||||||
constructor(private activeModal: NgbActiveModal, private route: ActivatedRoute, private router: Router) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
navigate(dso: DSpaceObject) {
|
||||||
this.communityRD$ = this.route.root.firstChild.firstChild.data.pipe(map(data => data.community));
|
|
||||||
}
|
|
||||||
|
|
||||||
createCommunity(dso?: DSpaceObject) {
|
|
||||||
this.close();
|
|
||||||
let navigationExtras: NavigationExtras = {};
|
let navigationExtras: NavigationExtras = {};
|
||||||
if (hasValue(dso)) {
|
if (hasValue(dso)) {
|
||||||
navigationExtras = {
|
navigationExtras = {
|
||||||
@@ -38,10 +40,6 @@ export class CreateCommunityParentSelectorComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
this.router.navigate([this.createPath], navigationExtras);
|
this.router.navigate([getCommunityCreatePath()], navigationExtras);
|
||||||
}
|
|
||||||
|
|
||||||
close() {
|
|
||||||
this.activeModal.close();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,10 +0,0 @@
|
|||||||
<div>
|
|
||||||
<div class="modal-header">New Item
|
|
||||||
<button type="button" class="close" (click)="close()" aria-label="Close">
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
<ds-dso-selector [currentDSOId]="(collectionRD$ | async)?.payload.uuid" [type]="type"></ds-dso-selector>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@@ -9,32 +9,28 @@ import { hasValue } from '../../../empty.util';
|
|||||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
import {
|
||||||
|
DSOSelectorModalWrapperComponent,
|
||||||
|
SelectorActionType
|
||||||
|
} from '../dso-selector-modal-wrapper.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-create-item-parent-selector',
|
selector: 'ds-create-item-parent-selector',
|
||||||
// styleUrls: ['./create-item-parent-selector.component.scss'],
|
// styleUrls: ['./create-item-parent-selector.component.scss'],
|
||||||
templateUrl: './create-item-parent-selector.component.html',
|
templateUrl: '../dso-selector-modal-wrapper.component.html',
|
||||||
})
|
})
|
||||||
export class CreateItemParentSelectorComponent implements OnInit {
|
export class CreateItemParentSelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit {
|
||||||
@Input() collectionRD$: Observable<RemoteData<Collection>>;
|
objectType = DSpaceObjectType.ITEM;
|
||||||
type = DSpaceObjectType.COLLECTION;
|
selectorType = DSpaceObjectType.COLLECTION;
|
||||||
|
action = SelectorActionType.CREATE;
|
||||||
|
|
||||||
constructor(private activeModal: NgbActiveModal, private route: ActivatedRoute) {
|
constructor(protected activeModal: NgbActiveModal, protected route: ActivatedRoute, private router: Router) {
|
||||||
|
super(activeModal, route);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
navigate(dso: DSpaceObject) {
|
||||||
this.collectionRD$ = this.route.root.firstChild.firstChild.data.pipe(map(data => data.collection));
|
|
||||||
}
|
|
||||||
|
|
||||||
createItem(dso: DSpaceObject) {
|
|
||||||
this.close();
|
|
||||||
|
|
||||||
let path;
|
let path;
|
||||||
// path = this.createPath;
|
// path = this.createPath;
|
||||||
// this.router.navigate([path]);
|
// this.router.navigate([path]);
|
||||||
}
|
}
|
||||||
|
|
||||||
close() {
|
|
||||||
this.activeModal.close();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,10 @@
|
|||||||
|
<div>
|
||||||
|
<div class="modal-header">{{'dso-selector.'+ action + '.' + objectType.toString().toLowerCase() + '.head' | translate}}
|
||||||
|
<button type="button" class="close" (click)="close()" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<ds-dso-selector [currentDSOId]="(dsoRD$ | async)?.payload.uuid" [type]="selectorType" (onSelect)="selectObject($event)"></ds-dso-selector>
|
||||||
|
</div>
|
||||||
|
</div>
|
@@ -0,0 +1,43 @@
|
|||||||
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
|
||||||
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
|
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
import { map } from 'rxjs/operators';
|
||||||
|
import { DSpaceObjectType } from '../../../core/shared/dspace-object-type.model';
|
||||||
|
|
||||||
|
export enum SelectorActionType {
|
||||||
|
CREATE = 'create',
|
||||||
|
EDIT = 'edit'
|
||||||
|
};
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-dso-selector-modal-wrapper',
|
||||||
|
templateUrl: './dso-selector-modal-wrapper.component.html',
|
||||||
|
})
|
||||||
|
export abstract class DSOSelectorModalWrapperComponent implements OnInit {
|
||||||
|
@Input() dsoRD$: Observable<RemoteData<DSpaceObject>>;
|
||||||
|
objectType: DSpaceObjectType;
|
||||||
|
selectorType: DSpaceObjectType;
|
||||||
|
action: SelectorActionType;
|
||||||
|
|
||||||
|
constructor(protected activeModal: NgbActiveModal, protected route: ActivatedRoute) {
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
const typeString = this.selectorType.toString().toLowerCase();
|
||||||
|
this.dsoRD$ = this.route.root.firstChild.firstChild.data.pipe(map(data => data[typeString]));
|
||||||
|
}
|
||||||
|
|
||||||
|
selectObject(dso: DSpaceObject) {
|
||||||
|
this.close();
|
||||||
|
this.navigate(dso);
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract navigate(dso: DSpaceObject);
|
||||||
|
|
||||||
|
close() {
|
||||||
|
this.activeModal.close();
|
||||||
|
}
|
||||||
|
}
|
@@ -1,10 +0,0 @@
|
|||||||
<div>
|
|
||||||
<div class="modal-header">Edit Collection
|
|
||||||
<button type="button" class="close" (click)="close()" aria-label="Close">
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
<ds-dso-selector [currentDSOId]="(collectionRD$ | async)?.payload.uuid" [type]="type" (onSelect)="editCollection($event)"></ds-dso-selector>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@@ -1,37 +0,0 @@
|
|||||||
import { Component, Input, OnInit } from '@angular/core';
|
|
||||||
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
|
|
||||||
import { Community } from '../../../../core/shared/community.model';
|
|
||||||
import { RemoteData } from '../../../../core/data/remote-data';
|
|
||||||
import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.model';
|
|
||||||
import { DSpaceObject } from '../../../../core/shared/dspace-object.model';
|
|
||||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
|
||||||
import { Collection } from '../../../../core/shared/collection.model';
|
|
||||||
import { Observable } from 'rxjs';
|
|
||||||
import { map } from 'rxjs/operators';
|
|
||||||
import { getCollectionEditPath } from '../../../../+collection-page/collection-page-routing.module';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'ds-edit-collection-parent-selector',
|
|
||||||
// styleUrls: ['./edit-collection-parent-selector.component.scss'],
|
|
||||||
templateUrl: './edit-collection-parent-selector.component.html',
|
|
||||||
})
|
|
||||||
export class EditCollectionParentSelectorComponent implements OnInit {
|
|
||||||
@Input() collectionRD$: Observable<RemoteData<Collection>>;
|
|
||||||
type = DSpaceObjectType.COLLECTION;
|
|
||||||
|
|
||||||
constructor(private activeModal: NgbActiveModal, private route: ActivatedRoute, private router: Router) {
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit(): void {
|
|
||||||
this.collectionRD$ = this.route.root.firstChild.firstChild.data.pipe(map(data => data.collection));
|
|
||||||
}
|
|
||||||
|
|
||||||
editCollection(dso: DSpaceObject) {
|
|
||||||
this.close();
|
|
||||||
this.router.navigate([getCollectionEditPath(dso.uuid)]);
|
|
||||||
}
|
|
||||||
|
|
||||||
close() {
|
|
||||||
this.activeModal.close();
|
|
||||||
}
|
|
||||||
}
|
|
@@ -0,0 +1,28 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ActivatedRoute, 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';
|
||||||
|
import { getCollectionEditPath } from '../../../../+collection-page/collection-page-routing.module';
|
||||||
|
import {
|
||||||
|
DSOSelectorModalWrapperComponent,
|
||||||
|
SelectorActionType
|
||||||
|
} from '../dso-selector-modal-wrapper.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-edit-collection-selector',
|
||||||
|
templateUrl: '../dso-selector-modal-wrapper.component.html',
|
||||||
|
})
|
||||||
|
export class EditCollectionSelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit {
|
||||||
|
objectType = DSpaceObjectType.COLLECTION;
|
||||||
|
selectorType = DSpaceObjectType.COLLECTION;
|
||||||
|
action = SelectorActionType.EDIT;
|
||||||
|
|
||||||
|
constructor(protected activeModal: NgbActiveModal, protected route: ActivatedRoute, private router: Router) {
|
||||||
|
super(activeModal, route);
|
||||||
|
}
|
||||||
|
|
||||||
|
navigate(dso: DSpaceObject) {
|
||||||
|
this.router.navigate([getCollectionEditPath(dso.uuid)]);
|
||||||
|
}
|
||||||
|
}
|
@@ -1,10 +0,0 @@
|
|||||||
<div>
|
|
||||||
<div class="modal-header">Edit Community
|
|
||||||
<button type="button" class="close" (click)="close()" aria-label="Close">
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
<ds-dso-selector [currentDSOId]="(communityRD$ | async)?.payload.uuid" [type]="type" (onSelect)="editCommunity($event)"></ds-dso-selector>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@@ -1,37 +0,0 @@
|
|||||||
import { Component, Input, OnInit } from '@angular/core';
|
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
|
||||||
import { Community } from '../../../../core/shared/community.model';
|
|
||||||
import { RemoteData } from '../../../../core/data/remote-data';
|
|
||||||
import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.model';
|
|
||||||
import { DSpaceObject } from '../../../../core/shared/dspace-object.model';
|
|
||||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
|
||||||
import { Observable } from 'rxjs';
|
|
||||||
import { map } from 'rxjs/operators';
|
|
||||||
import { getCommunityEditPath } from '../../../../+community-page/community-page-routing.module';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'ds-edit-community-parent-selector',
|
|
||||||
// styleUrls: ['./edit-community-parent-selector.component.scss'],
|
|
||||||
templateUrl: './edit-community-parent-selector.component.html',
|
|
||||||
})
|
|
||||||
export class EditCommunityParentSelectorComponent implements OnInit {
|
|
||||||
@Input() communityRD$: Observable<RemoteData<Community>>;
|
|
||||||
type = DSpaceObjectType.COMMUNITY;
|
|
||||||
|
|
||||||
constructor(private activeModal: NgbActiveModal, private route: ActivatedRoute, private router: Router) {
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit(): void {
|
|
||||||
this.communityRD$ = this.route.root.firstChild.firstChild.data.pipe(map(data => data.collection));
|
|
||||||
}
|
|
||||||
|
|
||||||
editCommunity(dso: DSpaceObject) {
|
|
||||||
this.close();
|
|
||||||
this.router.navigate([getCommunityEditPath(dso.uuid)]);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
close() {
|
|
||||||
this.activeModal.close();
|
|
||||||
}
|
|
||||||
}
|
|
@@ -0,0 +1,29 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ActivatedRoute, 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';
|
||||||
|
import { getCommunityEditPath } from '../../../../+community-page/community-page-routing.module';
|
||||||
|
import {
|
||||||
|
DSOSelectorModalWrapperComponent,
|
||||||
|
SelectorActionType
|
||||||
|
} from '../dso-selector-modal-wrapper.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-edit-community-selector',
|
||||||
|
templateUrl: '../dso-selector-modal-wrapper.component.html',
|
||||||
|
})
|
||||||
|
|
||||||
|
export class EditCommunitySelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit {
|
||||||
|
objectType = DSpaceObjectType.COMMUNITY;
|
||||||
|
selectorType = DSpaceObjectType.COMMUNITY;
|
||||||
|
action = SelectorActionType.EDIT;
|
||||||
|
|
||||||
|
constructor(protected activeModal: NgbActiveModal, protected route: ActivatedRoute, private router: Router) {
|
||||||
|
super(activeModal, route);
|
||||||
|
}
|
||||||
|
|
||||||
|
navigate(dso: DSpaceObject) {
|
||||||
|
this.router.navigate([getCommunityEditPath(dso.uuid)]);
|
||||||
|
}
|
||||||
|
}
|
@@ -1,10 +0,0 @@
|
|||||||
<div>
|
|
||||||
<div class="modal-header">Edit Item
|
|
||||||
<button type="button" class="close" (click)="close()" aria-label="Close">
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
<ds-dso-selector [currentDSOId]="(itemRD$ | async)?.payload.uuid" [type]="type" (onSelect)="editItem($event)"></ds-dso-selector>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@@ -10,29 +10,25 @@ import { Observable } from 'rxjs';
|
|||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { getItemEditPath } from '../../../../+item-page/item-page-routing.module';
|
import { getItemEditPath } from '../../../../+item-page/item-page-routing.module';
|
||||||
|
import {
|
||||||
|
DSOSelectorModalWrapperComponent,
|
||||||
|
SelectorActionType
|
||||||
|
} from '../dso-selector-modal-wrapper.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-edit-item-parent-selector',
|
selector: 'ds-edit-item-selector',
|
||||||
// styleUrls: ['./edit-item-parent-selector.component.scss'],
|
templateUrl: '../dso-selector-modal-wrapper.component.html',
|
||||||
templateUrl: './edit-item-parent-selector.component.html',
|
|
||||||
})
|
})
|
||||||
export class EditItemParentSelectorComponent implements OnInit {
|
export class EditItemSelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit {
|
||||||
@Input() itemRD$: Observable<RemoteData<Item>>;
|
objectType = DSpaceObjectType.ITEM;
|
||||||
type = DSpaceObjectType.ITEM;
|
selectorType = DSpaceObjectType.ITEM;
|
||||||
|
action = SelectorActionType.EDIT;
|
||||||
|
|
||||||
constructor(private activeModal: NgbActiveModal, private route: ActivatedRoute, private router: Router) {
|
constructor(protected activeModal: NgbActiveModal, protected route: ActivatedRoute, private router: Router) {
|
||||||
|
super(activeModal, route);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
navigate(dso: DSpaceObject) {
|
||||||
this.itemRD$ = this.route.root.firstChild.firstChild.data.pipe(map(data => data.item));
|
|
||||||
}
|
|
||||||
|
|
||||||
editItem(dso: DSpaceObject) {
|
|
||||||
this.close();
|
|
||||||
this.router.navigate([getItemEditPath(dso.uuid)]);
|
this.router.navigate([getItemEditPath(dso.uuid)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
close() {
|
|
||||||
this.activeModal.close();
|
|
||||||
}
|
|
||||||
}
|
}
|
@@ -99,9 +99,12 @@ import { DSOSelectorComponent } from './dso-selector/dso-selector/dso-selector.c
|
|||||||
import { CreateCommunityParentSelectorComponent } from './dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component';
|
import { CreateCommunityParentSelectorComponent } from './dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component';
|
||||||
import { CreateItemParentSelectorComponent } from './dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component';
|
import { CreateItemParentSelectorComponent } from './dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component';
|
||||||
import { CreateCollectionParentSelectorComponent } from './dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component';
|
import { CreateCollectionParentSelectorComponent } from './dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component';
|
||||||
import { EditCollectionParentSelectorComponent } from './dso-selector/modal-wrappers/edit-collection-parent-selector/edit-collection-parent-selector.component';
|
import { CommunitySearchResultListElementComponent } from './object-list/search-result-list-element/community-search-result/community-search-result-list-element.component';
|
||||||
import { EditItemParentSelectorComponent } from './dso-selector/modal-wrappers/edit-item-parent-selector/edit-item-parent-selector.component';
|
import { CollectionSearchResultListElementComponent } from './object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component';
|
||||||
import { EditCommunityParentSelectorComponent } from './dso-selector/modal-wrappers/edit-community-parent-selector/edit-community-parent-selector.component';
|
import { ItemSearchResultListElementComponent } from './object-list/search-result-list-element/item-search-result/item-search-result-list-element.component';
|
||||||
|
import { EditItemSelectorComponent } from './dso-selector/modal-wrappers/edit-item-parent-selector/edit-item-selector.component';
|
||||||
|
import { EditCommunitySelectorComponent } from './dso-selector/modal-wrappers/edit-community-parent-selector/edit-community-selector.component';
|
||||||
|
import { EditCollectionSelectorComponent } from './dso-selector/modal-wrappers/edit-collection-parent-selector/edit-collection-selector.component';
|
||||||
|
|
||||||
const MODULES = [
|
const MODULES = [
|
||||||
// Do NOT include UniversalModule, HttpModule, or JsonpModule here
|
// Do NOT include UniversalModule, HttpModule, or JsonpModule here
|
||||||
@@ -188,9 +191,12 @@ const COMPONENTS = [
|
|||||||
CreateCommunityParentSelectorComponent,
|
CreateCommunityParentSelectorComponent,
|
||||||
CreateCollectionParentSelectorComponent,
|
CreateCollectionParentSelectorComponent,
|
||||||
CreateItemParentSelectorComponent,
|
CreateItemParentSelectorComponent,
|
||||||
EditCommunityParentSelectorComponent,
|
EditCommunitySelectorComponent,
|
||||||
EditCollectionParentSelectorComponent,
|
EditCollectionSelectorComponent,
|
||||||
EditItemParentSelectorComponent,
|
EditItemSelectorComponent,
|
||||||
|
CommunitySearchResultListElementComponent,
|
||||||
|
CollectionSearchResultListElementComponent,
|
||||||
|
ItemSearchResultListElementComponent,
|
||||||
];
|
];
|
||||||
|
|
||||||
const ENTRY_COMPONENTS = [
|
const ENTRY_COMPONENTS = [
|
||||||
@@ -199,6 +205,9 @@ const ENTRY_COMPONENTS = [
|
|||||||
CollectionListElementComponent,
|
CollectionListElementComponent,
|
||||||
CommunityListElementComponent,
|
CommunityListElementComponent,
|
||||||
SearchResultListElementComponent,
|
SearchResultListElementComponent,
|
||||||
|
CommunitySearchResultListElementComponent,
|
||||||
|
CollectionSearchResultListElementComponent,
|
||||||
|
ItemSearchResultListElementComponent,
|
||||||
ItemGridElementComponent,
|
ItemGridElementComponent,
|
||||||
CollectionGridElementComponent,
|
CollectionGridElementComponent,
|
||||||
CommunityGridElementComponent,
|
CommunityGridElementComponent,
|
||||||
@@ -208,9 +217,9 @@ const ENTRY_COMPONENTS = [
|
|||||||
CreateCommunityParentSelectorComponent,
|
CreateCommunityParentSelectorComponent,
|
||||||
CreateCollectionParentSelectorComponent,
|
CreateCollectionParentSelectorComponent,
|
||||||
CreateItemParentSelectorComponent,
|
CreateItemParentSelectorComponent,
|
||||||
EditCommunityParentSelectorComponent,
|
EditCommunitySelectorComponent,
|
||||||
EditCollectionParentSelectorComponent,
|
EditCollectionSelectorComponent,
|
||||||
EditItemParentSelectorComponent,
|
EditItemSelectorComponent,
|
||||||
];
|
];
|
||||||
|
|
||||||
const PROVIDERS = [
|
const PROVIDERS = [
|
||||||
|
@@ -40,4 +40,8 @@ export class SearchServiceStub {
|
|||||||
getFilterLabels() {
|
getFilterLabels() {
|
||||||
return observableOf([]);
|
return observableOf([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
search() {
|
||||||
|
return observableOf({});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user