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

Update predefined pages #2550

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

Update predefined pages #2550

wants to merge 19 commits into from

Conversation

johnnyomair
Copy link
Collaborator

@johnnyomair johnnyomair commented Sep 19, 2024

Description

The predefined pages demo was in a bad shape: Loading/saving didn't work, the info tag didn't look right, etc. I've therefore updated the demo to reflect the latests changes/decisions made in the CRUD Generator. Notable changes:

  • Use a GraphQL enum for type
  • Add the save conflict check

Related tasks and documents

https://vivid-planet.atlassian.net/browse/COM-1080

Further information

The implementation in Demo will be the basis for the docs, so please review carefully.

@johnnyomair johnnyomair self-assigned this Sep 19, 2024
@johnnyomair johnnyomair marked this pull request as ready for review September 23, 2024 08:20
@johnnyomair
Copy link
Collaborator Author

I tried splitting the save mutation into a create and update mutation first, but this requires a change to DocumentInterface, so I reverted my change. Should we plan this for the future?

@Field(() => String, { nullable: true })
@IsString()
@Field(() => PredefinedPageType, { nullable: true })
@IsEnum(PredefinedPageType)
@IsOptional()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@nsams type can be both optional (not changed) and nullable (unset). Should I use @IsUndefinable and @IsNullable() instead? And should the TS type reflect that as well?

Copy link
Member

Choose a reason for hiding this comment

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

yes, @IsOptional should not be used anymore. And in that case @IsUndefinable and @IsNullable() together are correct.

And should the TS type reflect that as well?

yes

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed: be85243

@johnnyomair
Copy link
Collaborator Author

@nsams @thomasdax98 it's probably best to review this on a commit basis.

@johnnyomair johnnyomair mentioned this pull request Sep 26, 2024
2 tasks
thomasdax98
thomasdax98 previously approved these changes Sep 30, 2024
@johnnyomair johnnyomair requested a review from nsams October 7, 2024 13:04
@johnnyomair
Copy link
Collaborator Author

@nsams please review again. I accidentally merged #2575, which needs the changes made here.

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