Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pro 6416 missing fields #76

Merged
merged 22 commits into from
Aug 27, 2024
Merged

Pro 6416 missing fields #76

merged 22 commits into from
Aug 27, 2024

Conversation

ValJed
Copy link
Contributor

@ValJed ValJed commented Aug 21, 2024

PRO-6416

Summary

  • Uses the method findForEditing to get related documents instead of taking them directly from exported docs. This way data exported isn't limited to projections.
  • The related routes, also checks related types of related types. Ex: if your exported piece is an article with relations to images, before the related modal wouldn't have proposed image-tag (relation of images) now it does.

What are the specific steps to test this change?

  • Related modal should should also show the related types of the exported document related documents. Still have a recursion level limit of 10 (that is probably useless).

  • Let's say you have articles and topics.
    Topics has projections.
    Export an article with a relation to a topic.
    It should export the entire topic not only projected fields

Cypress tests: 🟠

What kind of change does this PR introduce?

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Build-related changes
  • Other

Make sure the PR fulfills these requirements:

  • It includes a) the existing issue ID being resolved, b) a convincing reason for adding this feature, or c) a clear description of the bug it resolves
  • The changelog is updated
  • Related documentation has been updated
  • Related tests have been updated

@ValJed ValJed marked this pull request as draft August 21, 2024 12:18
@ValJed ValJed self-assigned this Aug 21, 2024
recursions++;
if (recursions >= MAX_RECURSION) {
return related;
}
Copy link
Contributor Author

@ValJed ValJed Aug 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure we need this recursion limit since we parse each type schema only once.

@ValJed ValJed requested a review from ETLaurent August 26, 2024 07:42
@ValJed ValJed requested a review from myovchev August 26, 2024 08:07
@ValJed ValJed marked this pull request as ready for review August 26, 2024 08:07
@@ -229,7 +229,7 @@ export default {
this.relatedTypes = await apos.http.get('/api/v1/@apostrophecms/import-export/related', {
busy: true,
qs: {
type: this.type
types: [ this.type ]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New related route takes an array of types (for future pages implementation).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be good to test the route in addition of the method, but lgtm

@@ -229,7 +229,7 @@ export default {
this.relatedTypes = await apos.http.get('/api/v1/@apostrophecms/import-export/related', {
busy: true,
qs: {
type: this.type
types: [ this.type ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be good to test the route in addition of the method, but lgtm

CHANGELOG.md Outdated Show resolved Hide resolved
@ValJed ValJed merged commit ab9a165 into main Aug 27, 2024
6 checks passed
@ValJed ValJed deleted the pro-6416-missing-fields branch August 27, 2024 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants