@@ -592,9 +592,9 @@ export function Control({
|
||||
return policies.filter((policy) => {
|
||||
return (
|
||||
!policySearchQuery ||
|
||||
policy.name?.toLowerCase().includes(policySearchQuery.toLowerCase()) ||
|
||||
(policy.content &&
|
||||
policy.content
|
||||
policy.title?.toLowerCase().includes(policySearchQuery.toLowerCase()) ||
|
||||
(policy.description &&
|
||||
policy.description
|
||||
.toLowerCase()
|
||||
.includes(policySearchQuery.toLowerCase()))
|
||||
);
|
||||
@@ -1092,18 +1092,18 @@ export function Control({
|
||||
>
|
||||
<td className="py-3 px-4">
|
||||
<div className="font-medium">
|
||||
{policy.name}
|
||||
{policy.title}
|
||||
</div>
|
||||
{policy.content && (
|
||||
{policy.description && (
|
||||
<div className="text-xs text-secondary line-clamp-1 mt-0.5">
|
||||
{policy.content}
|
||||
{policy.description}
|
||||
</div>
|
||||
)}
|
||||
</td>
|
||||
<td className="py-3 px-4">
|
||||
{policy.reviewDate
|
||||
{policy.updatedAt
|
||||
? new Date(
|
||||
policy.reviewDate
|
||||
policy.updatedAt
|
||||
).toLocaleDateString()
|
||||
: "Not set"}
|
||||
</td>
|
||||
@@ -1202,16 +1202,16 @@ export function Control({
|
||||
className="border-b hover:bg-invert-bg"
|
||||
>
|
||||
<td className="py-3 px-4">
|
||||
<div className="font-medium">{policy.name}</div>
|
||||
{policy.content && (
|
||||
<div className="font-medium">{policy.title}</div>
|
||||
{policy.description && (
|
||||
<div className="text-xs text-secondary line-clamp-1 mt-0.5">
|
||||
{policy.content}
|
||||
{policy.description}
|
||||
</div>
|
||||
)}
|
||||
</td>
|
||||
<td className="py-3 px-4">
|
||||
{policy.reviewDate
|
||||
? new Date(policy.reviewDate).toLocaleDateString()
|
||||
{policy.updatedAt
|
||||
? new Date(policy.updatedAt).toLocaleDateString()
|
||||
: "Not set"}
|
||||
</td>
|
||||
<td className="py-3 px-4 text-right whitespace-nowrap">
|
||||
|
||||
@@ -100,21 +100,6 @@ interface SignaturesModalProps {
|
||||
} | null;
|
||||
}
|
||||
|
||||
// Define the signature type based on the GraphQL response
|
||||
// interface Signature {
|
||||
// id: string;
|
||||
// state: string;
|
||||
// signedAt?: string | null;
|
||||
// requestedAt: string;
|
||||
// signedBy: {
|
||||
// fullName: string;
|
||||
// id: string;
|
||||
// } | null;
|
||||
// requestedBy: {
|
||||
// fullName: string;
|
||||
// } | null;
|
||||
// }
|
||||
|
||||
export function SignaturesModal({
|
||||
isOpen,
|
||||
onClose,
|
||||
@@ -126,10 +111,7 @@ export function SignaturesModal({
|
||||
policyRef
|
||||
);
|
||||
|
||||
// Safely access and extract version nodes
|
||||
const versionNodes = (data?.policyVersions?.edges?.map(edge => edge.node) || []);
|
||||
|
||||
// Filter to just published versions and sort by version number
|
||||
const publishedVersions = versionNodes
|
||||
.filter(v => v.status === "PUBLISHED")
|
||||
.sort((a, b) => b.version - a.version);
|
||||
@@ -147,7 +129,6 @@ export function SignaturesModal({
|
||||
|
||||
const [commitRequestSignature] = useMutation<SignaturesModalRequestSignatureMutation>(requestSignatureMutation);
|
||||
|
||||
// Load organization data when the modal opens and we have a valid version selected
|
||||
useEffect(() => {
|
||||
if (isOpen && organizationId && selectedVersionData?.status === "PUBLISHED") {
|
||||
loadQuery({ organizationId });
|
||||
@@ -160,7 +141,6 @@ export function SignaturesModal({
|
||||
return format(date, "h:mm a • MMM d, yyyy");
|
||||
};
|
||||
|
||||
// Safely type signatures as our defined Signature interface
|
||||
const signatures = selectedVersionData?.signatures?.edges?.map(edge => edge.node) || [];
|
||||
|
||||
const handleRequestSignature = (personId: string) => {
|
||||
|
||||
Reference in New Issue
Block a user