Skip to content

Commit

Permalink
Merge branch 'preview' into fix/lock-unlock-realtime
Browse files Browse the repository at this point in the history
  • Loading branch information
Palanikannan1437 committed Sep 23, 2024
2 parents cd29430 + f38755b commit 8ce39f5
Show file tree
Hide file tree
Showing 214 changed files with 3,161 additions and 3,532 deletions.
59 changes: 0 additions & 59 deletions .eslintrc-staged.js

This file was deleted.

10 changes: 0 additions & 10 deletions .eslintrc.js

This file was deleted.

Empty file removed .husky/pre-commit
Empty file.
3 changes: 0 additions & 3 deletions .lintstagedrc.json

This file was deleted.

52 changes: 4 additions & 48 deletions admin/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,52 +1,8 @@
module.exports = {
root: true,
extends: ["custom"],
extends: ["@plane/eslint-config/next.js"],
parser: "@typescript-eslint/parser",
settings: {
"import/resolver": {
typescript: {},
node: {
moduleDirectory: ["node_modules", "."],
},
},
parserOptions: {
project: true,
},
rules: {
"import/order": [
"error",
{
groups: ["builtin", "external", "internal", "parent", "sibling",],
pathGroups: [
{
pattern: "react",
group: "external",
position: "before",
},
{
pattern: "lucide-react",
group: "external",
position: "after",
},
{
pattern: "@headlessui/**",
group: "external",
position: "after",
},
{
pattern: "@plane/**",
group: "external",
position: "after",
},
{
pattern: "@/**",
group: "internal",
}
],
pathGroupsExcludedImportTypes: ["builtin", "internal", "react"],
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
},
}
};
4 changes: 1 addition & 3 deletions admin/core/components/admin-sidebar/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ import { HelpSection, SidebarMenu, SidebarDropdown } from "@/components/admin-si
// hooks
import { useTheme } from "@/hooks/store";

export interface IInstanceSidebar {}

export const InstanceSidebar: FC<IInstanceSidebar> = observer(() => {
export const InstanceSidebar: FC = observer(() => {
// store
const { isSidebarCollapsed, toggleSidebar } = useTheme();

Expand Down
6 changes: 1 addition & 5 deletions admin/core/components/instance/instance-failure-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ import { Button } from "@plane/ui";
import InstanceFailureDarkImage from "@/public/instance/instance-failure-dark.svg";
import InstanceFailureImage from "@/public/instance/instance-failure.svg";

type InstanceFailureViewProps = {
// mutate: () => void;
};

export const InstanceFailureView: FC<InstanceFailureViewProps> = () => {
export const InstanceFailureView: FC = () => {
const { resolvedTheme } = useTheme();

const instanceImage = resolvedTheme === "dark" ? InstanceFailureDarkImage : InstanceFailureImage;
Expand Down
2 changes: 1 addition & 1 deletion admin/core/services/auth.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// helpers
import { API_BASE_URL } from "helpers/common.helper";
import { API_BASE_URL } from "@/helpers/common.helper";
// services
import { APIService } from "@/services/api.service";

Expand Down
4 changes: 2 additions & 2 deletions admin/core/services/user.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// helpers
import { API_BASE_URL } from "helpers/common.helper";
// types
import type { IUser } from "@plane/types";
// helpers
import { API_BASE_URL } from "@/helpers/common.helper";
// services
import { APIService } from "@/services/api.service";

Expand Down
11 changes: 6 additions & 5 deletions admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"build": "next build",
"preview": "next build && next start",
"start": "next start",
"lint": "next lint"
"lint": "eslint . --ext .ts,.tsx",
"lint:errors": "eslint . --ext .ts,.tsx --quiet"
},
"dependencies": {
"@headlessui/react": "^1.7.19",
Expand All @@ -25,7 +26,7 @@
"lucide-react": "^0.356.0",
"mobx": "^6.12.0",
"mobx-react": "^9.1.1",
"next": "^14.2.3",
"next": "^14.2.12",
"next-themes": "^0.2.1",
"postcss": "^8.4.38",
"react": "^18.3.1",
Expand All @@ -43,9 +44,9 @@
"@types/react-dom": "^18.2.18",
"@types/uuid": "^9.0.8",
"@types/zxcvbn": "^4.4.4",
"eslint-config-custom": "*",
"@plane/eslint-config": "*",
"tailwind-config-custom": "*",
"tsconfig": "*",
"typescript": "5.4.5"
"@plane/typescript-config": "*",
"typescript": "5.3.3"
}
}
18 changes: 6 additions & 12 deletions admin/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
{
"extends": "tsconfig/nextjs.json",
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"],
"extends": "@plane/typescript-config/nextjs.json",
"compilerOptions": {
"plugins": [{ "name": "next" }],
"baseUrl": ".",
"jsx": "preserve",
"esModuleInterop": true,
"paths": {
"@/*": ["core/*"],
"@/helpers/*": ["helpers/*"],
"@/public/*": ["public/*"],
"@/plane-admin/*": ["ce/*"]
},
"plugins": [
{
"name": "next"
}
]
}
}
},
"include": ["next-env.d.ts", "next.config.js", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}
11 changes: 8 additions & 3 deletions apiserver/plane/api/views/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,16 @@ def patch(self, request, slug, pk):
if serializer.is_valid():
serializer.save()
if serializer.data["inbox_view"]:
Inbox.objects.get_or_create(
name=f"{project.name} Inbox",
inbox = Inbox.objects.filter(
project=project,
is_default=True,
)
).first()
if not inbox:
Inbox.objects.create(
name=f"{project.name} Inbox",
project=project,
is_default=True,
)

# Create the triage state in Backlog group
State.objects.get_or_create(
Expand Down
10 changes: 5 additions & 5 deletions apiserver/plane/app/views/inbox/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ def get_queryset(self):

@allow_permission([ROLE.ADMIN, ROLE.MEMBER, ROLE.GUEST])
def list(self, request, slug, project_id):
inbox_id = Inbox.objects.get(
inbox_id = Inbox.objects.filter(
workspace__slug=slug, project_id=project_id
)
project = Project.objects.get(pk=project_id)
).first()
project = Project.objects.get(pk=project_id)
filters = issue_filters(request.GET, "GET", "issue__")
inbox_issue = (
InboxIssue.objects.filter(
Expand Down Expand Up @@ -527,9 +527,9 @@ def partial_update(self, request, slug, project_id, pk):
model=Issue,
)
def retrieve(self, request, slug, project_id, pk):
inbox_id = Inbox.objects.get(
inbox_id = Inbox.objects.filter(
workspace__slug=slug, project_id=project_id
)
).first()
project = Project.objects.get(pk=project_id)
inbox_issue = (
InboxIssue.objects.select_related("issue")
Expand Down
4 changes: 2 additions & 2 deletions apiserver/plane/app/views/issue/reaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_queryset(self):
.distinct()
)

@allow_permission(ROLE.ADMIN, ROLE.MEMBER, ROLE.GUEST)
@allow_permission([ROLE.ADMIN, ROLE.MEMBER, ROLE.GUEST])
def create(self, request, slug, project_id, issue_id):
serializer = IssueReactionSerializer(data=request.data)
if serializer.is_valid():
Expand All @@ -60,7 +60,7 @@ def create(self, request, slug, project_id, issue_id):
return Response(serializer.data, status=status.HTTP_201_CREATED)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)

@allow_permission(ROLE.ADMIN, ROLE.MEMBER, ROLE.GUEST)
@allow_permission([ROLE.ADMIN, ROLE.MEMBER, ROLE.GUEST])
def destroy(self, request, slug, project_id, issue_id, reaction_code):
issue_reaction = IssueReaction.objects.get(
workspace__slug=slug,
Expand Down
2 changes: 1 addition & 1 deletion apiserver/plane/app/views/issue/relation.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def remove_relation(self, request, slug, project_id, issue_id):
IssueRelationSerializer(issue_relation).data,
cls=DjangoJSONEncoder,
)
issue_relation.delete()
issue_relation.delete(soft=False)
issue_activity.delay(
type="issue_relation.activity.deleted",
requested_data=json.dumps(request.data, cls=DjangoJSONEncoder),
Expand Down
13 changes: 9 additions & 4 deletions apiserver/plane/app/views/project/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def list(self, request, slug):
member=request.user,
workspace__slug=slug,
is_active=True,
role=10,
role=15,
).exists():
projects = projects.filter(
Q(
Expand Down Expand Up @@ -438,11 +438,16 @@ def partial_update(self, request, slug, pk=None):
if serializer.is_valid():
serializer.save()
if serializer.data["inbox_view"]:
Inbox.objects.get_or_create(
name=f"{project.name} Inbox",
inbox = Inbox.objects.filter(
project=project,
is_default=True,
)
).first()
if not inbox:
Inbox.objects.create(
name=f"{project.name} Inbox",
project=project,
is_default=True,
)

# Create the triage state in Backlog group
State.objects.get_or_create(
Expand Down
1 change: 1 addition & 0 deletions apiserver/plane/app/views/project/member.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ def get(self, request, slug):
project_members = ProjectMember.objects.filter(
workspace__slug=slug,
member_id=request.user.id,
is_active=True,
).values("project_id", "role")

project_members = {
Expand Down
4 changes: 2 additions & 2 deletions apiserver/plane/utils/order_queryset.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ def order_issue_queryset(issue_queryset, order_by_param="-created_at"):
)
).order_by("priority_order")
order_by_param = (
"-priority_order"
"priority_order"
if order_by_param.startswith("-")
else "priority_order"
else "-priority_order"
)
# State Ordering
elif order_by_param in [
Expand Down
4 changes: 4 additions & 0 deletions live/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.turbo/*
out/*
dist/*
public/*
8 changes: 8 additions & 0 deletions live/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"root": true,
"extends": ["@plane/eslint-config/server.js"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": true
}
}
4 changes: 3 additions & 1 deletion live/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ RUN apk add --no-cache libc6-compat
# Set working directory
WORKDIR /app


COPY . .
RUN yarn global add turbo
RUN yarn install
EXPOSE 3003

ENV TURBO_TELEMETRY_DISABLED 1

VOLUME [ "/app/node_modules", "/app/live/node_modules"]

CMD ["yarn","dev", "--filter=live"]
Loading

0 comments on commit 8ce39f5

Please sign in to comment.