refactor: rename remaining recipient references to person/people
This commit is contained in:
@@ -31,7 +31,7 @@ export default async function EditAssetPage({
|
||||
</div>
|
||||
<EditAssetForm
|
||||
items={items}
|
||||
recipients={people}
|
||||
people={people}
|
||||
asset={asset as unknown as AssetWithAssignment}
|
||||
formCopy={copy.form}
|
||||
schemaCopy={copy.schema}
|
||||
|
||||
@@ -31,7 +31,7 @@ import type {
|
||||
interface EditAssetFormProps {
|
||||
asset: AssetWithAssignment
|
||||
items: Item[]
|
||||
recipients: Person[]
|
||||
people: Person[]
|
||||
formCopy: AssetFormCopy
|
||||
schemaCopy: AssetSchemaCopy
|
||||
statusCopy: AssetStatusCopy
|
||||
@@ -41,7 +41,7 @@ interface EditAssetFormProps {
|
||||
export default function EditAssetForm({
|
||||
asset,
|
||||
items,
|
||||
recipients,
|
||||
people,
|
||||
formCopy,
|
||||
schemaCopy,
|
||||
statusCopy,
|
||||
@@ -64,7 +64,7 @@ export default function EditAssetForm({
|
||||
serialNumber: asset.serialNumber,
|
||||
deliveryNote: asset.deliveryNote ?? undefined,
|
||||
status: asset.status as UpdateAssetStatus,
|
||||
recipientId: asset.assignment?.recipientId ?? undefined,
|
||||
personId: asset.assignment?.recipientId ?? undefined,
|
||||
},
|
||||
shouldFocusError: true,
|
||||
mode: "onSubmit",
|
||||
@@ -168,23 +168,23 @@ export default function EditAssetForm({
|
||||
</div>
|
||||
{status === "ASSIGNED" && (
|
||||
<div>
|
||||
<label htmlFor="recipientId" className="mb-2 block text-lg">
|
||||
{formCopy.recipientLabel}
|
||||
<label htmlFor="personId" className="mb-2 block text-lg">
|
||||
{formCopy.personLabel}
|
||||
</label>
|
||||
<select
|
||||
id="recipientId"
|
||||
{...register("recipientId")}
|
||||
id="personId"
|
||||
{...register("personId")}
|
||||
className="w-full rounded-lg border px-4 py-2"
|
||||
>
|
||||
<option value="">{formCopy.recipientPlaceholder}</option>
|
||||
{recipients?.map((recipient) => (
|
||||
<option key={recipient.id} value={recipient.id}>
|
||||
{recipient.firstName} {recipient.lastName}
|
||||
<option value="">{formCopy.personPlaceholder}</option>
|
||||
{people?.map((person) => (
|
||||
<option key={person.id} value={person.id}>
|
||||
{person.firstName} {person.lastName}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
{errors?.recipientId && (
|
||||
<p className="text-error">{errors.recipientId.message}</p>
|
||||
{errors?.personId && (
|
||||
<p className="text-error">{errors.personId.message}</p>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -25,7 +25,7 @@ import type {
|
||||
|
||||
interface NewAssetFormProps {
|
||||
items: ItemWithoutStock[]
|
||||
recipients: Person[]
|
||||
people: Person[]
|
||||
formCopy: AssetFormCopy
|
||||
schemaCopy: AssetSchemaCopy
|
||||
statusCopy: AssetStatusCopy
|
||||
@@ -34,7 +34,7 @@ interface NewAssetFormProps {
|
||||
|
||||
export default function NewAssetForm({
|
||||
items,
|
||||
recipients,
|
||||
people,
|
||||
formCopy,
|
||||
schemaCopy,
|
||||
statusCopy,
|
||||
@@ -156,23 +156,23 @@ export default function NewAssetForm({
|
||||
</div>
|
||||
{status === "ASSIGNED" && (
|
||||
<div>
|
||||
<label htmlFor="recipientId" className="mb-2 block text-lg">
|
||||
{formCopy.recipientLabel}
|
||||
<label htmlFor="personId" className="mb-2 block text-lg">
|
||||
{formCopy.personLabel}
|
||||
</label>
|
||||
<select
|
||||
id="recipientId"
|
||||
{...register("recipientId")}
|
||||
id="personId"
|
||||
{...register("personId")}
|
||||
className="w-full rounded-lg border px-4 py-2"
|
||||
>
|
||||
<option value="">{formCopy.recipientPlaceholder}</option>
|
||||
{recipients?.map((recipient) => (
|
||||
<option key={recipient.id} value={recipient.id}>
|
||||
{recipient.firstName} {recipient.lastName}
|
||||
<option value="">{formCopy.personPlaceholder}</option>
|
||||
{people?.map((person) => (
|
||||
<option key={person.id} value={person.id}>
|
||||
{person.firstName} {person.lastName}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
{errors?.recipientId && (
|
||||
<p className="text-error">{errors.recipientId.message}</p>
|
||||
{errors?.personId && (
|
||||
<p className="text-error">{errors.personId.message}</p>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -19,7 +19,7 @@ export default async function NewAssetPage() {
|
||||
</div>
|
||||
<NewAssetForm
|
||||
items={items}
|
||||
recipients={people}
|
||||
people={people}
|
||||
formCopy={copy.form}
|
||||
schemaCopy={copy.schema}
|
||||
statusCopy={copy.status}
|
||||
|
||||
Reference in New Issue
Block a user