Skip to content

Commit 970544c

Browse files
120109: Updated the route configuration to only resolve the dsoEditMenuResolver on pages who use the DsoEditMenuComponent
(cherry picked from commit 5c9f494)
1 parent c9ba47b commit 970544c

File tree

6 files changed

+13
-11
lines changed

6 files changed

+13
-11
lines changed

cypress/e2e/item-edit.cy.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ beforeEach(() => {
99

1010
// This page is restricted, so we will be shown the login form. Fill it out & submit.
1111
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
12-
13-
// We need to wait for the correction types allowed for the item to be loaded to be sure that each tab is fully loaded.
14-
// This because the edit item page causes often tests to fails due to timeout.
15-
cy.intercept('GET', 'server/api/config/correctiontypes/search/findByItem*').as('correctionTypes');
16-
cy.wait('@correctionTypes');
1712
});
1813

1914
describe('Edit Item > Edit Metadata tab', () => {

src/app/browse-by/browse-by-page-routes.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Route } from '@angular/router';
22

3-
import { dsoEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver';
43
import { browseByDSOBreadcrumbResolver } from './browse-by-dso-breadcrumb.resolver';
54
import { browseByGuard } from './browse-by-guard';
65
import { browseByI18nBreadcrumbResolver } from './browse-by-i18n-breadcrumb.resolver';
@@ -11,7 +10,6 @@ export const ROUTES: Route[] = [
1110
path: '',
1211
resolve: {
1312
breadcrumb: browseByDSOBreadcrumbResolver,
14-
menu: dsoEditMenuResolver,
1513
},
1614
children: [
1715
{

src/app/collection-page/collection-page-routes.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ export const ROUTES: Route[] = [
5454
resolve: {
5555
dso: collectionPageResolver,
5656
breadcrumb: collectionBreadcrumbResolver,
57-
menu: dsoEditMenuResolver,
5857
},
5958
runGuardsAndResolvers: 'always',
6059
children: [
@@ -83,6 +82,9 @@ export const ROUTES: Route[] = [
8382
{
8483
path: '',
8584
component: ThemedCollectionPageComponent,
85+
resolve: {
86+
menu: dsoEditMenuResolver,
87+
},
8688
children: [
8789
{
8890
path: '',

src/app/community-page/community-page-routes.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ export const ROUTES: Route[] = [
5151
resolve: {
5252
dso: communityPageResolver,
5353
breadcrumb: communityBreadcrumbResolver,
54-
menu: dsoEditMenuResolver,
5554
},
5655
runGuardsAndResolvers: 'always',
5756
children: [
@@ -70,6 +69,9 @@ export const ROUTES: Route[] = [
7069
{
7170
path: '',
7271
component: ThemedCommunityPageComponent,
72+
resolve: {
73+
menu: dsoEditMenuResolver,
74+
},
7375
children: [
7476
{
7577
path: '',

src/app/item-page/item-page-routes.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,23 @@ export const ROUTES: Route[] = [
2727
resolve: {
2828
dso: itemPageResolver,
2929
breadcrumb: itemBreadcrumbResolver,
30-
menu: dsoEditMenuResolver,
3130
},
3231
runGuardsAndResolvers: 'always',
3332
children: [
3433
{
3534
path: '',
3635
component: ThemedItemPageComponent,
3736
pathMatch: 'full',
37+
resolve: {
38+
menu: dsoEditMenuResolver,
39+
},
3840
},
3941
{
4042
path: 'full',
4143
component: ThemedFullItemPageComponent,
44+
resolve: {
45+
menu: dsoEditMenuResolver,
46+
},
4247
},
4348
{
4449
path: ITEM_EDIT_PATH,

src/app/shared/dso-page/dso-edit-menu-resolver.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export class DSOEditMenuResolverService {
155155
this.dsoVersioningModalService.getVersioningTooltipMessage(dso, 'item.page.version.hasDraft', 'item.page.version.create'),
156156
this.authorizationService.isAuthorized(FeatureID.CanSynchronizeWithORCID, dso.self),
157157
this.authorizationService.isAuthorized(FeatureID.CanClaimItem, dso.self),
158-
this.correctionTypeDataService.findByItem(dso.uuid, false).pipe(
158+
this.correctionTypeDataService.findByItem(dso.uuid, true).pipe(
159159
getFirstCompletedRemoteData(),
160160
getRemoteDataPayload()),
161161
]).pipe(

0 commit comments

Comments
 (0)