mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 02:16:03 +00:00
chore: merge fixes
chore: fix lint
This commit is contained in:
parent
0654f395cd
commit
9a537e811b
File diff suppressed because one or more lines are too long
@ -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';
|
||||
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user