From 2522cd90e42bb0f44fffaff4cc1602e70c712aba Mon Sep 17 00:00:00 2001 From: JF-Cozy Date: Wed, 11 Dec 2024 16:35:15 +0100 Subject: [PATCH 1/2] feat: Upgrade packages BREAKING CHANGE: You must have `cozy-client >= 51.6.0` and `cozy-intent >= 2.29.1` --- package.json | 10 ++++----- react/Paywall/Paywall.spec.jsx | 8 +++---- yarn.lock | 39 +++++++++++++++++----------------- 3 files changed, 27 insertions(+), 30 deletions(-) diff --git a/package.json b/package.json index 6d06f7a76c..6b6c56f5f7 100644 --- a/package.json +++ b/package.json @@ -92,12 +92,12 @@ "browserslist-config-cozy": "0.4.0", "bundlemon": "3.1.0", "copyfiles": "2.4.1", - "cozy-client": "^48.8.0", + "cozy-client": "^51.6.0", "cozy-device-helper": "2.0.0", "cozy-flags": "^2.10.1", - "cozy-intent": "1.16.1", + "cozy-intent": "^2.29.1", "cozy-logger": "^1.9.0", - "cozy-stack-client": "^47.4.0", + "cozy-stack-client": "^51.6.0", "css-loader": "0.28.11", "cssnano": "4.1.11", "cssnano-preset-advanced": "4.0.8", @@ -181,9 +181,9 @@ "rooks": "^5.11.2" }, "peerDependencies": { - "cozy-client": ">=48.8.0", + "cozy-client": ">=51.6.0", "cozy-device-helper": "^2.0.0", - "cozy-intent": ">=1.3.0", + "cozy-intent": ">=2.29.1", "react": "^16.8.6", "react-dom": "^16.8.6" }, diff --git a/react/Paywall/Paywall.spec.jsx b/react/Paywall/Paywall.spec.jsx index 9fbfd144cb..4e4f749657 100644 --- a/react/Paywall/Paywall.spec.jsx +++ b/react/Paywall/Paywall.spec.jsx @@ -42,15 +42,13 @@ describe('Paywall', () => { useInstanceInfo.mockReturnValue({ context: { data: { - attributes: { - enable_premium_links: enablePremiumLinks, - manager_url: 'http://mycozy.cloud' - } + enable_premium_links: enablePremiumLinks, + manager_url: 'http://mycozy.cloud' } }, instance: { data: { - attributes: { uuid: hasUuid ? '123' : null } + uuid: hasUuid ? '123' : null } }, isLoaded: true diff --git a/yarn.lock b/yarn.lock index cc901006e9..39ca64c0cb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5969,16 +5969,16 @@ cosmiconfig@^8.3.6: parse-json "^5.2.0" path-type "^4.0.0" -cozy-client@^48.8.0: - version "48.8.0" - resolved "https://registry.yarnpkg.com/cozy-client/-/cozy-client-48.8.0.tgz#66bfe0d1866013080ca39083faf6dd0d59548c33" - integrity sha512-o/TmAlgn0xbdxrV928eVYtORE1g0Xykx32LeT83iQaRe26F4mnz4WVpcwizNH1zV7OTue8LNhLHPHZypCO23AQ== +cozy-client@^51.6.0: + version "51.6.0" + resolved "https://registry.yarnpkg.com/cozy-client/-/cozy-client-51.6.0.tgz#22f77a40f316011d8e8a298cc9d4cbc7cfdbbcc0" + integrity sha512-H0jhhju5jhoQHCiPZB2tfoRZb4QrhxfArNTRwLs5Lsd3+5WmtaSnPgbQUTBHWPRCv7qxP89Spz7eSgDmpdzA5Q== dependencies: "@cozy/minilog" "1.0.0" "@types/jest" "^26.0.20" "@types/lodash" "^4.14.170" btoa "^1.2.1" - cozy-stack-client "^48.6.0" + cozy-stack-client "^51.6.0" date-fns "2.29.3" json-stable-stringify "^1.0.1" lodash "^4.17.13" @@ -6008,11 +6008,12 @@ cozy-flags@^2.10.1: dependencies: microee "^0.0.6" -cozy-intent@1.16.1: - version "1.16.1" - resolved "https://registry.yarnpkg.com/cozy-intent/-/cozy-intent-1.16.1.tgz#ec75d4eff6db966998b6881580319134c9aec7bd" - integrity sha512-5Gl9a+kYicX1xV4s0P3BdAOwfjgrRvTubRKvT2EVIT7rwK0puPwQDidLFf3bbPtdJAtwjdWh/OHEuQ0HqK1gTw== +cozy-intent@^2.29.1: + version "2.29.1" + resolved "https://registry.yarnpkg.com/cozy-intent/-/cozy-intent-2.29.1.tgz#929d6dfe1e7d619ed5d62447483c5899914b04ed" + integrity sha512-Es+7WkPU+mkrMM1RDjuVXZqWeXEYXo0xLZinEBJIYyTrz/gopLLztHcrjfL4bglKqAt9XTdDxrT1KxsenDd1bw== dependencies: + cozy-minilog "^3.9.1" post-me "0.4.5" cozy-interapp@^0.5.4: @@ -6028,19 +6029,17 @@ cozy-logger@^1.9.0: chalk "^2.4.2" json-stringify-safe "5.0.1" -cozy-stack-client@^47.4.0: - version "47.4.0" - resolved "https://registry.yarnpkg.com/cozy-stack-client/-/cozy-stack-client-47.4.0.tgz#db58f19ecc1f3a4100d24648ca9f87a4a825b6fe" - integrity sha512-hwk//fVrM05GZmRodYTQel7tvpK+NZ6gDn1gkpYmjaLvG8hN24PskeWr5+a6iBNzlO1FtDh7qQ1/jU5vw7v6zg== +cozy-minilog@^3.9.1: + version "3.9.1" + resolved "https://registry.yarnpkg.com/cozy-minilog/-/cozy-minilog-3.9.1.tgz#8a89743664145da7b1808d78cc53daacaa97e758" + integrity sha512-UwtNfRWKIWpNA4NK2MovPvUalijmYpFk726r1zxLlMixRTBtHTqVZtEcDF+3PrE5o5UiUAUC8Z+MWiz3ivstbw== dependencies: - detect-node "^2.0.4" - mime "^2.4.0" - qs "^6.7.0" + microee "0.0.6" -cozy-stack-client@^48.6.0: - version "48.6.0" - resolved "https://registry.yarnpkg.com/cozy-stack-client/-/cozy-stack-client-48.6.0.tgz#c2d2697fcc9061c87425a2f9abc69aff41a94882" - integrity sha512-pYrGc1ZWJPWZ2jshBb+IRvGHl8ByHcRCqkgSaAsEzcrlrZzxPWnkSAVekZrPbSDx+Pwg2UE/d8puCF+wEtk+6w== +cozy-stack-client@^51.6.0: + version "51.6.0" + resolved "https://registry.yarnpkg.com/cozy-stack-client/-/cozy-stack-client-51.6.0.tgz#bd81605bdd1e68161d1143856f78bca969086575" + integrity sha512-MRBTKtBtQ6jnmS4ij+nYjgeOecSNr9Z9kCNDlKW9884JxnI4VGfpq1w+ihN3EVh3EyqD98vnaQZ8VuYr6czeVQ== dependencies: detect-node "^2.0.4" mime "^2.4.0" From 8b249344ecde141a94936d95e8da74605be4c1f8 Mon Sep 17 00:00:00 2001 From: JF-Cozy Date: Wed, 11 Dec 2024 16:29:41 +0100 Subject: [PATCH 2/2] feat: Add QualificationModal component --- docs/styleguide.config.js | 1 + react/QualificationModal/Readme.md | 28 +++++++ react/QualificationModal/index.jsx | 94 ++++++++++++++++++++++ react/QualificationModal/locales/en.json | 5 ++ react/QualificationModal/locales/fr.json | 5 ++ react/QualificationModal/locales/index.jsx | 7 ++ react/index.js | 2 + 7 files changed, 142 insertions(+) create mode 100644 react/QualificationModal/Readme.md create mode 100644 react/QualificationModal/index.jsx create mode 100644 react/QualificationModal/locales/en.json create mode 100644 react/QualificationModal/locales/fr.json create mode 100644 react/QualificationModal/locales/index.jsx diff --git a/docs/styleguide.config.js b/docs/styleguide.config.js index 933530fe5b..ee4c491b6c 100644 --- a/docs/styleguide.config.js +++ b/docs/styleguide.config.js @@ -96,6 +96,7 @@ module.exports = { '../react/QualificationGrid', '../react/QualificationIconStack', '../react/QualificationItem', + '../react/QualificationModal', '../react/UploadQueue' ] }, diff --git a/react/QualificationModal/Readme.md b/react/QualificationModal/Readme.md new file mode 100644 index 0000000000..d4b47ed14d --- /dev/null +++ b/react/QualificationModal/Readme.md @@ -0,0 +1,28 @@ +```jsx +import DemoProvider from 'cozy-ui/docs/components/DemoProvider' +import QualificationModal from 'cozy-ui/transpiled/react/QualificationModal' +import Typography from 'cozy-ui/transpiled/react/Typography' +import CloudIcon from 'cozy-ui/transpiled/react/Icons/Cloud' +import FormControlLabel from 'cozy-ui/transpiled/react/FormControlLabel' +import RadioGroup from 'cozy-ui/transpiled/react/RadioGroup' +import Radio from 'cozy-ui/transpiled/react/Radios' +import FormControl from 'cozy-ui/transpiled/react/FormControl' +import Button from 'cozy-ui/transpiled/react/Buttons' + +initialState = { show: isTesting() ? true : false } + +const show = () => setState({show: true}) +const hide = () => setState({show: false}) + +; + + ({ updateMetadataAttribute: () => {}}) }}> +