49 Commits

Author SHA1 Message Date
markkaylor
51ac3e3622
future(homepage): refactor internal widgets to use api (#23352) 2025-04-14 17:08:21 +02:00
Alexandre Bodin
92055a7fb1 chore: use rollup
chore: fetch template only if name matches name convention

chore: linting

chore: fix tests

chore: fix npm scripts

test: try to fix test
2025-01-23 16:28:23 +01:00
Marc Roig
002fc78b3c
feat: preview endpoint (#21574)
* feat: base files for static preview

* feat: preview config

* Update packages/core/content-manager/server/src/preview/routes/index.ts

Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com>

* chore: empty handler

* chore: comment controllers type

* fix: remove is enabled check from load

* feat: test preview config

* chore: refactor type

* feat: preview endpoint

* feat: preview test

* fix: tests

* fix: api test

* chore: comment

---------

Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com>
2024-10-08 14:23:47 +02:00
Jamie Howard
69590e70d5
feat(i18n): add bulk unpublish locales edit view action (#21030)
* feat(i18n): add bulk unpublish locales edit view action

* fix(e2e): i18n bulk actions

* chore(e2e): skip for webkit

* chore: clean up

* fix(i18n): fixes and e2e test coverage for bulk locale unpublish

* fix(e2e): content manager edit view

* fix(content-manager): incorporate edit view notification fix

* chore(i18n): clean up
2024-08-27 12:04:59 +01:00
Jamie Howard
8c5105d949
Publish multiple locales (#20258)
* fix: date comparison

* feat(core): document service publish multiple locales (#20046)

* feat(core): document service (un)publish multiple locales

* fix(core): cleanup locale param types

* feat(content-manager): wip - multiple locale support

* Count draft relations across locales (#20116)

* feat(content-manager): publish multiple locales from CM route

* feat(core): multiple locales in document service discard draft

* feat(content-manager): use bulkpublish for locale publish

* feat(content-manager): use query from bulkpublish locales

* feat(content-manager): publishMany

* feat(content-manager): api test for bulk locale + document publish

* chore(content-manager): fix for build

* fix(core): avoid * in locale data

* chore(content-manager): pr amends and validation improvement

* feat(content-manager): use transaction in document manager publish many

* feat(core): throw when a non string locale is provided and not supported

* fix(core): doc service find many

* chore: clean up

* feat(content-manager): Select fields that require validation in availablelocales (#20156)

* feat(content-manager): wip - select more fields in availablelocales

* feat(content-manager): wip available locales using entity traversal

* feat(content-manager): wip test available locales returns fields with validation

* feat(content-manager): test available locales returns fields with validation

* fix(content-manager): ensure sensitive info not exposed in available statuses

* fix(content-manager): sanitize document metadata available status

* fix(content-manager): sanitize document metadata available status at controller level

* fix(content-manager): populate only for validatable fields

* chore: clean up

* chore: clean up

* chore: clean up

* fix(content-manager): build issues

* fix(content-manager): allow null locales

* fix(content-manager): history service (#20185)

* fix(content-manager): history service

* chore(content-manager): clean up

* fix: pr feedback

* chore: update actions deps

* chore: update utility deps

* chore: upgrade sentry

* chore: upgrade graphql-tools

* fix: http-errors ugprade

* chore: add fs-extra types where needed

* docs(typescript): type system cheat sheet

* chore!: remove deprecated verbose option from ts:generate-types

* chore: clean up

fix(content-manager) correctly count bulk publish results

* fix(content-manager): pr feedback and test improvements

* feat(i18n): bulk locale publish modal in CM edit view (#20069)

* feat(i18n): wip bulk locale publish modal

* fix(i18n): wip - fe bulk locale publish

* feat(content-manager): multi locale publish, integrate with backend and add basic e2e test

* feat(i18n): wip - display validation errors in bulk locale modal

* chore: clean up

* chore(i18n): design system changes

* feat(i18n): display correct status after publish and clean up error messaging

* feat(i18n): access onclose from modal body

* fix(i18n): selected locale change

* fix(i18n): locale table state

* fix(i18n): edit view e2e test

* chore(content-manager): validation tweak wip

* feat(i18n): cover validation cases in i18n e2e tests

* chore: clean up

* fix(i18n): edit view more document actions disabled state

* chore: feedback

* fix(i18n): send all params to publish many

* fix(i18n): place bulk locale publish 3rd in array

* fix(content-manager): validation error extraction

* fix(content-manager): pr feedback

* fix: build

* chore(content-manager): simplify exports

* chore(i18n): revert package

---------

Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com>
Co-authored-by: Jean-Sébastien Herbaux <jean-sebastien.herbaux@epitech.eu>
Co-authored-by: Ben Irvin <ben.irvin@strapi.io>

* fix(i18n): disable publish button after bulk locale publish

* fix(content-manager): ce e2e fix

* chore: typography

* fix(i18n): e2e edit view test

* fix: wip date comparison

* fix: wip date comparison

* fix(content-manager): simplify date comparison

* fix: clean up metadata api test

* chore: update api tests

* fix: draft versions must be ahead of published to be considered modified

* fix: published modified calculation

* fix: clean up

* fix: simplify draft and publish comparison

* chore: clean up

* fix: flaky fe tests

* fix: pr feedback

* fix(i18n): error message extraction in bulk locale modal

* chore: remove old publish action

* chore: pr feedback

* chore: refactor error types & validation messages

* chore: use anchor link for locale changes

* chore: fix releases

* fix: clean up

* chore: snapshot

---------

Co-authored-by: Marc-Roig <marc12info@gmail.com>
Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com>
Co-authored-by: Jean-Sébastien Herbaux <jean-sebastien.herbaux@epitech.eu>
Co-authored-by: Ben Irvin <ben.irvin@strapi.io>
Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
2024-05-10 18:20:35 +01:00
Marc Roig
521cd3f8cd
fix: improve CM modified date comparison (#19898)
* fix: date comparison

* fix(content-manager): simplify date comparison

* fix: clean up metadata api test

* fix: draft versions must be ahead of published to be considered modified

* fix: published modified calculation

* fix: clean up

* fix: simplify draft and publish comparison

* chore: clean up

* fix: flaky fe tests

* fix: pr feedback

---------

Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-05-09 19:19:18 +02:00
Fernando Chávez
3fdf1a575b
enhancement: migrate bulk publish & unpublish to v5 (#20184)
* chore: migrate bulk publish & unpublish to v5

* chore: change findLocales type to accept arrays

* chore: fix lint error

* chore: migrate bulkDelete to v5 (#20161)

* chore: migrate bulkDelete to v5

* chore: change findLocales type to accept strings array

* fix: docs prettier styles

* chore: remove console.log

* enhancement: migrate countManyDraftRelations to v5

* only publish not published entries

* use strapi query directly on bulkPublish

* fix api tests for bulk publish

* apply jamie feedback
2024-05-07 16:58:56 +02:00
markkaylor
4a26739ee0
fix(history): handle sanitization when fetching versions (#20212)
Co-authored-by: Rémi de Juvigny <remi.dejuvigny@strapi.io>
2024-04-30 11:33:06 +02:00
markkaylor
bdaafbbb3c
chore(history): add api tests (#20157) 2024-04-23 10:50:47 +02:00
Rémi de Juvigny
7431ba9b38
fix: sanitize history versions data field (#20143)
* fix: sanitize history versions data field

* fix: ts cannot be named error
2024-04-22 08:03:52 -04:00
markkaylor
b2d2f81797
feat: add confirmation modal when restoring history version (#20106)
Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com>
2024-04-17 10:13:36 +02:00
markkaylor
b4f819aae7
feat(history): restore version (#20102) 2024-04-16 09:18:33 +02:00
Marc Roig
01a203b446
feat: move rw to plugin (#19937)
* chore: initiate moving CM to own package

* chore: refactor to handle routes

* chore: init review-workflows-package

* chore: fix build

* chore: refactor review-workflows fe

* chore: fix unit suite

* feat: move rw to plugin

* fix: build

* fix: start up

* chore: clean things up

* fix: peer dependencies

* chore(wip): refactor rw fe

* chore: re-add admin ui

* chore: fix tests & linter

* chore: re-implement drag layer

* fix: type

* feat: review-workflow middlewares

* chore: send params to CM endpoints

* fix: use layout options as well, let that have the final say, just incase

* feat: use doc id and locale for entity assignee and stage

* fix: api tests

* fix: cm updates when we update fields

* chore: cleanup edit-view e2e tests

* fix: build

* fix: useDocumentLayout for RW options

* test: fix fe tests

* fix: ts

* test(e2e): add review-workflow e2e tests

* chore: fix bad import for cli tests

* chore: delete old e2e data

* chore: import EVERYTHING for DTS

* chore: update dataset

* fix: e2e script

* fix: stage permissions

* chore: remove duplicate settings menu link

* fix: workflow middleware

* chore: change permission

* test(e2e): fix RW tests

* chore: ignore dynamic attributes in DTS

Co-Authored-By: Jean-Sébastien Herbaux <25851739+Convly@users.noreply.github.com>

* chore: make settings rw e2e run on EE only

* test(e2e): fix them all pls

* fix: admin stage transition uid name

* chore: fix firefox e2e ce tests

---------

Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
Co-authored-by: Jean-Sébastien Herbaux <25851739+Convly@users.noreply.github.com>
2024-04-12 10:58:38 +02:00
Rémi de Juvigny
163e91acfe
enhancement: add relation data to history versions response (#20035)
* feat: add relation data to history versions response

* fix: restore unknown attributes

* fix: admin test ts errors

* chore: mark feedback
2024-04-04 17:31:51 -04:00
markkaylor
971168147b
chore(history): simplify the meta object (#19990) 2024-04-02 13:49:09 -04:00
Jamie Howard
43b9e91c67
feat(i18n): non localized fields (#19720)
* feat(i18n): wip non localized fields

* feat(i18n): use document service middleware for non localized fields

* feat(i18n): support component data in non localized sync

* chore(i18n): cleanup and fix unit tests

* fix(i18n): reintroduce permissions sync

* test(i18n): api test for non localized fields

* feat(i18n): add earth icon to symbolise localised fields (#19774)

* test(i18n): cover publish, unpublish, update and create in api tests

* feat(i18n): ensure non localized fields are populated

* fix(i18n): get right id

* fix(content-manager): doc metadata in non d&p cases

* fix(conent-manager): i18n detection

* fix: pr feedback

* fix(i18n): handle non localized components

* feat(i18n): sync non localized components

* fix(i18n): wip unit test

* feat(i18n): handle relations within non localized components

* feat(i18n): reintroduce FE and fix for repeatables

* chore: lockfile

* chore(i18n): cleanup

* chore(i18n): cleanup

* feat(i18n): match relation locales to source entry during transformation

* fix(i18n): unit tests

* fix(i18n): getNonLocalizedAttributes

* chore(i18n): fix unit tests

* chore(i18n): pr feedback

* chore(i18n): pr feedback

* fix(i18n): unit tests

---------

Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
2024-04-02 10:08:10 +01:00
markkaylor
1c2f2708ff
feat(history): diff schemas to get unknown attributes (#19849) 2024-03-21 15:20:57 +01:00
Convly
d671c5698d Merge branch 'v5/main' of github.com:strapi/strapi into v5/types/v2 2024-03-20 08:51:37 +01:00
Convly
a328275adb Merge branch 'v5/main' of github.com:strapi/strapi into v5/types/v2 2024-03-18 11:38:17 +01:00
Marc Roig
a2741e3bc6
feat: do not send status relations (#19776)
* feat: do not send status relations

* fix: status contract

* chore: hide D&P status on relations that don't have it

* fix: relations not appearing

* fix: do not show status on relations dropdown

---------

Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
2024-03-18 11:21:30 +01:00
Christian Capeans
8cb962b8dd Merge branch 'v5/main' of github.com:strapi/strapi into v5/types/v2 2024-03-18 11:11:46 +01:00
Josh
98ecaa5093
feat: add drag-and-drop to relations (#19788)
* feat: add drag-and-drop to relations

Co-Authored-By: Marc Roig <20578351+Marc-Roig@users.noreply.github.com>

* chore: spelling mistakes

* chore: fix mainField accessing

* chore: remove comment code

Co-Authored-By: Marc Roig <marc12info@gmail.com>

---------

Co-authored-by: Marc Roig <20578351+Marc-Roig@users.noreply.github.com>
Co-authored-by: Marc Roig <marc12info@gmail.com>
2024-03-15 15:16:35 +00:00
Josh
a8498df926
feat(cm): reimplement relations for draft & publish (#19642)
* feat(content-manager): Rework findAvailable and findExisting (#19597)

* feat(content-manager): wip rework findAvailable and findExisting

* chore(strapi): simplify relations controller

* feat(content-manager): entity Id based find available

* feat(content-manager): entity Id based find existing

* fix(content-manager): build issues

* chore(content-manager): cleanup

* fix(content-manager): relations controllers unit tests

* fix(content-manager): improve error handling

* fix(content-manager): simplify findExisting relations logic

* fix(content-manager): clean up types

* fix(content-manager): extend available relation API tests

* fix(content-manager): pr feedback

* feat(content-manager): cover find existing test cases

* feat(content-manager): test that we can only find available relations in the same locale

* fix: wip fix unit tests

* chore(content-manager): pr feedback

* fix(content-manager): use db layer to find relations

fix(content-manager): failing relations tests

* fix(content-manager): find relations test

* fix(content-manager): build issues

* fix(content-manager): return latest status of relations in findAvailable (#19681)

* fix(content-manager): return latest status of relations in findAvailable

* fix(content-manager): share logic for findAvailable and findExisting

* fix(admin): relation tests

* fix(content-manager): clean up types

* fix(content-manager): support status for find exisiting

* fix(content-manager): add status and locale filters to subQuery

* fix(content-manager): ts front and skip relations unit tests

* fix(content-manager): request specific status or get latest using document-metadata

* chore(content-manager): use interface

* fix(content-manager): tidy up target relation subquery

* fix(content-manager): tidy up and skip TS for build issues

* fix(content-manager): return status when requested

* chore(content-manager): dont re type entity service response

* fix(content-manager): use document metadata getManyAvailableStatus

* chore(content-manager): remove mapAsync

* feat: implement relations in the cm (#19702)

* Fix: Relating i18n and non-i18n content types (#19731)

* chore: re-enable e2e relation tests

* fix: return undefined

---------

Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com>
Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
Co-authored-by: Marc-Roig <marc12info@gmail.com>
2024-03-13 10:25:47 +00:00
Rémi de Juvigny
6ded4328d3
feat: add basic pagination to history frontend (#19729)
* feat: handle history version pagination params

* fix: ts build error

* chore: validate pagination params

* chore: pr feedback and test

* feat: show pagination ui

* fix: no history version selected

* chore: change default history page size to 20

* fix: don't redirect to old version

* fix: add comment
2024-03-12 10:53:02 +01:00
Convly
011d316a00 Merge branch 'v5/main' into v5/types/v2 2024-03-11 12:15:50 +01:00
Rémi de Juvigny
6408670a35
feat: handle history version pagination params (#19594)
* feat: handle history version pagination params

* fix: ts build error

* chore: validate pagination params

* chore: pr feedback and test
2024-03-07 14:43:37 +01:00
Convly
c16930d5b2 chore: fix build 2024-03-06 15:22:39 +01:00
Convly
8c6c0f1020 Merge branch 'v5/main' into v5/types/v2 2024-03-06 15:22:08 +01:00
Convly
7d7d7404ce Merge branch 'v5/main' into v5/types/v2 2024-03-01 17:18:24 +01:00
Convly
c425f82942 chore: move Public.UID and Internal.Struct to the root namespace 2024-03-01 15:56:07 +01:00
Convly
5167af6c73 chore: fix build following latest TS type system changes 2024-03-01 14:41:47 +01:00
Rémi de Juvigny
8294852592 Merge remote-tracking branch 'origin/v5/main' into v5/history 2024-02-29 11:48:35 +01:00
Rémi de Juvigny
1307b18e6a
chore: merge draft & publish into history (#19632)
* fix: prevent infinite loop opening pool connections in mysql

* test(database): init unit tests for createMetadata

* 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>

* chore: add centralized methods for replacing hardcoded strings for database identifiers

* chore: update History with new v5 APIs (#19623)

* chore: implement new form component

* chore: display version data

* fix: remove FormLayout to block unsupported fields

* fix: history tests

* chore: infer model kind from initialEntry

* chore: pr feedback first batch

* chore: move mainField to history context

* chore: move data fetching to page level

* fix: ts error in VersionsList test

* fix: permissions loading state

* chore: lift DocumentRBAC

---------

Co-authored-by: Mark Kaylor <mark.kaylor@strapi.io>

---------

Co-authored-by: Ben Irvin <ben.irvin@strapi.io>
Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
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: 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-28 18:06:17 +01:00
Marc Roig
fe7a20fed1
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 13:15:24 +00:00
Josh
4f4e3c3acd
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
markkaylor
acec060882
feat(content-history): add version header (#19462) 2024-02-09 17:17:02 +01:00
Rémi de Juvigny
16c0c1a956
feat: list history versions in the history page sidebar (#19421)
* feat: add history versions endpoint

* fix: add author to response

* fix: types

* fix: yarn.lock

* fix: sort by most recent

* feat: display history versions

* chore: remove locale from VersionsList props

* chore: use buildValidGetParams

* chore: josh feedback

* chore: add locale util

* fix: not wrapped in act

* chore: move data fetching to page level

* chore: prepare VersionsDetail component

* fix: failing ci

* fix: empty view

* chore: mark feedback

* chore: use RelativeTime component

* chore: remove redundant loading check
2024-02-06 10:59:33 +01:00
Rémi de Juvigny
878a93dc44
feat: add history versions endpoint (#19386)
* feat: add history versions endpoint

* fix: add author to response

* fix: types

* fix: yarn.lock

* fix: sort by most recent

* fix: mark feedback

* chore: rework user sanitization
2024-02-02 10:09:11 +01:00
Rémi de Juvigny
d28f5a388b
Merge branch 'v5/main' into v5/history 2024-01-29 18:11:54 +01:00
Rémi de Juvigny
4e7378852a
feat(history): capture content types history (#19343)
* chore: init release action service

* feat: save history versions

* fix: ignore non api content types

* chore: move init history logic to service

* chore: feedback

* fix: save publish and unpublish actions

* fix: create action document ids

* chore: clarify comment
2024-01-29 18:10:58 +01:00
Jamie Howard
1097504b36
[core] document unique field validation per content type and locale (#19153)
* 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

* feat(core): document unique field validation per content type and locale

* feat(e2e): test document unique fields

* fix(admin): ts build

* fix: cm contract import

* chore: test new d&p cm features

* feat(core): validate document unique fields within one publication state

chore: remove build:ts

* 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

* test(document-service): api tests for unique document fields per publication state

* test(i18n): api tests for unique document fields per locale

* chore(api-tests): adjust author schema

* chore(e2e): disable edit view tests (#19235)

* fix(core): unique validation on publish

* fix(api-tests): un-localise author

* fix(e2e): incorrect path

* fix(admin): tidy up

* fix(admin): pass correct locale query params

fix(core): pass locale outside of filters

* chore(api-tests): wip comment for relatedEntityId logic

* fix(core): entity validator tests

* chore(api-tests): wip skip failing relations i18n test

* chore(e2e): clean up editview spec

* fix(content-manager): pass locale to publish and unpublish

* fix(content-manager): fix test:ts:back

* fix(e2e): update edit view expected path

* fix(entity-validator): default to null locale

fix(api-tests): wip i18n test changes

* fix(e2e): wip UID fields

* chore(content-type-builder): temporarily disable component unique field checkboxes (#19253)

* fix(admin): wip correctly pass params

feat(e2e): reintroduce uniqueness e2e tests

* Refactor UID validation for V5 (#19285)

* fix(database): wip remove UID unique DB constraint

* feat(content-manager): update uid checking endpoints to look at locale

* chore(admin): clean up

* fix(content-manager): single type unit tests

* fix(content-manager): send all params to uid endpoints

* feat(e2e): update tar backup to support unique CT

* fix(e2e): uniqueness spec

* chore(e2e): remove only

* fix(content-manager): only check UID availability against drafts

feat(api-tests): test case for UID validation across locales

* fix(content-manager): uid unit tests

* chore(api-tests): clean up

* chore(content-manager): clean up

* chore(i18n): remove relatedEntityId reference

---------

Co-authored-by: Marc-Roig <marc12info@gmail.com>
Co-authored-by: Ben Irvin <ben@innerdvations.com>
Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
2024-01-29 15:35:20 +00:00
Marc Roig
ff8ed1fc36
feat: Draft & Publish V5 (#18941)
* feat: use document service in content manager
* feat: locale and status filtering
* feat: refactor single type controllers to use documents
* feat: get locale param from in cm endpoints
* feat: get locale param from cm endpoints
* feat: prevent empty string locale filtering
* fix(content-manager): access to non default locale documents
* chore(content-manager): revert route construction
* test(content-manager): counting number of draft relations for non default locales
* chore(content-manager): remove default locale from entity manager countDraftRelations


---------

Co-authored-by: Ben Irvin <ben@innerdvations.com>
Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com>
Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
2024-01-25 18:43:08 +01:00
Josh
f6f04719a4
chore(cm): refactor to use redux-toolkit-query (#19281)
* chore: move existing react-query calls to redux-toolkit-query

* test: fix unit tests
2024-01-22 09:32:03 +00:00
Alexandre Bodin
a0d7ebc30f chore: migrate EditSettingsView to ts 2024-01-15 16:06:54 +00:00
Josh
d23325640d
chore(cm): convert list-view to TS (#19016)
* chore(cm): convert list-view to TS

* chore: fix broken tests

* chore: remove separate recursive paths and unify
2023-12-11 18:51:25 +00:00
Jamie Howard
40ef34cbcd
(content-manager): types for component service (#18869) 2023-12-07 11:58:14 +00:00
Josh
ac7ce4ebf2
chore(content-manager): convert cm app shell to TS (#18985) 2023-12-06 16:51:55 +00:00
Josh
f1dd5cc8ee
chore(content-manager): convert the editview to typescript (#18948) 2023-12-04 16:00:50 +00:00
Jamie Howard
08920be519
Convert CM to TS (#18669)
Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
2023-11-15 11:08:04 +00:00