forked from QuivrHQ/quivr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Remove unused onboarding code (QuivrHQ#2901)
Remove unused code related to onboarding functionality. This includes removing the `OnboardingUpdatableProperties` class and the `OnboardingStates` class. These classes are no longer used in the codebase and can be safely deleted. # Description Please include a summary of the changes and the related issue. Please also include relevant motivation and context. ## Checklist before requesting a review Please delete options that are not relevant. - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented hard-to-understand areas - [ ] I have ideally added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged ## Screenshots (if appropriate):
- Loading branch information
1 parent
d9e7ba8
commit cf5c56d
Showing
12 changed files
with
57 additions
and
266 deletions.
There are no files selected for viewing
This file contains 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
32 changes: 4 additions & 28 deletions
32
backend/api/quivr_api/modules/onboarding/controller/onboarding_routes.py
This file contains 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 |
---|---|---|
@@ -1,44 +1,20 @@ | ||
from fastapi import APIRouter, Depends | ||
from quivr_api.middlewares.auth import ( # Assuming you have a get_current_user function | ||
AuthBearer, | ||
get_current_user, | ||
) | ||
from quivr_api.modules.onboarding.dto.inputs import OnboardingUpdatableProperties | ||
from quivr_api.modules.onboarding.entity.onboarding import OnboardingStates | ||
from quivr_api.modules.onboarding.service.onboarding_service import OnboardingService | ||
from quivr_api.middlewares.auth import AuthBearer, get_current_user | ||
from quivr_api.modules.user.entity.user_identity import UserIdentity | ||
|
||
onboarding_router = APIRouter() | ||
|
||
onboardingService = OnboardingService() | ||
|
||
|
||
@onboarding_router.get( | ||
"/onboarding", | ||
dependencies=[Depends(AuthBearer())], | ||
tags=["Onboarding"], | ||
tags=["Deprecated"], | ||
) | ||
async def get_user_onboarding_handler( | ||
current_user: UserIdentity = Depends(get_current_user), | ||
) -> OnboardingStates | None: | ||
) -> dict: | ||
""" | ||
Get user onboarding information for the current user | ||
""" | ||
|
||
return onboardingService.get_user_onboarding(current_user.id) | ||
|
||
|
||
@onboarding_router.put( | ||
"/onboarding", | ||
dependencies=[Depends(AuthBearer())], | ||
tags=["Onboarding"], | ||
) | ||
async def update_user_onboarding_handler( | ||
onboarding: OnboardingUpdatableProperties, | ||
current_user: UserIdentity = Depends(get_current_user), | ||
) -> OnboardingStates: | ||
""" | ||
Update user onboarding information for the current user | ||
""" | ||
|
||
return onboardingService.update_user_onboarding(current_user.id, onboarding) | ||
return {"status": "Deprecated and will be removed in v0.1"} |
This file contains 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 |
---|---|---|
@@ -1 +0,0 @@ | ||
from .inputs import OnboardingUpdatableProperties | ||
This file was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -1 +0,0 @@ | ||
from .onboarding import OnboardingStates | ||
10 changes: 0 additions & 10 deletions
10
backend/api/quivr_api/modules/onboarding/entity/onboarding.py
This file was deleted.
Oops, something went wrong.
106 changes: 0 additions & 106 deletions
106
backend/api/quivr_api/modules/onboarding/repository/onboardings.py
This file was deleted.
Oops, something went wrong.
43 changes: 0 additions & 43 deletions
43
backend/api/quivr_api/modules/onboarding/repository/onboardings_interface.py
This file was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -1 +0,0 @@ | ||
from .onboarding_service import OnboardingService | ||
51 changes: 0 additions & 51 deletions
51
backend/api/quivr_api/modules/onboarding/service/onboarding_service.py
This file was deleted.
Oops, something went wrong.
Empty file.
53 changes: 53 additions & 0 deletions
53
backend/supabase/migrations/20240722164034_onboarding-removed.sql
This file contains 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,53 @@ | ||
drop policy "NOTIFICATIONS" on "public"."onboardings"; | ||
|
||
revoke delete on table "public"."onboardings" from "anon"; | ||
|
||
revoke insert on table "public"."onboardings" from "anon"; | ||
|
||
revoke references on table "public"."onboardings" from "anon"; | ||
|
||
revoke select on table "public"."onboardings" from "anon"; | ||
|
||
revoke trigger on table "public"."onboardings" from "anon"; | ||
|
||
revoke truncate on table "public"."onboardings" from "anon"; | ||
|
||
revoke update on table "public"."onboardings" from "anon"; | ||
|
||
revoke delete on table "public"."onboardings" from "authenticated"; | ||
|
||
revoke insert on table "public"."onboardings" from "authenticated"; | ||
|
||
revoke references on table "public"."onboardings" from "authenticated"; | ||
|
||
revoke select on table "public"."onboardings" from "authenticated"; | ||
|
||
revoke trigger on table "public"."onboardings" from "authenticated"; | ||
|
||
revoke truncate on table "public"."onboardings" from "authenticated"; | ||
|
||
revoke update on table "public"."onboardings" from "authenticated"; | ||
|
||
revoke delete on table "public"."onboardings" from "service_role"; | ||
|
||
revoke insert on table "public"."onboardings" from "service_role"; | ||
|
||
revoke references on table "public"."onboardings" from "service_role"; | ||
|
||
revoke select on table "public"."onboardings" from "service_role"; | ||
|
||
revoke trigger on table "public"."onboardings" from "service_role"; | ||
|
||
revoke truncate on table "public"."onboardings" from "service_role"; | ||
|
||
revoke update on table "public"."onboardings" from "service_role"; | ||
|
||
alter table "public"."onboardings" drop constraint "onboardings_user_id_fkey"; | ||
|
||
alter table "public"."onboardings" drop constraint "onboardings_pkey"; | ||
|
||
drop index if exists "public"."onboardings_pkey"; | ||
|
||
drop table "public"."onboardings" CASCADE; | ||
|
||
drop function if exists public.create_user_onboarding cascade; |