remove project permissions
This commit is contained in:
parent
c1e5ff4043
commit
ae772d925a
@ -1,24 +1,24 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import {
|
// import {
|
||||||
useDashboardProjectsCardData,
|
// useDashboardProjectsCardData,
|
||||||
useDashboardTeamsCardData,
|
// useDashboardTeamsCardData,
|
||||||
useDashboardTasksCardData,
|
// useDashboardTasksCardData,
|
||||||
useAttendanceOverviewData
|
// useAttendanceOverviewData
|
||||||
} from "../../hooks/useDashboard_Data";
|
// } from "../../hooks/useDashboard_Data";
|
||||||
|
|
||||||
import Projects from "./Projects";
|
// import Projects from "./Projects";
|
||||||
import Teams from "./Teams";
|
// import Teams from "./Teams";
|
||||||
import TasksCard from "./Tasks";
|
// import TasksCard from "./Tasks";
|
||||||
import ProjectCompletionChart from "./ProjectCompletionChart";
|
// import ProjectCompletionChart from "./ProjectCompletionChart";
|
||||||
import ProjectProgressChart from "./ProjectProgressChart";
|
// import ProjectProgressChart from "./ProjectProgressChart";
|
||||||
import ProjectOverview from "../Project/ProjectOverview";
|
// import ProjectOverview from "../Project/ProjectOverview";
|
||||||
import AttendanceOverview from "./AttendanceChart";
|
import AttendanceOverview from "./AttendanceChart";
|
||||||
|
|
||||||
const Dashboard = () => {
|
const Dashboard = () => {
|
||||||
const { projectsCardData } = useDashboardProjectsCardData();
|
// const { projectsCardData } = useDashboardProjectsCardData();
|
||||||
const { teamsCardData } = useDashboardTeamsCardData();
|
// const { teamsCardData } = useDashboardTeamsCardData();
|
||||||
const { tasksCardData } = useDashboardTasksCardData();
|
// const { tasksCardData } = useDashboardTasksCardData();
|
||||||
|
|
||||||
// Get the selected project ID from Redux store
|
// Get the selected project ID from Redux store
|
||||||
const projectId = useSelector((store) => store.localVariables.projectId);
|
const projectId = useSelector((store) => store.localVariables.projectId);
|
||||||
|
@ -188,7 +188,7 @@ const ListViewContact = ({ data, Pagination, isLoading }) => {
|
|||||||
<tr style={{ height: "200px" }}>
|
<tr style={{ height: "200px" }}>
|
||||||
<td
|
<td
|
||||||
colSpan={contactList.length + 1}
|
colSpan={contactList.length + 1}
|
||||||
className="text-center align-middle"
|
className="text-center align-middle border-0"
|
||||||
>
|
>
|
||||||
No contacts found
|
No contacts found
|
||||||
</td>
|
</td>
|
||||||
@ -201,9 +201,7 @@ const ListViewContact = ({ data, Pagination, isLoading }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{data?.length === 0 && !isLoading && (
|
|
||||||
<div className="text-center"> No Expense Found</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
@ -246,7 +246,7 @@ const Header = () => {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<ul className="navbar-nav flex-row align-items-center ms-md-auto">
|
<ul className="navbar-nav flex-row align-items-center ms-md-auto">
|
||||||
{HasManageProjectPermission && (
|
{/* {HasManageProjectPermission && ( */}
|
||||||
<li className="nav-item navbar-dropdown dropdown-user dropdown">
|
<li className="nav-item navbar-dropdown dropdown-user dropdown">
|
||||||
<button
|
<button
|
||||||
className="btn btn-sm btn-primary"
|
className="btn btn-sm btn-primary"
|
||||||
@ -257,7 +257,7 @@ const Header = () => {
|
|||||||
<span className="d-none d-md-inline-block">Create Project</span>
|
<span className="d-none d-md-inline-block">Create Project</span>
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
)}
|
{/* )} */}
|
||||||
<li className="nav-item navbar-dropdown dropdown-user dropdown">
|
<li className="nav-item navbar-dropdown dropdown-user dropdown">
|
||||||
<a
|
<a
|
||||||
aria-label="dropdown profile avatar"
|
aria-label="dropdown profile avatar"
|
||||||
|
@ -41,21 +41,24 @@ const LoginPage = () => {
|
|||||||
password: data.password,
|
password: data.password,
|
||||||
};
|
};
|
||||||
const response = await AuthRepository.login(userCredential);
|
const response = await AuthRepository.login(userCredential);
|
||||||
if (data.rememberMe) {
|
// if (data.rememberMe) {
|
||||||
localStorage.setItem("jwtToken", response.data.token);
|
// localStorage.setItem("jwtToken", response.data.token);
|
||||||
localStorage.setItem("refreshToken", response.data.refreshToken);
|
// localStorage.setItem("refreshToken", response.data.refreshToken);
|
||||||
} else {
|
// } else {
|
||||||
sessionStorage.setItem("jwtToken", response.data.token);
|
// sessionStorage.setItem("jwtToken", response.data.token);
|
||||||
sessionStorage.setItem("refreshToken", response.data.refreshToken);
|
// sessionStorage.setItem("refreshToken", response.data.refreshToken);
|
||||||
}
|
// }
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
navigate("/auth/switch/org");
|
localStorage.setItem("jwtToken", response.data.token);
|
||||||
|
localStorage.setItem("refreshToken", response.data.refreshToken);
|
||||||
|
navigate("/dashboard",{ replace: true });
|
||||||
} else {
|
} else {
|
||||||
await AuthRepository.sendOTP({ email: data.username });
|
await AuthRepository.sendOTP({ email: data.username });
|
||||||
showToast("OTP has been sent to your email.", "success");
|
showToast("OTP has been sent to your email.", "success");
|
||||||
localStorage.setItem("otpUsername", data.username);
|
localStorage.setItem("otpUsername", data.username);
|
||||||
localStorage.setItem("otpSentTime", now.toString());
|
localStorage.setItem("otpSentTime", now.toString());
|
||||||
navigate("/auth/login-otp");
|
// navigate("/auth/login-otp");
|
||||||
|
navigate("/dashboard",{ replace: true });
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
showToast("Invalid username or password.", "error");
|
showToast("Invalid username or password.", "error");
|
||||||
|
@ -36,7 +36,7 @@ const ProjectDetails = () => {
|
|||||||
refetch,
|
refetch,
|
||||||
} = useProjectDetails(projectId);
|
} = useProjectDetails(projectId);
|
||||||
|
|
||||||
const { canView, loading: permsLoading } = useProjectAccess(projectId);
|
// const { canView, loading: permsLoading } = useProjectAccess(projectId);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!projectId && projectNames.length > 0) {
|
if (!projectId && projectNames.length > 0) {
|
||||||
@ -70,7 +70,7 @@ const ProjectDetails = () => {
|
|||||||
localStorage.setItem("lastActiveProjectTab", pillKey);
|
localStorage.setItem("lastActiveProjectTab", pillKey);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (projectLoading || permsLoading || !projects_Details) {
|
if (projectLoading || !projects_Details) {
|
||||||
return <Loader />;
|
return <Loader />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user