Skip to content

Commit bfdbb15

Browse files
committed
feat: update policy signature requirement and dependencies
- Changed the default value of the isRequiredToSign field in the Policy model to true and updated existing records accordingly. - Removed the Employee Signature Requirement section from the UpdatePolicyOverview component. - Added new dependencies including @vitejs/plugin-react, jsdom, vite-tsconfig-paths, and vitest in bun.lock. - Updated the scheduler version in bun.lock to 0.26.0.
1 parent 36a7c76 commit bfdbb15

4 files changed

Lines changed: 13 additions & 26 deletions

File tree

apps/app/src/app/(app)/[orgId]/policies/[policyId]/components/UpdatePolicyOverview.tsx

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { Calendar } from '@comp/ui/calendar';
99
import { cn } from '@comp/ui/cn';
1010
import { Popover, PopoverContent, PopoverTrigger } from '@comp/ui/popover';
1111
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@comp/ui/select';
12-
import { Switch } from '@comp/ui/switch';
1312
import { Departments, Frequency, Member, type Policy, PolicyStatus, User } from '@db';
1413
import { format } from 'date-fns';
1514
import { CalendarIcon, Loader2 } from 'lucide-react';
@@ -372,25 +371,6 @@ export function UpdatePolicyOverview({
372371
}
373372
/>
374373
</div>
375-
376-
{/* Required to Sign Field */}
377-
<div className="mt-2 flex flex-col gap-2">
378-
<label htmlFor="isRequiredToSign" className="text-sm font-medium">
379-
Employee Signature Requirement
380-
</label>
381-
<div className="mt-4 flex items-center space-x-2">
382-
<Switch
383-
id="isRequiredToSign"
384-
name="isRequiredToSign"
385-
disabled={fieldsDisabled}
386-
defaultChecked={policy.isRequiredToSign}
387-
onCheckedChange={handleFormChange}
388-
/>
389-
<span className="text-sm text-gray-500">
390-
{policy.isRequiredToSign ? 'Required' : 'Not Required'}
391-
</span>
392-
</div>
393-
</div>
394374
</div>
395375

396376
<div className="col-span-1 flex justify-end gap-2 md:col-span-2">

bun.lock

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-- Update the default value for the isRequiredToSign field to true
2+
ALTER TABLE "Policy" ALTER COLUMN "isRequiredToSign" SET DEFAULT true;
3+
4+
-- Set all existing policies to be required to sign
5+
UPDATE "Policy" SET "isRequiredToSign" = true WHERE "isRequiredToSign" IS FALSE OR "isRequiredToSign" IS NULL;

packages/db/prisma/schema/policy.prisma

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ model Policy {
66
content Json[]
77
frequency Frequency?
88
department Departments?
9-
isRequiredToSign Boolean @default(false)
9+
isRequiredToSign Boolean @default(true)
1010
signedBy String[] @default([])
1111
reviewDate DateTime?
1212
isArchived Boolean @default(false)

0 commit comments

Comments
 (0)