forked from github/plane
feat: project view default props with migrations
This commit is contained in:
parent
c9e9b67a30
commit
37007514e3
@ -609,7 +609,13 @@ class ProjectUserViewsEndpoint(BaseAPIView):
|
|||||||
{"error": "Forbidden"}, status=status.HTTP_403_FORBIDDEN
|
{"error": "Forbidden"}, status=status.HTTP_403_FORBIDDEN
|
||||||
)
|
)
|
||||||
|
|
||||||
project_member.view_props = request.data
|
view_props = project_member.view_props
|
||||||
|
default_props = project_member.default_props
|
||||||
|
|
||||||
|
project_member.view_props = request.data.get("view_props", view_props)
|
||||||
|
project_member.default_props = request.data.get(
|
||||||
|
"default_props", default_props
|
||||||
|
)
|
||||||
|
|
||||||
project_member.save()
|
project_member.save()
|
||||||
|
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 3.2.14 on 2022-12-20 11:29
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import plane.db.models.project
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('db', '0012_user_my_issues_prop'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='projectmember',
|
||||||
|
name='default_props',
|
||||||
|
field=models.JSONField(default=plane.db.models.project.get_default_props),
|
||||||
|
),
|
||||||
|
]
|
@ -19,6 +19,15 @@ ROLE_CHOICES = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def get_default_props():
|
||||||
|
return {
|
||||||
|
"issueView": "list",
|
||||||
|
"groupByProperty": None,
|
||||||
|
"orderBy": None,
|
||||||
|
"filterIssue": None,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class Project(BaseModel):
|
class Project(BaseModel):
|
||||||
|
|
||||||
NETWORK_CHOICES = ((0, "Secret"), (2, "Public"))
|
NETWORK_CHOICES = ((0, "Secret"), (2, "Public"))
|
||||||
@ -119,6 +128,7 @@ class ProjectMember(ProjectBaseModel):
|
|||||||
comment = models.TextField(blank=True, null=True)
|
comment = models.TextField(blank=True, null=True)
|
||||||
role = models.PositiveSmallIntegerField(choices=ROLE_CHOICES, default=10)
|
role = models.PositiveSmallIntegerField(choices=ROLE_CHOICES, default=10)
|
||||||
view_props = models.JSONField(null=True)
|
view_props = models.JSONField(null=True)
|
||||||
|
default_props = models.JSONField(default=get_default_props)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
unique_together = ["project", "member"]
|
unique_together = ["project", "member"]
|
||||||
|
Loading…
Reference in New Issue
Block a user