mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 08:58:26 +00:00
bug fixes
This commit is contained in:
parent
4597997485
commit
bf8495b6ea
3 changed files with 24 additions and 10 deletions
|
|
@ -190,11 +190,15 @@ export default function PagePermission({ darkMode }) {
|
|||
appPermissionService
|
||||
.createPagePermission(appId, editingPage?.id, body)
|
||||
.then((data) => {
|
||||
toast.success('Permission successfully created!');
|
||||
toast.success('Permission successfully created!', {
|
||||
className: 'text-nowrap w-auto mw-100',
|
||||
});
|
||||
updatePageWithPermissions(editingPage?.id, data);
|
||||
})
|
||||
.catch(() => {
|
||||
toast.error('Permission could not be created. Please try again!');
|
||||
toast.error('Permission could not be created. Please try again!', {
|
||||
className: 'text-nowrap w-auto mw-100',
|
||||
});
|
||||
})
|
||||
.finally(() => {
|
||||
setIsLoading(false);
|
||||
|
|
@ -214,11 +218,15 @@ export default function PagePermission({ darkMode }) {
|
|||
appPermissionService
|
||||
.updatePagePermission(appId, editingPage?.id, body)
|
||||
.then((data) => {
|
||||
toast.success('Permission successfully updated!');
|
||||
toast.success('Permission successfully updated!', {
|
||||
className: 'text-nowrap w-auto mw-100',
|
||||
});
|
||||
updatePageWithPermissions(editingPage?.id, data);
|
||||
})
|
||||
.catch(() => {
|
||||
toast.error('Permission could not be updated. Please try again!');
|
||||
toast.error('Permission could not be updated. Please try again!', {
|
||||
className: 'text-nowrap w-auto mw-100',
|
||||
});
|
||||
})
|
||||
.finally(() => {
|
||||
setIsLoading(false);
|
||||
|
|
@ -231,12 +239,16 @@ export default function PagePermission({ darkMode }) {
|
|||
appPermissionService
|
||||
.deletePagePermission(appId, pageToDelete)
|
||||
.then((data) => {
|
||||
toast.success('Permission successfully deleted!');
|
||||
toast.success('Permission successfully deleted!', {
|
||||
className: 'text-nowrap w-auto mw-100',
|
||||
});
|
||||
updatePageWithPermissions(pageToDelete, []);
|
||||
setPageToDelete(null);
|
||||
})
|
||||
.catch(() => {
|
||||
toast.error('Permission could not be deleted. Please try again!');
|
||||
toast.error('Permission could not be deleted. Please try again!', {
|
||||
className: 'text-nowrap w-auto mw-100',
|
||||
});
|
||||
setShowConfirmDelete(false);
|
||||
togglePagePermissionModal(true);
|
||||
})
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export const ViewerSidebarNavigation = ({
|
|||
const iconName = isHomePage && !page.icon ? 'IconHome2' : page.icon;
|
||||
// eslint-disable-next-line import/namespace
|
||||
const IconElement = Icons?.[iconName] ?? Icons?.['IconFileDescription'];
|
||||
return page.hidden || page.disabled ? null : (
|
||||
return page.hidden || page.disabled || page?.restricted ? null : (
|
||||
<FolderList
|
||||
key={page.handle}
|
||||
onClick={() => switchPageWrapper(page?.id)}
|
||||
|
|
|
|||
|
|
@ -323,8 +323,8 @@ const useAppData = (appId, moduleId, darkMode, mode = 'edit', { environmentId, v
|
|||
let startingPage = appData.pages.find((page) => page.id === homePageId);
|
||||
|
||||
//no access to homepage, set to the next available page
|
||||
if (!homePageId) {
|
||||
startingPage = appData.pages[0];
|
||||
if (startingPage?.restricted) {
|
||||
startingPage = appData.pages.find((page) => !page?.restricted);
|
||||
}
|
||||
|
||||
if (initialLoadRef.current) {
|
||||
|
|
@ -341,7 +341,9 @@ const useAppData = (appId, moduleId, darkMode, mode = 'edit', { environmentId, v
|
|||
window.history.replaceState(null, null, newUrl);
|
||||
|
||||
if (page?.restricted) {
|
||||
toast.error('Access to this page is restricted. Contact admin to know more.');
|
||||
toast.error('Access to this page is restricted. Contact admin to know more.', {
|
||||
className: 'text-nowrap w-auto mw-100',
|
||||
});
|
||||
}
|
||||
} else {
|
||||
startingPage = page;
|
||||
|
|
|
|||
Loading…
Reference in a new issue