From d0d106901ea07273ce295d29768cbf86d2343798 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal Date: Fri, 8 Dec 2023 15:01:49 +0530 Subject: [PATCH 01/17] bug: cycle and module change not working from the peek overview --- .../issues/peek-overview/properties.tsx | 34 +++++++++++-------- .../project-issues/cycle/issue.store.ts | 12 +++---- .../project-issues/module/issue.store.ts | 8 ++--- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/web/components/issues/peek-overview/properties.tsx b/web/components/issues/peek-overview/properties.tsx index 5132aaa8a..ce08e7e4d 100644 --- a/web/components/issues/peek-overview/properties.tsx +++ b/web/components/issues/peek-overview/properties.tsx @@ -48,10 +48,11 @@ export const PeekOverviewProperties: FC = observer((pro const { user: { currentProjectRole }, issueDetail: { fetchPeekIssueDetails }, + project: { getProjectById }, } = useMobxStore(); const router = useRouter(); - const { workspaceSlug, projectId } = router.query as { workspaceSlug: string; projectId: string }; + const { workspaceSlug, projectId } = router.query; const { setToastAlert } = useToast(); @@ -138,7 +139,7 @@ export const PeekOverviewProperties: FC = observer((pro const handleCycleOrModuleChange = async () => { if (!workspaceSlug || !projectId) return; - await fetchPeekIssueDetails(workspaceSlug, projectId, issue.id); + await fetchPeekIssueDetails(workspaceSlug.toString(), projectId.toString(), issue.id); }; const handleEditLink = (link: ILinkDetails) => { @@ -167,6 +168,9 @@ export const PeekOverviewProperties: FC = observer((pro }); }; + const projectDetails = workspaceSlug ? getProjectById(workspaceSlug.toString(), issue.project) : null; + const isEstimateEnabled = projectDetails?.estimate; + const minDate = issue.start_date ? new Date(issue.start_date) : null; minDate?.setDate(minDate.getDate()); @@ -230,19 +234,21 @@ export const PeekOverviewProperties: FC = observer((pro {/* estimate */} -
-
- -

Estimate

+ {isEstimateEnabled && ( +
+
+ +

Estimate

+
+
+ +
-
- -
-
+ )} {/* start date */}
diff --git a/web/store/issues/project-issues/cycle/issue.store.ts b/web/store/issues/project-issues/cycle/issue.store.ts index ffcf850b8..ed1bdcfeb 100644 --- a/web/store/issues/project-issues/cycle/issue.store.ts +++ b/web/store/issues/project-issues/cycle/issue.store.ts @@ -5,7 +5,7 @@ import { IssueBaseStore } from "store/issues"; import { IssueService } from "services/issue"; import { CycleService } from "services/cycle.service"; // types -import { CycleIssueResponse, TIssueGroupByOptions } from "types"; +import { TIssueGroupByOptions } from "types"; import { IIssue } from "types/issues"; import { IIssueResponse, TLoader, IGroupedIssues, ISubGroupedIssues, TUnGroupedIssues, ViewFlags } from "../../types"; import { RootStore } from "store/root"; @@ -83,9 +83,6 @@ export class CycleIssuesStore extends IssueBaseStore implements ICycleIssuesStor cycleService; issueService; - //projectId - currentProjectId: string | undefined; - //viewData viewFlags = { enableQuickAdd: true, @@ -174,8 +171,6 @@ export class CycleIssuesStore extends IssueBaseStore implements ICycleIssuesStor try { this.loader = loadType; - this.currentProjectId = projectId; - const params = this.rootStore?.cycleIssuesFilter?.appliedFilters; const response = await this.cycleService.getCycleIssuesWithParams(workspaceSlug, projectId, cycleId, params); @@ -322,9 +317,10 @@ export class CycleIssuesStore extends IssueBaseStore implements ICycleIssuesStor fetchAfterAddition = true, projectId?: string ) => { - if (!this.currentProjectId && !projectId) return; + const activeProjectId = this.rootStore.project.projectId; + if (!activeProjectId && !projectId) return; - const projectIdToUpdate: string = this.currentProjectId || projectId || ""; + const projectIdToUpdate: string = projectId || activeProjectId || ""; try { const issueToCycle = await this.issueService.addIssueToCycle(workspaceSlug, projectIdToUpdate, cycleId, { diff --git a/web/store/issues/project-issues/module/issue.store.ts b/web/store/issues/project-issues/module/issue.store.ts index 89a678422..1f1d1c190 100644 --- a/web/store/issues/project-issues/module/issue.store.ts +++ b/web/store/issues/project-issues/module/issue.store.ts @@ -76,8 +76,6 @@ export class ModuleIssuesStore extends IssueBaseStore implements IModuleIssuesSt moduleService; issueService; - currentProjectId: string | undefined; - //viewData viewFlags = { enableQuickAdd: true, @@ -162,7 +160,6 @@ export class ModuleIssuesStore extends IssueBaseStore implements IModuleIssuesSt ) => { if (!moduleId) return undefined; - this.currentProjectId = projectId; try { this.loader = loadType; @@ -314,9 +311,10 @@ export class ModuleIssuesStore extends IssueBaseStore implements IModuleIssuesSt fetchAfterAddition = true, projectId?: string ) => { - if (!this.currentProjectId && !projectId) return; + const activeProjectId = this.rootStore.project.projectId; + if (!activeProjectId && !projectId) return; - const projectIdToUpdate: string = this.currentProjectId || projectId || ""; + const projectIdToUpdate: string = projectId || activeProjectId || ""; try { const issueToModule = await this.moduleService.addIssuesToModule(workspaceSlug, projectIdToUpdate, moduleId, { From 39d1916ab2cabeaaef0a4e940c41db3ffa2d3c81 Mon Sep 17 00:00:00 2001 From: gurusainath Date: Fri, 8 Dec 2023 12:45:08 +0530 Subject: [PATCH 02/17] fix: calendar filters and handled kanban issue empty state dnd error --- .../calendar/base-calendar-root.tsx | 5 +- .../issue-layouts/calendar/calendar.tsx | 18 ++++++- .../issue-layouts/calendar/day-tile.tsx | 26 ++++++++-- .../calendar/dropdowns/options-dropdown.tsx | 47 ++++++++++++------- .../issues/issue-layouts/calendar/header.tsx | 20 +++++++- .../calendar/roots/cycle-root.tsx | 2 - .../calendar/roots/module-root.tsx | 2 - .../calendar/roots/project-root.tsx | 2 - .../calendar/roots/project-view-root.tsx | 2 - .../issue-layouts/calendar/week-days.tsx | 32 +++++++++---- .../issues/issue-layouts/kanban/default.tsx | 30 ++++++------ 11 files changed, 127 insertions(+), 59 deletions(-) diff --git a/web/components/issues/issue-layouts/calendar/base-calendar-root.tsx b/web/components/issues/issue-layouts/calendar/base-calendar-root.tsx index e4aa079b5..c1fcaad62 100644 --- a/web/components/issues/issue-layouts/calendar/base-calendar-root.tsx +++ b/web/components/issues/issue-layouts/calendar/base-calendar-root.tsx @@ -16,7 +16,6 @@ import { IViewIssuesFilterStore, IViewIssuesStore, } from "store/issues"; -import { IIssueCalendarViewStore } from "store/issue"; import { IQuickActionProps } from "../list/list-view-types"; import { EIssueActions } from "../types"; import { IGroupedIssues } from "store/issues/types"; @@ -28,7 +27,6 @@ interface IBaseCalendarRoot { | IModuleIssuesFilterStore | ICycleIssuesFilterStore | IViewIssuesFilterStore; - calendarViewStore: IIssueCalendarViewStore; QuickActions: FC; issueActions: { [EIssueActions.DELETE]: (issue: IIssue) => Promise; @@ -77,13 +75,14 @@ export const BaseCalendarRoot = observer((props: IBaseCalendarRoot) => {
( handleIssues(issue.target_date ?? "", issue, EIssueActions.DELETE)} handleUpdate={ diff --git a/web/components/issues/issue-layouts/calendar/calendar.tsx b/web/components/issues/issue-layouts/calendar/calendar.tsx index 0240a8ebe..7b9787f81 100644 --- a/web/components/issues/issue-layouts/calendar/calendar.tsx +++ b/web/components/issues/issue-layouts/calendar/calendar.tsx @@ -10,8 +10,19 @@ import { Spinner } from "@plane/ui"; import { ICalendarWeek } from "./types"; import { IIssue } from "types"; import { IGroupedIssues, IIssueResponse } from "store/issues/types"; +import { + ICycleIssuesFilterStore, + IModuleIssuesFilterStore, + IProjectIssuesFilterStore, + IViewIssuesFilterStore, +} from "store/issues"; type Props = { + issuesFilterStore: + | IProjectIssuesFilterStore + | IModuleIssuesFilterStore + | ICycleIssuesFilterStore + | IViewIssuesFilterStore; issues: IIssueResponse | undefined; groupedIssueIds: IGroupedIssues; layout: "month" | "week" | undefined; @@ -27,7 +38,8 @@ type Props = { }; export const CalendarChart: React.FC = observer((props) => { - const { issues, groupedIssueIds, layout, showWeekends, quickActions, quickAddCallback, viewId } = props; + const { issuesFilterStore, issues, groupedIssueIds, layout, showWeekends, quickActions, quickAddCallback, viewId } = + props; const { calendar: calendarStore } = useMobxStore(); @@ -45,7 +57,7 @@ export const CalendarChart: React.FC = observer((props) => { return ( <>
- +
{layout === "month" && ( @@ -53,6 +65,7 @@ export const CalendarChart: React.FC = observer((props) => { {allWeeksOfActiveMonth && Object.values(allWeeksOfActiveMonth).map((week: ICalendarWeek, weekIndex) => ( = observer((props) => { )} {layout === "week" && ( = observer((props) => { - const { date, issues, groupedIssueIds, quickActions, enableQuickIssueCreate, quickAddCallback, viewId } = props; + const { + issuesFilterStore, + date, + issues, + groupedIssueIds, + quickActions, + enableQuickIssueCreate, + quickAddCallback, + viewId, + } = props; - const { issueFilter: issueFilterStore } = useMobxStore(); - - const calendarLayout = issueFilterStore.userDisplayFilters.calendar?.layout ?? "month"; + const calendarLayout = issuesFilterStore?.issueFilters?.displayFilters?.calendar?.layout ?? "month"; const issueIdList = groupedIssueIds ? groupedIssueIds[renderDateFormat(date.date)] : null; diff --git a/web/components/issues/issue-layouts/calendar/dropdowns/options-dropdown.tsx b/web/components/issues/issue-layouts/calendar/dropdowns/options-dropdown.tsx index f9fb48f21..61f61ca02 100644 --- a/web/components/issues/issue-layouts/calendar/dropdowns/options-dropdown.tsx +++ b/web/components/issues/issue-layouts/calendar/dropdowns/options-dropdown.tsx @@ -13,12 +13,29 @@ import { Check, ChevronUp } from "lucide-react"; import { TCalendarLayouts } from "types"; // constants import { CALENDAR_LAYOUTS } from "constants/calendar"; +import { EFilterType } from "store/issues/types"; +import { + ICycleIssuesFilterStore, + IModuleIssuesFilterStore, + IProjectIssuesFilterStore, + IViewIssuesFilterStore, +} from "store/issues"; + +interface ICalendarHeader { + issuesFilterStore: + | IProjectIssuesFilterStore + | IModuleIssuesFilterStore + | ICycleIssuesFilterStore + | IViewIssuesFilterStore; +} + +export const CalendarOptionsDropdown: React.FC = observer((props) => { + const { issuesFilterStore } = props; -export const CalendarOptionsDropdown: React.FC = observer(() => { const router = useRouter(); const { workspaceSlug, projectId } = router.query; - const { issueFilter: issueFilterStore, calendar: calendarStore } = useMobxStore(); + const { calendar: calendarStore } = useMobxStore(); const [referenceElement, setReferenceElement] = useState(null); const [popperElement, setPopperElement] = useState(null); @@ -35,18 +52,16 @@ export const CalendarOptionsDropdown: React.FC = observer(() => { ], }); - const calendarLayout = issueFilterStore.userDisplayFilters.calendar?.layout ?? "month"; - const showWeekends = issueFilterStore.userDisplayFilters.calendar?.show_weekends ?? false; + const calendarLayout = issuesFilterStore.issueFilters?.displayFilters?.calendar?.layout ?? "month"; + const showWeekends = issuesFilterStore.issueFilters?.displayFilters?.calendar?.show_weekends ?? false; const handleLayoutChange = (layout: TCalendarLayouts) => { if (!workspaceSlug || !projectId) return; - issueFilterStore.updateUserFilters(workspaceSlug.toString(), projectId.toString(), { - display_filters: { - calendar: { - ...issueFilterStore.userDisplayFilters.calendar, - layout, - }, + issuesFilterStore.updateFilters(workspaceSlug.toString(), projectId.toString(), EFilterType.DISPLAY_FILTERS, { + calendar: { + ...issuesFilterStore.issueFilters?.displayFilters?.calendar, + layout, }, }); @@ -56,16 +71,14 @@ export const CalendarOptionsDropdown: React.FC = observer(() => { }; const handleToggleWeekends = () => { - const showWeekends = issueFilterStore.userDisplayFilters.calendar?.show_weekends ?? false; + const showWeekends = issuesFilterStore.issueFilters?.displayFilters?.calendar?.show_weekends ?? false; if (!workspaceSlug || !projectId) return; - issueFilterStore.updateUserFilters(workspaceSlug.toString(), projectId.toString(), { - display_filters: { - calendar: { - ...issueFilterStore.userDisplayFilters.calendar, - show_weekends: !showWeekends, - }, + issuesFilterStore.updateFilters(workspaceSlug.toString(), projectId.toString(), EFilterType.DISPLAY_FILTERS, { + calendar: { + ...issuesFilterStore.issueFilters?.displayFilters?.calendar, + show_weekends: !showWeekends, }, }); }; diff --git a/web/components/issues/issue-layouts/calendar/header.tsx b/web/components/issues/issue-layouts/calendar/header.tsx index 034be98c4..ac54aa6d2 100644 --- a/web/components/issues/issue-layouts/calendar/header.tsx +++ b/web/components/issues/issue-layouts/calendar/header.tsx @@ -6,8 +6,24 @@ import { useMobxStore } from "lib/mobx/store-provider"; import { CalendarMonthsDropdown, CalendarOptionsDropdown } from "components/issues"; // icons import { ChevronLeft, ChevronRight } from "lucide-react"; +import { + ICycleIssuesFilterStore, + IModuleIssuesFilterStore, + IProjectIssuesFilterStore, + IViewIssuesFilterStore, +} from "store/issues"; + +interface ICalendarHeader { + issuesFilterStore: + | IProjectIssuesFilterStore + | IModuleIssuesFilterStore + | ICycleIssuesFilterStore + | IViewIssuesFilterStore; +} + +export const CalendarHeader: React.FC = observer((props) => { + const { issuesFilterStore } = props; -export const CalendarHeader: React.FC = observer(() => { const { issueFilter: issueFilterStore, calendar: calendarStore } = useMobxStore(); const calendarLayout = issueFilterStore.userDisplayFilters.calendar?.layout ?? "month"; @@ -91,7 +107,7 @@ export const CalendarHeader: React.FC = observer(() => { > Today - +
); diff --git a/web/components/issues/issue-layouts/calendar/roots/cycle-root.tsx b/web/components/issues/issue-layouts/calendar/roots/cycle-root.tsx index 784e9a830..9830b871f 100644 --- a/web/components/issues/issue-layouts/calendar/roots/cycle-root.tsx +++ b/web/components/issues/issue-layouts/calendar/roots/cycle-root.tsx @@ -13,7 +13,6 @@ export const CycleCalendarLayout: React.FC = observer(() => { const { cycleIssues: cycleIssueStore, cycleIssuesFilter: cycleIssueFilterStore, - cycleIssueCalendarView: cycleIssueCalendarViewStore, calendarHelpers: { handleDragDrop: handleCalenderDragDrop }, } = useMobxStore(); @@ -62,7 +61,6 @@ export const CycleCalendarLayout: React.FC = observer(() => { { const { moduleIssues: moduleIssueStore, moduleIssuesFilter: moduleIssueFilterStore, - moduleIssueCalendarView: moduleIssueCalendarViewStore, calendarHelpers: { handleDragDrop: handleCalenderDragDrop }, } = useMobxStore(); @@ -56,7 +55,6 @@ export const ModuleCalendarLayout: React.FC = observer(() => { { const { projectIssues: issueStore, - issueCalendarView: issueCalendarViewStore, projectIssuesFilter: projectIssueFiltersStore, calendarHelpers: { handleDragDrop: handleCalenderDragDrop }, } = useMobxStore(); @@ -49,7 +48,6 @@ export const CalendarLayout: React.FC = observer(() => { { const { viewIssues: projectViewIssuesStore, viewIssuesFilter: projectIssueViewFiltersStore, - projectViewIssueCalendarView: projectViewIssueCalendarViewStore, calendarHelpers: { handleDragDrop: handleCalenderDragDrop }, } = useMobxStore(); @@ -50,7 +49,6 @@ export const ProjectViewCalendarLayout: React.FC = observer(() => { = observer((props) => { - const { issues, groupedIssueIds, week, quickActions, enableQuickIssueCreate, quickAddCallback, viewId } = props; + const { + issuesFilterStore, + issues, + groupedIssueIds, + week, + quickActions, + enableQuickIssueCreate, + quickAddCallback, + viewId, + } = props; - const { issueFilter: issueFilterStore } = useMobxStore(); - - const calendarLayout = issueFilterStore.userDisplayFilters.calendar?.layout ?? "month"; - const showWeekends = issueFilterStore.userDisplayFilters.calendar?.show_weekends ?? false; + const calendarLayout = issuesFilterStore?.issueFilters?.displayFilters?.calendar?.layout ?? "month"; + const showWeekends = issuesFilterStore?.issueFilters?.displayFilters?.calendar?.show_weekends ?? false; if (!week) return null; @@ -47,6 +62,7 @@ export const CalendarWeekDays: React.FC = observer((props) => { return ( = observer((props) => {
)} -
-
- {enableQuickIssueCreate && ( - - )} +
+ {enableQuickIssueCreate && ( + + )} +
{/* {isDragStarted && isDragDisabled && ( From d4a4046cd3a63b2da95417c1225a0485f15e024f Mon Sep 17 00:00:00 2001 From: gurusainath Date: Fri, 8 Dec 2023 14:36:35 +0530 Subject: [PATCH 03/17] fix: Handled navigation dates in week view in calendar layout --- web/components/issues/issue-layouts/calendar/header.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/components/issues/issue-layouts/calendar/header.tsx b/web/components/issues/issue-layouts/calendar/header.tsx index ac54aa6d2..5557abbaa 100644 --- a/web/components/issues/issue-layouts/calendar/header.tsx +++ b/web/components/issues/issue-layouts/calendar/header.tsx @@ -24,9 +24,9 @@ interface ICalendarHeader { export const CalendarHeader: React.FC = observer((props) => { const { issuesFilterStore } = props; - const { issueFilter: issueFilterStore, calendar: calendarStore } = useMobxStore(); + const { calendar: calendarStore } = useMobxStore(); - const calendarLayout = issueFilterStore.userDisplayFilters.calendar?.layout ?? "month"; + const calendarLayout = issuesFilterStore.issueFilters?.displayFilters?.calendar?.layout ?? "month"; const { activeMonthDate, activeWeekDate } = calendarStore.calendarFilters; From aebf8daf08503e5261776cbfe47029e97263b892 Mon Sep 17 00:00:00 2001 From: pablohashescobar Date: Fri, 8 Dec 2023 13:52:01 +0530 Subject: [PATCH 04/17] fix: user deactivation if instance admin and remove auto assigning of workspace and projects --- apiserver/plane/app/views/user.py | 4 +++ apiserver/plane/license/api/views/instance.py | 31 ------------------- 2 files changed, 4 insertions(+), 31 deletions(-) diff --git a/apiserver/plane/app/views/user.py b/apiserver/plane/app/views/user.py index 85874f460..008780526 100644 --- a/apiserver/plane/app/views/user.py +++ b/apiserver/plane/app/views/user.py @@ -49,6 +49,10 @@ class UserEndpoint(BaseViewSet): # Check all workspace user is active user = self.get_object() + # Instance admin check + if InstanceAdmin.objects.filter(user=user).exists(): + return Response({"error": "You cannot deactivate your account since you are an instance admin"}, status=status.HTTP_400_BAD_REQUEST) + projects_to_deactivate = [] workspaces_to_deactivate = [] diff --git a/apiserver/plane/license/api/views/instance.py b/apiserver/plane/license/api/views/instance.py index 0e40b897f..c88b3b75f 100644 --- a/apiserver/plane/license/api/views/instance.py +++ b/apiserver/plane/license/api/views/instance.py @@ -221,37 +221,6 @@ class InstanceAdminSignInEndpoint(BaseAPIView): is_password_autoset=False, ) - # if the current user is not using captain then add the current all users to workspace and projects - if user.email != "captain@plane.so": - # Add the current user also as a workspace member and project memeber to all the workspaces and projects - captain = User.objects.filter(email="captain@plane.so") - # Workspace members - workspace_members = WorkspaceMember.objects.filter(member=captain) - WorkspaceMember.objects.bulk_create( - [ - WorkspaceMember( - workspace=member.workspace_id, - member=user, - role=member.role, - ) - for member in workspace_members - ], - batch_size=100, - ) - # project members - project_members = ProjectMember.objects.filter(member=captain) - ProjectMember.objects.bulk_create( - [ - ProjectMember( - workspace=member.workspace_id, - member=user, - role=member.role, - ) - for member in project_members - ], - batch_size=100, - ) - # settings last active for the user user.is_active = True user.last_active = timezone.now() From 49a4c466b7b45e01f4a0505aceb60787aaa64ae9 Mon Sep 17 00:00:00 2001 From: pablohashescobar Date: Fri, 8 Dec 2023 15:17:51 +0530 Subject: [PATCH 05/17] dev: update dockerfile.dev to install local requirements --- apiserver/Dockerfile.dev | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apiserver/Dockerfile.dev b/apiserver/Dockerfile.dev index f1c9b4cac..d52020735 100644 --- a/apiserver/Dockerfile.dev +++ b/apiserver/Dockerfile.dev @@ -27,7 +27,8 @@ WORKDIR /code COPY requirements.txt ./requirements.txt ADD requirements ./requirements -RUN pip install -r requirements.txt --compile --no-cache-dir +# Install the local development settings +RUN pip install -r requirements/local.txt --compile --no-cache-dir RUN addgroup -S plane && \ adduser -S captain -G plane From 89d4851ff54e5d796dd4a1953ebf68d04d56de22 Mon Sep 17 00:00:00 2001 From: pablohashescobar Date: Fri, 8 Dec 2023 10:14:04 +0000 Subject: [PATCH 06/17] dev: change default value for Github and Google client id if it is not present --- apiserver/plane/app/views/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apiserver/plane/app/views/config.py b/apiserver/plane/app/views/config.py index fb32e8570..7c341da4a 100644 --- a/apiserver/plane/app/views/config.py +++ b/apiserver/plane/app/views/config.py @@ -90,8 +90,8 @@ class ConfigurationEndpoint(BaseAPIView): data = {} # Authentication - data["google_client_id"] = GOOGLE_CLIENT_ID - data["github_client_id"] = GITHUB_CLIENT_ID + data["google_client_id"] = GOOGLE_CLIENT_ID if GOOGLE_CLIENT_ID else None + data["github_client_id"] = GITHUB_CLIENT_ID if GITHUB_CLIENT_ID else None data["github_app_name"] = GITHUB_APP_NAME data["magic_login"] = ( bool(EMAIL_HOST_USER) and bool(EMAIL_HOST_PASSWORD) From dd9056c1654d7a7906e9b8d8045183a8e70f270d Mon Sep 17 00:00:00 2001 From: pablohashescobar Date: Fri, 8 Dec 2023 10:16:56 +0000 Subject: [PATCH 07/17] dev: take configuration value for Github client secret from get_configuration --- apiserver/plane/app/views/oauth.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apiserver/plane/app/views/oauth.py b/apiserver/plane/app/views/oauth.py index e12cba2ae..8a0396137 100644 --- a/apiserver/plane/app/views/oauth.py +++ b/apiserver/plane/app/views/oauth.py @@ -86,7 +86,14 @@ def get_access_token(request_token: str, client_id: str) -> str: if not request_token: raise ValueError("The request token has to be supplied!") - CLIENT_SECRET = os.environ.get("GITHUB_CLIENT_SECRET") + (CLIENT_SECRET,) = get_configuration_value( + [ + { + "key": "GITHUB_CLIENT_SECRET", + "default": os.environ.get("GITHUB_CLIENT_SECRET", None), + }, + ] + ) url = f"https://github.com/login/oauth/access_token?client_id={client_id}&client_secret={CLIENT_SECRET}&code={request_token}" headers = {"accept": "application/json"} @@ -299,7 +306,7 @@ class OauthEndpoint(BaseAPIView): return Response(data, status=status.HTTP_200_OK) except User.DoesNotExist: - ENABLE_SIGNUP, = get_configuration_value( + (ENABLE_SIGNUP,) = get_configuration_value( [ { "key": "ENABLE_SIGNUP", From 3400e31d0afe8cc13f389ed3c54b46e0e5e62800 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia Date: Fri, 8 Dec 2023 15:52:32 +0530 Subject: [PATCH 08/17] chore: release version update --- apiserver/package.json | 6 +++--- package.json | 2 +- packages/eslint-config-custom/package.json | 2 +- packages/tailwind-config-custom/package.json | 2 +- packages/tsconfig/package.json | 2 +- space/package.json | 2 +- web/package.json | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apiserver/package.json b/apiserver/package.json index c622ae496..7119f05ad 100644 --- a/apiserver/package.json +++ b/apiserver/package.json @@ -1,4 +1,4 @@ { - "name": "plane-api", - "version": "0.13.2" -} \ No newline at end of file + "name": "plane-api", + "version": "0.14" +} diff --git a/package.json b/package.json index ad3156a86..61f6d6b79 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "repository": "https://github.com/makeplane/plane.git", - "version": "0.13.2", + "version": "0.14", "license": "AGPL-3.0", "private": true, "workspaces": [ diff --git a/packages/eslint-config-custom/package.json b/packages/eslint-config-custom/package.json index 11e970d0e..ab4d78cfc 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.13.2", + "version": "0.14", "main": "index.js", "license": "MIT", "dependencies": { diff --git a/packages/tailwind-config-custom/package.json b/packages/tailwind-config-custom/package.json index 286dfc3b6..146b79aad 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.13.2", + "version": "0.14", "description": "common tailwind configuration across monorepo", "main": "index.js", "private": true, diff --git a/packages/tsconfig/package.json b/packages/tsconfig/package.json index 58bfb8451..5596d0602 100644 --- a/packages/tsconfig/package.json +++ b/packages/tsconfig/package.json @@ -1,6 +1,6 @@ { "name": "tsconfig", - "version": "0.13.2", + "version": "0.14", "private": true, "files": [ "base.json", diff --git a/space/package.json b/space/package.json index 7c3c77a92..f14393774 100644 --- a/space/package.json +++ b/space/package.json @@ -1,6 +1,6 @@ { "name": "space", - "version": "0.13.2", + "version": "0.14", "private": true, "scripts": { "dev": "turbo run develop", diff --git a/web/package.json b/web/package.json index aeb751c4a..ea9ffcb20 100644 --- a/web/package.json +++ b/web/package.json @@ -1,6 +1,6 @@ { "name": "web", - "version": "0.13.2", + "version": "0.14", "private": true, "scripts": { "dev": "turbo run develop", From f198d14cc7dedc892d76cbb16709d88e44e3e08c Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia Date: Fri, 8 Dec 2023 16:00:21 +0530 Subject: [PATCH 09/17] chore: release version update --- packages/editor/core/package.json | 2 +- packages/editor/document-editor/package.json | 2 +- packages/editor/extensions/package.json | 4 ++-- packages/editor/lite-text-editor/package.json | 4 ++-- packages/editor/rich-text-editor/package.json | 4 ++-- packages/editor/types/package.json | 4 ++-- packages/ui/package.json | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/editor/core/package.json b/packages/editor/core/package.json index e9f857d8a..ab532f6a2 100644 --- a/packages/editor/core/package.json +++ b/packages/editor/core/package.json @@ -1,6 +1,6 @@ { "name": "@plane/editor-core", - "version": "0.0.1", + "version": "0.14", "description": "Core Editor that powers Plane", "private": true, "main": "./dist/index.mjs", diff --git a/packages/editor/document-editor/package.json b/packages/editor/document-editor/package.json index c716536da..f2d331458 100644 --- a/packages/editor/document-editor/package.json +++ b/packages/editor/document-editor/package.json @@ -1,6 +1,6 @@ { "name": "@plane/document-editor", - "version": "0.1.0", + "version": "0.14", "description": "Package that powers Plane's Pages Editor", "main": "./dist/index.mjs", "module": "./dist/index.mjs", diff --git a/packages/editor/extensions/package.json b/packages/editor/extensions/package.json index b106b8517..25d818762 100644 --- a/packages/editor/extensions/package.json +++ b/packages/editor/extensions/package.json @@ -1,6 +1,6 @@ { "name": "@plane/editor-extensions", - "version": "0.1.0", + "version": "0.14", "description": "Package that powers Plane's Editor with extensions", "private": true, "main": "./dist/index.mjs", @@ -57,4 +57,4 @@ "nextjs", "react" ] -} \ No newline at end of file +} diff --git a/packages/editor/lite-text-editor/package.json b/packages/editor/lite-text-editor/package.json index 00efc08ea..98d562e6a 100644 --- a/packages/editor/lite-text-editor/package.json +++ b/packages/editor/lite-text-editor/package.json @@ -1,6 +1,6 @@ { "name": "@plane/lite-text-editor", - "version": "0.1.0", + "version": "0.14", "description": "Package that powers Plane's Comment Editor", "private": true, "main": "./dist/index.mjs", @@ -52,4 +52,4 @@ "nextjs", "react" ] -} \ No newline at end of file +} diff --git a/packages/editor/rich-text-editor/package.json b/packages/editor/rich-text-editor/package.json index 86ada4668..489737cdb 100644 --- a/packages/editor/rich-text-editor/package.json +++ b/packages/editor/rich-text-editor/package.json @@ -1,6 +1,6 @@ { "name": "@plane/rich-text-editor", - "version": "0.1.0", + "version": "0.14", "description": "Rich Text Editor that powers Plane", "private": true, "main": "./dist/index.mjs", @@ -55,4 +55,4 @@ "nextjs", "react" ] -} \ No newline at end of file +} diff --git a/packages/editor/types/package.json b/packages/editor/types/package.json index ebf25be6a..1972b6b6c 100644 --- a/packages/editor/types/package.json +++ b/packages/editor/types/package.json @@ -1,6 +1,6 @@ { "name": "@plane/editor-types", - "version": "0.1.0", + "version": "0.14", "description": "Package that powers Plane's Editor with extensions", "private": true, "main": "./dist/index.mjs", @@ -48,4 +48,4 @@ "nextjs", "react" ] -} \ No newline at end of file +} diff --git a/packages/ui/package.json b/packages/ui/package.json index 52ae9522a..79d8f3d10 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.1.0", + "version": "0.14", "main": "./dist/index.js", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", @@ -38,4 +38,4 @@ "react-color": "^2.19.3", "react-popper": "^2.3.0" } -} \ No newline at end of file +} From 5ac2c17e53a12f7603666f47e5978e5eb724c75d Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia Date: Fri, 8 Dec 2023 16:10:40 +0530 Subject: [PATCH 10/17] chore: release version update --- apiserver/package.json | 2 +- package.json | 2 +- packages/editor/core/package.json | 4 ++-- packages/editor/document-editor/package.json | 4 ++-- packages/editor/extensions/package.json | 2 +- packages/editor/lite-text-editor/package.json | 2 +- packages/editor/rich-text-editor/package.json | 2 +- packages/editor/types/package.json | 2 +- packages/eslint-config-custom/package.json | 2 +- packages/tailwind-config-custom/package.json | 2 +- packages/tsconfig/package.json | 2 +- packages/ui/package.json | 2 +- space/package.json | 2 +- web/package.json | 2 +- 14 files changed, 16 insertions(+), 16 deletions(-) diff --git a/apiserver/package.json b/apiserver/package.json index 7119f05ad..a317b4776 100644 --- a/apiserver/package.json +++ b/apiserver/package.json @@ -1,4 +1,4 @@ { "name": "plane-api", - "version": "0.14" + "version": "0.14.0" } diff --git a/package.json b/package.json index 61f6d6b79..7c3937852 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "repository": "https://github.com/makeplane/plane.git", - "version": "0.14", + "version": "0.14.0", "license": "AGPL-3.0", "private": true, "workspaces": [ diff --git a/packages/editor/core/package.json b/packages/editor/core/package.json index ab532f6a2..9fca82e36 100644 --- a/packages/editor/core/package.json +++ b/packages/editor/core/package.json @@ -1,6 +1,6 @@ { "name": "@plane/editor-core", - "version": "0.14", + "version": "0.14.0", "description": "Core Editor that powers Plane", "private": true, "main": "./dist/index.mjs", @@ -80,4 +80,4 @@ "nextjs", "react" ] -} \ No newline at end of file +} diff --git a/packages/editor/document-editor/package.json b/packages/editor/document-editor/package.json index f2d331458..302a06fb0 100644 --- a/packages/editor/document-editor/package.json +++ b/packages/editor/document-editor/package.json @@ -1,6 +1,6 @@ { "name": "@plane/document-editor", - "version": "0.14", + "version": "0.14.0", "description": "Package that powers Plane's Pages Editor", "main": "./dist/index.mjs", "module": "./dist/index.mjs", @@ -63,4 +63,4 @@ "nextjs", "react" ] -} \ No newline at end of file +} diff --git a/packages/editor/extensions/package.json b/packages/editor/extensions/package.json index 25d818762..2b1a487bd 100644 --- a/packages/editor/extensions/package.json +++ b/packages/editor/extensions/package.json @@ -1,6 +1,6 @@ { "name": "@plane/editor-extensions", - "version": "0.14", + "version": "0.14.0", "description": "Package that powers Plane's Editor with extensions", "private": true, "main": "./dist/index.mjs", diff --git a/packages/editor/lite-text-editor/package.json b/packages/editor/lite-text-editor/package.json index 98d562e6a..bcaa36a02 100644 --- a/packages/editor/lite-text-editor/package.json +++ b/packages/editor/lite-text-editor/package.json @@ -1,6 +1,6 @@ { "name": "@plane/lite-text-editor", - "version": "0.14", + "version": "0.14.0", "description": "Package that powers Plane's Comment Editor", "private": true, "main": "./dist/index.mjs", diff --git a/packages/editor/rich-text-editor/package.json b/packages/editor/rich-text-editor/package.json index 489737cdb..e960f2827 100644 --- a/packages/editor/rich-text-editor/package.json +++ b/packages/editor/rich-text-editor/package.json @@ -1,6 +1,6 @@ { "name": "@plane/rich-text-editor", - "version": "0.14", + "version": "0.14.0", "description": "Rich Text Editor that powers Plane", "private": true, "main": "./dist/index.mjs", diff --git a/packages/editor/types/package.json b/packages/editor/types/package.json index 1972b6b6c..292282098 100644 --- a/packages/editor/types/package.json +++ b/packages/editor/types/package.json @@ -1,6 +1,6 @@ { "name": "@plane/editor-types", - "version": "0.14", + "version": "0.14.0", "description": "Package that powers Plane's Editor with extensions", "private": true, "main": "./dist/index.mjs", diff --git a/packages/eslint-config-custom/package.json b/packages/eslint-config-custom/package.json index ab4d78cfc..160753c38 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.14", + "version": "0.14.0", "main": "index.js", "license": "MIT", "dependencies": { diff --git a/packages/tailwind-config-custom/package.json b/packages/tailwind-config-custom/package.json index 146b79aad..213367b4f 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.14", + "version": "0.14.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 5596d0602..a23b1b3c2 100644 --- a/packages/tsconfig/package.json +++ b/packages/tsconfig/package.json @@ -1,6 +1,6 @@ { "name": "tsconfig", - "version": "0.14", + "version": "0.14.0", "private": true, "files": [ "base.json", diff --git a/packages/ui/package.json b/packages/ui/package.json index 79d8f3d10..b643d47d4 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.14", + "version": "0.14.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 f14393774..d2f5949f1 100644 --- a/space/package.json +++ b/space/package.json @@ -1,6 +1,6 @@ { "name": "space", - "version": "0.14", + "version": "0.14.0", "private": true, "scripts": { "dev": "turbo run develop", diff --git a/web/package.json b/web/package.json index ea9ffcb20..b7224baf0 100644 --- a/web/package.json +++ b/web/package.json @@ -1,6 +1,6 @@ { "name": "web", - "version": "0.14", + "version": "0.14.0", "private": true, "scripts": { "dev": "turbo run develop", From cb2577d25929ea2ddac5d21f7ac6fcb03369868e Mon Sep 17 00:00:00 2001 From: gurusainath Date: Fri, 8 Dec 2023 16:43:58 +0530 Subject: [PATCH 11/17] fix: handled undefined issue_id in list layout --- web/components/issues/issue-layouts/list/blocks-list.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/web/components/issues/issue-layouts/list/blocks-list.tsx b/web/components/issues/issue-layouts/list/blocks-list.tsx index c51d37547..29709496c 100644 --- a/web/components/issues/issue-layouts/list/blocks-list.tsx +++ b/web/components/issues/issue-layouts/list/blocks-list.tsx @@ -24,6 +24,7 @@ export const IssueBlocksList: FC = (props) => { {issueIds && issueIds.length > 0 ? ( issueIds.map( (issueId: string) => + issueId != undefined && issues[issueId] && ( Date: Fri, 8 Dec 2023 16:21:03 +0530 Subject: [PATCH 12/17] regression: peek overview rerendering --- web/components/issues/peek-overview/issue-detail.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/components/issues/peek-overview/issue-detail.tsx b/web/components/issues/peek-overview/issue-detail.tsx index bc9e4c1d9..e20179bc7 100644 --- a/web/components/issues/peek-overview/issue-detail.tsx +++ b/web/components/issues/peek-overview/issue-detail.tsx @@ -92,7 +92,7 @@ export const PeekOverviewIssueDetails: FC = (props) = setLocalIssueDescription({ id: issue.id, description_html: issue.description_html }); setLocalTitleValue(issue.name); } - }, [issue.id, issue.description_html, issue.name]); + }, [issue.id]); const debouncedFormSave = debounce(async () => { handleSubmit(handleDescriptionFormSubmit)().finally(() => setIsSubmitting("submitted")); From 29e8e6c9970385a7cf903a93f75377c2dd8938a1 Mon Sep 17 00:00:00 2001 From: Palanikannan1437 <73993394+Palanikannan1437@users.noreply.github.com> Date: Fri, 8 Dec 2023 16:42:37 +0530 Subject: [PATCH 13/17] added comments to prevent further changes --- web/components/issues/description-form.tsx | 2 ++ web/components/issues/peek-overview/issue-detail.tsx | 2 ++ .../[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx | 2 ++ 3 files changed, 6 insertions(+) diff --git a/web/components/issues/description-form.tsx b/web/components/issues/description-form.tsx index 94c82c934..a0204d35c 100644 --- a/web/components/issues/description-form.tsx +++ b/web/components/issues/description-form.tsx @@ -61,6 +61,8 @@ export const IssueDescriptionForm: FC = (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) { setLocalIssueDescription({ id: issue.id, description_html: issue.description_html }); diff --git a/web/components/issues/peek-overview/issue-detail.tsx b/web/components/issues/peek-overview/issue-detail.tsx index e20179bc7..8ba8da79c 100644 --- a/web/components/issues/peek-overview/issue-detail.tsx +++ b/web/components/issues/peek-overview/issue-detail.tsx @@ -87,6 +87,8 @@ export const PeekOverviewIssueDetails: FC = (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) { setLocalIssueDescription({ id: issue.id, description_html: issue.description_html }); diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx b/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx index 8ea8bf2e9..b678e951a 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx @@ -152,6 +152,8 @@ const PageDetailsPage: NextPageWithLayout = observer(() => { } }, [isSubmitting, setShowAlert]); + // adding pageDetails.description_html to dependency array causes + // editor rerendering on every save useEffect(() => { if (pageDetails?.description_html) { setLocalIssueDescription({ id: pageId as string, description_html: pageDetails.description_html }); From b82f04ea04d366092b39d18683b3ca758ddfac2c Mon Sep 17 00:00:00 2001 From: Henit Chobisa Date: Fri, 8 Dec 2023 16:34:17 +0530 Subject: [PATCH 14/17] fix: document editor debounced --- .../projects/[projectId]/pages/[pageId].tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx b/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx index b678e951a..3d416c507 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useRef, useState, ReactElement } from "react"; +import React, { useEffect, useRef, useState, ReactElement, useCallback } from "react"; import { useRouter } from "next/router"; import useSWR, { MutatorOptions } from "swr"; import { Controller, useForm } from "react-hook-form"; @@ -59,7 +59,7 @@ const PageDetailsPage: NextPageWithLayout = observer(() => { const { user } = useUser(); - const { handleSubmit, reset, setValue, watch, getValues, control } = useForm({ + const { handleSubmit, setValue, watch, getValues, control } = useForm({ defaultValues: { name: "", description_html: "" }, }); @@ -328,9 +328,12 @@ const PageDetailsPage: NextPageWithLayout = observer(() => { description_html: "", }); - const debouncedFormSave = debounce(async () => { - handleSubmit(updatePage)().finally(() => setIsSubmitting("submitted")); - }, 1500); + const debouncedFormSave = useCallback( + debounce(async () => { + handleSubmit(updatePage)().finally(() => setIsSubmitting("submitted")); + }, 1500), + [handleSubmit] + ); if (error) return ( From 01874cb2db21d3e080a3b41bec5e40b6b3ae9ee0 Mon Sep 17 00:00:00 2001 From: Henit Chobisa Date: Fri, 8 Dec 2023 16:44:42 +0530 Subject: [PATCH 15/17] fix: added useCallback for controlling debounce function triggering on every rerendeer Added a useCallback function, which helps keeping only one version of the debounce function, what happens is that when we type in the editor, the rerenders produces multiple debounce function, which all triggers together after the specifier amount of time, making many request to backend, consiquently failing the debounce. Now useCallback will give only one function even if the rerenders are happening which fixes the issue --- .../[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx b/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx index 3d416c507..61a291634 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx @@ -328,6 +328,7 @@ const PageDetailsPage: NextPageWithLayout = observer(() => { description_html: "", }); + // ADDING updatePage TO DEPENDENCY ARRAY PRODUCES ADVERSE EFFECTS const debouncedFormSave = useCallback( debounce(async () => { handleSubmit(updatePage)().finally(() => setIsSubmitting("submitted")); From fffcb2d94726318ef8920de1da87a118f5d0f212 Mon Sep 17 00:00:00 2001 From: Henit Chobisa Date: Fri, 8 Dec 2023 16:45:04 +0530 Subject: [PATCH 16/17] fix: debounce logic in issue detail and description --- web/components/issues/description-form.tsx | 10 +++++++--- web/components/issues/peek-overview/issue-detail.tsx | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/web/components/issues/description-form.tsx b/web/components/issues/description-form.tsx index a0204d35c..47a2f335e 100644 --- a/web/components/issues/description-form.tsx +++ b/web/components/issues/description-form.tsx @@ -102,9 +102,13 @@ export const IssueDescriptionForm: FC = (props) => { }); }, [issue, reset]); - const debouncedFormSave = debounce(async () => { - handleSubmit(handleDescriptionFormSubmit)().finally(() => setIsSubmitting("submitted")); - }, 1500); + // ADDING handleDescriptionFormSubmit TO DEPENDENCY ARRAY PRODUCES ADVERSE EFFECTS + const debouncedFormSave = useCallback( + debounce(async () => { + handleSubmit(handleDescriptionFormSubmit)().finally(() => setIsSubmitting("submitted")); + }, 1500), + [handleSubmit] + ); return (
diff --git a/web/components/issues/peek-overview/issue-detail.tsx b/web/components/issues/peek-overview/issue-detail.tsx index 8ba8da79c..08a0aaf1f 100644 --- a/web/components/issues/peek-overview/issue-detail.tsx +++ b/web/components/issues/peek-overview/issue-detail.tsx @@ -96,9 +96,13 @@ export const PeekOverviewIssueDetails: FC = (props) = } }, [issue.id]); - const debouncedFormSave = debounce(async () => { - handleSubmit(handleDescriptionFormSubmit)().finally(() => setIsSubmitting("submitted")); - }, 1500); + // ADDING handleDescriptionFormSubmit TO DEPENDENCY ARRAY PRODUCES ADVERSE EFFECTS + const debouncedFormSave = useCallback( + debounce(async () => { + handleSubmit(handleDescriptionFormSubmit)().finally(() => setIsSubmitting("submitted")); + }, 1500), + [handleSubmit] + ); useEffect(() => { if (isSubmitting === "submitted") { From b487e2defe0f8653a3af6f34a8234cb1d2596437 Mon Sep 17 00:00:00 2001 From: Nikhil <118773738+pablohashescobar@users.noreply.github.com> Date: Fri, 8 Dec 2023 19:46:46 +0530 Subject: [PATCH 17/17] fix: open api configuration (#3044) * dev: fix openapi config default for docker setup * dev: remove the default values from google client id and github client id * dev: handle case for google and github client id --- apiserver/plane/app/views/config.py | 6 +++--- deploy/selfhost/docker-compose.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apiserver/plane/app/views/config.py b/apiserver/plane/app/views/config.py index 7c341da4a..c53b30495 100644 --- a/apiserver/plane/app/views/config.py +++ b/apiserver/plane/app/views/config.py @@ -90,8 +90,8 @@ class ConfigurationEndpoint(BaseAPIView): data = {} # Authentication - data["google_client_id"] = GOOGLE_CLIENT_ID if GOOGLE_CLIENT_ID else None - data["github_client_id"] = GITHUB_CLIENT_ID if GITHUB_CLIENT_ID else None + data["google_client_id"] = GOOGLE_CLIENT_ID if GOOGLE_CLIENT_ID and GOOGLE_CLIENT_ID != "\"\"" else None + data["github_client_id"] = GITHUB_CLIENT_ID if GITHUB_CLIENT_ID and GITHUB_CLIENT_ID != "\"\"" else None data["github_app_name"] = GITHUB_APP_NAME data["magic_login"] = ( bool(EMAIL_HOST_USER) and bool(EMAIL_HOST_PASSWORD) @@ -106,7 +106,7 @@ class ConfigurationEndpoint(BaseAPIView): data["posthog_host"] = POSTHOG_HOST # Unsplash - data["has_unsplash_configured"] = UNSPLASH_ACCESS_KEY + data["has_unsplash_configured"] = bool(UNSPLASH_ACCESS_KEY) # Open AI settings data["has_openai_configured"] = bool(OPENAI_API_KEY) diff --git a/deploy/selfhost/docker-compose.yml b/deploy/selfhost/docker-compose.yml index ba0c28827..26be26ea5 100644 --- a/deploy/selfhost/docker-compose.yml +++ b/deploy/selfhost/docker-compose.yml @@ -41,7 +41,7 @@ x-app-env : &app-env - DEFAULT_PASSWORD=${DEFAULT_PASSWORD:-password123} # OPENAI SETTINGS - Deprecated can be configured through admin panel - OPENAI_API_BASE=${OPENAI_API_BASE:-https://api.openai.com/v1} - - OPENAI_API_KEY=${OPENAI_API_KEY:-"sk-"} + - OPENAI_API_KEY=${OPENAI_API_KEY:-""} - GPT_ENGINE=${GPT_ENGINE:-"gpt-3.5-turbo"} # LOGIN/SIGNUP SETTINGS - Deprecated can be configured through admin panel - ENABLE_SIGNUP=${ENABLE_SIGNUP:-1}