Skip to content

Commit 9d2e0e2

Browse files
committed
chore: merge develop
2 parents 9595493 + a86dafc commit 9d2e0e2

File tree

97 files changed

+1200
-379
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+1200
-379
lines changed

.github/workflows/create-sync-pr.yml

+3-12
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Create Sync Action
33
on:
44
pull_request:
55
branches:
6-
- develop # Change this to preview
6+
- preview
77
types:
88
- closed
99
env:
@@ -33,23 +33,14 @@ jobs:
3333
sudo apt update
3434
sudo apt install gh -y
3535
36-
- name: Create Pull Request
36+
- name: Push Changes to Target Repo
3737
env:
3838
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
3939
run: |
4040
TARGET_REPO="${{ secrets.SYNC_TARGET_REPO_NAME }}"
4141
TARGET_BRANCH="${{ secrets.SYNC_TARGET_BRANCH_NAME }}"
42-
TARGET_BASE_BRANCH="${{ secrets.SYNC_TARGET_BASE_BRANCH_NAME }}"
4342
SOURCE_BRANCH="${{ env.SOURCE_BRANCH_NAME }}"
4443
4544
git checkout $SOURCE_BRANCH
4645
git remote add target-origin "https://[email protected]/$TARGET_REPO.git"
47-
git push target-origin $SOURCE_BRANCH:$TARGET_BRANCH
48-
49-
PR_TITLE=${{secrets.SYNC_PR_TITLE}}
50-
51-
gh pr create \
52-
--base $TARGET_BASE_BRANCH \
53-
--head $TARGET_BRANCH \
54-
--title "$PR_TITLE" \
55-
--repo $TARGET_REPO
46+
git push target-origin $SOURCE_BRANCH:$TARGET_BRANCH

apiserver/plane/app/views/project.py

+25-8
Original file line numberDiff line numberDiff line change
@@ -999,11 +999,18 @@ class ProjectPublicCoverImagesEndpoint(BaseAPIView):
999999

10001000
def get(self, request):
10011001
files = []
1002-
s3 = boto3.client(
1003-
"s3",
1004-
aws_access_key_id=settings.AWS_ACCESS_KEY_ID,
1005-
aws_secret_access_key=settings.AWS_SECRET_ACCESS_KEY,
1006-
)
1002+
s3_client_params = {
1003+
"service_name": "s3",
1004+
"aws_access_key_id": settings.AWS_ACCESS_KEY_ID,
1005+
"aws_secret_access_key": settings.AWS_SECRET_ACCESS_KEY,
1006+
}
1007+
1008+
# Use AWS_S3_ENDPOINT_URL if it is present in the settings
1009+
if hasattr(settings, "AWS_S3_ENDPOINT_URL") and settings.AWS_S3_ENDPOINT_URL:
1010+
s3_client_params["endpoint_url"] = settings.AWS_S3_ENDPOINT_URL
1011+
1012+
s3 = boto3.client(**s3_client_params)
1013+
10071014
params = {
10081015
"Bucket": settings.AWS_STORAGE_BUCKET_NAME,
10091016
"Prefix": "static/project-cover/",
@@ -1016,9 +1023,19 @@ def get(self, request):
10161023
if not content["Key"].endswith(
10171024
"/"
10181025
): # This line ensures we're only getting files, not "sub-folders"
1019-
files.append(
1020-
f"https://{settings.AWS_STORAGE_BUCKET_NAME}.s3.{settings.AWS_REGION}.amazonaws.com/{content['Key']}"
1021-
)
1026+
if (
1027+
hasattr(settings, "AWS_S3_CUSTOM_DOMAIN")
1028+
and settings.AWS_S3_CUSTOM_DOMAIN
1029+
and hasattr(settings, "AWS_S3_URL_PROTOCOL")
1030+
and settings.AWS_S3_URL_PROTOCOL
1031+
):
1032+
files.append(
1033+
f"{settings.AWS_S3_URL_PROTOCOL}//{settings.AWS_S3_CUSTOM_DOMAIN}/{content['Key']}"
1034+
)
1035+
else:
1036+
files.append(
1037+
f"https://{settings.AWS_STORAGE_BUCKET_NAME}.s3.{settings.AWS_REGION}.amazonaws.com/{content['Key']}"
1038+
)
10221039

10231040
return Response(files, status=status.HTTP_200_OK)
10241041

apiserver/requirements/base.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ openpyxl==3.1.2
3030
beautifulsoup4==4.12.2
3131
dj-database-url==2.1.0
3232
posthog==3.0.2
33-
cryptography==41.0.5
33+
cryptography==41.0.6
3434
lxml==4.9.3
3535
boto3==1.28.40
3636

deploy/selfhost/install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function download(){
3939
echo ""
4040
echo "Latest version is now available for you to use"
4141
echo ""
42-
echo "In case of Upgrade, your new setting file is availabe as 'variables-upgrade.env'. Please compare and set the required values in '.env 'file."
42+
echo "In case of Upgrade, your new setting file is available as 'variables-upgrade.env'. Please compare and set the required values in '.env 'file."
4343
echo ""
4444

4545
}

web/components/common/new-empty-state.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type Props = {
1919
icon?: any;
2020
text: string;
2121
onClick: () => void;
22-
};
22+
} | null;
2323
disabled?: boolean;
2424
};
2525

