From 0a617eec267b7bf5ee6ba0a65c9d3a9474b40dd3 Mon Sep 17 00:00:00 2001 From: "M. Palanikannan" <73993394+Palanikannan1437@users.noreply.github.com> Date: Tue, 26 Dec 2023 16:45:00 +0530 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=94=A7=20fix:=20Pages=20mutation=20on?= =?UTF-8?q?=20component=20mount=20(#3230)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🔧 chore: Update revalidate option and add useEffect hook in PageDetailsPage component - Set the `revalidate` option to `false` in the `commonSwrOptions` object. - Add an `useEffect` hook that calls the `mutatePageDetails` function with specific options. - Inside the `useEffect` hook, set `revalidate` to `true`, `populateCache` to `true`, and define a rollback function for error handling. - If an error occurs during the rollback, display an error alert message using the `actionCompleteAlert` function. - In the `updatePage` function, ensure that `workspaceSlug`, `projectId`, and `pageId` are all defined before proceeding. * ♻️ refactor: Update code styling for inline code in CoreEditorExtensions In the `packages/editor/core/src/ui/extensions/index.tsx` file, the code for inline code styling in the CoreEditorExtensions component has been updated. Previously, it was set to `false`, but now it is defined as an object with specific HTML attributes. The code styling includes a rounded-md background, custom primary color, margin, padding, font styling, and disabling spellcheck. This change improves the visual appearance and readability of inline code elements in the editor. --- .../editor/core/src/ui/extensions/index.tsx | 12 ++++++------ .../projects/[projectId]/pages/[pageId].tsx | 18 +++++++++++++++++- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/packages/editor/core/src/ui/extensions/index.tsx b/packages/editor/core/src/ui/extensions/index.tsx index 1406cde67..4ae55f00c 100644 --- a/packages/editor/core/src/ui/extensions/index.tsx +++ b/packages/editor/core/src/ui/extensions/index.tsx @@ -52,12 +52,12 @@ export const CoreEditorExtensions = ( class: "leading-normal -mb-2", }, }, - // blockquote: { - // HTMLAttributes: { - // class: "border-l-4 border-custom-border-300", - // }, - // }, - code: false, + code: { + HTMLAttributes: { + class: "rounded-md bg-custom-primary-30 mx-1 px-1 py-1 font-mono font-medium text-custom-text-1000", + spellcheck: "false", + }, + }, codeBlock: false, horizontalRule: false, dropcursor: { diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx b/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx index 067d3e18f..f91be2c2d 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx @@ -177,7 +177,7 @@ const PageDetailsPage: NextPageWithLayout = observer(() => { onErrorAction: () => void ) => { const commonSwrOptions: MutatorOptions = { - revalidate: true, + revalidate: false, populateCache: false, rollbackOnError: () => { onErrorAction(); @@ -201,6 +201,22 @@ const PageDetailsPage: NextPageWithLayout = observer(() => { }); }; + useEffect(() => { + mutatePageDetails(undefined, { + revalidate: true, + populateCache: true, + rollbackOnError: () => { + actionCompleteAlert({ + title: `Page could not be updated`, + message: `Sorry, page could not be updated, please try again later`, + type: "error", + }); + return true; + }, + }); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + const updatePage = async (formData: IPage) => { if (!workspaceSlug || !projectId || !pageId) return; From 1e27c7936d10765350889eacec2432ee6c78744f Mon Sep 17 00:00:00 2001 From: sriram veeraghanta Date: Tue, 26 Dec 2023 17:03:43 +0530 Subject: [PATCH 2/4] fix: eslint dependencies fixes --- packages/editor/document-editor/package.json | 3 +-- packages/editor/extensions/package.json | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/editor/document-editor/package.json b/packages/editor/document-editor/package.json index 61a075e5f..72dfab954 100644 --- a/packages/editor/document-editor/package.json +++ b/packages/editor/document-editor/package.json @@ -35,7 +35,6 @@ "@tiptap/extension-placeholder": "^2.1.13", "@tiptap/pm": "^2.1.13", "@tiptap/suggestion": "^2.1.13", - "eslint": "8.36.0", "eslint-config-next": "13.2.4", "react-popper": "^2.3.0", "tippy.js": "^6.3.7", @@ -45,7 +44,7 @@ "@types/node": "18.15.3", "@types/react": "^18.2.42", "@types/react-dom": "^18.2.17", - "eslint": "^7.32.0", + "eslint": "8.36.0", "postcss": "^8.4.29", "tailwind-config-custom": "*", "tsconfig": "*", diff --git a/packages/editor/extensions/package.json b/packages/editor/extensions/package.json index dda0e58db..94801928c 100644 --- a/packages/editor/extensions/package.json +++ b/packages/editor/extensions/package.json @@ -33,7 +33,6 @@ "@tiptap/pm": "^2.1.13", "@tiptap/react": "^2.1.13", "@tiptap/suggestion": "^2.1.13", - "eslint": "8.36.0", "eslint-config-next": "13.2.4", "lucide-react": "^0.294.0", "tippy.js": "^6.3.7" @@ -42,7 +41,7 @@ "@types/node": "18.15.3", "@types/react": "^18.2.42", "@types/react-dom": "^18.2.17", - "eslint": "^7.32.0", + "eslint": "8.36.0", "postcss": "^8.4.29", "tailwind-config-custom": "*", "tsconfig": "*", From eabb31a764d44d50a69458abc16ae27163502a7b Mon Sep 17 00:00:00 2001 From: sriram veeraghanta Date: Tue, 26 Dec 2023 17:04:59 +0530 Subject: [PATCH 3/4] fix: upgrading turbo repo changes --- package.json | 2 +- yarn.lock | 68 ++++++++++++++++++++++++++-------------------------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index 06e84557b..b5d997662 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "prettier": "latest", "prettier-plugin-tailwindcss": "^0.5.4", "tailwindcss": "^3.3.3", - "turbo": "^1.11.1" + "turbo": "^1.11.2" }, "resolutions": { "@types/react": "18.2.42" diff --git a/yarn.lock b/yarn.lock index 617ebf75b..ad1268469 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8495,47 +8495,47 @@ tunnel-agent@^0.6.0: dependencies: safe-buffer "^5.0.1" -turbo-darwin-64@1.11.1: - version "1.11.1" - resolved "https://registry.yarnpkg.com/turbo-darwin-64/-/turbo-darwin-64-1.11.1.tgz#fc9c2e578bd2d270b9942b11750a519a39850c57" - integrity sha512-JmwL8kcfxncDf2SZFioSa6dUvpMq/HbMcurh9mGm6BxWLQoB0d3fP/q3HizgCSbOE4ihScXoQ+c/C2xhl6Ngjg== +turbo-darwin-64@1.11.2: + version "1.11.2" + resolved "https://registry.yarnpkg.com/turbo-darwin-64/-/turbo-darwin-64-1.11.2.tgz#fc3d4d74b325a27aef11b6a52a61f07d466846b9" + integrity sha512-toFmRG/adriZY3hOps7nYCfqHAS+Ci6xqgX3fbo82kkLpC6OBzcXnleSwuPqjHVAaRNhVoB83L5njcE9Qwi2og== -turbo-darwin-arm64@1.11.1: - version "1.11.1" - resolved "https://registry.yarnpkg.com/turbo-darwin-arm64/-/turbo-darwin-arm64-1.11.1.tgz#77ba7f16106dc6e48acad03ce37ccf41d2851017" - integrity sha512-lIpT7nPkU0xmpkI8VOGQcgoQKmUATRMpRhTDclz6j/Px7Qtxjc+2PitKHKfR3aCnseoRMGkgMzPEJTPUwCpnlQ== +turbo-darwin-arm64@1.11.2: + version "1.11.2" + resolved "https://registry.yarnpkg.com/turbo-darwin-arm64/-/turbo-darwin-arm64-1.11.2.tgz#583a4d0025bc3f953a9eeb7065cb173f481a9965" + integrity sha512-FCsEDZ8BUSFYEOSC3rrARQrj7x2VOrmVcfrMUIhexTxproRh4QyMxLfr6LALk4ymx6jbDCxWa6Szal8ckldFbA== -turbo-linux-64@1.11.1: - version "1.11.1" - resolved "https://registry.yarnpkg.com/turbo-linux-64/-/turbo-linux-64-1.11.1.tgz#40458e4db3c7b56b6347a42d9e4aab43acdcf197" - integrity sha512-mHFSqMkgy3h/M8Ocj2oiOr6CqlCqB6coCPWVIAmraBk+SQywwsszgJ69GWBfm7lwwJvb3B1YN1wkZNe9ZZnBfg== +turbo-linux-64@1.11.2: + version "1.11.2" + resolved "https://registry.yarnpkg.com/turbo-linux-64/-/turbo-linux-64-1.11.2.tgz#55ef996d856cb397b9fb2855a554ccef1cee9dd7" + integrity sha512-Vzda/o/QyEske5CxLf0wcu7UUS+7zB90GgHZV4tyN+WZtoouTvbwuvZ3V6b5Wgd3OJ/JwWR0CXDK7Sf4VEMr7A== -turbo-linux-arm64@1.11.1: - version "1.11.1" - resolved "https://registry.yarnpkg.com/turbo-linux-arm64/-/turbo-linux-arm64-1.11.1.tgz#3eb32d42851dbe7fb9627de29687171af2c20295" - integrity sha512-6ybojTkAkymo1Ig7kU3s2YQUUSRf3l2qatPZgw3v4OmFTSU2feCU1sHjAEqhHwEjV1KciDo1wRl1gjjyby4foQ== +turbo-linux-arm64@1.11.2: + version "1.11.2" + resolved "https://registry.yarnpkg.com/turbo-linux-arm64/-/turbo-linux-arm64-1.11.2.tgz#64d6093c9a2f32f410624564fd10685c847d947e" + integrity sha512-bRLwovQRz0yxDZrM4tQEAYV0fBHEaTzUF0JZ8RG1UmZt/CqtpnUrJpYb1VK8hj1z46z9YehARpYCwQ2K0qU4yw== -turbo-windows-64@1.11.1: - version "1.11.1" - resolved "https://registry.yarnpkg.com/turbo-windows-64/-/turbo-windows-64-1.11.1.tgz#b30bd6bd113fee6e455e96f99cf4cc069ef4964b" - integrity sha512-ytWy6+yEtBfv6nbgCKW6HsolgUFAC1PZGMPzbqRGnCm2eLVWhDuwO1Yk7uq4cvdrpXcXgOMcPEoJZxUCDbeJaQ== +turbo-windows-64@1.11.2: + version "1.11.2" + resolved "https://registry.yarnpkg.com/turbo-windows-64/-/turbo-windows-64-1.11.2.tgz#f4164be9c42796c86ca3929e27f1992a4310b9ed" + integrity sha512-LgTWqkHAKgyVuLYcEPxZVGPInTjjeCnN5KQMdJ4uQZ+xMDROvMFS2rM93iQl4ieDJgidwHCxxCxaU9u8c3d/Kg== -turbo-windows-arm64@1.11.1: - version "1.11.1" - resolved "https://registry.yarnpkg.com/turbo-windows-arm64/-/turbo-windows-arm64-1.11.1.tgz#9e152b30232ada57144004f0ff7939933ae0d57d" - integrity sha512-O04DdJoRavOh/v9/MM5wWCEtOekO4aiLljNZc/fOh853sOhid61ZRSEYUmS9ecjmZ/OjKqedIfbkitaQ77c4xA== +turbo-windows-arm64@1.11.2: + version "1.11.2" + resolved "https://registry.yarnpkg.com/turbo-windows-arm64/-/turbo-windows-arm64-1.11.2.tgz#ca1b4d7ac6fe8c931baef1a270ac07bbd924277b" + integrity sha512-829aVBU7IX0c/B4G7g1VI8KniAGutHhIupkYMgF6xPkYVev2G3MYe6DMS/vsLt9GGM9ulDtdWxWrH5P2ngK8IQ== -turbo@^1.11.1: - version "1.11.1" - resolved "https://registry.yarnpkg.com/turbo/-/turbo-1.11.1.tgz#1a779ee58382397e2f4c538bc0f15a820081ba8c" - integrity sha512-pmIsyTcyBJ5iJIaTjJyCxAq7YquDqyRai6FW2q0mFAkwK3k0p36wJ5yH85U2Ue6esrTKzeSEKskP4/fa7dv4+A== +turbo@^1.11.2: + version "1.11.2" + resolved "https://registry.yarnpkg.com/turbo/-/turbo-1.11.2.tgz#7bae6df12c210e9b12973aad8f0e7b077039d4ce" + integrity sha512-jPC7LVQJzebs5gWf8FmEvsvXGNyKbN+O9qpvv98xpNaM59aS0/Irhd0H0KbcqnXfsz7ETlzOC3R+xFWthC4Z8A== optionalDependencies: - turbo-darwin-64 "1.11.1" - turbo-darwin-arm64 "1.11.1" - turbo-linux-64 "1.11.1" - turbo-linux-arm64 "1.11.1" - turbo-windows-64 "1.11.1" - turbo-windows-arm64 "1.11.1" + turbo-darwin-64 "1.11.2" + turbo-darwin-arm64 "1.11.2" + turbo-linux-64 "1.11.2" + turbo-linux-arm64 "1.11.2" + turbo-windows-64 "1.11.2" + turbo-windows-arm64 "1.11.2" type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" From 37fe9a185c5df1a0a922674a70c0e7d3c96f80d2 Mon Sep 17 00:00:00 2001 From: sriram veeraghanta Date: Tue, 26 Dec 2023 18:13:13 +0530 Subject: [PATCH 4/4] fix: adding token to the build pr workflow (#3254) * fix: adding token to the build pr workflow * fix: using automatic github token --- .github/workflows/build-test-pull-request.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-test-pull-request.yml b/.github/workflows/build-test-pull-request.yml index c74975f48..b7583e953 100644 --- a/.github/workflows/build-test-pull-request.yml +++ b/.github/workflows/build-test-pull-request.yml @@ -1,6 +1,6 @@ name: Build Pull Request Contents -on: +on: pull_request: types: ["opened", "synchronize"] @@ -14,13 +14,15 @@ jobs: steps: - name: Checkout Repository to Actions uses: actions/checkout@v3.3.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} - name: Setup Node.js 18.x uses: actions/setup-node@v2 with: node-version: 18.x - cache: 'yarn' - + cache: "yarn" + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v38 @@ -44,5 +46,3 @@ jobs: run: | yarn yarn build --filter=space - -