Skip to content

Commit

Permalink
Merge pull request #1504 from entando/ENG-4899-amend-child-repositioning
Browse files Browse the repository at this point in the history
ENG-4899 amend child repositioning
  • Loading branch information
DMinnai authored May 31, 2023
2 parents 26305d5 + 9feed52 commit d6cde28
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -1601,6 +1601,7 @@ export default {
'componentRepository.categories.group': 'Group',
'componentRepository.components.installedVersion': 'Installed Version',
'componentRepository.components.genericError': 'An Error has occurred in the Application',
'page.invalidChildPositionError': 'A page belonging to a group cannot be placed as a child of the root',
'page.invalidPositionError': 'A page can only be a direct child of a page with the same owner group or free access',
'app.installFailed': 'An Error occurred and the Bundle could not be installed',
'app.uninstallFailed': 'An Error occurred and the Bundle could not be uninstalled',
Expand Down
1 change: 1 addition & 0 deletions src/locales/it.js
Original file line number Diff line number Diff line change
Expand Up @@ -1601,6 +1601,7 @@ export default {
'componentRepository.categories.group': 'Gruppo',
'componentRepository.components.installedVersion': 'Versione installata',
'componentRepository.components.genericError': 'Si è verificato un errore nell\'applicazione',
'page.invalidChildPositionError': 'Una pagina appartenente ad un gruppo non può essere posizionata figlia della root',
'page.invalidPositionError': 'Una pagina può essere figlia solo di un\'altra pagina con lo stesso owner group o con owner group free access',
'app.installFailed': 'Si è verificato un errore e non è stato possibile installare il Bundle',
'app.uninstallFailed': 'Si è verificato un errore e non è stato possibile disinstallare il Bundle',
Expand Down
1 change: 1 addition & 0 deletions src/locales/pt.js
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,7 @@ export default {
'componentRepository.categories.group': 'Grupo',
'componentRepository.components.installedVersion': 'Versão Instalada',
'componentRepository.components.genericError': 'Ocorreu um erro no aplicativo',
'page.invalidChildPositionError': 'Uma página que pertence a um grupo não pode se tornar um filho direto da raiz atual',
'page.invalidPositionError': 'Uma página só pode ser filha direta de uma página com o mesmo grupo de proprietários ou free access',
'app.installFailed': 'Ocorreu um erro e o pacote não pôde ser instalado',
'app.uninstallFailed': 'Ocorreu um erro e o pacote não pôde ser desinstalado',
Expand Down
11 changes: 6 additions & 5 deletions src/state/pages/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ import { getAppTourProgress } from 'state/app-tour/selectors';
const INVALID_PAGE_POSITION_ERROR = { id: 'page.invalidPositionError' };
const INVALID_PAGE_POSITION_STATUS_CODE = 422;

const INVALID_PAGE_CHILD_POSITION_ERROR = { id: 'page.invalidChildPositionError' };
const INVALID_PAGE_CHILD_POSITION_STATUS_CODE = 400;

const RESET_FOR_CLONE = {
code: '',
titles: '',
Expand Down Expand Up @@ -237,11 +240,7 @@ export const fetchPageTree = pageCode => async (dispatch) => {
return response.payload;
};

/**
* will call:
* http://confluence.entando.org/display/E5/Page+Tree
* /pages
*/

export const handleExpandPage = (pageCode = HOMEPAGE_CODE, alwaysExpand) => (
(dispatch, getState) => {
const state = getState();
Expand Down Expand Up @@ -286,6 +285,8 @@ export const setPageParent = (pageCode, newParentCode) => (dispatch, getState) =
dispatch(setPageParentSync(pageCode, oldParentCode, newParentCode));
} else if (response && response.status === INVALID_PAGE_POSITION_STATUS_CODE) {
dispatch(addToast(INVALID_PAGE_POSITION_ERROR, TOAST_ERROR));
} else if (response && response.status === INVALID_PAGE_CHILD_POSITION_STATUS_CODE) {
dispatch(addToast(INVALID_PAGE_CHILD_POSITION_ERROR, TOAST_ERROR));
} else {
response.json().then((json) => {
json.errors.forEach(err => dispatch(addToast(err.message, TOAST_ERROR)));
Expand Down

0 comments on commit d6cde28

Please sign in to comment.