web/components/core/modals/bulk-delete-issues-modal.tsx

+19-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import React, { useState } from "react";
22
import { useRouter } from "next/router";
3-
import useSWR from "swr";
4-
// react hook form
3+
import { observer } from "mobx-react-lite";
54
import { SubmitHandler, useForm } from "react-hook-form";
6-
// headless ui
75
import { Combobox, Dialog, Transition } from "@headlessui/react";
8-
// services
9-
import { IssueService } from "services/issue";
6+
import useSWR from "swr";
107
// hooks
8+
import { useMobxStore } from "lib/mobx/store-provider";
119
import useToast from "hooks/use-toast";
10+
// services
11+
import { IssueService } from "services/issue";
1212
// ui
1313
import { Button, LayersIcon } from "@plane/ui";
1414
// icons
@@ -30,17 +30,25 @@ type Props = {
3030

3131
const issueService = new IssueService();
3232

33-
export const BulkDeleteIssuesModal: React.FC<Props> = (props) => {
33+
export const BulkDeleteIssuesModal: React.FC<Props> = observer((props) => {
3434
const { isOpen, onClose } = props;
35+
// states
36+
const [query, setQuery] = useState("");
3537
// router
3638
const router = useRouter();
3739
const { workspaceSlug, projectId } = router.query;
38-
// states
39-
const [query, setQuery] = useState("");
40+
// store hooks
41+
const {
42+
user: { hasPermissionToCurrentProject },
43+
} = useMobxStore();
4044
// fetching project issues.
4145
const { data: issues } = useSWR(
42-
workspaceSlug && projectId ? PROJECT_ISSUES_LIST(workspaceSlug as string, projectId as string) : null,
43-
workspaceSlug && projectId ? () => issueService.getIssues(workspaceSlug as string, projectId as string) : null
46+
workspaceSlug && projectId && hasPermissionToCurrentProject
47+
? PROJECT_ISSUES_LIST(workspaceSlug.toString(), projectId.toString())
48+
: null,
49+
workspaceSlug && projectId && hasPermissionToCurrentProject
50+
? () => issueService.getIssues(workspaceSlug.toString(), projectId.toString())
51+
: null
4452
);
4553

4654
const { setToastAlert } = useToast();
@@ -222,4 +230,4 @@ export const BulkDeleteIssuesModal: React.FC<Props> = (props) => {
222230
</Dialog>
223231
</Transition.Root>
224232
);
225-
};
233+
});

web/components/core/sidebar/links-list.tsx

+14-12
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ export const LinksList: React.FC<Props> = ({ links, handleDeleteLink, handleEdit
5050
</Tooltip>
5151
</div>
5252

53-
{!isNotAllowed && (
54-
<div className="z-[1] flex flex-shrink-0 items-center gap-2">
53+
<div className="z-[1] flex flex-shrink-0 items-center gap-2">
54+
{!isNotAllowed && (
5555
<button
5656
type="button"
5757
className="flex items-center justify-center p-1 hover:bg-custom-background-80"
@@ -63,14 +63,16 @@ export const LinksList: React.FC<Props> = ({ links, handleDeleteLink, handleEdit
6363
>
6464
<Pencil className="h-3 w-3 stroke-[1.5] text-custom-text-200" />
6565
</button>
66-
<a
67-
href={link.url}
68-
target="_blank"
69-
rel="noopener noreferrer"
70-
className="flex items-center justify-center p-1 hover:bg-custom-background-80"
71-
>
72-
<ExternalLinkIcon className="h-3 w-3 stroke-[1.5] text-custom-text-200" />
73-
</a>
66+
)}
67+
<a
68+
href={link.url}
69+
target="_blank"
70+
rel="noopener noreferrer"
71+
className="flex items-center justify-center p-1 hover:bg-custom-background-80"
72+
>
73+
<ExternalLinkIcon className="h-3 w-3 stroke-[1.5] text-custom-text-200" />
74+
</a>
75+
{!isNotAllowed && (
7476
<button
7577
type="button"
7678
className="flex items-center justify-center p-1 hover:bg-custom-background-80"
@@ -82,8 +84,8 @@ export const LinksList: React.FC<Props> = ({ links, handleDeleteLink, handleEdit
8284
>
8385
<Trash2 className="h-3 w-3" />
8486
</button>
85-
</div>
86-
)}
87+
)}
88+
</div>
8789
</div>
8890
<div className="px-5">
8991
<p className="mt-0.5 stroke-[1.5] text-xs text-custom-text-300">

web/components/core/sidebar/sidebar-progress-stats.tsx

+17-25
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { SingleProgressStats } from "components/core";
1414
import { Avatar, StateGroupIcon } from "@plane/ui";
1515
// types
1616
import {
17+
IIssueFilterOptions,
1718
IModule,
1819
TAssigneesDistribution,
1920
TCompletionChartDistribution,
@@ -35,6 +36,9 @@ type Props = {
3536
roundedTab?: boolean;
3637
noBackground?: boolean;
3738
isPeekView?: boolean;
39+
isCompleted?: boolean;
40+
filters?: IIssueFilterOptions;
41+
handleFiltersUpdate: (key: keyof IIssueFilterOptions, value: string | string[]) => void;
3842
};
3943

4044
export const SidebarProgressStats: React.FC<Props> = ({
@@ -44,7 +48,10 @@ export const SidebarProgressStats: React.FC<Props> = ({
4448
module,
4549
roundedTab,
4650
noBackground,
51+
isCompleted = false,
4752
isPeekView = false,
53+
filters,
54+
handleFiltersUpdate,
4855
}) => {
4956
const { storedValue: tab, setValue: setTab } = useLocalStorage("tab", "Assignees");
5057

@@ -140,20 +147,11 @@ export const SidebarProgressStats: React.FC<Props> = ({
140147
}
141148
completed={assignee.completed_issues}
142149
total={assignee.total_issues}
143-
{...(!isPeekView && {
144-
onClick: () => {
145-
// TODO: set filters here
146-
// if (filters?.assignees?.includes(assignee.assignee_id ?? ""))
147-
// setFilters({
148-
// assignees: filters?.assignees?.filter((a) => a !== assignee.assignee_id),
149-
// });
150-
// else
151-
// setFilters({
152-
// assignees: [...(filters?.assignees ?? []), assignee.assignee_id ?? ""],
153-
// });
154-
},
155-
// selected: filters?.assignees?.includes(assignee.assignee_id ?? ""),
156-
})}
150+
{...(!isPeekView &&
151+
!isCompleted && {
152+
onClick: () => handleFiltersUpdate("assignees", assignee.assignee_id ?? ""),
153+
selected: filters?.assignees?.includes(assignee.assignee_id ?? ""),
154+
})}
157155
/>
158156
);
159157
else
@@ -200,17 +198,11 @@ export const SidebarProgressStats: React.FC<Props> = ({
200198
}
201199
completed={label.completed_issues}
202200
total={label.total_issues}
203-
{...(!isPeekView && {
204-
// TODO: set filters here
205-
onClick: () => {
206-
// if (filters.labels?.includes(label.label_id ?? ""))
207-
// setFilters({
208-
// labels: filters?.labels?.filter((l) => l !== label.label_id),
209-
// });
210-
// else setFilters({ labels: [...(filters?.labels ?? []), label.label_id ?? ""] });
211-
},
212-
// selected: filters?.labels?.includes(label.label_id ?? ""),
213-
})}
201+
{...(!isPeekView &&
202+
!isCompleted && {
203+
onClick: () => handleFiltersUpdate("labels", label.label_id ?? ""),
204+
selected: filters?.labels?.includes(label.label_id ?? `no-label-${index}`),
205+
})}
214206
/>
215207
))
216208
) : (

web/components/cycles/sidebar.tsx

+33-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useState } from "react";
1+
import React, { useCallback, useEffect, useState } from "react";
22
import { useRouter } from "next/router";
33
import { observer } from "mobx-react-lite";
44
import { useForm } from "react-hook-form";
@@ -28,7 +28,8 @@ import {
2828
renderShortMonthDate,
2929
} from "helpers/date-time.helper";
3030
// types
31-
import { ICycle } from "types";
31+
import { ICycle, IIssueFilterOptions } from "types";
32+
import { EFilterType } from "store/issues/types";
3233
// constants
3334
import { EUserWorkspaceRoles } from "constants/workspace";
3435
// fetch-keys
@@ -52,12 +53,20 @@ export const CycleDetailsSidebar: React.FC<Props> = observer((props) => {
5253
const { workspaceSlug, projectId, peekCycle } = router.query;
5354
// store hooks
5455
const {
56+
<<<<<<< HEAD
5557
eventTracker: { setTrackElement },
5658
} = useApplication();
5759
const {
5860
membership: { currentProjectRole },
5961
} = useUser();
6062
const { getCycleById, updateCycleDetails } = useCycle();
63+
=======
64+
cycle: cycleDetailsStore,
65+
cycleIssuesFilter: { issueFilters, updateFilters },
66+
trackEvent: { setTrackElement },
67+
user: { currentProjectRole },
68+
} = useMobxStore();
69+
>>>>>>> a86dafc11c3e52699f4050e9d9c97393e29f0434
6170

6271
const cycleDetails = getCycleById(cycleId);
6372

@@ -246,6 +255,25 @@ export const CycleDetailsSidebar: React.FC<Props> = observer((props) => {
246255
}
247256
};
248257

258+
const handleFiltersUpdate = useCallback(
259+
(key: keyof IIssueFilterOptions, value: string | string[]) => {
260+
if (!workspaceSlug || !projectId) return;
261+
const newValues = issueFilters?.filters?.[key] ?? [];
262+
263+
if (Array.isArray(value)) {
264+
value.forEach((val) => {
265+
if (!newValues.includes(val)) newValues.push(val);
266+
});
267+
} else {
268+
if (issueFilters?.filters?.[key]?.includes(value)) newValues.splice(newValues.indexOf(value), 1);
269+
else newValues.push(value);
270+
}
271+
272+
updateFilters(workspaceSlug.toString(), projectId.toString(), EFilterType.FILTERS, { [key]: newValues }, cycleId);
273+
},
274+
[workspaceSlug, projectId, cycleId, issueFilters, updateFilters]
275+
);
276+
249277
const cycleStatus =
250278
cycleDetails?.start_date && cycleDetails?.end_date
251279
? getDateRangeStatus(cycleDetails?.start_date, cycleDetails?.end_date)
@@ -539,6 +567,9 @@ export const CycleDetailsSidebar: React.FC<Props> = observer((props) => {
539567
}}
540568
totalIssues={cycleDetails.total_issues}
541569
isPeekView={Boolean(peekCycle)}
570+
isCompleted={isCompleted}
571+
filters={issueFilters?.filters}
572+
handleFiltersUpdate={handleFiltersUpdate}
542573
/>
543574
</div>
544575
)}

0 commit comments

Comments
 (0)