mirror of
https://github.com/makeplane/plane.git
synced 2025-12-29 00:24:56 +01:00
[MOBIL-194] chore: added type in all projects query (#1106)
* chore: integrated type all and joined in all projects query * chore: updated member query * chore: commented state_group issue filter in workspace your work * chore: handled the project member is active or not * chore: removed views form user recent visits and favorite * chore: updated the query
This commit is contained in:
@@ -32,10 +32,24 @@ class ProjectQuery:
|
||||
self,
|
||||
info: Info,
|
||||
slug: str,
|
||||
type: Optional[str] = "all",
|
||||
) -> list[ProjectType]:
|
||||
project_query = Project.objects.filter(
|
||||
workspace__slug=slug, archived_at__isnull=True
|
||||
)
|
||||
|
||||
if type == "joined":
|
||||
project_query = project_query.filter(
|
||||
Q(
|
||||
project_projectmember__member=info.context.user,
|
||||
project_projectmember__is_active=True,
|
||||
)
|
||||
| Q(
|
||||
created_by=info.context.user,
|
||||
project_projectmember__is_active=True,
|
||||
)
|
||||
)
|
||||
|
||||
projects = await sync_to_async(list)(project_query)
|
||||
return projects
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@ class UserFavoritesQuery:
|
||||
)
|
||||
& Q(project__project_projectmember__is_active=True)
|
||||
),
|
||||
~Q(entity_type="view"),
|
||||
)
|
||||
.order_by("-created_at")
|
||||
)
|
||||
@@ -102,7 +103,9 @@ class UserRecentVisitQuery:
|
||||
) -> list[UserRecentVisitType]:
|
||||
recent_visits = await sync_to_async(list)(
|
||||
UserRecentVisit.objects.filter(
|
||||
workspace__slug=slug, user=info.context.user
|
||||
Q(workspace__slug=slug),
|
||||
Q(user=info.context.user),
|
||||
~Q(entity_name="view"),
|
||||
).order_by("-visited_at")
|
||||
)
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ class YourWorkQuery:
|
||||
Q(
|
||||
project__project_projectmember__member=info.context.user,
|
||||
project__project_projectmember__is_active=True,
|
||||
state__group__in=["unstarted", "started"],
|
||||
# state__group__in=["unstarted", "started"],
|
||||
assignees__in=[info.context.user],
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user