From 2548a9f062f7f0ce9362a89dd7d8d51e2103da1a Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Thu, 15 Feb 2024 03:17:16 +0530 Subject: [PATCH 1/4] fix: peek overview issue description initial load bug (#3670) * fix: peek overview issue description initial load bug * fix: peekoverview issue description infinite loading for certain data sets --------- Co-authored-by: sriram veeraghanta --- web/components/issues/description-form.tsx | 30 ++++++---------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/web/components/issues/description-form.tsx b/web/components/issues/description-form.tsx index 452e37e75..4d20fd978 100644 --- a/web/components/issues/description-form.tsx +++ b/web/components/issues/description-form.tsx @@ -41,10 +41,9 @@ export const IssueDescriptionForm: FC = observer((props) => { const { workspaceSlug, projectId, issueId, issue, issueOperations, disabled, isSubmitting, setIsSubmitting } = props; const workspaceStore = useWorkspace(); const workspaceId = workspaceStore.getWorkspaceBySlug(workspaceSlug)?.id as string; - // states const [characterLimit, setCharacterLimit] = useState(false); - + // hooks const { setShowAlert } = useReloadConfirmations(); // store hooks const { mentionHighlights, mentionSuggestions } = useMention(); @@ -57,8 +56,8 @@ export const IssueDescriptionForm: FC = observer((props) => { formState: { errors }, } = useForm({ defaultValues: { - name: "", - description_html: "", + name: issue?.name, + description_html: issue?.description_html, }, }); @@ -68,24 +67,6 @@ export const IssueDescriptionForm: FC = observer((props) => { description_html: issue.description_html, }); - // adding issue.description_html or issue.name to dependency array causes - // editor rerendering on every save - useEffect(() => { - if (issue.id) { - setLocalTitleValue(issue.name); - } - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [issue.id]); // TODO: verify the exhaustive-deps warning - - useEffect(() => { - if (["", undefined, null].includes(localIssueDescription.description_html)) { - setLocalIssueDescription((state) => { - if (!["", undefined, null].includes(state.description_html)) return state; - return { id: issue.id, description_html: issue.description_html || "

" }; - }); - } - }, [issue.description_html, localIssueDescription.description_html, issue.id]); - const handleDescriptionFormSubmit = useCallback( async (formData: Partial) => { if (!formData?.name || formData?.name.length === 0 || formData?.name.length > 255) return; @@ -122,6 +103,11 @@ export const IssueDescriptionForm: FC = observer((props) => { reset({ ...issue, }); + setLocalIssueDescription({ + id: issue.id, + description_html: issue.description_html === "" ? "

" : issue.description_html, + }); + setLocalTitleValue(issue.name); }, [issue, reset]); // ADDING handleDescriptionFormSubmit TO DEPENDENCY ARRAY PRODUCES ADVERSE EFFECTS From 98d545cfb94c2fbdad0ef1bd8a200d80fd370fd0 Mon Sep 17 00:00:00 2001 From: Manish Gupta <59428681+mguptahub@users.noreply.github.com> Date: Thu, 15 Feb 2024 13:47:26 +0530 Subject: [PATCH 2/4] github action modified (#3673) --- .github/workflows/build-branch.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index 603f08e94..f02062189 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -54,7 +54,7 @@ jobs: steps: - name: Set Frontend Docker Tag run: | - if [ "${{ env.TARGET_BRANCH }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then + if [ "${{ github.event_name }}" == "release" ]; then TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend:${{ github.event.release.tag_name }} elif [ "${{ env.TARGET_BRANCH }}" == "master" ]; then TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend:stable @@ -105,7 +105,7 @@ jobs: steps: - name: Set Space Docker Tag run: | - if [ "${{ env.TARGET_BRANCH }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then + if [ "${{ github.event_name }}" == "release" ]; then TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-space:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-space:${{ github.event.release.tag_name }} elif [ "${{ env.TARGET_BRANCH }}" == "master" ]; then TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-space:stable @@ -156,7 +156,7 @@ jobs: steps: - name: Set Backend Docker Tag run: | - if [ "${{ env.TARGET_BRANCH }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then + if [ "${{ github.event_name }}" == "release" ]; then TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-backend:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-backend:${{ github.event.release.tag_name }} elif [ "${{ env.TARGET_BRANCH }}" == "master" ]; then TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-backend:stable @@ -208,7 +208,7 @@ jobs: steps: - name: Set Proxy Docker Tag run: | - if [ "${{ env.TARGET_BRANCH }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then + if [ "${{ github.event_name }}" == "release" ]; then TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy:${{ github.event.release.tag_name }} elif [ "${{ env.TARGET_BRANCH }}" == "master" ]; then TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy:stable From 2cd16c61bab21628bc14144652e81d55aad1d81c Mon Sep 17 00:00:00 2001 From: Manish Gupta <59428681+mguptahub@users.noreply.github.com> Date: Thu, 15 Feb 2024 14:52:18 +0530 Subject: [PATCH 3/4] arm build for release tag (#3676) --- .github/workflows/build-branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index f02062189..0d3f97068 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -28,7 +28,7 @@ jobs: - id: set_env_variables name: Set Environment Variables run: | - if [ "${{ env.TARGET_BRANCH }}" == "master" ]; then + if [ "${{ env.TARGET_BRANCH }}" == "master" ] || [ "${{ github.event_name }}" == "release" ]; then echo "BUILDX_DRIVER=cloud" >> $GITHUB_OUTPUT echo "BUILDX_VERSION=lab:latest" >> $GITHUB_OUTPUT echo "BUILDX_PLATFORMS=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT From 7628419a26e9798bcb2a1000b0e9383c7f14f56b Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Thu, 15 Feb 2024 19:31:38 +0530 Subject: [PATCH 4/4] fix: inbox description and mutation (#3677) * fix: inbox status mutation fix * fix: inbox description fix * chore: added description in inbox issue --------- Co-authored-by: NarayanBavisetti --- apiserver/plane/app/views/inbox.py | 4 ++-- web/components/inbox/inbox-issue-status.tsx | 5 +++-- web/components/issues/description-form.tsx | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/apiserver/plane/app/views/inbox.py b/apiserver/plane/app/views/inbox.py index 01eee78e3..f76c74d9c 100644 --- a/apiserver/plane/app/views/inbox.py +++ b/apiserver/plane/app/views/inbox.py @@ -27,7 +27,7 @@ from plane.app.serializers import ( InboxSerializer, InboxIssueSerializer, IssueCreateSerializer, - IssueStateInboxSerializer, + IssueDetailSerializer, ) from plane.utils.issue_filters import issue_filters from plane.bgtasks.issue_activites_task import issue_activity @@ -333,7 +333,7 @@ class InboxIssueViewSet(BaseViewSet): def retrieve(self, request, slug, project_id, inbox_id, issue_id): issue = self.get_queryset().filter(pk=issue_id).first() - serializer = IssueSerializer(issue, expand=self.expand,) + serializer = IssueDetailSerializer(issue, expand=self.expand,) return Response(serializer.data, status=status.HTTP_200_OK) def destroy(self, request, slug, project_id, inbox_id, issue_id): diff --git a/web/components/inbox/inbox-issue-status.tsx b/web/components/inbox/inbox-issue-status.tsx index 301583b4b..2d101f2aa 100644 --- a/web/components/inbox/inbox-issue-status.tsx +++ b/web/components/inbox/inbox-issue-status.tsx @@ -1,4 +1,5 @@ import React from "react"; +import { observer } from "mobx-react"; // hooks import { useInboxIssues } from "hooks/store"; // constants @@ -13,7 +14,7 @@ type Props = { showDescription?: boolean; }; -export const InboxIssueStatus: React.FC = (props) => { +export const InboxIssueStatus: React.FC = observer((props) => { const { workspaceSlug, projectId, inboxId, issueId, iconSize = 18, showDescription = false } = props; // hooks const { @@ -52,4 +53,4 @@ export const InboxIssueStatus: React.FC = (props) => { )} ); -}; +}); diff --git a/web/components/issues/description-form.tsx b/web/components/issues/description-form.tsx index 4d20fd978..c64c147ea 100644 --- a/web/components/issues/description-form.tsx +++ b/web/components/issues/description-form.tsx @@ -108,7 +108,7 @@ export const IssueDescriptionForm: FC = observer((props) => { description_html: issue.description_html === "" ? "

" : issue.description_html, }); setLocalTitleValue(issue.name); - }, [issue, reset]); + }, [issue, issue.description_html, reset]); // ADDING handleDescriptionFormSubmit TO DEPENDENCY ARRAY PRODUCES ADVERSE EFFECTS // TODO: Verify the exhaustive-deps warning