chore: merge fixes

chore: fix lint
This commit is contained in:
Josh 2023-06-22 09:12:27 +01:00
parent 0654f395cd
commit 9a537e811b
6 changed files with 17 additions and 14 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,8 +1,8 @@
import * as React from 'react';
import { MemoryRouter } from 'react-router-dom';
import { useCMEditViewDataManager } from '@strapi/helper-plugin';
import { act, renderHook } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';
import useSelect from '../select';

View File

@ -1,8 +1,10 @@
import React from 'react';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { Dialog, DialogBody, DialogFooter, Flex, Typography, Button } from '@strapi/design-system';
import { ExclamationMarkCircle, Trash } from '@strapi/icons';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import InjectionZoneList from '../../../../components/InjectionZoneList';
import { getTrad } from '../../../../utils';

View File

@ -164,7 +164,12 @@ module.exports = {
return ctx.forbidden();
}
const entity = await entityManager.findOneWithCreatorRoles(id, model);
const permissionQuery = await permissionChecker.sanitizedQuery.create(ctx.query);
const populate = await getService('populate-builder')(model)
.populateFromQuery(permissionQuery)
.build();
const entity = await entityManager.findOne(id, model, { populate });
if (!entity) {
return ctx.notFound();

View File

@ -127,8 +127,8 @@ module.exports = ({ strapi }) => ({
},
async clone(entity, body, uid) {
const modelDef = strapi.getModel(uid);
const populate = await buildDeepPopulate(uid);
const publishData = { ...body };
const populateRelations = isRelationsPopulateEnabled(uid);
if (hasDraftAndPublish(modelDef)) {
publishData[PUBLISHED_AT_ATTRIBUTE] = null;
@ -136,15 +136,13 @@ module.exports = ({ strapi }) => ({
const params = {
data: publishData,
populate: populateRelations
? getDeepPopulate(uid, {})
: getDeepPopulate(uid, { countMany: true, countOne: true }),
populate,
};
const clonedEntity = await strapi.entityService.clone(uid, entity.id, params);
// If relations were populated, relations count will be returned instead of the array of relations.
if (populateRelations) {
if (isWebhooksPopulateRelationsEnabled(uid)) {
return getDeepRelationsCount(clonedEntity, uid);
}

View File

@ -149,7 +149,7 @@ describe('UploadAssetDialog', () => {
});
it('snapshots the component with 4 URLs: 3 valid and one in failure', async () => {
const { debug } = render();
render();
fireEvent.click(screen.getByText('From url'));
const urls = [
@ -201,8 +201,6 @@ describe('UploadAssetDialog', () => {
},
];
debug(undefined, 100000);
await waitFor(() =>
expect(
screen.getByText(