Compare commits
2 Commits
main
...
Kartik_Bug
| Author | SHA1 | Date | |
|---|---|---|---|
| 465c42f18c | |||
| 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();
|
||||||
@ -48,23 +49,37 @@ const ProjectAssignedOrgs = () => {
|
|||||||
align: "text-center",
|
align: "text-center",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "isActive",
|
key: "organizationType",
|
||||||
label: "Status",
|
label: "Organization Type",
|
||||||
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?.organizationType || "N/A"}
|
||||||
</span>
|
</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 (isLoading) return <div>Loading...</div>;
|
||||||
if (isError) return <div>{error.message}</div>;
|
if (isError) return <div>{error.message}</div>;
|
||||||
|
console.log("kartik", data)
|
||||||
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,7 +14,6 @@ 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");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user