Remove full name input from nda page
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<d9088a212dfa65ed0a833670cf8bc6d4>>
|
||||
* @generated SignedSource<<426a1227dea8949a1d77d75edf05437a>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -26,7 +26,7 @@ export type PeopleGraphPaginatedFragment$data = {
|
||||
readonly emailAddress: string;
|
||||
readonly fullName: string;
|
||||
readonly id: string;
|
||||
readonly kind: ProfileKind;
|
||||
readonly kind: ProfileKind | null | undefined;
|
||||
readonly position: string | null | undefined;
|
||||
};
|
||||
}>;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<1eea90ca68f7381b881c68f0489837cb>>
|
||||
* @generated SignedSource<<e88375170021c3387ee6a5491bc60e52>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -20,7 +20,7 @@ export type PersonFormFragment$data = {
|
||||
readonly emailAddress: string;
|
||||
readonly fullName: string;
|
||||
readonly id: string;
|
||||
readonly kind: ProfileKind;
|
||||
readonly kind: ProfileKind | null | undefined;
|
||||
readonly membership: {
|
||||
readonly role: MembershipRole;
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<7889e38e185230a2c5b41c3b0fb73cca>>
|
||||
* @generated SignedSource<<8ef1dc9de9a669636884e4f60f7f39fc>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -18,7 +18,7 @@ export type CreateUserInput = {
|
||||
contractStartDate?: string | null | undefined;
|
||||
emailAddress: string;
|
||||
fullName: string;
|
||||
kind: ProfileKind;
|
||||
kind?: ProfileKind | null | undefined;
|
||||
organizationId: string;
|
||||
position?: string | null | undefined;
|
||||
role: MembershipRole;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<8563f3b122bb8d5b6c2e5e7354a0a0c8>>
|
||||
* @generated SignedSource<<dc04e9218150e42554925f8c39d83b41>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -16,7 +16,7 @@ export type UpdateUserInput = {
|
||||
contractStartDate?: string | null | undefined;
|
||||
fullName: string;
|
||||
id: string;
|
||||
kind: ProfileKind;
|
||||
kind?: ProfileKind | null | undefined;
|
||||
position?: string | null | undefined;
|
||||
};
|
||||
export type PersonForm_updateMutation$variables = {
|
||||
|
||||
@@ -68,7 +68,7 @@ const schema = z.object({
|
||||
v => (v as string[]).filter(v => !!v),
|
||||
z.array(z.string().email()),
|
||||
),
|
||||
kind: z.enum(peopleRoles),
|
||||
kind: z.enum(peopleRoles).optional().nullable(),
|
||||
contractStartDate: z.string().optional().nullable(),
|
||||
contractEndDate: z.string().optional().nullable(),
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { sprintf } from "@probo/helpers";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { Button, Card, Field, IconCircleX, Logo, Spinner } from "@probo/ui";
|
||||
import { Button, Card, IconCircleX, Logo, Spinner } from "@probo/ui";
|
||||
import { startTransition, useEffect, useRef } from "react";
|
||||
import {
|
||||
type PreloadedQuery,
|
||||
@@ -11,10 +11,8 @@ import {
|
||||
import { Navigate, useSearchParams } from "react-router";
|
||||
import { graphql } from "relay-runtime";
|
||||
import { useWindowSize } from "usehooks-ts";
|
||||
import { z } from "zod";
|
||||
|
||||
import { PDFPreview } from "#/components/PDFPreview";
|
||||
import { useFormWithSchema } from "#/hooks/useFormWithSchema";
|
||||
import { getPathPrefix } from "#/utils/pathPrefix";
|
||||
|
||||
import type { NDAPageAcceptElectronicSignatureMutation } from "./__generated__/NDAPageAcceptElectronicSignatureMutation.graphql";
|
||||
@@ -81,10 +79,6 @@ const recordSigningEventMutation = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
const schema = z.object({
|
||||
fullName: z.string().min(1),
|
||||
});
|
||||
|
||||
export function NDAPage(props: {
|
||||
queryRef: PreloadedQuery<NDAPageQueryType>;
|
||||
}) {
|
||||
@@ -137,16 +131,6 @@ export function NDAPage(props: {
|
||||
const isFailed = ndaSignature?.status === "FAILED";
|
||||
const isCompleted = ndaSignature?.status === "COMPLETED";
|
||||
|
||||
const {
|
||||
handleSubmit: handleSubmitWrapper,
|
||||
register,
|
||||
formState,
|
||||
} = useFormWithSchema(schema, {
|
||||
defaultValues: {
|
||||
fullName: viewer?.fullName,
|
||||
},
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (isCompleted) {
|
||||
window.location.href = safeContinueUrl;
|
||||
@@ -182,7 +166,7 @@ export function NDAPage(props: {
|
||||
}
|
||||
}, [ndaSignature, recordSigningEvent]);
|
||||
|
||||
const handleSubmit = handleSubmitWrapper(({ fullName }) => {
|
||||
const handleAccept = () => {
|
||||
if (!ndaSignature) return;
|
||||
|
||||
if (ndaSignature.status === "PENDING") {
|
||||
@@ -208,13 +192,12 @@ export function NDAPage(props: {
|
||||
variables: {
|
||||
input: {
|
||||
signatureId: ndaSignature.id,
|
||||
fullName,
|
||||
},
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const nda = trustCenter.nonDisclosureAgreement;
|
||||
if (!viewer) {
|
||||
@@ -260,18 +243,7 @@ export function NDAPage(props: {
|
||||
</Button>
|
||||
</Card>
|
||||
)}
|
||||
<form
|
||||
onSubmit={e => void handleSubmit(e)}
|
||||
className="mt-8"
|
||||
>
|
||||
<Field
|
||||
required
|
||||
label={__("Full name")}
|
||||
placeholder="John Doe"
|
||||
{...register("fullName")}
|
||||
type="text"
|
||||
disabled={isProcessing}
|
||||
/>
|
||||
<div className="mt-8">
|
||||
<p className="text-xs text-txt-tertiary mt-6">
|
||||
{consentText}
|
||||
</p>
|
||||
@@ -302,9 +274,10 @@ export function NDAPage(props: {
|
||||
)
|
||||
: (
|
||||
<Button
|
||||
type="submit"
|
||||
type="button"
|
||||
onClick={handleAccept}
|
||||
className="h-10 w-full mt-4"
|
||||
disabled={formState.isSubmitting || !formState.isValid}
|
||||
disabled={isProcessing}
|
||||
icon={isAccepting ? Spinner : undefined}
|
||||
>
|
||||
{isFailed
|
||||
@@ -312,7 +285,7 @@ export function NDAPage(props: {
|
||||
: __("Accept")}
|
||||
</Button>
|
||||
)}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<a
|
||||
href="https://www.getprobo.com/"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<41e415a03c63efbb590b1c2c782d5eac>>
|
||||
* @generated SignedSource<<319d6df7ac6b5452d4a74501a35cec43>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -11,7 +11,6 @@
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type ElectronicSignatureStatus = "ACCEPTED" | "COMPLETED" | "FAILED" | "PENDING" | "PROCESSING";
|
||||
export type AcceptElectronicSignatureInput = {
|
||||
fullName: string;
|
||||
signatureId: string;
|
||||
};
|
||||
export type NDAPageAcceptElectronicSignatureMutation$variables = {
|
||||
|
||||
Reference in New Issue
Block a user