Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

feat: user preference url and sort order change (#6505)

Sangeetha8f5ce6b23265
diff --git a/apiserver/plane/app/urls/workspace.py b/apiserver/plane/app/urls/workspace.py
index ea81d1ef73..f16fdb1611 100644
--- a/apiserver/plane/app/urls/workspace.py
+++ b/apiserver/plane/app/urls/workspace.py
@@ -261,12 +261,12 @@ urlpatterns = [
),
# User Preference
path(
- "workspaces/<str:slug>/user-preferences/",
+ "workspaces/<str:slug>/sidebar-preferences/",
WorkspaceUserPreferenceViewSet.as_view(),
name="workspace-user-preference",
),
path(
- "workspaces/<str:slug>/user-preferences/<str:key>/",
+ "workspaces/<str:slug>/sidebar-preferences/<str:key>/",
WorkspaceUserPreferenceViewSet.as_view(),
name="workspace-user-preference",
),
diff --git a/apiserver/plane/app/views/workspace/user_preference.py b/apiserver/plane/app/views/workspace/user_preference.py
index 4c245b8f8d..66daffd193 100644
--- a/apiserver/plane/app/views/workspace/user_preference.py
+++ b/apiserver/plane/app/views/workspace/user_preference.py
@@ -27,7 +27,11 @@ class WorkspaceUserPreferenceViewSet(BaseAPIView):
create_preference_keys = []
- keys = [key for key, _ in WorkspaceUserPreference.UserPreferenceKeys.choices]
+ keys = [
+ key
+ for key, _ in WorkspaceUserPreference.UserPreferenceKeys.choices
+ if key not in ["projects"]
+ ]
for preference in keys:
if preference not in get_preference.values_list("key", flat=True):
diff --git a/apiserver/plane/db/models/workspace.py b/apiserver/plane/db/models/workspace.py
index 733cc4aa32..504873bcf5 100644
--- a/apiserver/plane/db/models/workspace.py
+++ b/apiserver/plane/db/models/workspace.py
@@ -392,10 +392,10 @@ class WorkspaceUserPreference(BaseModel):
"""Preference for the workspace for a user"""
class UserPreferenceKeys(models.TextChoices):
+ PROJECTS = "projects", "Projects"
+ ANALYTICS = "analytics", "Analytics"
CYCLES = "cycles", "Cycles"
VIEWS = "views", "Views"
- ANALYTICS = "analytics", "Analytics"
- PROJECTS = "projects", "Projects"
workspace = models.ForeignKey(
"db.Workspace",