dso-selector-modal-wrapper.component.ts (dspace-angular-dspace-7.0) | : | dso-selector-modal-wrapper.component.ts (dspace-angular-dspace-7.1) | ||
---|---|---|---|---|
skipping to change at line 12 | skipping to change at line 12 | |||
import { ActivatedRoute, ActivatedRouteSnapshot } from '@angular/router'; | import { ActivatedRoute, ActivatedRouteSnapshot } from '@angular/router'; | |||
import { DSpaceObject } from '../../../core/shared/dspace-object.model'; | import { DSpaceObject } from '../../../core/shared/dspace-object.model'; | |||
import { RemoteData } from '../../../core/data/remote-data'; | import { RemoteData } from '../../../core/data/remote-data'; | |||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; | import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; | |||
import { DSpaceObjectType } from '../../../core/shared/dspace-object-type.model' ; | import { DSpaceObjectType } from '../../../core/shared/dspace-object-type.model' ; | |||
import { hasValue, isNotEmpty } from '../../empty.util'; | import { hasValue, isNotEmpty } from '../../empty.util'; | |||
export enum SelectorActionType { | export enum SelectorActionType { | |||
CREATE = 'create', | CREATE = 'create', | |||
EDIT = 'edit', | EDIT = 'edit', | |||
EXPORT_METADATA = 'export-metadata' | EXPORT_METADATA = 'export-metadata', | |||
SET_SCOPE = 'set-scope' | ||||
} | } | |||
/** | /** | |||
* Abstract base class that represents a wrapper for modal content used to selec t a DSpace Object | * Abstract base class that represents a wrapper for modal content used to selec t a DSpace Object | |||
*/ | */ | |||
@Component({ | @Component({ | |||
selector: 'ds-dso-selector-modal', | selector: 'ds-dso-selector-modal', | |||
template: '' | template: '' | |||
}) | }) | |||
export abstract class DSOSelectorModalWrapperComponent implements OnInit { | export abstract class DSOSelectorModalWrapperComponent implements OnInit { | |||
skipping to change at line 80 | skipping to change at line 81 | |||
const nextLevelRoutes = routes | const nextLevelRoutes = routes | |||
.map((route: ActivatedRouteSnapshot) => route.children) | .map((route: ActivatedRouteSnapshot) => route.children) | |||
.reduce((combined: ActivatedRouteSnapshot[], current: ActivatedRouteSnap shot[]) => [...combined, ...current]); | .reduce((combined: ActivatedRouteSnapshot[], current: ActivatedRouteSnap shot[]) => [...combined, ...current]); | |||
if (isNotEmpty(nextLevelRoutes)) { | if (isNotEmpty(nextLevelRoutes)) { | |||
return this.findRouteData(predicate, ...nextLevelRoutes); | return this.findRouteData(predicate, ...nextLevelRoutes); | |||
} else { | } else { | |||
return undefined; | return undefined; | |||
} | } | |||
} | } | |||
} | } | |||
/** | /** | |||
* Method called when an object has been selected | * Method called when an object has been selected | |||
* @param dso The selected DSpaceObject | * @param dso The selected DSpaceObject | |||
*/ | */ | |||
selectObject(dso: DSpaceObject) { | selectObject(dso: DSpaceObject) { | |||
this.close(); | this.close(); | |||
this.navigate(dso); | this.navigate(dso); | |||
} | } | |||
/** | /** | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 3 lines changed or added |