From 216a7c8fda3482ba96482aa46e1f6e4a103b9c9a Mon Sep 17 00:00:00 2001 From: sriram veeraghanta Date: Wed, 20 Dec 2023 13:49:17 +0530 Subject: [PATCH 1/3] fix: adding additional headers to restrict iframe --- space/next.config.js | 14 ++++++++++++++ web/next.config.js | 8 ++++++++ 2 files changed, 22 insertions(+) diff --git a/space/next.config.js b/space/next.config.js index 16450199c..18b9275a1 100644 --- a/space/next.config.js +++ b/space/next.config.js @@ -3,10 +3,24 @@ require("dotenv").config({ path: ".env" }); const { withSentryConfig } = require("@sentry/nextjs"); const nextConfig = { + async headers() { + return [ + { + source: "/", + headers: [{ key: "X-Frame-Options", value: "SAMEORIGIN" }], + }, + ]; + }, basePath: process.env.NEXT_PUBLIC_DEPLOY_WITH_NGINX === "1" ? "/spaces" : "", reactStrictMode: false, swcMinify: true, images: { + remotePatterns: [ + { + protocol: "https", + hostname: "**", + }, + ], unoptimized: true, }, output: "standalone", diff --git a/web/next.config.js b/web/next.config.js index 29925a312..e018ea317 100644 --- a/web/next.config.js +++ b/web/next.config.js @@ -2,6 +2,14 @@ require("dotenv").config({ path: ".env" }); const { withSentryConfig } = require("@sentry/nextjs"); const nextConfig = { + async headers() { + return [ + { + source: "/(.*)?", + headers: [{ key: "X-Frame-Options", value: "SAMEORIGIN" }], + }, + ]; + }, reactStrictMode: false, swcMinify: true, images: { From 40b8b0ac355fd7b0a04b9553270b5ae0e07964ba Mon Sep 17 00:00:00 2001 From: Lakhan Baheti <94619783+1akhanBaheti@users.noreply.github.com> Date: Wed, 20 Dec 2023 18:53:35 +0530 Subject: [PATCH 2/3] fix: role authorization for create project button in project empty state (#3204) --- web/components/page-views/workspace-dashboard.tsx | 3 +-- web/components/project/card-list.tsx | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/web/components/page-views/workspace-dashboard.tsx b/web/components/page-views/workspace-dashboard.tsx index ff378e23d..299c35de9 100644 --- a/web/components/page-views/workspace-dashboard.tsx +++ b/web/components/page-views/workspace-dashboard.tsx @@ -37,8 +37,7 @@ export const WorkspaceDashboardView = observer(() => { workspaceSlug ? `USER_WORKSPACE_DASHBOARD_${workspaceSlug}_${month}` : null, workspaceSlug ? () => userStore.fetchUserDashboardInfo(workspaceSlug.toString(), month) : null ); - - const isEditingAllowed = !!userStore.currentProjectRole && userStore.currentProjectRole >= EUserWorkspaceRoles.MEMBER; + const isEditingAllowed = !!userStore.currentWorkspaceRole && userStore.currentWorkspaceRole >= EUserWorkspaceRoles.MEMBER; const handleTourCompleted = () => { userStore diff --git a/web/components/project/card-list.tsx b/web/components/project/card-list.tsx index 76f3112b6..3ccc403c1 100644 --- a/web/components/project/card-list.tsx +++ b/web/components/project/card-list.tsx @@ -23,12 +23,11 @@ export const ProjectCardList: FC = observer((props) => { project: projectStore, commandPalette: commandPaletteStore, trackEvent: { setTrackElement }, - user: { currentProjectRole }, + user: { currentWorkspaceRole }, } = useMobxStore(); const projects = workspaceSlug ? projectStore.projects[workspaceSlug.toString()] : null; - - const isEditingAllowed = !!currentProjectRole && currentProjectRole >= EUserWorkspaceRoles.MEMBER; + const isEditingAllowed = !!currentWorkspaceRole && currentWorkspaceRole >= EUserWorkspaceRoles.MEMBER; if (!projects) { return ( From e141091e99a59e03182856d0b89bd69972f3b101 Mon Sep 17 00:00:00 2001 From: "M. Palanikannan" <73993394+Palanikannan1437@users.noreply.github.com> Date: Wed, 20 Dec 2023 18:54:16 +0530 Subject: [PATCH 3/3] fix: Resolved page not saving/not copying contents bug (#3203) This commit adds a duplicate_page function to the PageDetailsPage component, which allows users to duplicate a page. If the current page does not have a description_html value, it will be set to the default value from the pageDetails object. The formData object is updated with the necessary values for duplication, including the new page name and description. Additionally, the handleSubmit dependency is included in the useEffect hook to ensure proper form submission. --- .../projects/[projectId]/pages/[pageId].tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx b/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx index a781cfd78..067d3e18f 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx @@ -246,6 +246,11 @@ const PageDetailsPage: NextPageWithLayout = observer(() => { // ================ Page Menu Actions ================== const duplicate_page = async () => { const currentPageValues = getValues(); + + if (!currentPageValues?.description_html) { + currentPageValues.description_html = pageDetails?.description_html as string; + } + const formData: Partial = { name: "Copy of " + pageDetails?.name, description_html: currentPageValues.description_html, @@ -336,7 +341,7 @@ const PageDetailsPage: NextPageWithLayout = observer(() => { debounce(async () => { handleSubmit(updatePage)().finally(() => setIsSubmitting("submitted")); }, 1500), - [handleSubmit] + [handleSubmit, pageDetails] ); if (error)