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

feat: disable dp #19671

Merged
merged 11 commits into from
Mar 12, 2024
Merged

feat: disable dp #19671

merged 11 commits into from
Mar 12, 2024

Conversation

Marc-Roig
Copy link
Contributor

What does it do?

Describe the technical changes you did.

Why is it needed?

Describe the issue you are solving.

How to test it?

Provide information about the environment and the path to verify the behaviour.

Related issue(s)/PR(s)

Let us know if this is related to any issue/pull request

Comment on lines +5 to +14
const testInTransaction = (...args: Parameters<jest.It>) => {
if (args.length > 1) {
return it(
args[0], // name
wrapInTransaction(args[1]), // fn
args[2] // timeout
);
}
return it(...args);
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

will actually remove this from here and do another separate pr for it

Comment on lines 154 to 171
const shop = await shopDocuments.create({
data: {
name: 'Shop1',
products_mo: { documentId: 'Skate', locale: 'en' },
products_oo: { documentId: 'Skate', locale: 'en' },
products_ow: { documentId: 'Skate', locale: 'en' },
},
locale: 'en',
populate: xToOneRelations,
});

// Products should be connected to both draft and published version
xToOneRelations.forEach((relation) => {
expect(shop[relation]).toMatchObject([
{ name: 'Skate-En', locale: 'en', publishedAt: null },
{ name: 'Skate-En', locale: 'en', publishedAt: expect.any(String) },
]);
});
Copy link
Contributor Author

@Marc-Roig Marc-Roig Mar 4, 2024

Choose a reason for hiding this comment

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

@alexandrebodin I would like to review the set of tests for relations together (there are still missing tests atm)

Specially, I would like to discuss the approach on return values of "oneToOne" relations, if a one to one relation can return a published and draft version, it has to be an array.

That will be a breaking change, and I wonder if it just would make sense (in xToOne relations) to always return a single relation at a time (draft or publish and pick a default)

Copy link
Member

@alexandrebodin alexandrebodin left a comment

Choose a reason for hiding this comment

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

small comments just to remember :)

@Marc-Roig Marc-Roig marked this pull request as ready for review March 5, 2024 13:49
@Marc-Roig
Copy link
Contributor Author

Will create other PRs for relations, I have checked and frontend does receive the default value of draft and publish if it is not set in the schema 👍 cc @alexandrebodin

@joshuaellis
Copy link
Member

Do you think it's better to build the whole feature on this branch like we are for relations? or merge incrementally, honestly i'd opt for the former considering they're small features 👀

@Marc-Roig
Copy link
Contributor Author

I wouldn't mind any of those options, handling relations will not be a small feature, so maybe we could keep this branch for this work+ the necessary ui work and I work on the relational stuff in parallel. wdyt?

joshuaellis and others added 4 commits March 11, 2024 15:16
* chore: re-implement option in ctb

* chore: refactor CM & i18n to accomodate option D&P

* test(unit): add test to ensure status is not in EditView header when we dont pass the prop

* chore: remove unused import

Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com>

---------

Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com>
@joshuaellis joshuaellis added source: core:content-manager Source is core/content-manager package pr: feature This PR adds a new feature labels Mar 12, 2024
@joshuaellis joshuaellis added this to the 5.0.0 milestone Mar 12, 2024
Copy link
Member

@joshuaellis joshuaellis left a comment

Choose a reason for hiding this comment

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

Approving because all the PRs were approved by the appropriate individuals

@Marc-Roig Marc-Roig merged commit 020096d into v5/main Mar 12, 2024
100 of 102 checks passed
@Marc-Roig Marc-Roig deleted the v5/disable-dp branch March 12, 2024 18:01
@echoes-hq echoes-hq bot added the echoes/type: feature/new For brand new features (v1/alpha/beta versions) label Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes/type: feature/new For brand new features (v1/alpha/beta versions) pr: feature This PR adds a new feature source: core:content-manager Source is core/content-manager package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants