diff --git a/packages/core/admin/admin/src/hooks/useFetchMarketplacePlugins/utils/api.js b/packages/core/admin/admin/src/hooks/useFetchMarketplacePlugins/utils/api.js index 3bf33beac6a..cf7a8bb6815 100644 --- a/packages/core/admin/admin/src/hooks/useFetchMarketplacePlugins/utils/api.js +++ b/packages/core/admin/admin/src/hooks/useFetchMarketplacePlugins/utils/api.js @@ -4,18 +4,15 @@ import qs from 'qs'; const MARKETPLACE_API_URL = 'https://market-api.strapi.io'; const fetchMarketplacePlugins = async (params = {}) => { - const { data: response } = await axios.get(`${MARKETPLACE_API_URL}/plugins`, { + const { data } = await axios.get(`${MARKETPLACE_API_URL}/plugins`, { params, - paramsSerializer: (params) => qs.stringify(params), + paramsSerializer: { + encode: qs.parse, + serialize: qs.stringify, + }, }); - // Only keep v4 plugins - const filteredResponse = { - ...response, - data: response.data.filter((plugin) => plugin.attributes.strapiCompatibility === 'v4'), - }; - - return filteredResponse; + return data; }; export { fetchMarketplacePlugins }; diff --git a/packages/core/admin/admin/src/hooks/useFetchMarketplaceProviders/utils/api.js b/packages/core/admin/admin/src/hooks/useFetchMarketplaceProviders/utils/api.js index a95f2e18a72..9ef8ce886b2 100644 --- a/packages/core/admin/admin/src/hooks/useFetchMarketplaceProviders/utils/api.js +++ b/packages/core/admin/admin/src/hooks/useFetchMarketplaceProviders/utils/api.js @@ -6,7 +6,10 @@ const MARKETPLACE_API_URL = 'https://market-api.strapi.io'; const fetchMarketplaceProviders = async (params = {}) => { const { data } = await axios.get(`${MARKETPLACE_API_URL}/providers`, { params, - paramsSerializer: (params) => qs.stringify(params), + paramsSerializer: { + encode: qs.parse, + serialize: qs.stringify, + }, }); return data; diff --git a/packages/core/admin/admin/src/pages/MarketplacePage/tests/__snapshots__/index.test.js.snap b/packages/core/admin/admin/src/pages/MarketplacePage/tests/__snapshots__/index.test.js.snap index f7f904c04a4..f777067e759 100644 --- a/packages/core/admin/admin/src/pages/MarketplacePage/tests/__snapshots__/index.test.js.snap +++ b/packages/core/admin/admin/src/pages/MarketplacePage/tests/__snapshots__/index.test.js.snap @@ -602,6 +602,25 @@ exports[`Marketplace page - layout renders the online layout 1`] = ` border: none; } +.c38 { + position: absolute; + left: 0; + right: 0; + bottom: 0; + top: 0; + width: 100%; + background: transparent; + border: none; +} + +.c38:focus { + outline: none; +} + +.c38[aria-disabled='true'] { + cursor: not-allowed; +} + .c32 { border: none; border-radius: 4px; @@ -663,37 +682,6 @@ exports[`Marketplace page - layout renders the online layout 1`] = ` box-shadow: #4945ff 0px 0px 0px 2px; } -.c58 path { - fill: #666687; -} - -.c60 path { - fill: #f29d41; -} - -.c75 path { - fill: #328048; -} - -.c38 { - position: absolute; - left: 0; - right: 0; - bottom: 0; - top: 0; - width: 100%; - background: transparent; - border: none; -} - -.c38:focus { - outline: none; -} - -.c38[aria-disabled='true'] { - cursor: not-allowed; -} - .c37 { position: relative; border: 1px solid #dcdce4; @@ -780,6 +768,18 @@ exports[`Marketplace page - layout renders the online layout 1`] = ` box-shadow: #4945ff 0px 0px 0px 2px; } +.c58 path { + fill: #666687; +} + +.c60 path { + fill: #f29d41; +} + +.c75 path { + fill: #328048; +} + .c81 > * + * { margin-left: 4px; } @@ -2302,7 +2302,7 @@ exports[`Marketplace page - layout renders the online layout 1`] = ` class="c8 c41" id="select-13-content" > - 10 + 24 diff --git a/packages/core/admin/admin/src/pages/MarketplacePage/tests/mocks/plugins.js b/packages/core/admin/admin/src/pages/MarketplacePage/tests/mocks/plugins.js index 13e4d73607e..f584ceebd53 100644 --- a/packages/core/admin/admin/src/pages/MarketplacePage/tests/mocks/plugins.js +++ b/packages/core/admin/admin/src/pages/MarketplacePage/tests/mocks/plugins.js @@ -1,49 +1,5 @@ const plugins = { data: [ - { - id: 'recQHmaveQknjaIdv', - attributes: { - name: 'Cloudflare pages', - description: 'This plugin lets you easily trigger Cloudflare Pages builds from Strapi.', - slug: 'strapi-plugin-cloudflare-pages', - npmPackageName: 'strapi-plugin-cloudflare-pages', - npmPackageUrl: 'https://www.npmjs.com/package/strapi-plugin-cloudflare-pages', - repositoryUrl: 'https://github.com/sarhugo/strapi-plugin-cloudflare-pages', - logo: { - id: 'attzLRKpax5MIrMtq', - width: 160, - height: 160, - url: 'https://dl.airtable.com/.attachments/3e586bbcdd7dc2effc3770fd49506aa6/ddbb2540/cf-logo-v-rgb.jpg', - filename: 'cf-logo-v-rgb.jpg', - size: 25615, - type: 'image/jpeg', - thumbnails: { - small: { - url: 'https://dl.airtable.com/.attachmentThumbnails/aa98b52525fdeb5767cf554563a9df14/7a03d156', - width: 36, - height: 36, - }, - large: { - url: 'https://dl.airtable.com/.attachmentThumbnails/a0e91d3564a0f41d89799e352b06c8ee/3d45329e', - width: 160, - height: 160, - }, - full: { - url: 'https://dl.airtable.com/.attachmentThumbnails/20b4afecf2bf8bc081c54eae92a7f599/d1e10f39', - width: 3000, - height: 3000, - }, - }, - }, - developerName: 'Hugo Sarti', - validated: false, - madeByStrapi: false, - strapiCompatibility: 'v3', - strapiVersion: '^4.0.0', - githubStars: 23, - npmDownloads: 5623, - }, - }, { id: 'recWQXzTM5e6Friiq', attributes: { @@ -407,49 +363,6 @@ const plugins = { npmDownloads: 7492, }, }, - { - id: 'recqR0rWAw5gZHc1c', - attributes: { - name: 'Documentation v3', - description: 'Create an OpenAPI Document and visualize your API with SWAGGER UI', - slug: 'strapi-plugin-documentation', - npmPackageName: 'strapi-plugin-documentation', - npmPackageUrl: 'https://www.npmjs.com/package/strapi-plugin-documentation', - repositoryUrl: - 'https://github.com/strapi/strapi/tree/v3.6.9/packages/strapi-plugin-documentation', - logo: { - id: 'att22dETRlzkfVWAl', - width: 225, - height: 225, - url: 'https://dl.airtable.com/.attachments/b6998ac52e8b0460b8a14ced8074b788/2a4d4a90/swagger.png', - filename: 'swagger.png', - size: 6052, - type: 'image/png', - thumbnails: { - small: { - url: 'https://dl.airtable.com/.attachmentThumbnails/71a6b03e03a6b26647991a617478cdfa/8e1d8d2b', - width: 36, - height: 36, - }, - large: { - url: 'https://dl.airtable.com/.attachmentThumbnails/c249c4953d5bb0e2f58ed7174afecc2f/796dca09', - width: 225, - height: 225, - }, - full: { - url: 'https://dl.airtable.com/.attachmentThumbnails/4b7bc3a765f3927b9fcd12809ddf82a8/d3a4b97b', - width: 3000, - height: 3000, - }, - }, - }, - developerName: 'Strapi team', - validated: true, - madeByStrapi: false, - strapiCompatibility: 'v3', - strapiVersion: '^4.3.0', - }, - }, { id: 'rec5s49X99wA67Ubj', attributes: {