Add “Organization Type” Column in Project > Organization Page
This commit is contained in:
parent
d5df200ede
commit
f0ce1e30fb
@ -1,6 +1,7 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { useProjectAssignedOrganizations } from "../../../hooks/useProjects";
|
import { useProjectAssignedOrganizations } from "../../../hooks/useProjects";
|
||||||
import { useSelectedProject } from "../../../slices/apiDataManager";
|
import { useSelectedProject } from "../../../slices/apiDataManager";
|
||||||
|
import { formatUTCToLocalTime } from "../../../utils/dateUtils";
|
||||||
|
|
||||||
const ProjectAssignedOrgs = () => {
|
const ProjectAssignedOrgs = () => {
|
||||||
const selectedProject = useSelectedProject();
|
const selectedProject = useSelectedProject();
|
||||||
@ -47,24 +48,25 @@ const ProjectAssignedOrgs = () => {
|
|||||||
),
|
),
|
||||||
align: "text-center",
|
align: "text-center",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "isActive",
|
key: "assignedDate",
|
||||||
label: "Status",
|
label: "Assigned Date",
|
||||||
getValue: (org) => (
|
getValue: (org) => (
|
||||||
<span
|
<span
|
||||||
className={`text-truncate d-inline-block badge bg-label-${org.isActive ? "primary" :"secondary"}`}
|
className="text-truncate d-inline-block"
|
||||||
style={{ maxWidth: "80px" }}
|
style={{ maxWidth: "200px" }}
|
||||||
>
|
>
|
||||||
{org?.isActive ? "Active" : "Inactive"}
|
{/* {org?.assignedDate || "N/A"} */}
|
||||||
|
{formatUTCToLocalTime(org?.assignedDate)}
|
||||||
</span>
|
</span>
|
||||||
),
|
),
|
||||||
align: "text-start",
|
align: "text-center",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
if (isLoading) return <div>Loading...</div>;
|
if (isLoading) return <div>Loading...</div>;
|
||||||
if (isError) return <div>{error.message}</div>;
|
if (isError) return <div>{error.message}</div>;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className="dataTables_wrapper no-footer mx-5 pb-2 page">
|
<div className="dataTables_wrapper no-footer mx-5 pb-2 page">
|
||||||
|
|||||||
@ -14,8 +14,7 @@ export const useProjectAccess = (projectId) => {
|
|||||||
const canView = useHasUserPermission(VIEW_PROJECTS);
|
const canView = useHasUserPermission(VIEW_PROJECTS);
|
||||||
|
|
||||||
const loading = isLoading || !isFetched;
|
const loading = isLoading || !isFetched;
|
||||||
debugger
|
useEffect(() => {
|
||||||
useEffect(() => {
|
|
||||||
if (projectId && !loading && !canView) {
|
if (projectId && !loading && !canView) {
|
||||||
showToast("You don't have permission to view project details", "warning");
|
showToast("You don't have permission to view project details", "warning");
|
||||||
navigate("/projects");
|
navigate("/projects");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user