@@ -3770,7 +3796,7 @@ exports[`Marketplace page renders and matches the provider tab snapshot 1`] = `
Sendmail
diff --git a/packages/core/admin/admin/src/pages/MarketplacePage/tests/index.test.js b/packages/core/admin/admin/src/pages/MarketplacePage/tests/index.test.js
index 99413b5ba5..a12c8df85b 100644
--- a/packages/core/admin/admin/src/pages/MarketplacePage/tests/index.test.js
+++ b/packages/core/admin/admin/src/pages/MarketplacePage/tests/index.test.js
@@ -8,6 +8,7 @@ import {
screen,
getByText,
queryByText,
+ getByRole,
} from '@testing-library/react';
import { IntlProvider } from 'react-intl';
import { QueryClient, QueryClientProvider } from 'react-query';
@@ -35,6 +36,7 @@ jest.mock('@strapi/helper-plugin', () => ({
'@strapi/plugin-documentation': '4.2.0',
'@strapi/provider-upload-cloudinary': '4.2.0',
},
+ strapiVersion: '4.1.0',
useYarn: true,
})),
}));
@@ -215,7 +217,7 @@ describe('Marketplace page', () => {
expect(pluginCardText).toEqual(null);
});
- it('shows the installed text for installed plugins', async () => {
+ it('shows the installed text for installed plugins', () => {
render(App);
const pluginsTab = screen.getByRole('tab', { name: /plugins/i });
fireEvent.click(pluginsTab);
@@ -235,7 +237,7 @@ describe('Marketplace page', () => {
expect(notInstalledText).toBeVisible();
});
- it('shows the installed text for installed providers', async () => {
+ it('shows the installed text for installed providers', () => {
// Open providers tab
render(App);
const providersTab = screen.getByRole('tab', { name: /providers/i });
@@ -255,4 +257,38 @@ describe('Marketplace page', () => {
const notInstalledText = queryByText(notInstalledCard, /copy install command/i);
expect(notInstalledText).toBeVisible();
});
+
+ it('disables the button and shows compatibility tooltip message when version provided', async () => {
+ const { getByTestId } = render(App);
+ const alreadyInstalledCard = screen
+ .getAllByTestId('npm-package-card')
+ .find((div) => div.innerHTML.includes('Transformer'));
+ const button = getByRole(alreadyInstalledCard, 'button', { name: /copy install command/i });
+ const tooltip = getByTestId(`tooltip-Transformer`);
+ fireEvent.mouseOver(button);
+ await waitFor(() => {
+ expect(tooltip).toBeVisible();
+ });
+ expect(button).toBeDisabled();
+ expect(tooltip).toBeInTheDocument();
+ expect(tooltip).toHaveTextContent('Update your Strapi version: "4.1.0" to: "4.0.7"');
+ });
+
+ it('shows compatibility tooltip message when no version provided', async () => {
+ const { getByTestId } = render(App);
+ const alreadyInstalledCard = screen
+ .getAllByTestId('npm-package-card')
+ .find((div) => div.innerHTML.includes('Config Sync'));
+ const button = getByRole(alreadyInstalledCard, 'button', { name: /copy install command/i });
+ const tooltip = getByTestId(`tooltip-Config Sync`);
+ fireEvent.mouseOver(button);
+ await waitFor(() => {
+ expect(tooltip).toBeVisible();
+ });
+ expect(button).not.toBeDisabled();
+ expect(tooltip).toBeInTheDocument();
+ expect(tooltip).toHaveTextContent(
+ 'Unable to verify compatibility with your Strapi version: "4.1.0"'
+ );
+ });
});
diff --git a/packages/core/admin/admin/src/pages/MarketplacePage/tests/server.js b/packages/core/admin/admin/src/pages/MarketplacePage/tests/server.js
index d5f59d1eec..6e87ef6eb7 100644
--- a/packages/core/admin/admin/src/pages/MarketplacePage/tests/server.js
+++ b/packages/core/admin/admin/src/pages/MarketplacePage/tests/server.js
@@ -48,6 +48,7 @@ const handlers = [
validated: false,
madeByStrapi: false,
strapiCompatibility: 'v3',
+ strapiVersion: '^4.0.0',
},
},
{
@@ -221,6 +222,7 @@ const handlers = [
validated: false,
madeByStrapi: false,
strapiCompatibility: 'v4',
+ strapiVersion: '4.x.x',
},
},
{
@@ -291,6 +293,7 @@ const handlers = [
validated: true,
madeByStrapi: false,
strapiCompatibility: 'v4',
+ strapiVersion: 'Contact developer',
},
},
{
@@ -362,6 +365,7 @@ const handlers = [
validated: false,
madeByStrapi: false,
strapiCompatibility: 'v4',
+ strapiVersion: '^3.4.2',
},
},
{
@@ -404,6 +408,7 @@ const handlers = [
validated: true,
madeByStrapi: true,
strapiCompatibility: 'v4',
+ strapiVersion: '^4.0.7',
},
},
{
@@ -446,6 +451,7 @@ const handlers = [
validated: true,
madeByStrapi: false,
strapiCompatibility: 'v3',
+ strapiVersion: '^4.3.0',
},
},
{
@@ -488,6 +494,7 @@ const handlers = [
validated: false,
madeByStrapi: false,
strapiCompatibility: 'v4',
+ strapiVersion: '4.0.7',
},
},
],
diff --git a/packages/core/admin/admin/src/translations/en.json b/packages/core/admin/admin/src/translations/en.json
index 52320dfbe3..128dff946d 100644
--- a/packages/core/admin/admin/src/translations/en.json
+++ b/packages/core/admin/admin/src/translations/en.json
@@ -100,11 +100,11 @@
"Settings.apiTokens.duration.30-days": "30 days",
"Settings.apiTokens.duration.90-days": "90 days",
"Settings.apiTokens.duration.unlimited": "Unlimited",
- "Settings.apiTokens.form.duration":"Token duration",
- "Settings.apiTokens.form.type":"Token type",
- "Settings.apiTokens.duration.expiration-date":"Expiration date",
- "Settings.apiTokens.createPage.permissions.title":"Permissions",
- "Settings.apiTokens.createPage.permissions.description":"Only actions bound by a route are listed below.",
+ "Settings.apiTokens.form.duration": "Token duration",
+ "Settings.apiTokens.form.type": "Token type",
+ "Settings.apiTokens.duration.expiration-date": "Expiration date",
+ "Settings.apiTokens.createPage.permissions.title": "Permissions",
+ "Settings.apiTokens.createPage.permissions.description": "Only actions bound by a route are listed below.",
"Settings.apiTokens.RegenerateDialog.title": "Regenerate token",
"Settings.apiTokens.popUpWarning.message": "Are you sure you want to regenerate this token?",
"Settings.apiTokens.Button.cancel": "Cancel",
@@ -270,6 +270,8 @@
"admin.pages.MarketPlacePage.plugin.installed": "Installed",
"admin.pages.MarketPlacePage.plugin.tooltip.madeByStrapi": "Made by Strapi",
"admin.pages.MarketPlacePage.plugin.tooltip.verified": "Plugin verified by Strapi",
+ "admin.pages.MarketPlacePage.plugin.version": "Update your Strapi version: \"{strapiAppVersion}\" to: \"{versionRange}\"",
+ "admin.pages.MarketPlacePage.plugin.version.null": "Unable to verify compatibility with your Strapi version: \"{strapiAppVersion}\"",
"admin.pages.MarketPlacePage.providers": "Providers",
"admin.pages.MarketPlacePage.search.clear": "Clear the search",
"admin.pages.MarketPlacePage.search.empty": "No result for \"{target}\"",
diff --git a/packages/core/admin/package.json b/packages/core/admin/package.json
index 42c3018c03..616e1ac22d 100644
--- a/packages/core/admin/package.json
+++ b/packages/core/admin/package.json
@@ -164,4 +164,4 @@
}
}
}
-}
+}
\ No newline at end of file
diff --git a/packages/generators/app/lib/resources/dot-files/common/gitignore b/packages/generators/app/lib/resources/dot-files/common/gitignore
index 8e339ee395..2ed5eafd63 100644
--- a/packages/generators/app/lib/resources/dot-files/common/gitignore
+++ b/packages/generators/app/lib/resources/dot-files/common/gitignore
@@ -110,5 +110,6 @@ coverage
license.txt
exports
*.cache
+dist
build
.strapi-updater.json