mirror of
https://github.com/makeplane/plane
synced 2025-08-07 19:59:33 +00:00
Compare commits
2 Commits
chore-arch
...
fix/notifi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b54a1d6838 | ||
|
|
7b262fa45a |
@@ -133,7 +133,15 @@ def track_parent(
|
||||
IssueActivity(
|
||||
issue_id=issue_id,
|
||||
actor_id=actor_id,
|
||||
verb="updated",
|
||||
verb=(
|
||||
"created"
|
||||
if new_parent is not None and old_parent is None
|
||||
else (
|
||||
"deleted"
|
||||
if new_parent is None and old_parent is not None
|
||||
else "updated"
|
||||
)
|
||||
),
|
||||
old_value=(
|
||||
f"{old_parent.project.identifier}-{old_parent.sequence_id}"
|
||||
if old_parent is not None
|
||||
@@ -240,7 +248,17 @@ def track_target_date(
|
||||
IssueActivity(
|
||||
issue_id=issue_id,
|
||||
actor_id=actor_id,
|
||||
verb="updated",
|
||||
verb=(
|
||||
"created"
|
||||
if requested_data.get("target_date") is not None
|
||||
and current_instance.get("target_date") is None
|
||||
else (
|
||||
"deleted"
|
||||
if current_instance.get("target_date") is not None
|
||||
and requested_data.get("target_date") is None
|
||||
else "updated"
|
||||
)
|
||||
),
|
||||
old_value=(
|
||||
current_instance.get("target_date")
|
||||
if current_instance.get("target_date") is not None
|
||||
@@ -276,7 +294,17 @@ def track_start_date(
|
||||
IssueActivity(
|
||||
issue_id=issue_id,
|
||||
actor_id=actor_id,
|
||||
verb="updated",
|
||||
verb=(
|
||||
"created"
|
||||
if requested_data.get("start_date") is not None
|
||||
and current_instance.get("start_date") is None
|
||||
else (
|
||||
"deleted"
|
||||
if current_instance.get("start_date") is not None
|
||||
and requested_data.get("start_date") is None
|
||||
else "updated"
|
||||
)
|
||||
),
|
||||
old_value=(
|
||||
current_instance.get("start_date")
|
||||
if current_instance.get("start_date") is not None
|
||||
@@ -344,7 +372,7 @@ def track_labels(
|
||||
IssueActivity(
|
||||
issue_id=issue_id,
|
||||
actor_id=actor_id,
|
||||
verb="updated",
|
||||
verb="deleted",
|
||||
old_value=label.name,
|
||||
new_value="",
|
||||
field="labels",
|
||||
@@ -423,7 +451,7 @@ def track_assignees(
|
||||
IssueActivity(
|
||||
issue_id=issue_id,
|
||||
actor_id=actor_id,
|
||||
verb="updated",
|
||||
verb="deleted",
|
||||
old_value=assignee.display_name,
|
||||
new_value="",
|
||||
field="assignees",
|
||||
@@ -467,7 +495,15 @@ def track_estimate_points(
|
||||
IssueActivity(
|
||||
issue_id=issue_id,
|
||||
actor_id=actor_id,
|
||||
verb="updated",
|
||||
verb=(
|
||||
"created"
|
||||
if new_estimate is not None and old_estimate is None
|
||||
else (
|
||||
"deleted"
|
||||
if new_estimate is None and old_estimate is not None
|
||||
else "updated"
|
||||
)
|
||||
),
|
||||
old_identifier=(
|
||||
current_instance.get("estimate_point")
|
||||
if current_instance.get("estimate_point") is not None
|
||||
@@ -1719,16 +1755,12 @@ def issue_activity(
|
||||
event=(
|
||||
"issue_comment"
|
||||
if activity.field == "comment"
|
||||
else "inbox_issue"
|
||||
if inbox
|
||||
else "issue"
|
||||
else "inbox_issue" if inbox else "issue"
|
||||
),
|
||||
event_id=(
|
||||
activity.issue_comment_id
|
||||
if activity.field == "comment"
|
||||
else inbox
|
||||
if inbox
|
||||
else activity.issue_id
|
||||
else inbox if inbox else activity.issue_id
|
||||
),
|
||||
verb=activity.verb,
|
||||
field=(
|
||||
|
||||
@@ -128,7 +128,9 @@ def extract_mentions(issue_instance):
|
||||
"mention-component", attrs={"target": "users"}
|
||||
)
|
||||
|
||||
mentions = [mention_tag["entity_identifier"] for mention_tag in mention_tags]
|
||||
mentions = [
|
||||
mention_tag["entity_identifier"] for mention_tag in mention_tags
|
||||
]
|
||||
|
||||
return list(set(mentions))
|
||||
except Exception:
|
||||
@@ -198,6 +200,8 @@ def create_mention_notification(
|
||||
"actor": str(activity.get("actor_id")),
|
||||
"new_value": str(activity.get("new_value")),
|
||||
"old_value": str(activity.get("old_value")),
|
||||
"old_identifier": str(activity.get("old_identifier")),
|
||||
"new_identifier": str(activity.get("new_identifier")),
|
||||
},
|
||||
},
|
||||
)
|
||||
@@ -425,21 +429,49 @@ def notifications(
|
||||
"issue_activity": {
|
||||
"id": str(issue_activity.get("id")),
|
||||
"verb": str(issue_activity.get("verb")),
|
||||
"field": str(issue_activity.get("field")),
|
||||
"actor": str(
|
||||
issue_activity.get("actor_id")
|
||||
"field": (
|
||||
str(issue_activity.get("field"))
|
||||
if issue_activity.get("field")
|
||||
else None
|
||||
),
|
||||
"new_value": str(
|
||||
issue_activity.get("new_value")
|
||||
"actor": (
|
||||
str(issue_activity.get("actor_id"))
|
||||
if issue_activity.get("actor_id")
|
||||
else None
|
||||
),
|
||||
"old_value": str(
|
||||
issue_activity.get("old_value")
|
||||
"new_value": (
|
||||
str(issue_activity.get("new_value"))
|
||||
if issue_activity.get("new_value")
|
||||
else None
|
||||
),
|
||||
"old_value": (
|
||||
str(issue_activity.get("old_value"))
|
||||
if issue_activity.get("old_value")
|
||||
else None
|
||||
),
|
||||
"issue_comment": str(
|
||||
issue_comment.comment_stripped
|
||||
if issue_comment is not None
|
||||
else ""
|
||||
),
|
||||
"old_identifier": (
|
||||
str(
|
||||
issue_activity.get(
|
||||
"old_identifier"
|
||||
)
|
||||
)
|
||||
if issue_activity.get("old_identifier")
|
||||
else None
|
||||
),
|
||||
"new_identifier": (
|
||||
str(
|
||||
issue_activity.get(
|
||||
"new_identifier"
|
||||
)
|
||||
)
|
||||
if issue_activity.get("new_identifier")
|
||||
else None
|
||||
),
|
||||
},
|
||||
},
|
||||
)
|
||||
@@ -484,6 +516,16 @@ def notifications(
|
||||
"old_value": str(
|
||||
issue_activity.get("old_value")
|
||||
),
|
||||
"old_identifier": str(
|
||||
issue_activity.get(
|
||||
"old_identifier"
|
||||
)
|
||||
),
|
||||
"new_identifier": str(
|
||||
issue_activity.get(
|
||||
"new_identifier"
|
||||
)
|
||||
),
|
||||
"issue_comment": str(
|
||||
issue_comment.comment_stripped
|
||||
if issue_comment is not None
|
||||
@@ -572,6 +614,16 @@ def notifications(
|
||||
"old_value": str(
|
||||
issue_activity.get("old_value")
|
||||
),
|
||||
"old_identifier": str(
|
||||
issue_activity.get(
|
||||
"old_identifier"
|
||||
)
|
||||
),
|
||||
"new_identifier": str(
|
||||
issue_activity.get(
|
||||
"new_identifier"
|
||||
)
|
||||
),
|
||||
"activity_time": issue_activity.get(
|
||||
"created_at"
|
||||
),
|
||||
@@ -627,6 +679,12 @@ def notifications(
|
||||
"old_value": str(
|
||||
last_activity.old_value
|
||||
),
|
||||
"old_identifier": str(
|
||||
last_activity.old_identifier
|
||||
),
|
||||
"new_identifier": str(
|
||||
last_activity.new_identifier
|
||||
),
|
||||
},
|
||||
},
|
||||
)
|
||||
@@ -662,7 +720,15 @@ def notifications(
|
||||
"old_value": str(
|
||||
last_activity.old_value
|
||||
),
|
||||
"activity_time": str(last_activity.created_at),
|
||||
"old_identifier": str(
|
||||
last_activity.old_identifier
|
||||
),
|
||||
"new_identifier": str(
|
||||
last_activity.new_identifier
|
||||
),
|
||||
"activity_time": str(
|
||||
last_activity.created_at
|
||||
),
|
||||
},
|
||||
},
|
||||
)
|
||||
@@ -719,6 +785,28 @@ def notifications(
|
||||
"old_value"
|
||||
)
|
||||
),
|
||||
"old_identifier": (
|
||||
str(
|
||||
issue_activity.get(
|
||||
"old_identifier"
|
||||
)
|
||||
)
|
||||
if issue_activity.get(
|
||||
"old_identifier"
|
||||
)
|
||||
else None
|
||||
),
|
||||
"new_identifier": (
|
||||
str(
|
||||
issue_activity.get(
|
||||
"new_identifier"
|
||||
)
|
||||
)
|
||||
if issue_activity.get(
|
||||
"new_identifier"
|
||||
)
|
||||
else None
|
||||
),
|
||||
"activity_time": issue_activity.get(
|
||||
"created_at"
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user