Compare commits

...
Author SHA1 Message Date
NarayanBavisetti c7ed825226 chore: added product tour fields 2025-12-02 20:33:07 +05:30
3 changed files with 56 additions and 0 deletions
@@ -0,0 +1,42 @@
# Generated by Django 4.2.25 on 2025-12-02 14:16
from django.db import migrations, models
import plane.db.models.workspace
def get_default_feature_tours():
return {
"work_items": True,
"cycles": True,
"modules": True,
"intake": True,
"pages": True,
}
def populate_feature_tours(apps, _schema_editor):
WorkspaceUserProperties = apps.get_model('db', 'WorkspaceUserProperties')
default_value = get_default_feature_tours()
# Use bulk update for better performance
WorkspaceUserProperties.objects.all().update(feature_tours=default_value)
class Migration(migrations.Migration):
dependencies = [
('db', '0112_auto_20251124_0603'),
]
operations = [
migrations.AddField(
model_name='profile',
name='is_navigation_tour_completed',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='workspaceuserproperties',
name='feature_tours',
field=models.JSONField(default=plane.db.models.workspace.get_default_feature_tours),
),
migrations.RunPython(populate_feature_tours, reverse_code=migrations.RunPython.noop),
]
+3
View File
@@ -214,6 +214,9 @@ class Profile(TimeAuditModel):
goals = models.JSONField(default=dict)
background_color = models.CharField(max_length=255, default=get_random_color)
# navigation tour
is_navigation_tour_completed = models.BooleanField(default=False)
# marketing
has_marketing_email_consent = models.BooleanField(default=False)
+11
View File
@@ -112,6 +112,16 @@ def slug_validator(value):
raise ValidationError("Slug is not valid")
def get_default_feature_tours():
return {
"work_items": False,
"cycles": False,
"modules": False,
"intake": False,
"pages": False,
}
class Workspace(BaseModel):
TIMEZONE_CHOICES = tuple(zip(pytz.common_timezones, pytz.common_timezones))
@@ -325,6 +335,7 @@ class WorkspaceUserProperties(BaseModel):
choices=NavigationControlPreference.choices,
default=NavigationControlPreference.ACCORDION,
)
feature_tours = models.JSONField(default=get_default_feature_tours)
class Meta:
unique_together = ["workspace", "user", "deleted_at"]