diff --git a/cypress/e2e/item-edit.cy.ts b/cypress/e2e/item-edit.cy.ts index 45131baace2..604aab9d042 100644 --- a/cypress/e2e/item-edit.cy.ts +++ b/cypress/e2e/item-edit.cy.ts @@ -9,11 +9,6 @@ beforeEach(() => { // This page is restricted, so we will be shown the login form. Fill it out & submit. cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); - - // We need to wait for the correction types allowed for the item to be loaded to be sure that each tab is fully loaded. - // This because the edit item page causes often tests to fails due to timeout. - cy.intercept('GET', 'server/api/config/correctiontypes/search/findByItem*').as('correctionTypes'); - cy.wait('@correctionTypes'); }); describe('Edit Item > Edit Metadata tab', () => { diff --git a/src/app/browse-by/browse-by-page-routes.ts b/src/app/browse-by/browse-by-page-routes.ts index 9c7e16ab39d..3843a50f6e0 100644 --- a/src/app/browse-by/browse-by-page-routes.ts +++ b/src/app/browse-by/browse-by-page-routes.ts @@ -1,6 +1,5 @@ import { Route } from '@angular/router'; -import { dsoEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver'; import { browseByDSOBreadcrumbResolver } from './browse-by-dso-breadcrumb.resolver'; import { browseByGuard } from './browse-by-guard'; import { browseByI18nBreadcrumbResolver } from './browse-by-i18n-breadcrumb.resolver'; @@ -11,7 +10,6 @@ export const ROUTES: Route[] = [ path: '', resolve: { breadcrumb: browseByDSOBreadcrumbResolver, - menu: dsoEditMenuResolver, }, children: [ { diff --git a/src/app/collection-page/collection-page-routes.ts b/src/app/collection-page/collection-page-routes.ts index f2dadc3fbe0..e20e3ba8af1 100644 --- a/src/app/collection-page/collection-page-routes.ts +++ b/src/app/collection-page/collection-page-routes.ts @@ -54,7 +54,6 @@ export const ROUTES: Route[] = [ resolve: { dso: collectionPageResolver, breadcrumb: collectionBreadcrumbResolver, - menu: dsoEditMenuResolver, }, runGuardsAndResolvers: 'always', children: [ @@ -83,6 +82,9 @@ export const ROUTES: Route[] = [ { path: '', component: ThemedCollectionPageComponent, + resolve: { + menu: dsoEditMenuResolver, + }, children: [ { path: '', diff --git a/src/app/community-page/community-page-routes.ts b/src/app/community-page/community-page-routes.ts index d9505c53b13..2c8a7942a4a 100644 --- a/src/app/community-page/community-page-routes.ts +++ b/src/app/community-page/community-page-routes.ts @@ -51,7 +51,6 @@ export const ROUTES: Route[] = [ resolve: { dso: communityPageResolver, breadcrumb: communityBreadcrumbResolver, - menu: dsoEditMenuResolver, }, runGuardsAndResolvers: 'always', children: [ @@ -70,6 +69,9 @@ export const ROUTES: Route[] = [ { path: '', component: ThemedCommunityPageComponent, + resolve: { + menu: dsoEditMenuResolver, + }, children: [ { path: '', diff --git a/src/app/item-page/item-page-routes.ts b/src/app/item-page/item-page-routes.ts index 684ea564598..854d66fabe4 100644 --- a/src/app/item-page/item-page-routes.ts +++ b/src/app/item-page/item-page-routes.ts @@ -27,7 +27,6 @@ export const ROUTES: Route[] = [ resolve: { dso: itemPageResolver, breadcrumb: itemBreadcrumbResolver, - menu: dsoEditMenuResolver, }, runGuardsAndResolvers: 'always', children: [ @@ -35,10 +34,16 @@ export const ROUTES: Route[] = [ path: '', component: ThemedItemPageComponent, pathMatch: 'full', + resolve: { + menu: dsoEditMenuResolver, + }, }, { path: 'full', component: ThemedFullItemPageComponent, + resolve: { + menu: dsoEditMenuResolver, + }, }, { path: ITEM_EDIT_PATH, diff --git a/src/app/shared/dso-page/dso-edit-menu-resolver.service.ts b/src/app/shared/dso-page/dso-edit-menu-resolver.service.ts index e6bbeac619c..8c4fd15b7e5 100644 --- a/src/app/shared/dso-page/dso-edit-menu-resolver.service.ts +++ b/src/app/shared/dso-page/dso-edit-menu-resolver.service.ts @@ -155,7 +155,7 @@ export class DSOEditMenuResolverService { this.dsoVersioningModalService.getVersioningTooltipMessage(dso, 'item.page.version.hasDraft', 'item.page.version.create'), this.authorizationService.isAuthorized(FeatureID.CanSynchronizeWithORCID, dso.self), this.authorizationService.isAuthorized(FeatureID.CanClaimItem, dso.self), - this.correctionTypeDataService.findByItem(dso.uuid, false).pipe( + this.correctionTypeDataService.findByItem(dso.uuid, true).pipe( getFirstCompletedRemoteData(), getRemoteDataPayload()), ]).pipe(