260326:1726 Fixing Refactor ADR-019 Naming convention uuid #06
This commit is contained in:
@@ -76,7 +76,7 @@ function CirculationItem({ circ }: { circ: Circulation }) {
|
||||
</div>
|
||||
)}
|
||||
|
||||
<Link href={`/circulation/${circ.uuid}`}>
|
||||
<Link href={`/circulation/${circ.publicId}`}>
|
||||
<Button variant="ghost" size="sm" className="w-full h-7 text-xs mt-1">
|
||||
View Details
|
||||
<ChevronRight className="h-3 w-3 ml-1" />
|
||||
@@ -118,7 +118,7 @@ export function CirculationStatusCard({ correspondenceUuid }: CirculationStatusC
|
||||
<p className="text-sm text-muted-foreground">No circulations yet</p>
|
||||
) : (
|
||||
circulations.map((circ) => (
|
||||
<CirculationItem key={circ.uuid} circ={circ} />
|
||||
<CirculationItem key={circ.publicId} circ={circ} />
|
||||
))
|
||||
)}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ export function CorrespondenceDetail({ data }: CorrespondenceDetailProps) {
|
||||
|
||||
const handleSubmit = () => {
|
||||
if (confirm('Are you sure you want to submit this correspondence?')) {
|
||||
submitMutation.mutate({ uuid: data.uuid, data: {} });
|
||||
submitMutation.mutate({ uuid: data.publicId, data: {} });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -52,7 +52,7 @@ export function CorrespondenceDetail({ data }: CorrespondenceDetailProps) {
|
||||
if (!actionState || actionState === 'cancel') return;
|
||||
const action = actionState === 'approve' ? 'APPROVE' : 'REJECT';
|
||||
processMutation.mutate(
|
||||
{ uuid: data.uuid, data: { action, comments } },
|
||||
{ uuid: data.publicId, data: { action, comments } },
|
||||
{ onSuccess: () => { setActionState(null); setComments(''); } }
|
||||
);
|
||||
};
|
||||
@@ -60,7 +60,7 @@ export function CorrespondenceDetail({ data }: CorrespondenceDetailProps) {
|
||||
const handleCancel = () => {
|
||||
if (!cancelReason.trim()) return;
|
||||
cancelMutation.mutate(
|
||||
{ uuid: data.uuid, reason: cancelReason },
|
||||
{ uuid: data.publicId, reason: cancelReason },
|
||||
{ onSuccess: () => { setActionState(null); setCancelReason(''); } }
|
||||
);
|
||||
};
|
||||
@@ -97,7 +97,7 @@ export function CorrespondenceDetail({ data }: CorrespondenceDetailProps) {
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
{status === 'DRAFT' && (
|
||||
<Link href={`/correspondences/${data.uuid}/edit`}>
|
||||
<Link href={`/correspondences/${data.publicId}/edit`}>
|
||||
<Button variant="outline">
|
||||
<Edit className="mr-2 h-4 w-4" />
|
||||
Edit
|
||||
@@ -256,7 +256,7 @@ export function CorrespondenceDetail({ data }: CorrespondenceDetailProps) {
|
||||
<div className="grid gap-2">
|
||||
{attachments.map((file, index) => (
|
||||
<div
|
||||
key={file.uuid || index}
|
||||
key={file.publicId || index}
|
||||
className="flex items-center justify-between p-3 border rounded-lg bg-muted/20"
|
||||
>
|
||||
<div className="flex items-center gap-3">
|
||||
@@ -376,17 +376,17 @@ export function CorrespondenceDetail({ data }: CorrespondenceDetailProps) {
|
||||
</Card>
|
||||
|
||||
{/* Circulations */}
|
||||
<CirculationStatusCard correspondenceUuid={data.uuid} />
|
||||
<CirculationStatusCard correspondenceUuid={data.publicId} />
|
||||
|
||||
{/* Tags */}
|
||||
<TagManager
|
||||
uuid={data.uuid}
|
||||
uuid={data.publicId}
|
||||
canEdit={status !== 'CANCELLED'}
|
||||
/>
|
||||
|
||||
{/* References */}
|
||||
<ReferenceSelector
|
||||
uuid={data.uuid}
|
||||
uuid={data.publicId}
|
||||
canEdit={status !== 'CANCELLED'}
|
||||
/>
|
||||
|
||||
|
||||
@@ -458,7 +458,7 @@ export function CorrespondenceForm({ initialData, uuid }: { initialData?: Initia
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{organizationOptions.map((org) => (
|
||||
<SelectItem key={org.uuid} value={org.uuid}>
|
||||
<SelectItem key={org.publicId} value={org.publicId}>
|
||||
{org.organizationName} ({org.organizationCode})
|
||||
</SelectItem>
|
||||
))}
|
||||
@@ -479,7 +479,7 @@ export function CorrespondenceForm({ initialData, uuid }: { initialData?: Initia
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{organizationOptions.map((org) => (
|
||||
<SelectItem key={org.uuid} value={org.uuid}>
|
||||
<SelectItem key={org.publicId} value={org.publicId}>
|
||||
{org.organizationName} ({org.organizationCode})
|
||||
</SelectItem>
|
||||
))}
|
||||
@@ -492,22 +492,22 @@ export function CorrespondenceForm({ initialData, uuid }: { initialData?: Initia
|
||||
<Label>CC Organizations (Optional)</Label>
|
||||
<div className="space-y-2 max-h-32 overflow-y-auto border rounded-md p-3">
|
||||
{organizationOptions
|
||||
.filter(org => org.uuid !== toOrgId) // Exclude TO organization
|
||||
.filter(org => org.publicId !== toOrgId) // Exclude TO organization
|
||||
.map((org) => (
|
||||
<div key={org.uuid} className="flex items-center space-x-2">
|
||||
<div key={org.publicId} className="flex items-center space-x-2">
|
||||
<Checkbox
|
||||
id={`cc-${org.uuid}`}
|
||||
checked={watch('ccOrganizationIds')?.includes(org.uuid) || false}
|
||||
id={`cc-${org.publicId}`}
|
||||
checked={watch('ccOrganizationIds')?.includes(org.publicId) || false}
|
||||
onCheckedChange={(checked) => {
|
||||
const currentCC = watch('ccOrganizationIds') || [];
|
||||
if (checked) {
|
||||
setValue('ccOrganizationIds', [...currentCC, org.uuid]);
|
||||
setValue('ccOrganizationIds', [...currentCC, org.publicId]);
|
||||
} else {
|
||||
setValue('ccOrganizationIds', currentCC.filter(id => id !== org.uuid));
|
||||
setValue('ccOrganizationIds', currentCC.filter(id => id !== org.publicId));
|
||||
}
|
||||
}}
|
||||
/>
|
||||
<Label htmlFor={`cc-${org.uuid}`} className="text-sm">
|
||||
<Label htmlFor={`cc-${org.publicId}`} className="text-sm">
|
||||
{org.organizationName} ({org.organizationCode})
|
||||
</Label>
|
||||
</div>
|
||||
|
||||
@@ -87,10 +87,10 @@ export function CorrespondenceList({ data }: CorrespondenceListProps) {
|
||||
id: 'actions',
|
||||
cell: ({ row }) => {
|
||||
const item = row.original;
|
||||
// Edit/View link goes to the DOCUMENT detail (correspondence.uuid)
|
||||
// Ideally we might pass ?revId=item.uuid to view specific revision, but detail page defaults to latest.
|
||||
// Edit/View link goes to the DOCUMENT detail (correspondence.publicId)
|
||||
// Ideally we might pass ?revId=item.publicId to view specific revision, but detail page defaults to latest.
|
||||
// For editing, we edit the document.
|
||||
const docUuid = item.correspondence.uuid;
|
||||
const docUuid = item.correspondence.publicId;
|
||||
const statusCode = item.status?.statusCode;
|
||||
|
||||
return (
|
||||
|
||||
@@ -54,7 +54,7 @@ export function RevisionHistory({ revisions }: RevisionHistoryProps) {
|
||||
const isCurrent = rev.isCurrent;
|
||||
|
||||
return (
|
||||
<div key={rev.uuid ?? rev.revisionNumber} className="flex gap-3 pl-7 relative">
|
||||
<div key={rev.publicId ?? rev.revisionNumber} className="flex gap-3 pl-7 relative">
|
||||
<div
|
||||
className={`absolute left-1.5 top-1 w-3 h-3 rounded-full border-2 ${
|
||||
isCurrent
|
||||
|
||||
Reference in New Issue
Block a user