mirror of
https://github.com/makeplane/plane
synced 2025-08-07 19:59:33 +00:00
Compare commits
3 Commits
chore-arch
...
issue-type
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41c6575884 | ||
|
|
f155875326 | ||
|
|
d9510fa381 |
@@ -0,0 +1,179 @@
|
||||
# Generated by Django 4.2.16 on 2024-10-14 07:59
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("db", "0080_fileasset_draft_issue_alter_fileasset_entity_type"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="issuetype",
|
||||
name="external_id",
|
||||
field=models.CharField(blank=True, max_length=255, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="issuetype",
|
||||
name="external_source",
|
||||
field=models.CharField(blank=True, max_length=255, null=True),
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name="usernotificationpreference",
|
||||
old_name="property_change",
|
||||
new_name="email_property_change",
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="usernotificationpreference",
|
||||
name="email_property_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name="usernotificationpreference",
|
||||
old_name="state_change",
|
||||
new_name="email_state_change",
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="usernotificationpreference",
|
||||
name="email_state_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name="usernotificationpreference",
|
||||
old_name="comment",
|
||||
new_name="email_comment",
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="usernotificationpreference",
|
||||
name="email_comment",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name="usernotificationpreference",
|
||||
old_name="mention",
|
||||
new_name="email_mention",
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="usernotificationpreference",
|
||||
name="email_mention",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name="usernotificationpreference",
|
||||
old_name="issue_completed",
|
||||
new_name="email_issue_completed",
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="usernotificationpreference",
|
||||
name="email_issue_completed",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="deployboard",
|
||||
name="is_disabled",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="email_assignee_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="email_cycle_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="email_module_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="email_priority_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="email_reactions",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="email_start_target_date_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="in_app_assignee_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="in_app_comment",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="in_app_cycle_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="in_app_issue_completed",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="in_app_mention",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="in_app_module_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="in_app_priority_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="in_app_property_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="in_app_reactions",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="in_app_start_target_date_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="usernotificationpreference",
|
||||
name="in_app_state_change",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="deployboard",
|
||||
name="entity_name",
|
||||
field=models.CharField(
|
||||
choices=[
|
||||
("project", "Project"),
|
||||
("issue", "Issue"),
|
||||
("module", "Module"),
|
||||
("cycle", "Task"),
|
||||
("page", "Page"),
|
||||
("view", "View"),
|
||||
("inbox", "Inbox"),
|
||||
],
|
||||
max_length=30,
|
||||
),
|
||||
),
|
||||
]
|
||||
@@ -20,6 +20,7 @@ class DeployBoard(WorkspaceBaseModel):
|
||||
("cycle", "Task"),
|
||||
("page", "Page"),
|
||||
("view", "View"),
|
||||
("inbox", "Inbox"),
|
||||
)
|
||||
|
||||
entity_identifier = models.UUIDField(null=True)
|
||||
@@ -41,6 +42,7 @@ class DeployBoard(WorkspaceBaseModel):
|
||||
is_votes_enabled = models.BooleanField(default=False)
|
||||
view_props = models.JSONField(default=dict)
|
||||
is_activity_enabled = models.BooleanField(default=True)
|
||||
is_disabled = models.BooleanField(default=False)
|
||||
|
||||
def __str__(self):
|
||||
"""Return name of the deploy board"""
|
||||
|
||||
@@ -19,6 +19,8 @@ class IssueType(BaseModel):
|
||||
is_default = models.BooleanField(default=False)
|
||||
is_active = models.BooleanField(default=True)
|
||||
level = models.PositiveIntegerField(default=0)
|
||||
external_source = models.CharField(max_length=255, null=True, blank=True)
|
||||
external_id = models.CharField(max_length=255, blank=True, null=True)
|
||||
|
||||
class Meta:
|
||||
verbose_name = "Issue Type"
|
||||
|
||||
@@ -6,7 +6,6 @@ from django.db import models
|
||||
from .base import BaseModel
|
||||
|
||||
|
||||
|
||||
class Notification(BaseModel):
|
||||
workspace = models.ForeignKey(
|
||||
"db.Workspace", related_name="notifications", on_delete=models.CASCADE
|
||||
@@ -90,12 +89,31 @@ class UserNotificationPreference(BaseModel):
|
||||
null=True,
|
||||
)
|
||||
|
||||
# preference fields
|
||||
property_change = models.BooleanField(default=True)
|
||||
state_change = models.BooleanField(default=True)
|
||||
comment = models.BooleanField(default=True)
|
||||
mention = models.BooleanField(default=True)
|
||||
issue_completed = models.BooleanField(default=True)
|
||||
# email preference fields
|
||||
email_property_change = models.BooleanField(default=False)
|
||||
email_state_change = models.BooleanField(default=False)
|
||||
email_priority_change = models.BooleanField(default=False)
|
||||
email_assignee_change = models.BooleanField(default=False)
|
||||
email_start_target_date_change = models.BooleanField(default=False)
|
||||
email_module_change = models.BooleanField(default=False)
|
||||
email_cycle_change = models.BooleanField(default=False)
|
||||
email_reactions = models.BooleanField(default=False)
|
||||
email_comment = models.BooleanField(default=False)
|
||||
email_mention = models.BooleanField(default=False)
|
||||
email_issue_completed = models.BooleanField(default=False)
|
||||
|
||||
# in app preference fields
|
||||
in_app_property_change = models.BooleanField(default=False)
|
||||
in_app_state_change = models.BooleanField(default=False)
|
||||
in_app_priority_change = models.BooleanField(default=False)
|
||||
in_app_assignee_change = models.BooleanField(default=False)
|
||||
in_app_start_target_date_change = models.BooleanField(default=False)
|
||||
in_app_module_change = models.BooleanField(default=False)
|
||||
in_app_cycle_change = models.BooleanField(default=False)
|
||||
in_app_reactions = models.BooleanField(default=False)
|
||||
in_app_comment = models.BooleanField(default=False)
|
||||
in_app_mention = models.BooleanField(default=False)
|
||||
in_app_issue_completed = models.BooleanField(default=False)
|
||||
|
||||
class Meta:
|
||||
verbose_name = "UserNotificationPreference"
|
||||
|
||||
@@ -252,9 +252,4 @@ def create_user_notification(sender, instance, created, **kwargs):
|
||||
|
||||
UserNotificationPreference.objects.create(
|
||||
user=instance,
|
||||
property_change=False,
|
||||
state_change=False,
|
||||
comment=False,
|
||||
mention=False,
|
||||
issue_completed=False,
|
||||
)
|
||||
|
||||
@@ -150,7 +150,6 @@ class OffsetPaginator:
|
||||
raise BadPaginationError("Pagination offset cannot be negative")
|
||||
|
||||
results = queryset[offset:stop]
|
||||
print(limit, "limit")
|
||||
if cursor.value != limit:
|
||||
results = results[-(limit + 1) :]
|
||||
|
||||
@@ -186,7 +185,6 @@ class OffsetPaginator:
|
||||
|
||||
|
||||
class GroupedOffsetPaginator(OffsetPaginator):
|
||||
|
||||
# Field mappers - list m2m fields here
|
||||
FIELD_MAPPER = {
|
||||
"labels__id": "label_ids",
|
||||
@@ -684,7 +682,7 @@ class SubGroupedOffsetPaginator(OffsetPaginator):
|
||||
# for multi groups
|
||||
result[
|
||||
self.FIELD_MAPPER.get(self.sub_group_by_field_name)
|
||||
] = ([] if "None" in sub_group_ids else sub_group_ids)
|
||||
] = [] if "None" in sub_group_ids else sub_group_ids
|
||||
# If a result belongs to multiple groups, add it to each group
|
||||
processed_results[str(group_value)]["results"][
|
||||
str(sub_group_value)
|
||||
@@ -761,7 +759,6 @@ class BasePaginator:
|
||||
):
|
||||
"""Paginate the request"""
|
||||
per_page = self.get_per_page(request, default_per_page, max_per_page)
|
||||
print(per_page, "per_page")
|
||||
# Convert the cursor value to integer and float from string
|
||||
input_cursor = None
|
||||
try:
|
||||
@@ -788,7 +785,6 @@ class BasePaginator:
|
||||
paginator = paginator_cls(**paginator_kwargs)
|
||||
|
||||
try:
|
||||
print(per_page, "per_page 2")
|
||||
cursor_result = paginator.get_result(
|
||||
limit=per_page, cursor=input_cursor
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user