mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 17:08:34 +00:00
Merged with main & fixed the bugs
This commit is contained in:
parent
5f246f48c0
commit
4804ae4a70
6 changed files with 23 additions and 11 deletions
|
|
@ -3,12 +3,14 @@ import useStore from '@/AppBuilder/_stores/store';
|
|||
import SwitchComponent from '@/components/ui/Switch/Index';
|
||||
import { shallow } from 'zustand/shallow';
|
||||
import { Confirm } from '@/Editor/Viewer/Confirm';
|
||||
import { useModuleContext } from '@/AppBuilder/_contexts/ModuleContext';
|
||||
|
||||
const MaintenanceMode = ({ darkMode }) => {
|
||||
const { moduleId } = useModuleContext();
|
||||
const [showConfirmation, setConfirmationShow] = useState(false);
|
||||
const { isMaintenanceOn, toggleAppMaintenance } = useStore(
|
||||
(state) => ({
|
||||
isMaintenanceOn: state.app.isMaintenanceOn,
|
||||
isMaintenanceOn: state.appStore.modules[moduleId].app.isMaintenanceOn,
|
||||
toggleAppMaintenance: state.toggleAppMaintenance,
|
||||
}),
|
||||
shallow
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import { appPermissionService } from '@/_services';
|
|||
import { ConfirmDialog } from '@/_components';
|
||||
import toast from 'react-hot-toast';
|
||||
import Spinner from '@/_ui/Spinner';
|
||||
import { useModuleContext } from '@/AppBuilder/_contexts/ModuleContext';
|
||||
|
||||
const PERMISSION_TYPES = {
|
||||
single: 'SINGLE',
|
||||
|
|
@ -16,10 +17,11 @@ const PERMISSION_TYPES = {
|
|||
};
|
||||
|
||||
export default function PagePermission({ darkMode }) {
|
||||
const { moduleId } = useModuleContext();
|
||||
const showPagePermissionModal = useStore((state) => state.showPagePermissionModal);
|
||||
const togglePagePermissionModal = useStore((state) => state.togglePagePermissionModal);
|
||||
const editingPage = useStore((state) => state.editingPage);
|
||||
const appId = useStore((state) => state.app.appId);
|
||||
const appId = useStore((state) => state.appStore.modules[moduleId].app.appId);
|
||||
const selectedUserGroups = useStore((state) => state.selectedUserGroups);
|
||||
const setSelectedUserGroups = useStore((state) => state.setSelectedUserGroups);
|
||||
const selectedUsers = useStore((state) => state.selectedUsers);
|
||||
|
|
@ -360,7 +362,8 @@ export default function PagePermission({ darkMode }) {
|
|||
}
|
||||
|
||||
const UserGroupSelect = () => {
|
||||
const appId = useStore((state) => state.app.appId);
|
||||
const { moduleId } = useModuleContext();
|
||||
const appId = useStore((state) => state.appStore.modules[moduleId].app.appId);
|
||||
const selectedUserGroups = useStore((state) => state.selectedUserGroups);
|
||||
const setSelectedUserGroups = useStore((state) => state.setSelectedUserGroups);
|
||||
const [userGroups, setUserGroups] = useState([]);
|
||||
|
|
@ -420,7 +423,8 @@ const UserGroupSelect = () => {
|
|||
};
|
||||
|
||||
const UserSelect = () => {
|
||||
const appId = useStore((state) => state.app.appId);
|
||||
const { moduleId } = useModuleContext();
|
||||
const appId = useStore((state) => state.appStore.modules[moduleId].app.appId);
|
||||
const editingPage = useStore((state) => state.editingPage);
|
||||
const selectedUsers = useStore((state) => state.selectedUsers);
|
||||
const setSelectedUsers = useStore((state) => state.setSelectedUsers);
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ export const Viewer = ({
|
|||
<div
|
||||
className="canvas-container align-items-center"
|
||||
style={{
|
||||
backgroundColor: canvasBgColor,
|
||||
backgroundColor: moduleMode ? 'inherit' : canvasBgColor,
|
||||
}}
|
||||
>
|
||||
<div className={`areas d-flex flex-rows app-${appId}`}>
|
||||
|
|
|
|||
|
|
@ -358,13 +358,13 @@ const useAppData = (
|
|||
global_settings.theme = baseTheme;
|
||||
}
|
||||
setGlobalSettings(global_settings);
|
||||
|
||||
setPages(pages, moduleId);
|
||||
setPageSettings(
|
||||
computePageSettings(deepCamelCase(appData?.editing_version?.page_settings ?? appData?.page_settings))
|
||||
);
|
||||
}
|
||||
|
||||
setPages(pages, moduleId);
|
||||
setPageSettings(
|
||||
computePageSettings(deepCamelCase(appData?.editing_version?.page_settings ?? appData?.page_settings))
|
||||
);
|
||||
|
||||
// set starting page as homepage initially
|
||||
let startingPage = appData.pages.find((page) => page.id === homePageId);
|
||||
|
||||
|
|
@ -513,10 +513,15 @@ const useAppData = (
|
|||
};
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('error--- ', error);
|
||||
|
||||
if (isPublicAccess) {
|
||||
if (mode !== 'edit') {
|
||||
handleError('view', error);
|
||||
}
|
||||
} else if (moduleMode) {
|
||||
setEditorLoading(false, moduleId);
|
||||
toast.error('Error fetching module data');
|
||||
}
|
||||
});
|
||||
}, [setApp, setEditorLoading, currentSession]);
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ export const getPrivateRoute = (page, params = {}) => {
|
|||
workflows: '/workflows',
|
||||
workspace_constants: '/workspace-constants',
|
||||
profile_settings: '/profile-settings',
|
||||
modules: '/modules',
|
||||
};
|
||||
|
||||
let url = routes[page];
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit e4bada464821218151cfa0c6ed1c7b31e18fa2c4
|
||||
Subproject commit f779cb99549ae248dbca9e3d0f658359651ede75
|
||||
Loading…
Reference in a new issue