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

EES-5787 Allow request Chart.Title to be null #5520

Merged
merged 1 commit into from
Jan 10, 2025
Merged

EES-5787 Allow request Chart.Title to be null #5520

merged 1 commit into from
Jan 10, 2025

Conversation

mmyoungman
Copy link
Collaborator

This fixes a bug introduced in EES-5731. A chart couldn't be created because the backend validation didn't allow a null chart title.

When creating a chart, the chart title is only provided in the request if the user is providing an alternative chart title. Otherwise, the chart title is generated by the backend (I believe).

@mmyoungman mmyoungman changed the title EES-5787 Allow Chart.Title to be null EES-5787 Allow request Chart.Title to be null Jan 10, 2025
@@ -70,7 +70,7 @@ public Validator()
{
chart
.RuleFor(request => request.Title)
.NotEmpty()
.NotEmpty().When(request => request.Title != null)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hey @mmyoungman - could this not just be:

                chart
                    .RuleFor(request => request.Title)
                    .MaximumLength(220);

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this would allow title to be an empty string?

I've switched to

  chart
                    .RuleFor(request => request.Title)
                    .Length(1, 220);

@mmyoungman mmyoungman merged commit 37c8de2 into dev Jan 10, 2025
10 checks passed
@mmyoungman mmyoungman deleted the EES-5787 branch January 10, 2025 14:27
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