From 766b7a0c7b2f6a3df124ef57d847a22f9b9767f7 Mon Sep 17 00:00:00 2001 From: NarayanBavisetti Date: Fri, 6 Oct 2023 11:52:28 +0530 Subject: [PATCH] chore: proper naming for urls --- apiserver/plane/api/urls/__init__.py | 4 ++++ apiserver/plane/api/urls/configuration.py | 12 ++++++++++ apiserver/plane/api/urls/cycle.py | 6 ++--- apiserver/plane/api/urls/importer.py | 4 ++-- apiserver/plane/api/urls/project.py | 28 ++++++++++++++--------- apiserver/plane/api/urls/unsplash.py | 13 +++++++++++ apiserver/plane/api/urls/user.py | 4 ++-- apiserver/plane/api/urls/workspace.py | 18 +++++++-------- 8 files changed, 62 insertions(+), 27 deletions(-) create mode 100644 apiserver/plane/api/urls/configuration.py create mode 100644 apiserver/plane/api/urls/unsplash.py diff --git a/apiserver/plane/api/urls/__init__.py b/apiserver/plane/api/urls/__init__.py index fbb86cf0b..49c2b772e 100644 --- a/apiserver/plane/api/urls/__init__.py +++ b/apiserver/plane/api/urls/__init__.py @@ -1,6 +1,7 @@ from .analytic import urlpatterns as analytic_urls from .asset import urlpatterns as asset_urls from .authentication import urlpatterns as authentication_urls +from .configuration import urlpatterns as configuration_urls from .cycle import urlpatterns as cycle_urls from .estimate import urlpatterns as estimate_urls from .gpt import urlpatterns as gpt_urls @@ -16,6 +17,7 @@ from .public_board import urlpatterns as public_board_urls from .release_note import urlpatterns as release_note_urls from .search import urlpatterns as search_urls from .state import urlpatterns as state_urls +from .unsplash import urlpatterns as unsplash_urls from .user import urlpatterns as user_urls from .views import urlpatterns as view_urls from .workspace import urlpatterns as workspace_urls @@ -25,6 +27,7 @@ urlpatterns = [ *analytic_urls, *asset_urls, *authentication_urls, + *configuration_urls, *cycle_urls, *estimate_urls, *gpt_urls, @@ -40,6 +43,7 @@ urlpatterns = [ *release_note_urls, *search_urls, *state_urls, + *unsplash_urls, *user_urls, *view_urls, *workspace_urls, diff --git a/apiserver/plane/api/urls/configuration.py b/apiserver/plane/api/urls/configuration.py new file mode 100644 index 000000000..321a56200 --- /dev/null +++ b/apiserver/plane/api/urls/configuration.py @@ -0,0 +1,12 @@ +from django.urls import path + + +from plane.api.views import ConfigurationEndpoint + +urlpatterns = [ + path( + "configs/", + ConfigurationEndpoint.as_view(), + name="configuration", + ), +] \ No newline at end of file diff --git a/apiserver/plane/api/urls/cycle.py b/apiserver/plane/api/urls/cycle.py index 562ba3014..068276361 100644 --- a/apiserver/plane/api/urls/cycle.py +++ b/apiserver/plane/api/urls/cycle.py @@ -41,7 +41,7 @@ urlpatterns = [ "post": "create", } ), - name="project-cycle", + name="project-issue-cycle", ), path( "workspaces//projects//cycles//cycle-issues//", @@ -53,12 +53,12 @@ urlpatterns = [ "delete": "destroy", } ), - name="project-cycle", + name="project-issue-cycle", ), path( "workspaces//projects//cycles/date-check/", CycleDateCheckEndpoint.as_view(), - name="project-cycle", + name="project-cycle-date", ), path( "workspaces//projects//user-favorite-cycles/", diff --git a/apiserver/plane/api/urls/importer.py b/apiserver/plane/api/urls/importer.py index 64a60ed0f..c0a9aa5b5 100644 --- a/apiserver/plane/api/urls/importer.py +++ b/apiserver/plane/api/urls/importer.py @@ -12,7 +12,7 @@ urlpatterns = [ path( "workspaces//importers//", ServiceIssueImportSummaryEndpoint.as_view(), - name="importer", + name="importer-summary", ), path( "workspaces//projects/importers//", @@ -32,6 +32,6 @@ urlpatterns = [ path( "workspaces//projects//service//importers//", UpdateServiceImportStatusEndpoint.as_view(), - name="importer", + name="importer-status", ), ] diff --git a/apiserver/plane/api/urls/project.py b/apiserver/plane/api/urls/project.py index 7eda57879..78ef2a491 100644 --- a/apiserver/plane/api/urls/project.py +++ b/apiserver/plane/api/urls/project.py @@ -14,6 +14,7 @@ from plane.api.views import ( ProjectIdentifierEndpoint, ProjectFavoritesViewSet, LeaveProjectEndpoint, + ProjectPublicCoverImagesEndpoint ) @@ -48,12 +49,12 @@ urlpatterns = [ path( "workspaces//projects//invite/", InviteProjectEndpoint.as_view(), - name="project", + name="invite-project", ), path( "workspaces//projects//members/", ProjectMemberViewSet.as_view({"get": "list"}), - name="project", + name="project-member", ), path( "workspaces//projects//members//", @@ -64,12 +65,12 @@ urlpatterns = [ "delete": "destroy", } ), - name="project", + name="project-member", ), path( "workspaces//projects//project-members/", ProjectMemberEndpoint.as_view(), - name="project", + name="project-member", ), path( "workspaces//projects//members/add/", @@ -79,7 +80,7 @@ urlpatterns = [ path( "workspaces//projects/join/", ProjectJoinEndpoint.as_view(), - name="project", + name="project-join", ), path( "workspaces//projects//team-invite/", @@ -89,7 +90,7 @@ urlpatterns = [ path( "workspaces//projects//invitations/", ProjectMemberInvitationsViewset.as_view({"get": "list"}), - name="workspace", + name="project-member-invite", ), path( "workspaces//projects//invitations//", @@ -99,7 +100,7 @@ urlpatterns = [ "delete": "destroy", } ), - name="project", + name="project-member-invite", ), path( "workspaces//projects//project-views/", @@ -109,7 +110,7 @@ urlpatterns = [ path( "workspaces//projects//project-members/me/", ProjectMemberUserEndpoint.as_view(), - name="project-view", + name="project-member-view", ), path( "workspaces//user-favorite-projects/", @@ -118,7 +119,7 @@ urlpatterns = [ "post": "create", } ), - name="project", + name="project-favorite", ), path( "workspaces//user-favorite-projects//", @@ -127,11 +128,16 @@ urlpatterns = [ "delete": "destroy", } ), - name="project", + name="project-favorite", ), path( "workspaces//projects//members/leave/", LeaveProjectEndpoint.as_view(), - name="project", + name="leave-project", + ), + path( + "project-covers/", + ProjectPublicCoverImagesEndpoint.as_view(), + name="project-covers", ), ] diff --git a/apiserver/plane/api/urls/unsplash.py b/apiserver/plane/api/urls/unsplash.py new file mode 100644 index 000000000..25fab4694 --- /dev/null +++ b/apiserver/plane/api/urls/unsplash.py @@ -0,0 +1,13 @@ +from django.urls import path + + +from plane.api.views import UnsplashEndpoint + + +urlpatterns = [ + path( + "unsplash/", + UnsplashEndpoint.as_view(), + name="unsplash", + ), +] diff --git a/apiserver/plane/api/urls/user.py b/apiserver/plane/api/urls/user.py index f99793af1..f8b0be519 100644 --- a/apiserver/plane/api/urls/user.py +++ b/apiserver/plane/api/urls/user.py @@ -70,7 +70,7 @@ urlpatterns = [ "get": "retrieve", } ), - name="workspace", + name="user-workspace-invitation", ), # user join workspace # User Graphs @@ -99,6 +99,6 @@ urlpatterns = [ path( "users/me/invitations/projects/", UserProjectInvitationsViewset.as_view({"get": "list", "post": "create"}), - name="user-project-invitaions", + name="user-project-invitations", ), ] diff --git a/apiserver/plane/api/urls/workspace.py b/apiserver/plane/api/urls/workspace.py index 87664d274..7cfc8f27a 100644 --- a/apiserver/plane/api/urls/workspace.py +++ b/apiserver/plane/api/urls/workspace.py @@ -53,12 +53,12 @@ urlpatterns = [ path( "workspaces//invite/", InviteWorkspaceEndpoint.as_view(), - name="workspace", + name="invite-workspace", ), path( "workspaces//invitations/", WorkspaceInvitationsViewset.as_view({"get": "list"}), - name="workspace", + name="workspace-invitations", ), path( "workspaces//invitations//", @@ -68,12 +68,12 @@ urlpatterns = [ "get": "retrieve", } ), - name="workspace", + name="workspace-invitations", ), path( "workspaces//members/", WorkSpaceMemberViewSet.as_view({"get": "list"}), - name="workspace", + name="workspace-member", ), path( "workspaces//members//", @@ -84,7 +84,7 @@ urlpatterns = [ "get": "retrieve", } ), - name="workspace", + name="workspace-member", ), path( "workspaces//workspace-members/", @@ -99,7 +99,7 @@ urlpatterns = [ "post": "create", } ), - name="workspace", + name="workspace-team-members", ), path( "workspaces//teams//", @@ -111,7 +111,7 @@ urlpatterns = [ "get": "retrieve", } ), - name="workspace", + name="workspace-team-members", ), path( "users/last-visited-workspace/", @@ -126,7 +126,7 @@ urlpatterns = [ path( "workspaces//workspace-views/", WorkspaceMemberUserViewsEndpoint.as_view(), - name="workspace-member-details", + name="workspace-member-views-details", ), path( "workspaces//workspace-themes/", @@ -177,6 +177,6 @@ urlpatterns = [ path( "workspaces//members/leave/", LeaveWorkspaceEndpoint.as_view(), - name="workspace-labels", + name="leave-workspace-members", ), ]