strapi/tests/api/core/content-manager/index.test.api.js

1045 lines
29 KiB
JavaScript
Raw Normal View History

'use strict';
2022-09-07 15:40:35 +02:00
const { isEmpty } = require('lodash/fp');
const { createTestBuilder } = require('api-tests/builder');
const { createStrapiInstance } = require('api-tests/strapi');
const form = require('api-tests/generators');
const { createAuthRequest } = require('api-tests/request');
2019-03-09 01:06:39 +01:00
2022-08-08 23:33:39 +02:00
const cleanDate = (entry) => {
2019-03-09 01:06:39 +01:00
delete entry.updatedAt;
delete entry.createdAt;
};
const builder = createTestBuilder();
let strapi;
2019-03-09 01:06:39 +01:00
let data;
let rq;
2022-09-07 15:40:35 +02:00
const getRelations = async (modelName, field, id) => {
const res = await rq({
method: 'GET',
url: `/content-manager/relations/api::${modelName}.${modelName}/${id}/${field}`,
2022-09-07 15:40:35 +02:00
});
return res.body;
2022-09-07 15:40:35 +02:00
};
const deleteFixtures = async () => {
for (const [name, modelName] of [
['references', 'reference'],
['tags', 'tag'],
['categories', 'category'],
['articles', 'article'],
['articlesWithTag', 'articlewithtag'],
]) {
2021-08-06 18:09:49 +02:00
const uid = `api::${modelName}.${modelName}`;
2021-08-11 09:34:55 +02:00
if (data[name] && data[name].length > 0) {
await rq({
method: 'POST',
url: `/content-manager/collection-types/${uid}/actions/bulkDelete`,
body: {
ids: (data[name] || []).map(({ id }) => id),
},
});
}
}
};
describe('Relations', () => {
2019-03-09 01:06:39 +01:00
beforeAll(async () => {
await builder
.addContentTypes(
[form.article, form.tag, form.category, form.reference, form.articlewithtag],
{ batch: true }
)
.build();
strapi = await createStrapiInstance();
rq = await createAuthRequest({ strapi });
});
2019-03-09 01:06:39 +01:00
afterAll(async () => {
await strapi.destroy();
await builder.cleanup();
});
2019-03-09 01:06:39 +01:00
describe('Test manyToMany relation (article - tag) with Content Manager', () => {
beforeAll(async () => {
data = {
articles: [],
tags: [],
};
});
afterAll(async () => {
await deleteFixtures();
});
2019-03-09 01:06:39 +01:00
test('Create tag1', async () => {
2022-08-08 15:50:34 +02:00
const { body } = await rq({
2021-08-06 18:09:49 +02:00
url: '/content-manager/collection-types/api::tag.tag',
2019-03-09 01:06:39 +01:00
method: 'POST',
body: {
2019-03-09 01:06:39 +01:00
name: 'tag1',
},
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
data.tags.push(body.data);
2019-03-09 01:06:39 +01:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(body.data.documentId).toBeDefined();
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.name).toBe('tag1');
expect(body.data.createdBy).toMatchObject({
2021-11-25 09:09:13 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.updatedBy).toMatchObject({
2021-11-25 09:09:13 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.publishedAt).toBeDefined();
2019-03-09 01:06:39 +01:00
});
test('Create tag2', async () => {
2022-08-08 15:50:34 +02:00
const { body } = await rq({
2021-08-06 18:09:49 +02:00
url: '/content-manager/collection-types/api::tag.tag',
2019-03-09 01:06:39 +01:00
method: 'POST',
body: {
2019-03-09 01:06:39 +01:00
name: 'tag2',
},
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
data.tags.push(body.data);
2019-03-09 01:06:39 +01:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(body.data.documentId).toBeDefined();
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.name).toBe('tag2');
expect(body.data.createdBy).toMatchObject({
2021-11-25 09:09:13 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.updatedBy).toMatchObject({
2021-11-25 09:09:13 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.publishedAt).toBeDefined();
2019-03-09 01:06:39 +01:00
});
test('Create tag3', async () => {
2022-08-08 15:50:34 +02:00
const { body } = await rq({
2021-08-06 18:09:49 +02:00
url: '/content-manager/collection-types/api::tag.tag',
2019-03-09 01:06:39 +01:00
method: 'POST',
body: {
2019-03-09 01:06:39 +01:00
name: 'tag3',
},
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
data.tags.push(body.data);
2019-03-09 01:06:39 +01:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(body.data.documentId).toBeDefined();
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.name).toBe('tag3');
expect(body.data.createdBy).toMatchObject({
2021-11-25 09:09:13 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.updatedBy).toMatchObject({
2021-11-25 09:09:13 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.publishedAt).toBeDefined();
2019-03-09 01:06:39 +01:00
});
test('Create article1 without relation', async () => {
const entry = {
title: 'Article 1',
content: 'My super content 1',
2022-09-01 11:05:18 +02:00
date: '2019-08-13',
2019-03-09 01:06:39 +01:00
};
2022-08-08 15:50:34 +02:00
const { body } = await rq({
2021-08-06 18:09:49 +02:00
url: '/content-manager/collection-types/api::article.article',
2019-03-09 01:06:39 +01:00
method: 'POST',
body: entry,
2019-03-09 01:06:39 +01:00
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
data.articles.push(body.data);
2019-03-09 01:06:39 +01:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(body.data.documentId).toBeDefined();
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.title).toBe(entry.title);
expect(body.data.content).toBe(entry.content);
expect(body.data.createdBy).toMatchObject({
2021-11-25 09:09:13 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.updatedBy).toMatchObject({
2021-11-25 09:09:13 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.publishedAt).toBeDefined();
2022-09-07 15:40:35 +02:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
const tags = (await getRelations('article', 'tags', body.data.documentId)).results;
2022-09-07 15:40:35 +02:00
expect(tags.length).toBe(0);
2019-03-09 01:06:39 +01:00
});
test('Create article2 with tag1', async () => {
const entry = {
title: 'Article 2',
content: 'Content 2',
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
tags: [data.tags[0].documentId],
2019-03-09 01:06:39 +01:00
};
2022-08-08 15:50:34 +02:00
const { body } = await rq({
2021-08-06 18:09:49 +02:00
url: '/content-manager/collection-types/api::article.article',
2019-03-09 01:06:39 +01:00
method: 'POST',
body: entry,
2019-03-09 01:06:39 +01:00
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
data.articles.push(body.data);
2019-03-09 01:06:39 +01:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(body.data.documentId).toBeDefined();
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.title).toBe(entry.title);
expect(body.data.content).toBe(entry.content);
expect(body.data.createdBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.updatedBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.publishedAt).toBeDefined();
2022-09-07 15:40:35 +02:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
const tags = (await getRelations('article', 'tags', body.data.documentId)).results;
2022-09-07 15:40:35 +02:00
expect(tags.length).toBe(1);
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(tags[0].documentId).toBe(data.tags[0].documentId);
2019-03-09 01:06:39 +01:00
});
test('Update article1 add tag2', async () => {
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
const entry = { ...data.articles[0], tags: [data.tags[1].documentId] };
2019-03-09 01:06:39 +01:00
cleanDate(entry);
2022-08-08 15:50:34 +02:00
const { body } = await rq({
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
url: `/content-manager/collection-types/api::article.article/${entry.documentId}`,
2019-03-09 01:06:39 +01:00
method: 'PUT',
body: entry,
2019-03-09 01:06:39 +01:00
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
data.articles[0] = body.data;
2019-03-09 01:06:39 +01:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(body.data.documentId).toBeDefined();
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.title).toBe(entry.title);
expect(body.data.content).toBe(entry.content);
expect(body.data.createdBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.updatedBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.publishedAt).toBeDefined();
2022-09-07 15:40:35 +02:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
const tags = (await getRelations('article', 'tags', body.data.documentId)).results;
2022-09-07 15:40:35 +02:00
expect(tags.length).toBe(1);
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(tags[0].documentId).toBe(data.tags[1].documentId);
2019-03-09 01:06:39 +01:00
});
test('Update article1 add tag1 and tag3', async () => {
2022-08-08 15:50:34 +02:00
const { body } = await rq({
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
url: `/content-manager/collection-types/api::article.article/${data.articles[0].documentId}`,
2019-03-09 01:06:39 +01:00
method: 'PUT',
2022-09-07 15:40:35 +02:00
body: {
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
tags: [data.tags[0].documentId, data.tags[1].documentId, data.tags[2].documentId],
2022-09-07 15:40:35 +02:00
},
2019-03-09 01:06:39 +01:00
});
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(body.data.documentId).toBeDefined();
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.title).toBe(data.articles[0].title);
expect(body.data.content).toBe(data.articles[0].content);
expect(body.data.createdBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.updatedBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.publishedAt).toBeDefined();
2022-09-07 15:40:35 +02:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
const tags = (await getRelations('article', 'tags', body.data.documentId)).results;
2022-09-07 15:40:35 +02:00
expect(tags.length).toBe(3);
2019-03-09 01:06:39 +01:00
});
test('Update article1 remove one tag', async () => {
2022-08-08 15:50:34 +02:00
const { body } = await rq({
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
url: `/content-manager/collection-types/api::article.article/${data.articles[0].documentId}`,
2019-03-09 01:06:39 +01:00
method: 'PUT',
2022-09-07 15:40:35 +02:00
body: {
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
tags: [data.tags[1].documentId, data.tags[2].documentId],
2022-09-07 15:40:35 +02:00
},
2019-03-09 01:06:39 +01:00
});
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(body.data.documentId).toBeDefined();
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.title).toBe(data.articles[0].title);
expect(body.data.content).toBe(data.articles[0].content);
expect(body.data.createdBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.updatedBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.publishedAt).toBeDefined();
2022-09-07 15:40:35 +02:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
const tags = (await getRelations('article', 'tags', body.data.documentId)).results;
2022-09-07 15:40:35 +02:00
expect(tags.length).toBe(2);
2019-03-09 01:06:39 +01:00
});
test('Update article1 remove all tag', async () => {
2022-08-08 15:50:34 +02:00
const entry = { ...data.articles[0], tags: [] };
2019-03-09 01:06:39 +01:00
cleanDate(entry);
2022-08-08 15:50:34 +02:00
const { body } = await rq({
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
url: `/content-manager/collection-types/api::article.article/${entry.documentId}`,
2019-03-09 01:06:39 +01:00
method: 'PUT',
body: entry,
2019-03-09 01:06:39 +01:00
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
data.articles[0] = body.data;
2019-03-09 01:06:39 +01:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(body.data.documentId).toBeDefined();
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.title).toBe(entry.title);
expect(body.data.content).toBe(entry.content);
expect(body.data.createdBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.updatedBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.publishedAt).toBeDefined();
2022-09-07 15:40:35 +02:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
const tags = (await getRelations('article', 'tags', body.data.documentId)).results;
2022-09-07 15:40:35 +02:00
expect(tags.length).toBe(0);
});
test('Delete all articles should remove the association from all tags related to them', async () => {
// Create a tag
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
const {
body: { data: createdTag },
} = await rq({
2021-08-06 18:09:49 +02:00
url: '/content-manager/collection-types/api::tag.tag',
2019-03-09 01:06:39 +01:00
method: 'POST',
body: {
2019-03-09 01:06:39 +01:00
name: 'tag11',
},
});
// Create the first article associated with the created tag
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
const {
body: { data: article12 },
} = await rq({
2021-08-06 18:09:49 +02:00
url: '/content-manager/collection-types/api::article.article',
2019-03-09 01:06:39 +01:00
method: 'POST',
body: {
2019-03-09 01:06:39 +01:00
title: 'article12',
content: 'Content',
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
tags: [createdTag.documentId],
2019-03-09 01:06:39 +01:00
},
});
// Retrieve the updated tag to ensure it has the association
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
const {
body: { data: updatedTag },
} = await rq({
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
url: `/content-manager/collection-types/api::tag.tag/${createdTag.documentId}`,
2019-03-12 11:58:30 +01:00
method: 'GET',
});
// Create a second article associated with the same tag
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
const {
body: { data: article13 },
} = await rq({
2021-08-06 18:09:49 +02:00
url: '/content-manager/collection-types/api::article.article',
2019-03-09 01:06:39 +01:00
method: 'POST',
body: {
2019-03-09 01:06:39 +01:00
title: 'article13',
content: 'Content',
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
tags: [updatedTag.documentId],
2019-03-09 01:06:39 +01:00
},
});
// Retrieve the tag again to validate that it is associated with both articles
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
const {
body: { data: foundTag },
} = await rq({
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
url: `/content-manager/collection-types/api::tag.tag/${createdTag.documentId}`,
2019-03-09 01:06:39 +01:00
method: 'GET',
});
// Assert that the tag is linked to both articles
2022-08-26 10:41:31 +02:00
expect(foundTag.articles.count).toBe(2);
2019-03-09 01:06:39 +01:00
// Bulk delete both articles using their document IDs
const bulkDelete = await rq({
2021-08-06 18:09:49 +02:00
url: '/content-manager/collection-types/api::article.article/actions/bulkDelete',
method: 'POST',
body: {
documentIds: [article12.documentId, article13.documentId],
},
2019-03-09 01:06:39 +01:00
});
expect(bulkDelete.status).toBe(200);
// Retrieve the tag again to check that no articles are associated with it
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
const {
body: { data: foundTag2 },
} = await rq({
url: `/content-manager/collection-types/api::tag.tag/${createdTag.documentId}?populate=articles`,
2019-03-09 01:06:39 +01:00
method: 'GET',
});
// Expect that the tag has no associated articles after the bulk delete
2022-08-26 10:41:31 +02:00
expect(foundTag2.articles.count).toBe(0);
2019-03-09 01:06:39 +01:00
});
test('Bulk delete with some known and some unknown should delete and return SUCCESS', async () => {
const {
body: { data: article12 },
} = await rq({
url: '/content-manager/collection-types/api::article.article',
method: 'POST',
body: {
title: 'article12',
content: 'Content',
tags: [],
},
});
const bulkDelete = await rq({
url: '/content-manager/collection-types/api::article.article/actions/bulkDelete',
method: 'POST',
body: {
documentIds: [article12.documentId, 9999999],
},
});
expect(bulkDelete.status).toBe(200);
expect(bulkDelete.body.count).toBe(1);
// article has been deleted
const article = await rq({
url: `/content-manager/collection-types/api::article.article/${article12.documentId}`,
method: 'GET',
});
expect(article.status).toBe(404);
});
test('Bulk delete of entirely unknown entries should return a NOT FOUND', async () => {
const bulkDelete = await rq({
url: '/content-manager/collection-types/api::article.article/actions/bulkDelete',
method: 'POST',
body: {
documentIds: [9999999],
},
});
expect(bulkDelete.status).toBe(404);
});
2019-03-09 01:06:39 +01:00
});
2019-07-08 17:34:56 +02:00
describe('Test manyWay articlesWithTags and tags', () => {
beforeAll(() => {
data = {
tags: [],
articlesWithTag: [],
};
});
afterAll(async () => {
await deleteFixtures();
});
2019-07-08 17:34:56 +02:00
test('Creating an article with some many way tags', async () => {
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
const {
body: { data: createdTag },
} = await rq({
2021-08-06 18:09:49 +02:00
url: '/content-manager/collection-types/api::tag.tag',
method: 'POST',
body: {
name: 'tag11',
},
});
data.tags.push(createdTag);
2019-07-08 17:34:56 +02:00
const entry = {
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
tags: [createdTag.documentId],
2019-07-08 17:34:56 +02:00
};
2022-08-08 15:50:34 +02:00
const { body } = await rq({
2021-08-06 18:09:49 +02:00
url: '/content-manager/collection-types/api::articlewithtag.articlewithtag',
2019-07-08 17:34:56 +02:00
method: 'POST',
body: entry,
2019-07-08 17:34:56 +02:00
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
data.articlesWithTag.push(body.data);
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(body.data.documentId).toBeDefined();
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.createdBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.updatedBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
2022-09-07 15:40:35 +02:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
const tags = (await getRelations('articlewithtag', 'tags', body.data.documentId)).results;
2022-09-07 15:40:35 +02:00
expect(tags.length).toBe(1);
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(tags[0].documentId).toBe(data.tags[0].documentId);
2019-07-08 17:34:56 +02:00
});
});
2019-03-09 01:06:39 +01:00
describe('Test oneToMany - manyToOne relation (article - category) with Content Manager', () => {
beforeAll(() => {
data = {
articles: [],
categories: [],
};
});
afterAll(async () => {
await deleteFixtures();
});
2019-03-09 01:06:39 +01:00
test('Create cat1', async () => {
2022-08-08 15:50:34 +02:00
const { body } = await rq({
2021-08-06 18:09:49 +02:00
url: '/content-manager/collection-types/api::category.category',
2019-03-09 01:06:39 +01:00
method: 'POST',
body: {
2019-03-09 01:06:39 +01:00
name: 'cat1',
},
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
data.categories.push(body.data);
2019-03-09 01:06:39 +01:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(body.data.documentId).toBeDefined();
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.name).toBe('cat1');
expect(body.data.createdBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.updatedBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.publishedAt).toBeDefined();
2022-09-07 15:40:35 +02:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
const articles = (await getRelations('category', 'articles', body.data.documentId)).results;
2022-09-07 15:40:35 +02:00
expect(articles.length).toBe(0);
2019-03-09 01:06:39 +01:00
});
test('Create cat2', async () => {
2022-08-08 15:50:34 +02:00
const { body } = await rq({
2021-08-06 18:09:49 +02:00
url: '/content-manager/collection-types/api::category.category',
2019-03-09 01:06:39 +01:00
method: 'POST',
body: {
2019-03-09 01:06:39 +01:00
name: 'cat2',
},
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
data.categories.push(body.data);
2019-03-09 01:06:39 +01:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(body.data.documentId).toBeDefined();
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.name).toBe('cat2');
expect(body.data.createdBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.updatedBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.publishedAt).toBeDefined();
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
const articles = (await getRelations('category', 'articles', body.data.documentId)).results;
2022-09-07 15:40:35 +02:00
expect(articles.length).toBe(0);
2019-03-09 01:06:39 +01:00
});
test('Create article1 with cat1', async () => {
const entry = {
title: 'Article 1',
content: 'Content 1',
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
category: data.categories[0].documentId,
2019-03-09 01:06:39 +01:00
};
2022-08-08 15:50:34 +02:00
const { body } = await rq({
2021-08-06 18:09:49 +02:00
url: '/content-manager/collection-types/api::article.article',
2019-03-09 01:06:39 +01:00
method: 'POST',
body: entry,
2019-03-09 01:06:39 +01:00
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
data.articles.push(body.data);
2019-03-09 01:06:39 +01:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(body.data.documentId).toBeDefined();
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.title).toBe(entry.title);
expect(body.data.content).toBe(entry.content);
expect(body.data.createdBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.updatedBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.publishedAt).toBeDefined();
2019-03-09 01:06:39 +01:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
const tags = (await getRelations('article', 'tags', body.data.documentId)).results;
2022-09-07 15:40:35 +02:00
expect(tags.length).toBe(0);
2019-03-09 01:06:39 +01:00
const categories = (await getRelations('article', 'category', body.data.documentId)).results;
expect(categories.length).toBe(1);
expect(categories[0].name).toBe(data.categories[0].name);
2022-09-07 15:40:35 +02:00
});
2019-03-09 01:06:39 +01:00
2022-09-07 15:40:35 +02:00
test('Update article1 with cat2', async () => {
2022-08-08 15:50:34 +02:00
const { body } = await rq({
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
url: `/content-manager/collection-types/api::article.article/${data.articles[0].documentId}`,
2019-03-09 01:06:39 +01:00
method: 'PUT',
2022-09-07 15:40:35 +02:00
body: {
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
category: data.categories[1].documentId,
2022-09-07 15:40:35 +02:00
},
2019-03-09 01:06:39 +01:00
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
data.articles[0] = body.data;
2019-03-09 01:06:39 +01:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(body.data.documentId).toBeDefined();
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.title).toBe(data.articles[0].title);
expect(body.data.content).toBe(data.articles[0].content);
expect(body.data.createdBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.updatedBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
2022-09-07 15:40:35 +02:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
const tags = (await getRelations('article', 'tags', body.data.documentId)).results;
2022-09-07 15:40:35 +02:00
expect(tags.length).toBe(0);
const categories = (await getRelations('article', 'category', body.data.documentId)).results;
expect(categories.length).toBe(1);
expect(categories[0].name).toBe(data.categories[1].name);
2019-03-09 01:06:39 +01:00
});
test('Create article2', async () => {
const entry = {
title: 'Article 2',
content: 'Content 2',
};
2022-08-08 15:50:34 +02:00
const { body } = await rq({
2021-08-06 18:09:49 +02:00
url: '/content-manager/collection-types/api::article.article',
2019-03-09 01:06:39 +01:00
method: 'POST',
body: entry,
2019-03-09 01:06:39 +01:00
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
data.articles.push(body.data);
2019-03-09 01:06:39 +01:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(body.data.documentId).toBeDefined();
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.title).toBe(entry.title);
expect(body.data.content).toBe(entry.content);
expect(body.data.createdBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.updatedBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
2022-09-07 15:40:35 +02:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
const tags = (await getRelations('article', 'tags', body.data.documentId)).results;
2022-09-07 15:40:35 +02:00
expect(tags.length).toBe(0);
2019-03-09 01:06:39 +01:00
});
test('Update article2 with cat2', async () => {
2022-08-08 15:50:34 +02:00
const { body } = await rq({
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
url: `/content-manager/collection-types/api::article.article/${data.articles[1].documentId}`,
2019-03-09 01:06:39 +01:00
method: 'PUT',
2022-09-07 15:40:35 +02:00
body: {
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
category: data.categories[1].documentId,
2022-09-07 15:40:35 +02:00
},
2019-03-09 01:06:39 +01:00
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
data.articles[1] = body.data;
2019-03-09 01:06:39 +01:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(body.data.documentId).toBeDefined();
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.title).toBe(data.articles[1].title);
expect(body.data.content).toBe(data.articles[1].content);
expect(body.data.createdBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.updatedBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
2019-03-09 01:06:39 +01:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
const tags = (await getRelations('article', 'tags', body.data.documentId)).results;
2022-09-07 15:40:35 +02:00
expect(tags.length).toBe(0);
2019-03-09 01:06:39 +01:00
const categories = (await getRelations('article', 'category', body.data.documentId)).results;
expect(categories.length).toBe(1);
expect(categories[0].name).toBe(data.categories[1].name);
2022-09-07 15:40:35 +02:00
});
2019-03-09 01:06:39 +01:00
2022-09-07 15:40:35 +02:00
test('Update cat1 with article1', async () => {
2022-08-08 15:50:34 +02:00
const { body } = await rq({
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
url: `/content-manager/collection-types/api::category.category/${data.categories[0].documentId}`,
2019-03-09 01:06:39 +01:00
method: 'PUT',
2022-09-07 15:40:35 +02:00
body: {
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
articles: [data.articles[0].documentId],
2022-09-07 15:40:35 +02:00
},
2019-03-09 01:06:39 +01:00
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
data.categories[0] = body.data;
2019-03-09 01:06:39 +01:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(body.data.documentId).toBeDefined();
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.name).toBe(data.categories[0].name);
expect(body.data.createdBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.updatedBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
2022-09-07 15:40:35 +02:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
const articles = (await getRelations('category', 'articles', body.data.documentId)).results;
2022-09-07 15:40:35 +02:00
expect(articles.length).toBe(1);
2019-03-09 01:06:39 +01:00
});
test('Create cat3 with article1', async () => {
const entry = {
name: 'cat3',
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
articles: [data.articles[0].documentId],
2019-03-09 01:06:39 +01:00
};
2022-08-08 15:50:34 +02:00
const { body } = await rq({
2021-08-06 18:09:49 +02:00
url: '/content-manager/collection-types/api::category.category',
2019-03-09 01:06:39 +01:00
method: 'POST',
body: entry,
2019-03-09 01:06:39 +01:00
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
data.categories.push(body.data);
2019-03-09 01:06:39 +01:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(body.data.documentId).toBeDefined();
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.name).toBe(entry.name);
expect(body.data.createdBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.updatedBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
2022-09-07 15:40:35 +02:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
const articles = (await getRelations('category', 'articles', body.data.documentId)).results;
2022-09-07 15:40:35 +02:00
expect(articles.length).toBe(1);
2019-03-09 01:06:39 +01:00
});
2022-09-07 15:40:35 +02:00
test('Get article1 with cat3', async () => {
2022-08-08 15:50:34 +02:00
const { body } = await rq({
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
url: `/content-manager/relations/api::article.article/${data.articles[0].documentId}/category`,
2019-03-09 01:06:39 +01:00
method: 'GET',
});
expect(body).toMatchObject({ results: [{ name: 'cat3' }] });
2019-03-09 01:06:39 +01:00
});
2022-09-07 15:40:35 +02:00
test('Get article2 with cat2', async () => {
2022-08-08 15:50:34 +02:00
const { body } = await rq({
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
url: `/content-manager/relations/api::article.article/${data.articles[1].documentId}/category`,
2019-03-09 01:06:39 +01:00
method: 'GET',
});
expect(body).toMatchObject({ results: [{ name: 'cat2' }] });
2019-03-09 01:06:39 +01:00
});
2022-09-07 15:40:35 +02:00
test('Get cat1 without relations', async () => {
2022-08-08 15:50:34 +02:00
const { body } = await rq({
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
url: `/content-manager/relations/api::category.category/${data.categories[0].documentId}/articles`,
2019-03-09 01:06:39 +01:00
method: 'GET',
});
expect(body).toMatchObject({
2022-09-01 11:05:18 +02:00
results: [],
pagination: {
total: 0,
pageSize: 10,
page: 1,
pageCount: 0,
},
2021-11-24 16:20:57 +01:00
});
2019-03-09 01:06:39 +01:00
});
2022-09-07 15:40:35 +02:00
test('Get cat2 with article2', async () => {
2022-08-08 15:50:34 +02:00
const { body } = await rq({
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
url: `/content-manager/relations/api::category.category/${data.categories[1].documentId}/articles`,
2019-03-09 01:06:39 +01:00
method: 'GET',
});
expect(body).toMatchObject({
2022-09-01 11:05:18 +02:00
pagination: { page: 1, pageCount: 1, pageSize: 10, total: 1 },
results: [{ title: 'Article 2' }],
2021-11-24 16:20:57 +01:00
});
2019-03-09 01:06:39 +01:00
});
2022-09-07 15:40:35 +02:00
test('Get cat3 with article1', async () => {
2022-08-08 15:50:34 +02:00
const { body } = await rq({
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
url: `/content-manager/relations/api::category.category/${data.categories[2].documentId}/articles`,
2019-03-09 01:06:39 +01:00
method: 'GET',
});
expect(body).toMatchObject({
2022-09-01 11:05:18 +02:00
pagination: { page: 1, pageCount: 1, pageSize: 10, total: 1 },
results: [{ title: 'Article 1' }],
2021-11-24 16:20:57 +01:00
});
2019-03-09 01:06:39 +01:00
});
});
describe('Test oneToOne relation (article - reference) with Content Manager', () => {
beforeAll(() => {
data = {
articles: [],
references: [],
};
});
afterAll(async () => {
await deleteFixtures();
});
2019-03-09 01:06:39 +01:00
test('Create ref1', async () => {
2022-08-08 15:50:34 +02:00
const { body } = await rq({
2021-08-06 18:09:49 +02:00
url: '/content-manager/collection-types/api::reference.reference',
2019-03-09 01:06:39 +01:00
method: 'POST',
body: {
2019-03-09 01:06:39 +01:00
name: 'ref1',
},
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
data.references.push(body.data);
2019-03-09 01:06:39 +01:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(body.data.documentId).toBeDefined();
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.name).toBe('ref1');
expect(body.data.createdBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.updatedBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
2019-03-09 01:06:39 +01:00
});
test('Create article1', async () => {
const entry = {
title: 'Article 1',
content: 'Content 1',
};
2022-08-08 15:50:34 +02:00
const { body } = await rq({
2021-08-06 18:09:49 +02:00
url: '/content-manager/collection-types/api::article.article',
2019-03-09 01:06:39 +01:00
method: 'POST',
body: entry,
2019-03-09 01:06:39 +01:00
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
data.articles.push(body.data);
2019-03-09 01:06:39 +01:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(body.data.documentId).toBeDefined();
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.title).toBe(entry.title);
expect(body.data.content).toBe(entry.content);
expect(body.data.createdBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.updatedBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.publishedAt).toBeDefined();
2019-03-09 01:06:39 +01:00
});
test('Update article1 with ref1', async () => {
2022-08-08 15:50:34 +02:00
const { body } = await rq({
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
url: `/content-manager/collection-types/api::article.article/${data.articles[0].documentId}`,
2019-03-09 01:06:39 +01:00
method: 'PUT',
2022-09-07 15:40:35 +02:00
body: {
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
reference: data.references[0].documentId,
2022-09-07 15:40:35 +02:00
},
2019-03-09 01:06:39 +01:00
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
data.articles[0] = body.data;
2019-03-09 01:06:39 +01:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(body.data.documentId).toBeDefined();
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.title).toBe(data.articles[0].title);
expect(body.data.content).toBe(data.articles[0].content);
expect(body.data.createdBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.updatedBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
2022-09-07 15:40:35 +02:00
const references = await getRelations('article', 'reference', body.data.documentId);
expect(references.results[0].documentId).toBe(data.references[0].documentId);
2019-03-09 01:06:39 +01:00
});
test('Create article2 with ref1', async () => {
const entry = {
title: 'Article 2',
content: 'Content 2',
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
reference: data.references[0].documentId,
2019-03-09 01:06:39 +01:00
};
2022-08-08 15:50:34 +02:00
const { body } = await rq({
2021-08-06 18:09:49 +02:00
url: '/content-manager/collection-types/api::article.article',
2019-03-09 01:06:39 +01:00
method: 'POST',
body: entry,
2019-03-09 01:06:39 +01:00
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
data.articles.push(body.data);
2019-03-09 01:06:39 +01:00
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(body.data.documentId).toBeDefined();
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.title).toBe(entry.title);
expect(body.data.content).toBe(entry.content);
expect(body.data.createdBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
expect(body.data.updatedBy).toMatchObject({
2021-11-24 16:20:57 +01:00
id: 1,
username: null,
});
const references = await getRelations('article', 'reference', body.data.documentId);
expect(references.results[0].documentId).toBe(data.references[0].documentId);
2019-03-09 01:06:39 +01:00
});
});
describe('Test oneWay relation (reference - tag) with Content Manager', () => {
test('Attach Tag to a Reference', async () => {
const {
body: { data: createdTag },
} = await rq({
2021-08-06 18:09:49 +02:00
url: '/content-manager/collection-types/api::tag.tag',
2019-03-09 01:06:39 +01:00
method: 'POST',
body: {
2019-03-09 01:06:39 +01:00
name: 'tag111',
},
});
const {
body: { data: createdReference },
} = await rq({
2021-08-06 18:09:49 +02:00
url: '/content-manager/collection-types/api::reference.reference',
2019-03-09 01:06:39 +01:00
method: 'POST',
body: {
2019-03-09 01:06:39 +01:00
name: 'cat111',
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
tag: createdTag.documentId,
2019-03-09 01:06:39 +01:00
},
});
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
expect(createdReference.documentId).toBeDefined();
2022-09-07 15:40:35 +02:00
const tags = await getRelations('reference', 'tag', createdReference.documentId);
expect(tags.results[0].documentId).toBe(createdTag.documentId);
2019-03-09 01:06:39 +01:00
});
test('Detach Tag to a Reference', async () => {
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
const {
body: { data: createdTag },
} = await rq({
2021-08-06 18:09:49 +02:00
url: '/content-manager/collection-types/api::tag.tag',
2019-03-09 01:06:39 +01:00
method: 'POST',
body: {
2019-03-09 01:06:39 +01:00
name: 'tag111',
},
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
const {
body: { data: createdReference },
} = await rq({
2021-08-06 18:09:49 +02:00
url: '/content-manager/collection-types/api::reference.reference',
2019-03-09 01:06:39 +01:00
method: 'POST',
body: {
2019-03-09 01:06:39 +01:00
name: 'cat111',
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
tag: createdTag.documentId,
2019-03-09 01:06:39 +01:00
},
});
let tags = await getRelations('reference', 'tag', createdReference.documentId);
expect(tags.results[0].documentId).toBe(createdTag.documentId);
2019-03-09 01:06:39 +01:00
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
const {
body: { data: referenceToUpdate },
} = await rq({
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
url: `/content-manager/collection-types/api::reference.reference/${createdReference.documentId}`,
2019-03-09 01:06:39 +01:00
method: 'PUT',
body: {
2019-03-09 01:06:39 +01:00
tag: null,
},
});
tags = await getRelations('reference', 'tag', referenceToUpdate.documentId);
expect(isEmpty(tags.results)).toBe(true);
2019-03-09 01:06:39 +01:00
});
test('Delete Tag so the relation in the Reference side should be removed', async () => {
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
const {
body: { data: createdTag },
} = await rq({
2021-08-06 18:09:49 +02:00
url: '/content-manager/collection-types/api::tag.tag',
2019-03-09 01:06:39 +01:00
method: 'POST',
body: {
2019-03-09 01:06:39 +01:00
name: 'tag111',
},
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
const {
body: { data: createdReference },
} = await rq({
2021-08-06 18:09:49 +02:00
url: '/content-manager/collection-types/api::reference.reference',
2019-03-09 01:06:39 +01:00
method: 'POST',
body: {
2019-03-09 01:06:39 +01:00
name: 'cat111',
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
tag: createdTag.documentId,
2019-03-09 01:06:39 +01:00
},
});
await rq({
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
url: `/content-manager/collection-types/api::tag.tag/${createdTag.documentId}`,
2019-03-09 01:06:39 +01:00
method: 'DELETE',
});
feat(cm): D&P pt2 (#19380) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Simone <startae14@gmail.com>
2024-02-22 17:18:32 +00:00
const {
body: { data: foundReference },
} = await rq({
feat(document-service): document id to id (#19573) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: save and publish * feat: update contract * feat: dp tests * chore: use document from create and update * feat: save and publish single types * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * fix(cm): list view & build process * feat: add publish & update action (#19423) * feat: return metadata on content manager endpoints (#19361) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * feat: fix cm metadata api tests (#19375) * feat: return metadata on content manager endpoints * feat: return meta * fix: cm tests * fix: admin test * chore(cm): refactor CM (#19341) * chore(cm): refactor EditView comes with a host of new re-usable APIs! * feat(cm): add useDocument hook * feat(cm): add useDocumentOperations hook * feat(cm): initialise EditView header * feat(cm): add useDocumentLayout hook * fix: listView from layout refactor * chore(cm): refactor editview form input renderer * chore: fix lint & ts * fix: re-add custom fields * test: fix admin/CM unit tests * docs(cm): add docs at a high level of how the CM works * test: add useDocumentRBAC tests * chore: pr amends * feat: add addEditViewSidePanel API to strapi (#19398) * feat: add addEditViewSidePanel API to strapi fix: don't pass all the query params to the create route * chore: pr amends * fix: return available status when content type doesnt have i18n enabled (#19419) * fix: return available status when content type doesnt have i18n enabled * chore: remove comment * feat: add publish & update action * feat: add published disabled state * test: fix suite * test: add unit for Panels * fix(cm): status not state for redirect * fix(cm): list view status & component main field property * chore: pr feedback * chore: apply suggestions Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> * feat: test single types * feat: wrap single type publish into a transaction * feat(cm): add unpublish & delete actions, also re-enable single-types (#19459) * fix: delete url was wrong way round * feat: compute modified status * fix(cm): reimplement ListSettingsView (#19432) * chore: PR feedback * feat: discard endpoint * feat: discard draft api tests * feat: unpublish and discard * chore: pr comments * chore: update sanitizer * feat(cm): add publish and save (#19500) * feat(cm): add publish and save * test(cm): fix unit for useDocumentActions * Update packages/core/content-manager/server/src/controllers/collection-types.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * Update packages/core/content-manager/shared/contracts/single-types-v5.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat(document-service): map document ID to entry ID (#19248) * feat: use document service in content manager * feat: update contracts with meta information * chore: group metadata types into a single type * feat: metadata information in single types * chore: change meta contract to return documents instead of strings * fix: remove unused type * fix: ignore doc id if entry is null * fix: update contract metadata * feat: document metadata service * feat: locale and status filtering * chore: add comment * chore: refactor metadata service * chore: refactor entity manager exists to handle single types * feat: refactor single type controllers to use documents * feat: get locale param from in cm endpoints * Revert "feat: get locale param from in cm endpoints" This reverts commit 856c38588b8f8521cadd85c8c933f42a36a2178a. * feat: get locale param from cm endpoints * Update packages/plugins/i18n/server/src/controllers/validate-locale-creation.ts Co-authored-by: Ben Irvin <ben@innerdvations.com> * fix: entity manager unit tests * chore: unit test document metadata * feat: prevent empty string locale filtering * fix: cm contract import * chore: test new d&p cm features * fix: search content manager api test * fix: cm tests * fix: cm tests * fix: cm tests * fix(content-manager): access to non default locale documents (#19190) * fix(content-manager): access to non default locale documents * chore(content-manager): revert route construction * fix(content-manager): api tests for number of draft relations * test(content-manager): counting number of draft relations for non default locales * chore(content-manager): remove default locale from entity manager countDraftRelations * chore: basic relations testing for document service * chore(e2e): disable edit view tests (#19235) * feat: get relation ids * chore: clean functions into other folders * chore: rename files * fix: group document ids by its uid * feat: id mapper * chore: improve typings * chore: rename transform functions * fix: id-transform tests * chore: simplify function return value * chore: improve comments * fix: api tests * fix: single types unit test * fix: skip relations test * fix: exclude fields * fix: short hand ifs * fix: merge conflict * fix: transform output of find one * Update packages/core/core/src/services/document-service/transform/utils.ts Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * feat[Document Service]: Param transformation (#19373) * fix(core): wip param transformation * feat(core): wip param transformation based on relational status * feat(core): wip populate and filter transformation based on relational status * chore(core): simplify fields and sort * chore(core): clean up * feat(core): wip filter transformation with traverseQueryFilters * feat(core): reorganise and PR feedback * fix(core): filters traversal logic * feat(core): populate relational transformations * chore(core): reintroduce populate transformation * fix(core): enforce that fields must include id * fix(core): enforce that fields must include id * fix(core): filter and sort transformation * chore(core): typos * chore(core): further filters test cases * feat(core): support object based sorts * chore(core): fields test naming * feat(core): handle logical operators in filters * fix: skip conditions test * fix(core): switchIdForDocumentId (#19497) * fix: uniqueness test * fix: available status should be an array * fix: available statuses * fix: skip uniqueness folder * fix: skip uniqueness test errors * fix: skip failing test --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> * chore: re-implement edit configuration (#19488) * chore: re-implement edit configuration * chore: cleanups * test: fix unit tests * feat(cm): add discard changes action (#19509) * feat(cm): add discard changes action * feat(cm): add discard when unpublishing * test(e2e): fix editview e2e * test(e2e): fix uniqueness partially * test(unit): fix unit tests for actions & add for discard * chore: bump playwright * fix(webkit): add shim for requestIdCallback * chore: pr amends * feat: return status on available locales * feat: add document-actions to list-view (#19523) * fix(cm): add gap and alignment for edit-view heading with super long names * fix(cm): list view status' * feat: add list-view actions * fix: conditions for actions to be enabled * fix: stay on draft tab when published * fix: stop propogation on list-view row click * test(e2e): fix editview tests * chore: update spelling error Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * feat: test document metadata * chore: remove unnecessary unit test * fix: return modified on published documents * chore: init split single-type collection-type in document service * Fix/fields test case (#19481) * Update packages/core/content-manager/server/src/services/document-metadata.ts Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: pretty * chore: refactor middlewares * feat: send empty object if locale does not exist on document * feat: single types * chore: add tests to middlewares * feat: update locale using query params (#19546) * feat: return available locales when not finding locale * chore: update typings * feat: add clone action (#19526) * feat: add clone action * test(e2e): add auto clone tests * chore: pr amends * feat: add information to header actions menu (#19548) * feat: add information to header actions menu * fix: dont use non-null-assertion * feat: manage relations on publish (#19427) --------- Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * feat: v5 i18n relations (#19504) Co-authored-by: Ben Irvin <ben@innerdvations.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * fix: locale test api * feat: undo document id to id switch * feat: make documentId preceed id when connecting relations * fix: return documentId in clone method * fix: document service api tests * chore: start content-api v5 migration * chore: implement entire content-api without d&p endpoints * chore: refactor i18n (#19555) * chore: remove types package, should be using strapi * chore: refactor i18n settings page * feat: add i18n to CM * feat(i18n): add delete locale action (#19562) * chore: pr amends Co-authored-by: Simone <startae14@gmail.com> --------- Co-authored-by: Simone <startae14@gmail.com> * chore: add withCount & loosen the typings for now * fix: adapt content manager to use new doc service api (#19584) * fix: adapt content manager to use new doc service api * fix: fix cm setting ids * chore: pr suggestions * chore: remove console.log * chore: fix unit tests * enhancement: use defaultLocale on delete/publish/unpublish/discardDra… (#19583) * enhancement: use defaultLocale on delete/publish/unpublish/discardDraft by default, add * for all * fix: delete all locales if locale is undefined when deleting --------- Co-authored-by: Marc-Roig <marc12info@gmail.com> * feat(cm): re-implement validation (#19578) * feat: re-implement validation in the CM feat: add blocker feat: handle validation errors from the API chore: reimplement useFieldHint test(unit): fix fe tests chore: fix bad logical operator * chore: await notifications to leave before trying to go to other pages * fix: validation issues & blocker showing up incorrectly * fix: broken publish behaviour * fix(content-manager): uid availability and generation (#19518) * fix(content-manager): uid availability and generation * fix(content-manager): pass locale as is from UID service * fix(content-manager): match UIDs based on startsWith * fix: ts error * feat: default document service factory (#19592) * feat: default ds factory * fix: use uid and not content type in repository * Merge branch 'v5/main' into v5/id-to-documentId * fix: udpate document id references in content manager * chore: use root document service on content manager endpoints * feat: move single type logic into core api * fix: unit tests * fix: content-api tests * fix: remove doc service repository from documents * fix: upload file tests * fix: api tests * fix: remove id mapping on content manager * fix: send documentId and nod id on collection types * chore(content-manager): use documentId over id (#19618) * chore: use doucmentId over id * docs: update contributor documentation * test: update snapshots & msw return values * chore: fix ts * chore: make bulk actions documentIds argument the same time for consistency Co-Authored-By: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> --------- Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> * fix: cm api tests * fix: remove type * fix: remove unused param --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-02-28 14:15:24 +01:00
url: `/content-manager/collection-types/api::reference.reference/${createdReference.documentId}`,
2019-03-09 01:06:39 +01:00
method: 'GET',
});
2022-10-17 18:55:21 +02:00
expect(foundReference.tag.count).toBe(0);
2019-03-09 01:06:39 +01:00
});
});
});