Skip to content

ESB-245 - fetch root page dynamically instead of hardcoding 'homepage'#1609

Open
ffalqui wants to merge 3 commits intorelease/7.5from
ESB-245
Open

ESB-245 - fetch root page dynamically instead of hardcoding 'homepage'#1609
ffalqui wants to merge 3 commits intorelease/7.5from
ESB-245

Conversation

@ffalqui
Copy link

@ffalqui ffalqui commented Feb 12, 2026

Add new Redux slice (SET_ROOT_PAGE) to store the root page code fetched from GET /api/pages/utils/root.
Replace all HOMEPAGE_CODE references in selectors, actions, page tree, and vertical menu with the dynamic value.
Expose rootPageCode via window.entando.globals for MFE menu consumption.

BREAKING CHANGE: page utility APIs moved under /api/pages/utils/:

  • /api/pages/viewpages -> /api/pages/utils/viewpages
  • /api/pages/search/group/free -> /api/pages/utils/search/group/free
  • /api/pages/search -> /api/pages/utils/search

@ffalqui ffalqui requested a review from MEM2677 February 12, 2026 17:39
Add new Redux slice (SET_ROOT_PAGE) to store the root page code fetched from GET /api/pages/utils/root.
 Replace all HOMEPAGE_CODE references in selectors, actions, page tree, and vertical menu with the dynamic value.
 Expose rootPageCode via window.entando.globals for MFE menu consumption.
@github-actions
Copy link

Requested publication of version 7.5.0-ESB-245-PR-1609

getPage(pageCode).then(response => resolve(response.ok)).catch(() => resolve(false));
});

let rootPageFetched = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Controllare se lasciare questo stato fuori da redux comporta problemi quando lo stato viene resettato (la variabile rimane a true impedendo un nuovo fetch)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ho rimosso il check per il fetch tramite variabile


let rootPageFetched = false;

export const fetchRootPage = () => async (dispatch) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Siamo certi che nessuna azione che usi la root registrata nello stato sia chiamata prima o durante l'esecuzione di questa funzione? Altrimenti potrebbero usare un fallback che poi verrebbe sostituito dal risultato vero di questa fetch.

…h/group/free

  - Add test for new GET /pages/utils/root endpoint
  - Use dynamic rootPageCode in NavigationBarConfigFormContainer instead of hardcoded HOMEPAGE_CODE
  - Change PageTree rootPageCode defaultProp to null
@github-actions
Copy link

Requested publication of version 7.5.0-ESB-245-PR-1609

@github-actions
Copy link

Requested publication of version 7.5.0-ESB-245-PR-1609

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants