diff --git a/CHANGELOG.md b/CHANGELOG.md index 015136923..06c5ef85a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,15 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v0.71.0](https://github.com/isomerpages/isomercms-frontend/compare/v0.70.0...v0.71.0) + +- fix(deps): downgrade react-dropzone to fix media uploading on GSIB [`#1775`](https://github.com/isomerpages/isomercms-frontend/pull/1775) +- release/0.70.0 [`#1773`](https://github.com/isomerpages/isomercms-frontend/pull/1773) + #### [v0.70.0](https://github.com/isomerpages/isomercms-frontend/compare/v0.69.0...v0.70.0) +> 10 January 2024 + - IS-846 fix copy for new rte [`#1769`](https://github.com/isomerpages/isomercms-frontend/pull/1769) - fix: header spacing [`#1772`](https://github.com/isomerpages/isomercms-frontend/pull/1772) - fix(cards): prevent overflowing of cards by enforcing width [`#1771`](https://github.com/isomerpages/isomercms-frontend/pull/1771) @@ -77,15 +84,16 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 6 December 2023 +- fix(embed-views): add a max width [`#1729`](https://github.com/isomerpages/isomercms-frontend/pull/1729) +- fix(blockwrapper): remove padding [`#1728`](https://github.com/isomerpages/isomercms-frontend/pull/1728) - fix(editpagelayout): shift context call elsewhere [`c95b2ab`](https://github.com/isomerpages/isomercms-frontend/commit/c95b2ab7e4909d0b9852e8603bc5995a716dc743) - fix(legacyeditpage): minor style fix so the editor grows [`ad8b36c`](https://github.com/isomerpages/isomercms-frontend/commit/ad8b36cfa09c2bafb4e1c44d65343d2621e2d1c8) #### [v0.63.0](https://github.com/isomerpages/isomercms-frontend/compare/v0.62.0...v0.63.0) -> 6 December 2023 +> 5 December 2023 -- fix(embed-views): add a max width [`#1729`](https://github.com/isomerpages/isomercms-frontend/pull/1729) -- fix(blockwrapper): remove padding [`#1728`](https://github.com/isomerpages/isomercms-frontend/pull/1728) +- chore: swap preview fonts [`#1715`](https://github.com/isomerpages/isomercms-frontend/pull/1715) - feat(editor): enhance image bubble menu with more functions [`#1721`](https://github.com/isomerpages/isomercms-frontend/pull/1721) - feat(editor): feature flag complex blocks [`#1720`](https://github.com/isomerpages/isomercms-frontend/pull/1720) - fix(tables): update table behaviour [`#1722`](https://github.com/isomerpages/isomercms-frontend/pull/1722) @@ -105,12 +113,12 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat(tiptap): add card grid block [`#1701`](https://github.com/isomerpages/isomercms-frontend/pull/1701) - feat(tiptap): allow inserting of complex blocks [`#1697`](https://github.com/isomerpages/isomercms-frontend/pull/1697) - 0.62.0 to develop [`#1710`](https://github.com/isomerpages/isomercms-frontend/pull/1710) +- fix(media): fix logic for disabling button in create media folder modal [`#1712`](https://github.com/isomerpages/isomercms-frontend/pull/1712) #### [v0.62.0](https://github.com/isomerpages/isomercms-frontend/compare/v0.61.0...v0.62.0) > 28 November 2023 -- fix(media): fix logic for disabling button in create media folder modal [`#1712`](https://github.com/isomerpages/isomercms-frontend/pull/1712) - Chore/update regex [`#1703`](https://github.com/isomerpages/isomercms-frontend/pull/1703) - fix(media): allow creating folders in empty folder [`#1702`](https://github.com/isomerpages/isomercms-frontend/pull/1702) - 0.61.0 (develop) [`#1700`](https://github.com/isomerpages/isomercms-frontend/pull/1700) @@ -126,12 +134,12 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat(tiptap): add Instagram embed proper node handler [`#1688`](https://github.com/isomerpages/isomercms-frontend/pull/1688) - fix(updateLinkModal): update link + proper default [`#1692`](https://github.com/isomerpages/isomercms-frontend/pull/1692) - 0.60.0 [`#1690`](https://github.com/isomerpages/isomercms-frontend/pull/1690) +- fix(input): empty input validation [`#1691`](https://github.com/isomerpages/isomercms-frontend/pull/1691) #### [v0.60.0](https://github.com/isomerpages/isomercms-frontend/compare/v0.59.0...v0.60.0) > 21 November 2023 -- fix(input): empty input validation [`#1691`](https://github.com/isomerpages/isomercms-frontend/pull/1691) - is-714/chore: add copy and layout changes [`#1687`](https://github.com/isomerpages/isomercms-frontend/pull/1687) - IS-780 fix(height): fix editor + preview heights [`#1686`](https://github.com/isomerpages/isomercms-frontend/pull/1686) - IS-782-Editor-File-text-always-comes-out-as-file-regardless-of-text [`#1685`](https://github.com/isomerpages/isomercms-frontend/pull/1685) @@ -208,13 +216,13 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat(media): introduce enhancement to media pages [`#1628`](https://github.com/isomerpages/isomercms-frontend/pull/1628) - feat(blocks): rollback handler [`#1603`](https://github.com/isomerpages/isomercms-frontend/pull/1603) - 0.54.0 to develop [`#1622`](https://github.com/isomerpages/isomercms-frontend/pull/1622) +- feat(media): introduce new image preview card common component [`#1620`](https://github.com/isomerpages/isomercms-frontend/pull/1620) +- fix(editpage): change query key from object to array [`#1623`](https://github.com/isomerpages/isomercms-frontend/pull/1623) #### [v0.54.0](https://github.com/isomerpages/isomercms-frontend/compare/v0.53.0...v0.54.0) -> 26 October 2023 +> 25 October 2023 -- feat(media): introduce new image preview card common component [`#1620`](https://github.com/isomerpages/isomercms-frontend/pull/1620) -- fix(editpage): change query key from object to array [`#1623`](https://github.com/isomerpages/isomercms-frontend/pull/1623) - Fix/login page layout [`#1619`](https://github.com/isomerpages/isomercms-frontend/pull/1619) - chore: add sgidlogin page story [`#1595`](https://github.com/isomerpages/isomercms-frontend/pull/1595) - IS-614-Make-it-easy-to-view-staging-on-mobile [`#1617`](https://github.com/isomerpages/isomercms-frontend/pull/1617) @@ -231,16 +239,16 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat: allow Isomer admins to edit on email-login [`#1604`](https://github.com/isomerpages/isomercms-frontend/pull/1604) - fix(settings): use env var [`#1609`](https://github.com/isomerpages/isomercms-frontend/pull/1609) - release/v0.52.0 [`#1600`](https://github.com/isomerpages/isomercms-frontend/pull/1600) - -#### [v0.52.0](https://github.com/isomerpages/isomercms-frontend/compare/v0.51.1...v0.52.0) - -> 19 October 2023 - - fix: errors indexes [`#1610`](https://github.com/isomerpages/isomercms-frontend/pull/1610) - fix(navbar): fix race condition when retrieving second level data [`#1608`](https://github.com/isomerpages/isomercms-frontend/pull/1608) - fix(navbar): ensure all queries are loaded first [`#1607`](https://github.com/isomerpages/isomercms-frontend/pull/1607) - fix(media): support replacement of media src with spaces [`#1606`](https://github.com/isomerpages/isomercms-frontend/pull/1606) - chore(hooks): add timeout [`#1605`](https://github.com/isomerpages/isomercms-frontend/pull/1605) + +#### [v0.52.0](https://github.com/isomerpages/isomercms-frontend/compare/v0.51.1...v0.52.0) + +> 18 October 2023 + - fix(media): adjust query key to load image in preview on upload [`#1602`](https://github.com/isomerpages/isomercms-frontend/pull/1602) - Feat/sgid govt rollout [`#1594`](https://github.com/isomerpages/isomercms-frontend/pull/1594) - feat(navbar): upgrade navbar to use v2 endpoints [`#1592`](https://github.com/isomerpages/isomercms-frontend/pull/1592) @@ -254,12 +262,12 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 18 October 2023 - fix(mediasselectmodal): update dir name [`#1596`](https://github.com/isomerpages/isomercms-frontend/pull/1596) +- fix(media): add limit [`#1591`](https://github.com/isomerpages/isomercms-frontend/pull/1591) #### [v0.51.0](https://github.com/isomerpages/isomercms-frontend/compare/v0.50.0...v0.51.0) > 16 October 2023 -- fix(media): add limit [`#1591`](https://github.com/isomerpages/isomercms-frontend/pull/1591) - chore(hooks): remove `useGetMediaFolders` [`#1582`](https://github.com/isomerpages/isomercms-frontend/pull/1582) - feat(homepage): allow user to override changes when there is a conflict [`#1588`](https://github.com/isomerpages/isomercms-frontend/pull/1588) - ref(media): update media hooks + components [`#1581`](https://github.com/isomerpages/isomercms-frontend/pull/1581) @@ -306,13 +314,13 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 3 October 2023 +- fix(herocenteredlayout): make dropdown optional [`#1556`](https://github.com/isomerpages/isomercms-frontend/pull/1556) - fix(hero.scss): css fix [`af09212`](https://github.com/isomerpages/isomercms-frontend/commit/af09212f81dbf845eae7579632fecb2a26d3eb1a) #### [v0.47.0](https://github.com/isomerpages/isomercms-frontend/compare/v0.46.0...v0.47.0) > 3 October 2023 -- fix(herocenteredlayout): make dropdown optional [`#1556`](https://github.com/isomerpages/isomercms-frontend/pull/1556) - Fix/text cards design [`#1535`](https://github.com/isomerpages/isomercms-frontend/pull/1535) - chore(cleanup): delete unused styles [`#1548`](https://github.com/isomerpages/isomercms-frontend/pull/1548) - refactor(hero): duplicate changes from template [`#1551`](https://github.com/isomerpages/isomercms-frontend/pull/1551) diff --git a/package-lock.json b/package-lock.json index e2db3148e..dbbd6752f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "isomercms-frontend", - "version": "0.70.0", + "version": "0.71.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "isomercms-frontend", - "version": "0.70.0", + "version": "0.71.0", "hasInstallScript": true, "dependencies": { "@braintree/sanitize-url": "^6.0.1", @@ -83,7 +83,7 @@ "react-color": "^2.19.3", "react-diff-viewer": "^3.1.1", "react-dom": "^18.2.0", - "react-dropzone": "^14.2.3", + "react-dropzone": "^11.7.1", "react-hook-form": "^7.32.0", "react-icons": "^4.4.0", "react-input-mask": "^2.0.4", @@ -7168,6 +7168,17 @@ "react": ">=16.12.0" } }, + "node_modules/@opengovsg/design-system-react/node_modules/file-selector": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/file-selector/-/file-selector-0.6.0.tgz", + "integrity": "sha512-QlZ5yJC0VxHxQQsQhXvBaC7VRJ2uaxTf+Tfpu4Z/OcVQJVpZO+DGU0rkoVW5ce2SccxugvpBJoMvUs59iILYdw==", + "dependencies": { + "tslib": "^2.4.0" + }, + "engines": { + "node": ">= 12" + } + }, "node_modules/@opengovsg/design-system-react/node_modules/nanoid": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.0.3.tgz", @@ -7185,6 +7196,22 @@ "node": "^18 || >=20" } }, + "node_modules/@opengovsg/design-system-react/node_modules/react-dropzone": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/react-dropzone/-/react-dropzone-14.2.3.tgz", + "integrity": "sha512-O3om8I+PkFKbxCukfIR3QAGftYXDZfOE2N1mr/7qebQJHs7U+/RSL/9xomJNpRg9kM5h9soQSdf0Gc7OHF5Fug==", + "dependencies": { + "attr-accept": "^2.2.2", + "file-selector": "^0.6.0", + "prop-types": "^15.8.1" + }, + "engines": { + "node": ">= 10.13" + }, + "peerDependencies": { + "react": ">= 16.8 || 18.0.0" + } + }, "node_modules/@opengovsg/design-system-react/node_modules/react-input-mask": { "version": "3.0.0-alpha.2", "license": "MIT", @@ -19177,14 +19204,14 @@ } }, "node_modules/file-selector": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/file-selector/-/file-selector-0.6.0.tgz", - "integrity": "sha512-QlZ5yJC0VxHxQQsQhXvBaC7VRJ2uaxTf+Tfpu4Z/OcVQJVpZO+DGU0rkoVW5ce2SccxugvpBJoMvUs59iILYdw==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/file-selector/-/file-selector-0.4.0.tgz", + "integrity": "sha512-iACCiXeMYOvZqlF1kTiYINzgepRBymz1wwjiuup9u9nayhb6g4fSwiyJ/6adli+EPwrWtpgQAh2PoS7HukEGEg==", "dependencies": { - "tslib": "^2.4.0" + "tslib": "^2.0.3" }, "engines": { - "node": ">= 12" + "node": ">= 10" } }, "node_modules/file-system-cache": { @@ -31921,19 +31948,19 @@ } }, "node_modules/react-dropzone": { - "version": "14.2.3", - "resolved": "https://registry.npmjs.org/react-dropzone/-/react-dropzone-14.2.3.tgz", - "integrity": "sha512-O3om8I+PkFKbxCukfIR3QAGftYXDZfOE2N1mr/7qebQJHs7U+/RSL/9xomJNpRg9kM5h9soQSdf0Gc7OHF5Fug==", + "version": "11.7.1", + "resolved": "https://registry.npmjs.org/react-dropzone/-/react-dropzone-11.7.1.tgz", + "integrity": "sha512-zxCMwhfPy1olUEbw3FLNPLhAm/HnaYH5aELIEglRbqabizKAdHs0h+WuyOpmA+v1JXn0++fpQDdNfUagWt5hJQ==", "dependencies": { "attr-accept": "^2.2.2", - "file-selector": "^0.6.0", + "file-selector": "^0.4.0", "prop-types": "^15.8.1" }, "engines": { "node": ">= 10.13" }, "peerDependencies": { - "react": ">= 16.8 || 18.0.0" + "react": ">= 16.8" } }, "node_modules/react-element-to-jsx-string": { diff --git a/package.json b/package.json index 43e1a09f3..fd766bc82 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "isomercms-frontend", - "version": "0.70.0", + "version": "0.71.0", "private": true, "engines": { "node": ">=16.0.0" @@ -80,7 +80,7 @@ "react-color": "^2.19.3", "react-diff-viewer": "^3.1.1", "react-dom": "^18.2.0", - "react-dropzone": "^14.2.3", + "react-dropzone": "^11.7.1", "react-hook-form": "^7.32.0", "react-icons": "^4.4.0", "react-input-mask": "^2.0.4", diff --git a/src/components/Attachment/Attachment.tsx b/src/components/Attachment/Attachment.tsx index 860f23ec8..3e39da708 100644 --- a/src/components/Attachment/Attachment.tsx +++ b/src/components/Attachment/Attachment.tsx @@ -147,6 +147,16 @@ export const Attachment = forwardRef( message: `File is too big (${getReadableFileSize(file.size)})`, } } + + // Note: We do not current support this right now on the backend, but + // once we add support for it, we can remove this restriction. + if (file.name.endsWith(".jfif")) { + return { + code: "jfif-file-not-supported", + message: + "The JFIF file format is not supported, please convert to JPEG instead", + } + } return null }, [maxSize] diff --git a/src/components/MediaCreationModal/MediaCreationModal.tsx b/src/components/MediaCreationModal/MediaCreationModal.tsx index 0eaa97df8..03e8fde48 100644 --- a/src/components/MediaCreationModal/MediaCreationModal.tsx +++ b/src/components/MediaCreationModal/MediaCreationModal.tsx @@ -36,18 +36,16 @@ import { Dropzone } from "./components/Dropzone" type MediaSteps = "upload" | "progressing" | "success" | "failed" -const IMAGE_UPLOAD_ACCEPTED_MIME_TYPES = { - "image/jpeg": [".jpg", ".jpeg"], - "image/png": [".png"], - "image/gif": [".gif"], - "image/svg+xml": [".svg"], - "image/tiff": [".tiff", ".tif"], - "image/bmp": [".bmp"], -} +const IMAGE_UPLOAD_ACCEPTED_MIME_TYPES = [ + "image/jpeg", + "image/png", + "image/gif", + "image/svg+xml", + "image/tiff", + "image/bmp", +] -const FILE_UPLOAD_ACCEPTED_MIME_TYPES = { - "application/pdf": [".pdf"], -} +const FILE_UPLOAD_ACCEPTED_MIME_TYPES = ["application/pdf"] interface MediaDropzoneProps { fileRejections: FileRejection[]