mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +00:00
first mark feedback
This commit is contained in:
parent
ee7520bfa0
commit
8babbcb31d
@ -121,7 +121,7 @@ describe('Marketplace page - plugins tab', () => {
|
||||
expect(noResult).toBeVisible();
|
||||
});
|
||||
|
||||
it('shows the installed text for installed plugins', async () => {
|
||||
it('shows the installed text for installed plugins', () => {
|
||||
// Plugin that's already installed
|
||||
const alreadyInstalledCard = screen
|
||||
.getAllByTestId('npm-package-card')
|
||||
|
@ -47,16 +47,16 @@ function useMarketplaceData({ npmPackageType, debouncedSearch, query, tabQuery }
|
||||
}
|
||||
);
|
||||
|
||||
const relevantResponse = npmPackageType === 'plugin' ? pluginsResponse : providersResponse;
|
||||
const relevantStatus = npmPackageType === 'plugin' ? pluginsStatus : providersStatus;
|
||||
const npmPackageTypeResponse = npmPackageType === 'plugin' ? pluginsResponse : providersResponse;
|
||||
const npmPackageTypeStatus = npmPackageType === 'plugin' ? pluginsStatus : providersStatus;
|
||||
|
||||
const [possibleCollections, setPossibleCollections] = useState({});
|
||||
const [possibleCategories, setPossibleCategories] = useState({});
|
||||
|
||||
// Keep possible filters up to date, but don't lose them while loading
|
||||
useEffect(() => {
|
||||
if (relevantStatus === 'success') {
|
||||
setPossibleCollections(relevantResponse.meta.collections);
|
||||
if (npmPackageTypeStatus === 'success') {
|
||||
setPossibleCollections(npmPackageTypeResponse.meta.collections);
|
||||
}
|
||||
|
||||
if (pluginsStatus === 'success') {
|
||||
@ -65,11 +65,11 @@ function useMarketplaceData({ npmPackageType, debouncedSearch, query, tabQuery }
|
||||
}, [
|
||||
pluginsResponse?.meta.categories,
|
||||
pluginsStatus,
|
||||
relevantResponse?.meta.collections,
|
||||
relevantStatus,
|
||||
npmPackageTypeResponse?.meta.collections,
|
||||
npmPackageTypeStatus,
|
||||
]);
|
||||
|
||||
const { pagination } = relevantStatus === 'success' ? relevantResponse.meta : {};
|
||||
const { pagination } = npmPackageTypeStatus === 'success' ? npmPackageTypeResponse.meta : {};
|
||||
|
||||
return {
|
||||
pluginsResponse,
|
||||
|
Loading…
x
Reference in New Issue
Block a user