From ba4e711f9b5a184b9e3e727f3113729e3009afcf Mon Sep 17 00:00:00 2001 From: Sangeetha Date: Fri, 21 Nov 2025 20:51:47 +0530 Subject: [PATCH] [WEB-5350] migration: navigation (#8156) * migration: navigation related fields in workspace_user_properties * fix: field names * fix: remove max_length * fix: create new migration * fix: typo * Renamed horizontal preference to tabbed --------- Co-authored-by: Dheeraj Kumar Ketireddy --- ..._navigation_control_preference_and_more.py | 23 +++++++++++++++++++ apps/api/plane/db/models/workspace.py | 10 ++++++++ 2 files changed, 33 insertions(+) create mode 100644 apps/api/plane/db/migrations/0110_workspaceuserproperties_navigation_control_preference_and_more.py diff --git a/apps/api/plane/db/migrations/0110_workspaceuserproperties_navigation_control_preference_and_more.py b/apps/api/plane/db/migrations/0110_workspaceuserproperties_navigation_control_preference_and_more.py new file mode 100644 index 000000000..a36f54c26 --- /dev/null +++ b/apps/api/plane/db/migrations/0110_workspaceuserproperties_navigation_control_preference_and_more.py @@ -0,0 +1,23 @@ +# Generated by Django 4.2.26 on 2025-11-21 11:32 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('db', '0109_issuecomment_description_and_parent_id'), + ] + + operations = [ + migrations.AddField( + model_name='workspaceuserproperties', + name='navigation_control_preference', + field=models.CharField(choices=[('ACCORDION', 'Accordion'), ('TABBED', 'Tabbed')], default='ACCORDION', max_length=25), + ), + migrations.AddField( + model_name='workspaceuserproperties', + name='navigation_project_limit', + field=models.IntegerField(default=10), + ), + ] diff --git a/apps/api/plane/db/models/workspace.py b/apps/api/plane/db/models/workspace.py index 0f5c09760..b545f52a2 100644 --- a/apps/api/plane/db/models/workspace.py +++ b/apps/api/plane/db/models/workspace.py @@ -301,6 +301,10 @@ class WorkspaceTheme(BaseModel): class WorkspaceUserProperties(BaseModel): + class NavigationControlPreference(models.TextChoices): + ACCORDION = "ACCORDION", "Accordion" + TABBED = "TABBED", "Tabbed" + workspace = models.ForeignKey( "db.Workspace", on_delete=models.CASCADE, @@ -315,6 +319,12 @@ class WorkspaceUserProperties(BaseModel): display_filters = models.JSONField(default=get_default_display_filters) display_properties = models.JSONField(default=get_default_display_properties) rich_filters = models.JSONField(default=dict) + navigation_project_limit = models.IntegerField(default=10) + navigation_control_preference = models.CharField( + max_length=25, + choices=NavigationControlPreference.choices, + default=NavigationControlPreference.ACCORDION, + ) class Meta: unique_together = ["workspace", "user", "deleted_at"]