From 9717497b4e243cae19cffb3e7af8c1ab71030879 Mon Sep 17 00:00:00 2001 From: sriram veeraghanta Date: Thu, 4 Jul 2024 15:27:37 +0530 Subject: [PATCH 1/8] chore: package version change --- admin/package.json | 2 +- apiserver/package.json | 2 +- package.json | 2 +- packages/constants/package.json | 2 +- packages/editor/package.json | 2 +- packages/eslint-config-custom/package.json | 2 +- packages/tailwind-config-custom/package.json | 2 +- packages/tsconfig/package.json | 2 +- packages/types/package.json | 2 +- packages/ui/package.json | 2 +- space/package.json | 2 +- web/package.json | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/admin/package.json b/admin/package.json index 0afef4adfc..c8b0726264 100644 --- a/admin/package.json +++ b/admin/package.json @@ -1,6 +1,6 @@ { "name": "admin", - "version": "0.21.0", + "version": "0.22.0", "private": true, "scripts": { "dev": "turbo run develop", diff --git a/apiserver/package.json b/apiserver/package.json index ecaf1194a8..9bf1c232ad 100644 --- a/apiserver/package.json +++ b/apiserver/package.json @@ -1,4 +1,4 @@ { "name": "plane-api", - "version": "0.21.0" + "version": "0.22.0" } diff --git a/package.json b/package.json index 700678bb95..e498846389 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "repository": "https://github.com/makeplane/plane.git", - "version": "0.21.0", + "version": "0.22.0", "license": "AGPL-3.0", "private": true, "workspaces": [ diff --git a/packages/constants/package.json b/packages/constants/package.json index d9939f8eef..7229217dcd 100644 --- a/packages/constants/package.json +++ b/packages/constants/package.json @@ -1,6 +1,6 @@ { "name": "@plane/constants", - "version": "0.21.0", + "version": "0.22.0", "private": true, "main": "./index.ts" } diff --git a/packages/editor/package.json b/packages/editor/package.json index ab3610131e..1c30558e3b 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -1,6 +1,6 @@ { "name": "@plane/editor", - "version": "0.21.0", + "version": "0.22.0", "description": "Core Editor that powers Plane", "private": true, "main": "./dist/index.mjs", diff --git a/packages/eslint-config-custom/package.json b/packages/eslint-config-custom/package.json index fb34284c3b..161ca7182c 100644 --- a/packages/eslint-config-custom/package.json +++ b/packages/eslint-config-custom/package.json @@ -1,7 +1,7 @@ { "name": "eslint-config-custom", "private": true, - "version": "0.21.0", + "version": "0.22.0", "main": "index.js", "license": "MIT", "devDependencies": {}, diff --git a/packages/tailwind-config-custom/package.json b/packages/tailwind-config-custom/package.json index 1871880296..b40c4f37cd 100644 --- a/packages/tailwind-config-custom/package.json +++ b/packages/tailwind-config-custom/package.json @@ -1,6 +1,6 @@ { "name": "tailwind-config-custom", - "version": "0.21.0", + "version": "0.22.0", "description": "common tailwind configuration across monorepo", "main": "index.js", "private": true, diff --git a/packages/tsconfig/package.json b/packages/tsconfig/package.json index a2f084dbc8..9e5d22eccf 100644 --- a/packages/tsconfig/package.json +++ b/packages/tsconfig/package.json @@ -1,6 +1,6 @@ { "name": "tsconfig", - "version": "0.21.0", + "version": "0.22.0", "private": true, "files": [ "base.json", diff --git a/packages/types/package.json b/packages/types/package.json index 918e9e77dd..3d7d663f68 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@plane/types", - "version": "0.21.0", + "version": "0.22.0", "private": true, "main": "./src/index.d.ts" } diff --git a/packages/ui/package.json b/packages/ui/package.json index 0914e18fd4..3f3ee777b8 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -2,7 +2,7 @@ "name": "@plane/ui", "description": "UI components shared across multiple apps internally", "private": true, - "version": "0.21.0", + "version": "0.22.0", "main": "./dist/index.js", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", diff --git a/space/package.json b/space/package.json index fdf156e9f3..c59f35589b 100644 --- a/space/package.json +++ b/space/package.json @@ -1,6 +1,6 @@ { "name": "space", - "version": "0.21.0", + "version": "0.22.0", "private": true, "scripts": { "dev": "turbo run develop", diff --git a/web/package.json b/web/package.json index 4d19742514..98555a9900 100644 --- a/web/package.json +++ b/web/package.json @@ -1,6 +1,6 @@ { "name": "web", - "version": "0.21.0", + "version": "0.22.0", "private": true, "scripts": { "dev": "turbo run develop", From f1496e3144d31bf9b570293c87ad003e62be51ab Mon Sep 17 00:00:00 2001 From: rahulramesha <71900764+rahulramesha@users.noreply.github.com> Date: Thu, 4 Jul 2024 16:17:49 +0530 Subject: [PATCH 2/8] fix module Quick add (#5039) --- .../store/issue/helpers/base-issues.store.ts | 37 +++++++++++++++++++ web/core/store/issue/module/issue.store.ts | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/web/core/store/issue/helpers/base-issues.store.ts b/web/core/store/issue/helpers/base-issues.store.ts index 3e70b66d35..524cda08d2 100644 --- a/web/core/store/issue/helpers/base-issues.store.ts +++ b/web/core/store/issue/helpers/base-issues.store.ts @@ -1041,6 +1041,43 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { } } + /* + * add Modules to Array in a non optimistic way while creating issues + * @param workspaceSlug + * @param projectId + * @param issueId + * @param moduleIds array of modules to be added + */ + async addModulesToIssue(workspaceSlug: string, projectId: string, issueId: string, moduleIds: string[]) { + // keep a copy of the original module ids + const originalModuleIds = get(this.rootIssueStore.issues.issuesMap, [issueId, "module_ids"]) ?? []; + try { + //Perform API call + await this.moduleService.addModulesToIssue(workspaceSlug, projectId, issueId, { + modules: moduleIds, + removed_modules: [], + }); + + runInAction(() => { + // get current Module Ids of the issue + let currentModuleIds = [...originalModuleIds]; + + // If current Module Id is included in the modules list, then add Issue to List + if (moduleIds.includes(this.moduleId ?? "")) this.addIssueToList(issueId); + currentModuleIds = uniq(concat([...currentModuleIds], moduleIds)); + + // For current Issue, update module Ids by calling current store's update Issue, without making an API call + this.updateIssue(workspaceSlug, projectId, issueId, { module_ids: currentModuleIds }, false); + }); + + if (moduleIds.includes(this.moduleId ?? "")) { + this.fetchParentStats(workspaceSlug, projectId); + } + } catch (error) { + throw error; + } + } + /* * change modules array in issue * @param workspaceSlug diff --git a/web/core/store/issue/module/issue.store.ts b/web/core/store/issue/module/issue.store.ts index 4f89f03663..8b592f8aba 100644 --- a/web/core/store/issue/module/issue.store.ts +++ b/web/core/store/issue/module/issue.store.ts @@ -209,7 +209,7 @@ export class ModuleIssues extends BaseIssuesStore implements IModuleIssues { try { const response = await super.createIssue(workspaceSlug, projectId, data, moduleId, false); const moduleIds = data.module_ids && data.module_ids.length > 1 ? data.module_ids : [moduleId]; - await this.changeModulesInIssue(workspaceSlug, projectId, response.id, moduleIds, []); + await this.addModulesToIssue(workspaceSlug, projectId, response.id, moduleIds); return response; } catch (error) { From 59186071717cfad0bf77c8d5027e99e594111262 Mon Sep 17 00:00:00 2001 From: rahulramesha <71900764+rahulramesha@users.noreply.github.com> Date: Thu, 4 Jul 2024 16:18:33 +0530 Subject: [PATCH 3/8] [WEB-1818] fix: issue changes done in Peek overview to reflect in the issue list boards (#5010) * fix issue changes done in Peek overview to reflect in the issue boards * Adding comments to aliased names --- .../issues/issue-detail/module-select.tsx | 5 +- .../components/issues/issue-detail/root.tsx | 66 ++----- .../components/issues/peek-overview/root.tsx | 166 +++++++----------- web/core/store/issue/archived/issue.store.ts | 5 + web/core/store/issue/cycle/issue.store.ts | 7 +- web/core/store/issue/draft/issue.store.ts | 4 + .../store/issue/helpers/base-issues.store.ts | 32 ++-- .../store/issue/issue-details/issue.store.ts | 34 ++-- .../store/issue/issue-details/root.store.ts | 11 +- web/core/store/issue/module/issue.store.ts | 3 + web/core/store/issue/profile/issue.store.ts | 5 + .../store/issue/project-views/issue.store.ts | 3 + web/core/store/issue/project/issue.store.ts | 3 + web/core/store/issue/workspace/issue.store.ts | 5 + 14 files changed, 148 insertions(+), 201 deletions(-) diff --git a/web/core/components/issues/issue-detail/module-select.tsx b/web/core/components/issues/issue-detail/module-select.tsx index 0214a5773b..f9f0a51e2d 100644 --- a/web/core/components/issues/issue-detail/module-select.tsx +++ b/web/core/components/issues/issue-detail/module-select.tsx @@ -47,11 +47,8 @@ export const IssueModuleSelect: React.FC = observer((props) modulesToAdd.push(moduleId); } } - if (modulesToRemove.length > 0) - await issueOperations.removeModulesFromIssue?.(workspaceSlug, projectId, issueId, modulesToRemove); - if (modulesToAdd.length > 0) - await issueOperations.addModulesToIssue?.(workspaceSlug, projectId, issueId, modulesToAdd); + await issueOperations.changeModulesInIssue?.(workspaceSlug, projectId, issueId, modulesToAdd, modulesToRemove); setIsUpdating(false); }; diff --git a/web/core/components/issues/issue-detail/root.tsx b/web/core/components/issues/issue-detail/root.tsx index 18255ac496..9de3684c73 100644 --- a/web/core/components/issues/issue-detail/root.tsx +++ b/web/core/components/issues/issue-detail/root.tsx @@ -32,18 +32,18 @@ export type TIssueOperations = { addCycleToIssue?: (workspaceSlug: string, projectId: string, cycleId: string, issueId: string) => Promise; addIssueToCycle?: (workspaceSlug: string, projectId: string, cycleId: string, issueIds: string[]) => Promise; removeIssueFromCycle?: (workspaceSlug: string, projectId: string, cycleId: string, issueId: string) => Promise; - addModulesToIssue?: (workspaceSlug: string, projectId: string, issueId: string, moduleIds: string[]) => Promise; removeIssueFromModule?: ( workspaceSlug: string, projectId: string, moduleId: string, issueId: string ) => Promise; - removeModulesFromIssue?: ( + changeModulesInIssue?: ( workspaceSlug: string, projectId: string, issueId: string, - moduleIds: string[] + addModuleIds: string[], + removeModuleIds: string[] ) => Promise; }; @@ -70,9 +70,8 @@ export const IssueDetailRoot: FC = observer((props) => { addCycleToIssue, addIssueToCycle, removeIssueFromCycle, - addModulesToIssue, + changeModulesInIssue, removeIssueFromModule, - removeModulesFromIssue, } = useIssueDetail(); const { issues: { removeIssue: removeArchivedIssue }, @@ -258,35 +257,6 @@ export const IssueDetailRoot: FC = observer((props) => { }); } }, - addModulesToIssue: async (workspaceSlug: string, projectId: string, issueId: string, moduleIds: string[]) => { - try { - const response = await addModulesToIssue(workspaceSlug, projectId, issueId, moduleIds); - captureIssueEvent({ - eventName: ISSUE_UPDATED, - payload: { ...response, state: "SUCCESS", element: "Issue detail page" }, - updates: { - changed_property: "module_id", - change_details: moduleIds, - }, - path: pathname, - }); - } catch (error) { - setToast({ - type: TOAST_TYPE.ERROR, - title: "Error!", - message: "Issue could not be added to the module. Please try again.", - }); - captureIssueEvent({ - eventName: ISSUE_UPDATED, - payload: { id: issueId, state: "FAILED", element: "Issue detail page" }, - updates: { - changed_property: "module_id", - change_details: moduleIds, - }, - path: pathname, - }); - } - }, removeIssueFromModule: async (workspaceSlug: string, projectId: string, moduleId: string, issueId: string) => { try { const removeFromModulePromise = removeIssueFromModule(workspaceSlug, projectId, moduleId, issueId); @@ -323,25 +293,24 @@ export const IssueDetailRoot: FC = observer((props) => { }); } }, - removeModulesFromIssue: async ( + changeModulesInIssue: async ( workspaceSlug: string, projectId: string, issueId: string, - moduleIds: string[] + addModuleIds: string[], + removeModuleIds: string[] ) => { - const removeModulesFromIssuePromise = removeModulesFromIssue(workspaceSlug, projectId, issueId, moduleIds); - setPromiseToast(removeModulesFromIssuePromise, { - loading: "Removing module from issue...", - success: { - title: "Success!", - message: () => "Module removed from issue successfully", - }, - error: { - title: "Error!", - message: () => "Module remove from issue failed", + const promise = await changeModulesInIssue(workspaceSlug, projectId, issueId, addModuleIds, removeModuleIds); + captureIssueEvent({ + eventName: ISSUE_UPDATED, + payload: { id: issueId, state: "SUCCESS", element: "Issue detail page" }, + updates: { + changed_property: "module_id", + change_details: { addModuleIds, removeModuleIds }, }, + path: pathname, }); - await removeModulesFromIssuePromise; + return promise; }, }), [ @@ -353,9 +322,8 @@ export const IssueDetailRoot: FC = observer((props) => { removeArchivedIssue, addIssueToCycle, removeIssueFromCycle, - addModulesToIssue, + changeModulesInIssue, removeIssueFromModule, - removeModulesFromIssue, captureIssueEvent, pathname, ] diff --git a/web/core/components/issues/peek-overview/root.tsx b/web/core/components/issues/peek-overview/root.tsx index 41ee666c4e..7211245520 100644 --- a/web/core/components/issues/peek-overview/root.tsx +++ b/web/core/components/issues/peek-overview/root.tsx @@ -13,6 +13,7 @@ import { EIssuesStoreType } from "@/constants/issue"; import { EUserProjectRoles } from "@/constants/project"; // hooks import { useEventTracker, useIssueDetail, useIssues, useUser } from "@/hooks/store"; +import { useIssuesStore } from "@/hooks/use-issue-layout-store"; interface IIssuePeekOverview { embedIssue?: boolean; @@ -55,19 +56,10 @@ export const IssuePeekOverview: FC = observer((props) => { } = useIssues(EIssuesStoreType.ARCHIVED); const { peekIssue, - updateIssue, - removeIssue, - archiveIssue, issue: { fetchIssue }, } = useIssueDetail(); - const { - addCycleToIssue, - addIssueToCycle, - removeIssueFromCycle, - addModulesToIssue, - removeIssueFromModule, - removeModulesFromIssue, - } = useIssueDetail(); + + const { issues } = useIssuesStore(); const { captureIssueEvent } = useEventTracker(); // state const [loader, setLoader] = useState(true); @@ -94,34 +86,36 @@ export const IssuePeekOverview: FC = observer((props) => { } }, update: async (workspaceSlug: string, projectId: string, issueId: string, data: Partial) => { - await updateIssue(workspaceSlug, projectId, issueId, data) - .then(() => { - captureIssueEvent({ - eventName: ISSUE_UPDATED, - payload: { ...data, issueId, state: "SUCCESS", element: "Issue peek-overview" }, - updates: { - changed_property: Object.keys(data).join(","), - change_details: Object.values(data).join(","), - }, - path: pathname, - }); - }) - .catch(() => { - captureIssueEvent({ - eventName: ISSUE_UPDATED, - payload: { state: "FAILED", element: "Issue peek-overview" }, - path: pathname, - }); - setToast({ - title: "Error!", - type: TOAST_TYPE.ERROR, - message: "Issue update failed", - }); - }); + issues?.updateIssue && + (await issues + .updateIssue(workspaceSlug, projectId, issueId, data) + .then(() => { + captureIssueEvent({ + eventName: ISSUE_UPDATED, + payload: { ...data, issueId, state: "SUCCESS", element: "Issue peek-overview" }, + updates: { + changed_property: Object.keys(data).join(","), + change_details: Object.values(data).join(","), + }, + path: pathname, + }); + }) + .catch(() => { + captureIssueEvent({ + eventName: ISSUE_UPDATED, + payload: { state: "FAILED", element: "Issue peek-overview" }, + path: pathname, + }); + setToast({ + title: "Error!", + type: TOAST_TYPE.ERROR, + message: "Issue update failed", + }); + })); }, remove: async (workspaceSlug: string, projectId: string, issueId: string) => { try { - removeIssue(workspaceSlug, projectId, issueId); + issues?.removeIssue(workspaceSlug, projectId, issueId); setToast({ title: "Success!", type: TOAST_TYPE.SUCCESS, @@ -147,7 +141,7 @@ export const IssuePeekOverview: FC = observer((props) => { }, archive: async (workspaceSlug: string, projectId: string, issueId: string) => { try { - await archiveIssue(workspaceSlug, projectId, issueId); + issues?.archiveIssue && (await issues.archiveIssue(workspaceSlug, projectId, issueId)); captureIssueEvent({ eventName: ISSUE_ARCHIVED, payload: { id: issueId, state: "SUCCESS", element: "Issue peek-overview" }, @@ -189,8 +183,7 @@ export const IssuePeekOverview: FC = observer((props) => { }, addCycleToIssue: async (workspaceSlug: string, projectId: string, cycleId: string, issueId: string) => { try { - console.log("Peek adding..."); - await addCycleToIssue(workspaceSlug, projectId, cycleId, issueId); + await issues.addCycleToIssue(workspaceSlug, projectId, cycleId, issueId); captureIssueEvent({ eventName: ISSUE_UPDATED, payload: { issueId, state: "SUCCESS", element: "Issue peek-overview" }, @@ -219,7 +212,7 @@ export const IssuePeekOverview: FC = observer((props) => { }, addIssueToCycle: async (workspaceSlug: string, projectId: string, cycleId: string, issueIds: string[]) => { try { - await addIssueToCycle(workspaceSlug, projectId, cycleId, issueIds); + await issues.addIssueToCycle(workspaceSlug, projectId, cycleId, issueIds); captureIssueEvent({ eventName: ISSUE_UPDATED, payload: { ...issueIds, state: "SUCCESS", element: "Issue peek-overview" }, @@ -248,7 +241,7 @@ export const IssuePeekOverview: FC = observer((props) => { }, removeIssueFromCycle: async (workspaceSlug: string, projectId: string, cycleId: string, issueId: string) => { try { - const removeFromCyclePromise = removeIssueFromCycle(workspaceSlug, projectId, cycleId, issueId); + const removeFromCyclePromise = issues.removeIssueFromCycle(workspaceSlug, projectId, cycleId, issueId); setPromiseToast(removeFromCyclePromise, { loading: "Removing issue from the cycle...", success: { @@ -282,38 +275,34 @@ export const IssuePeekOverview: FC = observer((props) => { }); } }, - addModulesToIssue: async (workspaceSlug: string, projectId: string, issueId: string, moduleIds: string[]) => { - try { - const response = await addModulesToIssue(workspaceSlug, projectId, issueId, moduleIds); - captureIssueEvent({ - eventName: ISSUE_UPDATED, - payload: { ...response, state: "SUCCESS", element: "Issue peek-overview" }, - updates: { - changed_property: "module_id", - change_details: moduleIds, - }, - path: pathname, - }); - } catch (error) { - setToast({ - type: TOAST_TYPE.ERROR, - title: "Error!", - message: "Issue could not be added to the module. Please try again.", - }); - captureIssueEvent({ - eventName: ISSUE_UPDATED, - payload: { id: issueId, state: "FAILED", element: "Issue peek-overview" }, - updates: { - changed_property: "module_id", - change_details: moduleIds, - }, - path: pathname, - }); - } + changeModulesInIssue: async ( + workspaceSlug: string, + projectId: string, + issueId: string, + addModuleIds: string[], + removeModuleIds: string[] + ) => { + const promise = await issues.changeModulesInIssue( + workspaceSlug, + projectId, + issueId, + addModuleIds, + removeModuleIds + ); + captureIssueEvent({ + eventName: ISSUE_UPDATED, + payload: { id: issueId, state: "SUCCESS", element: "Issue detail page" }, + updates: { + changed_property: "module_id", + change_details: { addModuleIds, removeModuleIds }, + }, + path: pathname, + }); + return promise; }, removeIssueFromModule: async (workspaceSlug: string, projectId: string, moduleId: string, issueId: string) => { try { - const removeFromModulePromise = removeIssueFromModule(workspaceSlug, projectId, moduleId, issueId); + const removeFromModulePromise = issues.removeIssuesFromModule(workspaceSlug, projectId, moduleId, [issueId]); setPromiseToast(removeFromModulePromise, { loading: "Removing issue from the module...", success: { @@ -347,43 +336,8 @@ export const IssuePeekOverview: FC = observer((props) => { }); } }, - removeModulesFromIssue: async ( - workspaceSlug: string, - projectId: string, - issueId: string, - moduleIds: string[] - ) => { - const removeModulesFromIssuePromise = removeModulesFromIssue(workspaceSlug, projectId, issueId, moduleIds); - setPromiseToast(removeModulesFromIssuePromise, { - loading: "Removing module from issue...", - success: { - title: "Success!", - message: () => "Module removed from issue successfully", - }, - error: { - title: "Error!", - message: () => "Module remove from issue failed", - }, - }); - await removeModulesFromIssuePromise; - }, }), - [ - is_archived, - is_draft, - fetchIssue, - updateIssue, - removeIssue, - archiveIssue, - restoreIssue, - addIssueToCycle, - removeIssueFromCycle, - addModulesToIssue, - removeIssueFromModule, - removeModulesFromIssue, - captureIssueEvent, - pathname, - ] + [is_archived, is_draft, fetchIssue, issues, restoreIssue, captureIssueEvent, pathname] ); useEffect(() => { diff --git a/web/core/store/issue/archived/issue.store.ts b/web/core/store/issue/archived/issue.store.ts index 1d3b691fb0..293ce7a3ac 100644 --- a/web/core/store/issue/archived/issue.store.ts +++ b/web/core/store/issue/archived/issue.store.ts @@ -33,6 +33,8 @@ export interface IArchivedIssues extends IBaseIssuesStore { removeBulkIssues: (workspaceSlug: string, projectId: string, issueIds: string[]) => Promise; bulkUpdateProperties: (workspaceSlug: string, projectId: string, data: TBulkOperationsPayload) => Promise; + updateIssue: undefined; + archiveIssue: undefined; archiveBulkIssues: undefined; quickAddIssue: undefined; } @@ -192,6 +194,9 @@ export class ArchivedIssues extends BaseIssuesStore implements IArchivedIssues { } }; + // Setting them as undefined as they can not performed on Archived issues + updateIssue = undefined; + archiveIssue = undefined; archiveBulkIssues = undefined; quickAddIssue = undefined; } diff --git a/web/core/store/issue/cycle/issue.store.ts b/web/core/store/issue/cycle/issue.store.ts index a71337ea62..14460b44e1 100644 --- a/web/core/store/issue/cycle/issue.store.ts +++ b/web/core/store/issue/cycle/issue.store.ts @@ -370,7 +370,9 @@ export class CycleIssues extends BaseIssuesStore implements ICycleIssues { set(this.activeCycleIds, [cycleId, "nextCursor"], response.next_cursor); set(this.activeCycleIds, [cycleId, "nextPageResults"], response.next_page_results); set(this.activeCycleIds, [cycleId, "issueCount"], response.total_count); - update(this.activeCycleIds, [cycleId, "issueIds"], (issueIds: string[] = []) => this.issuesSortWithOrderBy(uniq(concat(issueIds, activeIssueIds)), this.orderBy)); + update(this.activeCycleIds, [cycleId, "issueIds"], (issueIds: string[] = []) => + this.issuesSortWithOrderBy(uniq(concat(issueIds, activeIssueIds)), this.orderBy) + ); return response; } catch (error) { @@ -413,5 +415,8 @@ export class CycleIssues extends BaseIssuesStore implements ICycleIssues { } }; + // Using aliased names as they cannot be overridden in other stores archiveBulkIssues = this.bulkArchiveIssues; + updateIssue = this.issueUpdate; + archiveIssue = this.issueArchive; } diff --git a/web/core/store/issue/draft/issue.store.ts b/web/core/store/issue/draft/issue.store.ts index b5a85e786f..ca322ac8d5 100644 --- a/web/core/store/issue/draft/issue.store.ts +++ b/web/core/store/issue/draft/issue.store.ts @@ -37,6 +37,7 @@ export interface IDraftIssues extends IBaseIssuesStore { archiveBulkIssues: undefined; quickAddIssue: undefined; + archiveIssue: undefined; } export class DraftIssues extends BaseIssuesStore implements IDraftIssues { @@ -164,9 +165,12 @@ export class DraftIssues extends BaseIssuesStore implements IDraftIssues { return await this.fetchIssues(workspaceSlug, projectId, loadType, this.paginationOptions, true); }; + // Using aliased names as they cannot be overridden in other stores createIssue = this.createDraftIssue; updateIssue = this.updateDraftIssue; + // Setting them as undefined as they can not performed on draft issues archiveBulkIssues = undefined; quickAddIssue = undefined; + archiveIssue = undefined; } diff --git a/web/core/store/issue/helpers/base-issues.store.ts b/web/core/store/issue/helpers/base-issues.store.ts index 524cda08d2..2c88834d3c 100644 --- a/web/core/store/issue/helpers/base-issues.store.ts +++ b/web/core/store/issue/helpers/base-issues.store.ts @@ -63,7 +63,7 @@ export interface IBaseIssuesStore { issuePaginationData: TIssuePaginationData; // map of groupId/subgroup and pagination Data of that particular group/subgroup //actions - removeIssue(workspaceSlug: string, projectId: string, issueId: string): Promise; + removeIssue: (workspaceSlug: string, projectId: string, issueId: string) => Promise; // helper methods getIssueIds: (groupId?: string, subGroupId?: string) => string[] | undefined; issuesSortWithOrderBy(issueIds: string[], key: Partial): string[]; @@ -220,12 +220,12 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { removeIssueFromList: action.bound, createIssue: action, - updateIssue: action, + issueUpdate: action, createDraftIssue: action, updateDraftIssue: action, issueQuickAdd: action.bound, removeIssue: action.bound, - archiveIssue: action.bound, + issueArchive: action.bound, removeBulkIssues: action.bound, bulkArchiveIssues: action.bound, bulkUpdateProperties: action.bound, @@ -539,7 +539,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { * @param shouldSync If False then only issue is to be updated in the store not call API to update * @returns */ - async updateIssue( + async issueUpdate( workspaceSlug: string, projectId: string, issueId: string, @@ -656,7 +656,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { * @param projectId * @param issueId */ - async archiveIssue(workspaceSlug: string, projectId: string, issueId: string) { + async issueArchive(workspaceSlug: string, projectId: string, issueId: string) { try { // Male API call const response = await this.issueArchiveService.archiveIssue(workspaceSlug, projectId, issueId); @@ -759,7 +759,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { runInAction(() => { issueIds.forEach((issueId) => { - this.updateIssue( + this.issueUpdate( workspaceSlug, projectId, issueId, @@ -855,7 +855,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { // For Each issue update cycle Id by calling current store's update Issue, without making an API call issueIds.forEach((issueId) => { - this.updateIssue(workspaceSlug, projectId, issueId, { cycle_id: cycleId }, false); + this.issueUpdate(workspaceSlug, projectId, issueId, { cycle_id: cycleId }, false); }); } catch (error) { throw error; @@ -883,7 +883,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { }); // update Issue cycle Id to null by calling current store's update Issue, without making an API call - this.updateIssue(workspaceSlug, projectId, issueId, { cycle_id: null }, false); + this.issueUpdate(workspaceSlug, projectId, issueId, { cycle_id: null }, false); } catch (error) { throw error; } @@ -897,7 +897,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { // If cycle Id is the current cycle Id, then, add issue to list of issueIds if (this.cycleId === cycleId) this.addIssueToList(issueId); // For Each issue update cycle Id by calling current store's update Issue, without making an API call - this.updateIssue(workspaceSlug, projectId, issueId, { cycle_id: cycleId }, false); + this.issueUpdate(workspaceSlug, projectId, issueId, { cycle_id: cycleId }, false); }); await this.issueService.addIssueToCycle(workspaceSlug, projectId, cycleId, { @@ -912,7 +912,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { // If cycle Id is the current cycle Id, then, remove issue to list of issueIds if (this.cycleId === cycleId) this.removeIssueFromList(issueId); // For Each issue update cycle Id to previous value by calling current store's update Issue, without making an API call - this.updateIssue(workspaceSlug, projectId, issueId, { cycle_id: issueCycleId }, false); + this.issueUpdate(workspaceSlug, projectId, issueId, { cycle_id: issueCycleId }, false); }); throw error; @@ -936,7 +936,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { // If cycle Id is the current cycle Id, then, add issue to list of issueIds if (this.cycleId === issueCycleId) this.removeIssueFromList(issueId); // For Each issue update cycle Id by calling current store's update Issue, without making an API call - this.updateIssue(workspaceSlug, projectId, issueId, { cycle_id: null }, false); + this.issueUpdate(workspaceSlug, projectId, issueId, { cycle_id: null }, false); }); // make API call @@ -950,7 +950,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { // If cycle Id is the current cycle Id, then, add issue to list of issueIds if (this.cycleId === issueCycleId) this.addIssueToList(issueId); // For Each issue update cycle Id by calling current store's update Issue, without making an API call - this.updateIssue(workspaceSlug, projectId, issueId, { cycle_id: issueCycleId }, false); + this.issueUpdate(workspaceSlug, projectId, issueId, { cycle_id: issueCycleId }, false); }); throw error; @@ -993,7 +993,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { issueIds.forEach((issueId) => { const issueModuleIds = get(this.rootIssueStore.issues.issuesMap, [issueId, "module_ids"]) ?? []; const updatedIssueModuleIds = uniq(concat(issueModuleIds, [moduleId])); - this.updateIssue(workspaceSlug, projectId, issueId, { module_ids: updatedIssueModuleIds }, false); + this.issueUpdate(workspaceSlug, projectId, issueId, { module_ids: updatedIssueModuleIds }, false); }); } catch (error) { throw error; @@ -1031,7 +1031,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { issueIds.forEach((issueId) => { const issueModuleIds = get(this.rootIssueStore.issues.issuesMap, [issueId, "module_ids"]) ?? []; const updatedIssueModuleIds = pull(issueModuleIds, moduleId); - this.updateIssue(workspaceSlug, projectId, issueId, { module_ids: updatedIssueModuleIds }, false); + this.issueUpdate(workspaceSlug, projectId, issueId, { module_ids: updatedIssueModuleIds }, false); }); }); @@ -1111,7 +1111,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { currentModuleIds = uniq(concat([...currentModuleIds], addModuleIds)); // For current Issue, update module Ids by calling current store's update Issue, without making an API call - this.updateIssue(workspaceSlug, projectId, issueId, { module_ids: currentModuleIds }, false); + this.issueUpdate(workspaceSlug, projectId, issueId, { module_ids: currentModuleIds }, false); }); //Perform API call @@ -1132,7 +1132,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { if (removeModuleIds.includes(this.moduleId ?? "")) this.addIssueToList(issueId); // For current Issue, update module Ids by calling current store's update Issue, without making an API call - this.updateIssue(workspaceSlug, projectId, issueId, { module_ids: originalModuleIds }, false); + this.issueUpdate(workspaceSlug, projectId, issueId, { module_ids: originalModuleIds }, false); }); throw error; diff --git a/web/core/store/issue/issue-details/issue.store.ts b/web/core/store/issue/issue-details/issue.store.ts index 485eb21be4..c464c25893 100644 --- a/web/core/store/issue/issue-details/issue.store.ts +++ b/web/core/store/issue/issue-details/issue.store.ts @@ -21,12 +21,12 @@ export interface IIssueStoreActions { addCycleToIssue: (workspaceSlug: string, projectId: string, cycleId: string, issueId: string) => Promise; addIssueToCycle: (workspaceSlug: string, projectId: string, cycleId: string, issueIds: string[]) => Promise; removeIssueFromCycle: (workspaceSlug: string, projectId: string, cycleId: string, issueId: string) => Promise; - addModulesToIssue: (workspaceSlug: string, projectId: string, issueId: string, moduleIds: string[]) => Promise; - removeModulesFromIssue: ( + changeModulesInIssue: ( workspaceSlug: string, projectId: string, issueId: string, - moduleIds: string[] + addModuleIds: string[], + removeModuleIds: string[] ) => Promise; removeIssueFromModule: (workspaceSlug: string, projectId: string, moduleId: string, issueId: string) => Promise; } @@ -193,29 +193,21 @@ export class IssueStore implements IIssueStore { return cycle; }; - addModulesToIssue = async (workspaceSlug: string, projectId: string, issueId: string, moduleIds: string[]) => { - const currentModule = await this.rootIssueDetailStore.rootIssueStore.moduleIssues.changeModulesInIssue( + changeModulesInIssue = async ( + workspaceSlug: string, + projectId: string, + issueId: string, + addModuleIds: string[], + removeModuleIds: string[] + ) => { + await this.rootIssueDetailStore.rootIssueStore.moduleIssues.changeModulesInIssue( workspaceSlug, projectId, issueId, - moduleIds, - [] - ); - if (moduleIds && moduleIds.length > 0) - await this.rootIssueDetailStore.activity.fetchActivities(workspaceSlug, projectId, issueId); - return currentModule; - }; - - removeModulesFromIssue = async (workspaceSlug: string, projectId: string, issueId: string, moduleIds: string[]) => { - const currentModule = await this.rootIssueDetailStore.rootIssueStore.moduleIssues.changeModulesInIssue( - workspaceSlug, - projectId, - issueId, - [], - moduleIds + addModuleIds, + removeModuleIds ); await this.rootIssueDetailStore.activity.fetchActivities(workspaceSlug, projectId, issueId); - return currentModule; }; removeIssueFromModule = async (workspaceSlug: string, projectId: string, moduleId: string, issueId: string) => { diff --git a/web/core/store/issue/issue-details/root.store.ts b/web/core/store/issue/issue-details/root.store.ts index f488422f16..835c5ef5e3 100644 --- a/web/core/store/issue/issue-details/root.store.ts +++ b/web/core/store/issue/issue-details/root.store.ts @@ -198,10 +198,13 @@ export class IssueDetail implements IIssueDetail { this.issue.addIssueToCycle(workspaceSlug, projectId, cycleId, issueIds); removeIssueFromCycle = async (workspaceSlug: string, projectId: string, cycleId: string, issueId: string) => this.issue.removeIssueFromCycle(workspaceSlug, projectId, cycleId, issueId); - addModulesToIssue = async (workspaceSlug: string, projectId: string, issueId: string, moduleIds: string[]) => - this.issue.addModulesToIssue(workspaceSlug, projectId, issueId, moduleIds); - removeModulesFromIssue = async (workspaceSlug: string, projectId: string, issueId: string, moduleIds: string[]) => - this.issue.removeModulesFromIssue(workspaceSlug, projectId, issueId, moduleIds); + changeModulesInIssue = async ( + workspaceSlug: string, + projectId: string, + issueId: string, + addModuleIds: string[], + removeModuleIds: string[] + ) => this.issue.changeModulesInIssue(workspaceSlug, projectId, issueId, addModuleIds, removeModuleIds); removeIssueFromModule = async (workspaceSlug: string, projectId: string, moduleId: string, issueId: string) => this.issue.removeIssueFromModule(workspaceSlug, projectId, moduleId, issueId); diff --git a/web/core/store/issue/module/issue.store.ts b/web/core/store/issue/module/issue.store.ts index 8b592f8aba..ee78b3d7c4 100644 --- a/web/core/store/issue/module/issue.store.ts +++ b/web/core/store/issue/module/issue.store.ts @@ -251,5 +251,8 @@ export class ModuleIssues extends BaseIssuesStore implements IModuleIssues { } }; + // Using aliased names as they cannot be overridden in other stores archiveBulkIssues = this.bulkArchiveIssues; + updateIssue = this.issueUpdate; + archiveIssue = this.issueArchive; } diff --git a/web/core/store/issue/profile/issue.store.ts b/web/core/store/issue/profile/issue.store.ts index a41d33088f..9637cb623c 100644 --- a/web/core/store/issue/profile/issue.store.ts +++ b/web/core/store/issue/profile/issue.store.ts @@ -208,6 +208,11 @@ export class ProfileIssues extends BaseIssuesStore implements IProfileIssues { return await this.fetchIssues(workspaceSlug, userId, loadType, this.paginationOptions, this.currentView, true); }; + // Using aliased names as they cannot be overridden in other stores archiveBulkIssues = this.bulkArchiveIssues; + updateIssue = this.issueUpdate; + archiveIssue = this.issueArchive; + + // Setting them as undefined as they can not performed on profile issues quickAddIssue = undefined; } diff --git a/web/core/store/issue/project-views/issue.store.ts b/web/core/store/issue/project-views/issue.store.ts index 2088d30c1e..07824dcd2a 100644 --- a/web/core/store/issue/project-views/issue.store.ts +++ b/web/core/store/issue/project-views/issue.store.ts @@ -173,6 +173,9 @@ export class ProjectViewIssues extends BaseIssuesStore implements IProjectViewIs return await this.fetchIssues(workspaceSlug, projectId, viewId, loadType, this.paginationOptions, true); }; + // Using aliased names as they cannot be overridden in other stores archiveBulkIssues = this.bulkArchiveIssues; quickAddIssue = this.issueQuickAdd; + updateIssue = this.issueUpdate; + archiveIssue = this.issueArchive; } diff --git a/web/core/store/issue/project/issue.store.ts b/web/core/store/issue/project/issue.store.ts index 413081716b..e1b013e4af 100644 --- a/web/core/store/issue/project/issue.store.ts +++ b/web/core/store/issue/project/issue.store.ts @@ -165,6 +165,9 @@ export class ProjectIssues extends BaseIssuesStore implements IProjectIssues { return await this.fetchIssues(workspaceSlug, projectId, loadType, this.paginationOptions, true); }; + // Using aliased names as they cannot be overridden in other stores archiveBulkIssues = this.bulkArchiveIssues; quickAddIssue = this.issueQuickAdd; + updateIssue = this.issueUpdate; + archiveIssue = this.issueArchive; } diff --git a/web/core/store/issue/workspace/issue.store.ts b/web/core/store/issue/workspace/issue.store.ts index 6960135f13..daeacb6508 100644 --- a/web/core/store/issue/workspace/issue.store.ts +++ b/web/core/store/issue/workspace/issue.store.ts @@ -167,6 +167,11 @@ export class WorkspaceIssues extends BaseIssuesStore implements IWorkspaceIssues return await this.fetchIssues(workspaceSlug, viewId, loadType, this.paginationOptions, true); }; + // Using aliased names as they cannot be overridden in other stores archiveBulkIssues = this.bulkArchiveIssues; + updateIssue = this.issueUpdate; + archiveIssue = this.issueArchive; + + // Setting them as undefined as they can not performed on workspace issues quickAddIssue = undefined; } From 2b570da890d9ea6c5249c64b57a177ad5d8736b6 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Thu, 4 Jul 2024 16:21:05 +0530 Subject: [PATCH 4/8] chore: change comment box placeholder (#5042) --- .../components/editor/lite-text-editor/lite-text-editor.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/core/components/editor/lite-text-editor/lite-text-editor.tsx b/web/core/components/editor/lite-text-editor/lite-text-editor.tsx index f1f84fbf94..447f4f309e 100644 --- a/web/core/components/editor/lite-text-editor/lite-text-editor.tsx +++ b/web/core/components/editor/lite-text-editor/lite-text-editor.tsx @@ -39,6 +39,7 @@ export const LiteTextEditor = React.forwardRef Date: Thu, 4 Jul 2024 17:03:25 +0530 Subject: [PATCH 5/8] fix: issue peek view link list ui (#5045) --- web/core/components/issues/issue-detail/links/links.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/core/components/issues/issue-detail/links/links.tsx b/web/core/components/issues/issue-detail/links/links.tsx index cd4fff4235..856d1ec4be 100644 --- a/web/core/components/issues/issue-detail/links/links.tsx +++ b/web/core/components/issues/issue-detail/links/links.tsx @@ -27,7 +27,7 @@ export const IssueLinkList: FC = observer((props) => { if (!issueLinks) return <>; return ( -
+
{issueLinks && issueLinks.length > 0 && issueLinks.map((linkId) => ( From d3ec1aa4229f11d32a2717a22b44f53e6ec4379b Mon Sep 17 00:00:00 2001 From: guru_sainath Date: Thu, 4 Jul 2024 17:04:00 +0530 Subject: [PATCH 6/8] [WEB-1792] chore: updated UI notification tooltip on header and app sidebar (#5046) * ui: updatedm UI notificaton tooltip on header and app sidebar * fix: reverted notification sorting * fix: renamed function name updateIssue with issueUpdate in issue base helper file --- .../notification-app-sidebar-option.tsx | 2 +- .../sidebar/header/root.tsx | 18 ++++++++++++++---- .../store/issue/helpers/base-issues.store.ts | 2 +- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/web/core/components/workspace-notifications/notification-app-sidebar-option.tsx b/web/core/components/workspace-notifications/notification-app-sidebar-option.tsx index 9e418df2a1..0a7335df4f 100644 --- a/web/core/components/workspace-notifications/notification-app-sidebar-option.tsx +++ b/web/core/components/workspace-notifications/notification-app-sidebar-option.tsx @@ -29,7 +29,7 @@ export const NotificationAppSidebarOption: FC = o return
; return ( -
+
{getNumberCount(unreadNotificationsCount.total_unread_notifications_count)}
); diff --git a/web/core/components/workspace-notifications/sidebar/header/root.tsx b/web/core/components/workspace-notifications/sidebar/header/root.tsx index 98d5831d8e..05bb1e44c6 100644 --- a/web/core/components/workspace-notifications/sidebar/header/root.tsx +++ b/web/core/components/workspace-notifications/sidebar/header/root.tsx @@ -3,13 +3,15 @@ import { FC } from "react"; import { observer } from "mobx-react"; import { Bell } from "lucide-react"; -import { Breadcrumbs } from "@plane/ui"; +import { Breadcrumbs, Tooltip } from "@plane/ui"; // components import { BreadcrumbLink } from "@/components/common"; import { SidebarHamburgerToggle } from "@/components/core"; import { NotificationSidebarHeaderOptions } from "@/components/workspace-notifications"; // helpers import { getNumberCount } from "@/helpers/string.helper"; +// hooks +import { usePlatformOS } from "@/hooks/use-platform-os"; type TNotificationSidebarHeader = { workspaceSlug: string; @@ -18,6 +20,8 @@ type TNotificationSidebarHeader = { export const NotificationSidebarHeader: FC = observer((props) => { const { workspaceSlug, notificationsCount } = props; + // hooks + const { isMobile } = usePlatformOS(); if (!workspaceSlug) return <>; return ( @@ -34,9 +38,15 @@ export const NotificationSidebarHeader: FC = observe label={
Notifications
-
- {getNumberCount(notificationsCount)} -
+ 1 ? "notifications" : "notification"} in this workspace`} + position="bottom" + > +
+ {getNumberCount(notificationsCount)} +
+
} icon={} diff --git a/web/core/store/issue/helpers/base-issues.store.ts b/web/core/store/issue/helpers/base-issues.store.ts index 2c88834d3c..2f9601493a 100644 --- a/web/core/store/issue/helpers/base-issues.store.ts +++ b/web/core/store/issue/helpers/base-issues.store.ts @@ -1067,7 +1067,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { currentModuleIds = uniq(concat([...currentModuleIds], moduleIds)); // For current Issue, update module Ids by calling current store's update Issue, without making an API call - this.updateIssue(workspaceSlug, projectId, issueId, { module_ids: currentModuleIds }, false); + this.issueUpdate(workspaceSlug, projectId, issueId, { module_ids: currentModuleIds }, false); }); if (moduleIds.includes(this.moduleId ?? "")) { From bd452101527760780f93a7a6baf3215ba20cf4cf Mon Sep 17 00:00:00 2001 From: sriram veeraghanta Date: Thu, 4 Jul 2024 17:12:36 +0530 Subject: [PATCH 7/8] fix: adding change log link in plane one --- web/ee/components/license/plane-one-modal.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/web/ee/components/license/plane-one-modal.tsx b/web/ee/components/license/plane-one-modal.tsx index 12d1bab46c..affbbdbff2 100644 --- a/web/ee/components/license/plane-one-modal.tsx +++ b/web/ee/components/license/plane-one-modal.tsx @@ -118,6 +118,16 @@ export const PlaneOneModal: FC = observer((props) => { + + Full Changelog + + + + Date: Thu, 4 Jul 2024 17:13:04 +0530 Subject: [PATCH 8/8] fix build errors due to conflicting PRs (#5047)