Skip to content

Commit

Permalink
Merge branch 'preview' of github.com:makeplane/plane into chore-activ…
Browse files Browse the repository at this point in the history
…ity_filters
  • Loading branch information
mathalav55 committed Jan 6, 2025
2 parents 45b1a9e + a6216be commit 4c83fcb
Show file tree
Hide file tree
Showing 40 changed files with 607 additions and 475 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
</a>
</p>
<h1 align="center"><b>Plane</b></h1>
<p align="center"><b>Open-source project management that unlocks customer value</b></p>

<p align="center">
<a href="https://discord.com/invite/A92xrEGCge">
Expand Down Expand Up @@ -57,7 +58,7 @@ Prefer full control over your data and infrastructure? Install and run Plane on
| Docker | [![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white)](https://developers.plane.so/self-hosting/methods/docker-compose) |
| Kubernetes | [![Kubernetes](https://img.shields.io/badge/kubernetes-%23326ce5.svg?style=for-the-badge&logo=kubernetes&logoColor=white)](https://developers.plane.so/self-hosting/methods/kubernetes) |

`Instance admins` can manage and customize settings using [God mode](https://developers.plane.so/self-hosting/govern/instance-admin).
`Instance admins` can configure instance settings with [God mode](https://developers.plane.so/self-hosting/govern/instance-admin).

## 🌟 Features

Expand Down Expand Up @@ -117,9 +118,9 @@ Setting up your local environment is simple and straightforward. Follow these st

That’s it! You’re all set to begin coding. Remember to refresh your browser if changes don’t auto-reload. Happy contributing! 🎉

## Built with
[![Next JS](https://img.shields.io/badge/next.js-000000?style=for-the-badge&logo=nextdotjs&logoColor=white)](https://nextjs.org/)<br/>
[![Django](https://img.shields.io/badge/Django-092E20?style=for-the-badge&logo=django&logoColor=green)](https://www.djangoproject.com/)<br/>
## ⚙️ Built with
[![Next JS](https://img.shields.io/badge/next.js-000000?style=for-the-badge&logo=nextdotjs&logoColor=white)](https://nextjs.org/)
[![Django](https://img.shields.io/badge/Django-092E20?style=for-the-badge&logo=django&logoColor=green)](https://www.djangoproject.com/)
[![Node JS](https://img.shields.io/badge/node.js-339933?style=for-the-badge&logo=Node.js&logoColor=white)](https://nodejs.org/en)

## 📸 Screenshots
Expand Down
61 changes: 34 additions & 27 deletions apiserver/plane/app/views/search/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,28 +277,14 @@ def get(self, request, slug):
for field in fields:
q |= Q(**{f"{field}__icontains": query})

base_filters = Q(
q,
is_active=True,
workspace__slug=slug,
member__is_bot=False,
project_id=project_id,
role__gt=10,
)
if issue_id:
issue_created_by = (
Issue.objects.filter(id=issue_id)
.values_list("created_by_id", flat=True)
.first()
)
# Add condition to include `issue_created_by` in the query
filters = Q(member_id=issue_created_by) | base_filters
else:
filters = base_filters

# Query to fetch users
users = (
ProjectMember.objects.filter(filters)
ProjectMember.objects.filter(
q,
is_active=True,
workspace__slug=slug,
member__is_bot=False,
project_id=project_id,
)
.annotate(
member__avatar_url=Case(
When(
Expand All @@ -318,14 +304,35 @@ def get(self, request, slug):
)
)
.order_by("-created_at")
.values(
"member__avatar_url",
"member__display_name",
"member__id",
)[:count]
)

response_data["user_mention"] = list(users)
if issue_id:
issue_created_by = (
Issue.objects.filter(id=issue_id)
.values_list("created_by_id", flat=True)
.first()
)
users = (
users.filter(Q(role__gt=10) | Q(member_id=issue_created_by))
.distinct()
.values(
"member__avatar_url",
"member__display_name",
"member__id",
)
)
else:
users = (
users.filter(Q(role__gt=10))
.distinct()
.values(
"member__avatar_url",
"member__display_name",
"member__id",
)
)

response_data["user_mention"] = list(users[:count])

elif query_type == "project":
fields = ["name", "identifier"]
Expand Down
1 change: 1 addition & 0 deletions packages/constants/src/event.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const SIDEBAR_CLICKED = "Sidenav clicked";
1 change: 1 addition & 0 deletions packages/constants/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export * from "./ai";
export * from "./auth";
export * from "./endpoints";
export * from "./event";
export * from "./file";
export * from "./instance";
export * from "./issue";
Expand Down
17 changes: 17 additions & 0 deletions packages/constants/src/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,20 @@ export type TUserStatus = {
status: EUserStatus | undefined;
message?: string;
};

export enum EUserPermissionsLevel {
WORKSPACE = "WORKSPACE",
PROJECT = "PROJECT",
}

export enum EUserWorkspaceRoles {
ADMIN = 20,
MEMBER = 15,
GUEST = 5,
}

export enum EUserProjectRoles {
ADMIN = 20,
MEMBER = 15,
GUEST = 5,
}
1 change: 1 addition & 0 deletions packages/hooks/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "./use-local-storage";
export * from "./use-outside-click-detector";
export * from "./use-platform-os";
34 changes: 34 additions & 0 deletions packages/hooks/src/use-platform-os.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { useState, useEffect } from "react";

export const usePlatformOS = () => {
const [platformData, setPlatformData] = useState({
isMobile: false,
platform: "",
});

useEffect(() => {
const detectPlatform = () => {
const userAgent = window.navigator.userAgent;
const isMobile = /iPhone|iPad|iPod|Android/i.test(userAgent);
let platform = "";

if (!isMobile) {
if (userAgent.indexOf("Win") !== -1) {
platform = "Windows";
} else if (userAgent.indexOf("Mac") !== -1) {
platform = "MacOS";
} else if (userAgent.indexOf("Linux") !== -1) {
platform = "Linux";
} else {
platform = "Unknown";
}
}

setPlatformData({ isMobile, platform });
};

detectPlatform();
}, []);

return platformData;
};
1 change: 1 addition & 0 deletions packages/i18n/src/locales/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"activity": "Activity",
"appearance": "Appearance",
"notifications": "Notifications",
"inbox": "Inbox",
"workspaces": "Workspaces",
"create_workspace": "Create workspace",
"invitations": "Invitations",
Expand Down
3 changes: 2 additions & 1 deletion packages/i18n/src/locales/es/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -314,5 +314,6 @@
"change_parent_issue": "Cambiar problema padre",
"remove_parent_issue": "Eliminar problema padre",
"add_parent": "Agregar padre",
"loading_members": "Cargando miembros..."
"loading_members": "Cargando miembros...",
"inbox": "bandeja de entrada"
}
3 changes: 2 additions & 1 deletion packages/i18n/src/locales/fr/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -314,5 +314,6 @@
"change_parent_issue": "Modifier le problème parent",
"remove_parent_issue": "Supprimer le problème parent",
"add_parent": "Ajouter un parent",
"loading_members": "Chargement des membres..."
"loading_members": "Chargement des membres...",
"inbox": "boîte de réception"
}
3 changes: 2 additions & 1 deletion packages/i18n/src/locales/ja/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -314,5 +314,6 @@
"change_parent_issue": "親問題を変更",
"remove_parent_issue": "親問題を削除",
"add_parent": "親問題を追加",
"loading_members": "メンバーを読み込んでいます..."
"loading_members": "メンバーを読み込んでいます...",
"inbox": "受信箱"
}
1 change: 1 addition & 0 deletions packages/types/src/search.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,5 @@ export type TSearchEntityRequestPayload = {
query_type: TSearchEntities[];
query: string;
team_id?: string;
issue_id?: string;
};
113 changes: 0 additions & 113 deletions web/ce/constants/dashboard.ts

This file was deleted.

8 changes: 0 additions & 8 deletions web/ce/helpers/dashboard.helper.ts

This file was deleted.

3 changes: 0 additions & 3 deletions web/ce/types/dashboard.ts

This file was deleted.

Loading

0 comments on commit 4c83fcb

Please sign in to comment.