-
Notifications
You must be signed in to change notification settings - Fork 58
Set limit for the MVP contributions #558
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
Changes from all commits
69ca33d
868a8ad
5b1d906
825297f
22e0e0e
a7fe8a2
4d692a8
f2be366
08495f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -432,6 +432,14 @@ private async Task ExecuteContributionsStep(ApplicationFormModel model) | |
&& model.ContributionDate.Value >= model.CurrentSelection?.ApplicationsEnd.AddMonths(-_options.TimeFrameMonths) | ||
&& model.ContributionDate.Value <= model.CurrentSelection.ApplicationsEnd) | ||
{ | ||
if (model.CurrentApplication?.Contributions.Count >= 30) | ||
{ | ||
model.NextStep = ApplicationStep.Contributions; | ||
await LoadProducts(model); | ||
ModelState.AddModelError(string.Empty, "You have reached the limit of 30 contributions. Please review your list and select only top 30 contributions."); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make this text content editable |
||
return; | ||
} | ||
|
||
Contribution contribution = new(model.UpdateContributionId ?? Guid.Empty) | ||
{ | ||
Date = model.ContributionDate.Value, | ||
|
@@ -536,6 +544,13 @@ private async Task ExecuteConfirmationStep(ApplicationFormModel model) | |
{ | ||
if (model.IsNavigation.HasValue && model.IsNavigation.Value) | ||
{ | ||
if (model.CurrentApplication?.Contributions.Count < 3) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make this value configurable on a Sitecore Item. |
||
{ | ||
ModelState.AddModelError(string.Empty, "You must add atleast 3 contributions to submit your application."); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make this text content editable |
||
model.NextStep = ApplicationStep.Contributions; | ||
return; | ||
} | ||
|
||
model.NextStep = ApplicationStep.Confirmation; | ||
} | ||
else if (model.IsNavigation.HasValue && !model.IsNavigation.Value && model.UnderstandsReviewConsent && model is { UnderstandsProgramAgreement: true, IsComplete: true, CurrentApplication: not null }) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this value configurable on a Sitecore Item