Add “Organization Type” and "Assigned Date" Column in Project > Organization Page #445
@ -1,6 +1,7 @@
|
||||
import React from "react";
|
||||
import { useProjectAssignedOrganizations } from "../../../hooks/useProjects";
|
||||
import { useSelectedProject } from "../../../slices/apiDataManager";
|
||||
import { formatUTCToLocalTime } from "../../../utils/dateUtils";
|
||||
|
||||
const ProjectAssignedOrgs = () => {
|
||||
const selectedProject = useSelectedProject();
|
||||
@ -24,12 +25,12 @@ const ProjectAssignedOrgs = () => {
|
||||
),
|
||||
align: "text-start",
|
||||
},
|
||||
{
|
||||
{
|
||||
key: "service",
|
||||
label: "Service Name",
|
||||
getValue: (org) => (
|
||||
<div className="d-flex gap-2 py-1 ">
|
||||
{org?.service?.name}
|
||||
{org?.service?.name}
|
||||
</div>
|
||||
),
|
||||
align: "text-start",
|
||||
@ -48,23 +49,37 @@ const ProjectAssignedOrgs = () => {
|
||||
align: "text-center",
|
||||
},
|
||||
{
|
||||
key: "isActive",
|
||||
label: "Status",
|
||||
key: "organizationType",
|
||||
label: "Organization Type",
|
||||
getValue: (org) => (
|
||||
<span
|
||||
className={`text-truncate d-inline-block badge bg-label-${org.isActive ? "primary" :"secondary"}`}
|
||||
style={{ maxWidth: "80px" }}
|
||||
className="text-truncate d-inline-block"
|
||||
style={{ maxWidth: "200px" }}
|
||||
>
|
||||
{org?.isActive ? "Active" : "Inactive"}
|
||||
{org?.organizationType || "N/A"}
|
||||
</span>
|
||||
),
|
||||
align: "text-start",
|
||||
align: "text-center",
|
||||
},
|
||||
{
|
||||
key: "assignedDate",
|
||||
label: "Assigned Date",
|
||||
getValue: (org) => (
|
||||
<span
|
||||
className="text-truncate d-inline-block"
|
||||
style={{ maxWidth: "200px" }}
|
||||
>
|
||||
{formatUTCToLocalTime(org?.assignedDate)}
|
||||
</span>
|
||||
),
|
||||
align: "text-center",
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
if (isLoading) return <div>Loading...</div>;
|
||||
if (isError) return <div>{error.message}</div>;
|
||||
|
||||
console.log("kartik", data)
|
||||
return (
|
||||
<div>
|
||||
<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 loading = isLoading || !isFetched;
|
||||
debugger
|
||||
useEffect(() => {
|
||||
useEffect(() => {
|
||||
if (projectId && !loading && !canView) {
|
||||
showToast("You don't have permission to view project details", "warning");
|
||||
navigate("/projects");
|
||||
|
Loading…
x
Reference in New Issue
Block a user