-
-
Notifications
You must be signed in to change notification settings - Fork 19
Add task support for calendar #3139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
phatgg221
wants to merge
25
commits into
main
Choose a base branch
from
feat-scheduler-db-and-functionality
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 12 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
79102b5
chore!: add calendar table tasks
phatgg221 64536a2
feat: button and add event front end
phatgg221 ffd4e18
update: event-modal front end
phatgg221 7dd16d9
refactor: add overflow for dialog
phatgg221 a33c045
update: update dialog form
phatgg221 7f2948d
chore: add description for event
phatgg221 d0e849b
fix: submit grm Error
phatgg221 16867b6
feat: save tasks to database
phatgg221 36cae75
fix: delete unwanted imports
phatgg221 8bad6cb
Update supabase.ts
phatgg221 e442cde
update: update tasks table policy
phatgg221 212dd3e
update: change total duration to float number
phatgg221 5ae2a5f
fix: miss data type of total duration
phatgg221 051dd1d
Update 20250620103311_changed_policy_of_tasks_table.sql
phatgg221 f2a9187
fix: hardcoded emails and remove unwanted props
phatgg221 55c5415
Update add-event-dialog.tsx
phatgg221 6f9726e
Merge branch 'main' into feat-scheduler-db-and-functionality
vhpx d24aead
chore(db): consolidate migration files
vhpx 540a5b9
chore(db): fix migration timestampt
vhpx b921e0b
Merge branch 'main' into feat-scheduler-db-and-functionality
phatgg221 19bfa98
fix: duplicates errors
phatgg221 e902936
chore: migrate to tasks table
phatgg221 0fa7534
refactor: moving to tasks table for schedule tasks
phatgg221 0160404
chore: rename from minutes to hours
phatgg221 8981c08
fix: build checks
phatgg221 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
79 changes: 79 additions & 0 deletions
79
apps/db/supabase/migrations/20250620065741_add_calendar_tasks_table.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
create type "public"."calendar_task_time" as enum ('working_time', 'personal_time'); | ||
|
||
create type "public"."priority_status" as enum ('low', 'medium', 'high', 'critical'); | ||
|
||
create table "public"."workspace_calendar_tasks" ( | ||
"id" uuid not null default gen_random_uuid(), | ||
"created_at" timestamp with time zone not null default now(), | ||
"ws_id" uuid, | ||
"creator_id" uuid, | ||
"updated_at" timestamp with time zone, | ||
"is_splittable" boolean, | ||
"name" text, | ||
vhpx marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"min_split_duration_minutes" smallint, | ||
"max_split_duration_minutes" smallint, | ||
"schedule_after" timestamp with time zone, | ||
"due_date" timestamp with time zone, | ||
"time_reference" calendar_task_time default 'working_time'::calendar_task_time, | ||
"user_defined_priority" priority_status default 'medium'::priority_status, | ||
"evaluated_priority" priority_status default 'medium'::priority_status | ||
); | ||
|
||
|
||
alter table "public"."workspace_calendar_tasks" enable row level security; | ||
|
||
CREATE UNIQUE INDEX workspace_calendar_taskss_pkey ON public.workspace_calendar_tasks USING btree (id); | ||
|
||
alter table "public"."workspace_calendar_tasks" add constraint "workspace_calendar_taskss_pkey" PRIMARY KEY using index "workspace_calendar_taskss_pkey"; | ||
vhpx marked this conversation as resolved.
Show resolved
Hide resolved
phatgg221 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
alter table "public"."workspace_calendar_tasks" add constraint "workspace_calendar_taskss_creator_id_fkey" FOREIGN KEY (creator_id) REFERENCES users(id) ON DELETE CASCADE not valid; | ||
|
||
alter table "public"."workspace_calendar_tasks" validate constraint "workspace_calendar_taskss_creator_id_fkey"; | ||
|
||
alter table "public"."workspace_calendar_tasks" add constraint "workspace_calendar_taskss_ws_id_fkey" FOREIGN KEY (ws_id) REFERENCES workspaces(id) ON DELETE CASCADE not valid; | ||
|
||
alter table "public"."workspace_calendar_tasks" validate constraint "workspace_calendar_taskss_ws_id_fkey"; | ||
vhpx marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
grant delete on table "public"."workspace_calendar_tasks" to "anon"; | ||
|
||
grant insert on table "public"."workspace_calendar_tasks" to "anon"; | ||
|
||
grant references on table "public"."workspace_calendar_tasks" to "anon"; | ||
|
||
grant select on table "public"."workspace_calendar_tasks" to "anon"; | ||
|
||
grant trigger on table "public"."workspace_calendar_tasks" to "anon"; | ||
|
||
grant truncate on table "public"."workspace_calendar_tasks" to "anon"; | ||
|
||
grant update on table "public"."workspace_calendar_tasks" to "anon"; | ||
phatgg221 marked this conversation as resolved.
Show resolved
Hide resolved
vhpx marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
grant delete on table "public"."workspace_calendar_tasks" to "authenticated"; | ||
|
||
grant insert on table "public"."workspace_calendar_tasks" to "authenticated"; | ||
|
||
grant references on table "public"."workspace_calendar_tasks" to "authenticated"; | ||
|
||
grant select on table "public"."workspace_calendar_tasks" to "authenticated"; | ||
|
||
grant trigger on table "public"."workspace_calendar_tasks" to "authenticated"; | ||
|
||
grant truncate on table "public"."workspace_calendar_tasks" to "authenticated"; | ||
|
||
grant update on table "public"."workspace_calendar_tasks" to "authenticated"; | ||
|
||
grant delete on table "public"."workspace_calendar_tasks" to "service_role"; | ||
|
||
grant insert on table "public"."workspace_calendar_tasks" to "service_role"; | ||
|
||
grant references on table "public"."workspace_calendar_tasks" to "service_role"; | ||
|
||
grant select on table "public"."workspace_calendar_tasks" to "service_role"; | ||
|
||
grant trigger on table "public"."workspace_calendar_tasks" to "service_role"; | ||
|
||
grant truncate on table "public"."workspace_calendar_tasks" to "service_role"; | ||
|
||
grant update on table "public"."workspace_calendar_tasks" to "service_role"; | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
|
||
alter table "public"."workspace_calendar_tasks" disable row level security; | ||
vhpx marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
alter table "public"."workspace_calendar_tasks" add column "description" text; | ||
|
||
alter table "public"."workspace_calendar_tasks" add column "total_duration" text not null; | ||
vhpx marked this conversation as resolved.
Show resolved
Hide resolved
phatgg221 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
alter table "public"."workspace_calendar_tasks" alter column "max_split_duration_minutes" set data type real using "max_split_duration_minutes"::real; | ||
|
||
alter table "public"."workspace_calendar_tasks" alter column "min_split_duration_minutes" set data type real using "min_split_duration_minutes"::real; | ||
|
||
|
13 changes: 13 additions & 0 deletions
13
apps/db/supabase/migrations/20250620103311_changed_policy_of_tasks_table.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
alter table "public"."workspace_calendar_tasks" enable row level security; | ||
|
||
vhpx marked this conversation as resolved.
Show resolved
Hide resolved
|
||
create policy "allow only user in the workspace to insert" | ||
on "public"."workspace_calendar_tasks" | ||
as permissive | ||
for insert | ||
to authenticated | ||
with check (true); | ||
phatgg221 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
alter table "public"."workspace_calendar_tasks" alter column "total_duration" set data type real using "total_duration"::real; | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
apps/web/src/app/[locale]/(dashboard)/[wsId]/calendar/components/add-event-button.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Button } from '@tuturuuu/ui/button'; | ||
import { PlusIcon } from '@tuturuuu/ui/icons'; | ||
import React from 'react'; | ||
|
||
interface AddEventButtonProps { | ||
wsId: string; | ||
phatgg221 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
onOpenDialog?: () => void; | ||
} | ||
|
||
export default function AddEventButton({ onOpenDialog }: AddEventButtonProps) { | ||
return ( | ||
<Button | ||
onClick={onOpenDialog} | ||
variant="default" | ||
size="sm" | ||
className="w-full bg-blue-500 text-white hover:bg-blue-600 md:w-fit" | ||
> | ||
<PlusIcon className="mr-2 h-4 w-4" /> | ||
Add Event | ||
</Button> | ||
); | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.