mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
101623: Fix request being sent with uuid=undefined if not going to a DSO page
This commit is contained in:
@@ -50,27 +50,32 @@ export class DSOEditMenuResolver implements Resolve<{ [key: string]: MenuSection
|
|||||||
if (hasNoValue(id) && hasValue(route.queryParams.scope)) {
|
if (hasNoValue(id) && hasValue(route.queryParams.scope)) {
|
||||||
id = route.queryParams.scope;
|
id = route.queryParams.scope;
|
||||||
}
|
}
|
||||||
return this.dSpaceObjectDataService.findById(id, true, false).pipe(
|
if (hasNoValue(id)) {
|
||||||
getFirstCompletedRemoteData(),
|
// If there's no ID, we're not on a DSO homepage, so pass on any pre-existing menu route data
|
||||||
switchMap((dsoRD) => {
|
return observableOf({ ...route.data?.menu });
|
||||||
if (dsoRD.hasSucceeded) {
|
} else {
|
||||||
const dso = dsoRD.payload;
|
return this.dSpaceObjectDataService.findById(id, true, false).pipe(
|
||||||
return combineLatest(this.getDsoMenus(dso, route, state)).pipe(
|
getFirstCompletedRemoteData(),
|
||||||
// Menu sections are retrieved as an array of arrays and flattened into a single array
|
switchMap((dsoRD) => {
|
||||||
map((combinedMenus) => [].concat.apply([], combinedMenus)),
|
if (dsoRD.hasSucceeded) {
|
||||||
map((menus) => this.addDsoUuidToMenuIDs(menus, dso)),
|
const dso = dsoRD.payload;
|
||||||
map((menus) => {
|
return combineLatest(this.getDsoMenus(dso, route, state)).pipe(
|
||||||
return {
|
// Menu sections are retrieved as an array of arrays and flattened into a single array
|
||||||
...route.data?.menu,
|
map((combinedMenus) => [].concat.apply([], combinedMenus)),
|
||||||
[MenuID.DSO_EDIT]: menus
|
map((menus) => this.addDsoUuidToMenuIDs(menus, dso)),
|
||||||
};
|
map((menus) => {
|
||||||
})
|
return {
|
||||||
);
|
...route.data?.menu,
|
||||||
} else {
|
[MenuID.DSO_EDIT]: menus
|
||||||
return observableOf({...route.data?.menu});
|
};
|
||||||
}
|
})
|
||||||
})
|
);
|
||||||
);
|
} else {
|
||||||
|
return observableOf({...route.data?.menu});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user