fix reviewed time & lint

This commit is contained in:
x032205
2025-11-08 00:28:03 -05:00
parent 216f5cc147
commit 7838c27915
25 changed files with 129 additions and 111 deletions
@@ -54,6 +54,7 @@ export type TSecretApprovalRequest = {
lastName: string;
username: string;
isOrgMembershipActive: boolean;
createdAt: Date;
}[];
project: string;
environment: string;
@@ -1,6 +1,6 @@
import { useState } from "react";
import { faPlus } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useState } from "react";
import { createNotification } from "@app/components/notifications";
import { Button, DeleteActionModal } from "@app/components/v2";
@@ -1,8 +1,8 @@
import { useEffect } from "react";
import { Controller, useForm } from "react-hook-form";
import { faQuestionCircle } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { zodResolver } from "@hookform/resolvers/zod";
import { useEffect } from "react";
import { Controller, useForm } from "react-hook-form";
import { z } from "zod";
import { createNotification } from "@app/components/notifications";
@@ -1,3 +1,4 @@
import { useCallback } from "react";
import {
faCheck,
faCircleInfo,
@@ -9,7 +10,6 @@ import {
faTrash
} from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useCallback } from "react";
import { createNotification } from "@app/components/notifications";
import {
@@ -1,3 +1,6 @@
import { faCheck, faCopy } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import {
Alert,
AlertDescription,
@@ -11,8 +14,6 @@ import {
import { useToggle } from "@app/hooks";
import { TCertificateProfileWithDetails } from "@app/hooks/api/certificateProfiles";
import { useRevealAcmeEabSecret } from "@app/hooks/api/certificateProfiles/queries";
import { faCheck, faCopy } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
const RESET_COPIED_DELAY = 1 * 1000;
@@ -160,14 +160,18 @@ export const SecretApprovalRequestChanges = ({ approvalRequestId, onGoBack }: Pr
secretApprovalRequestDetails.policy.bypassers.some(({ userId }) => userId === userSession.id);
const reviewedUsers = secretApprovalRequestDetails?.reviewers?.reduce<
Record<string, { status: ApprovalStatus; comment: string; isOrgMembershipActive: boolean }>
Record<
string,
{ status: ApprovalStatus; comment: string; isOrgMembershipActive: boolean; createdAt: Date }
>
>(
(prev, curr) => ({
...prev,
[curr.userId]: {
status: curr.status,
comment: curr.comment,
isOrgMembershipActive: curr.isOrgMembershipActive
isOrgMembershipActive: curr.isOrgMembershipActive,
createdAt: curr.createdAt
}
}),
{}
@@ -488,7 +492,7 @@ export const SecretApprovalRequestChanges = ({ approvalRequestId, onGoBack }: Pr
</span>{" "}
the request on{" "}
{format(
new Date(secretApprovalRequestDetails.createdAt),
new Date(reviewer ? reviewer.createdAt : new Date()),
"MM/dd/yyyy h:mm:ss aa"
)}
.