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

Fix duplicate report content #2259

Merged
merged 1 commit into from
Sep 4, 2024
Merged

Fix duplicate report content #2259

merged 1 commit into from
Sep 4, 2024

Conversation

Fosol
Copy link
Collaborator

@Fosol Fosol commented Sep 4, 2024

Reports will not include duplicate content, and they will also exclude linked report content when configured to do so.

@Fosol Fosol added the bug Something isn't working label Sep 4, 2024
@Fosol Fosol self-assigned this Sep 4, 2024
</Row>
</Show>
<Row>
<FormikCheckbox
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Always show to reduce issue where the data source changes and it becomes hidden.

@@ -829,8 +828,14 @@ public IEnumerable<ReportInstance> GetLatestInstances(int id, int? ownerId = nul
if (sectionSettings.RemoveDuplicates)
query = query.Where(fc => !excludeAboveSectionContentIds.Contains(fc.ContentId));

if (excludeContentIds.Any() && !sectionSettings.OverrideExcludeHistorical)
query = query.Where(fc => !excludeContentIds.Contains(fc.ContentId));
if (!sectionSettings.OverrideExcludeHistorical)
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 logic for excluding content from a linked report.

Fixed logic for excluding content from above sections.

var excludeAboveAndHistorical = sectionSettings.OverrideExcludeHistorical
? excludeOnlyTheseContentIds.AppendRange(excludeAboveSectionContentIds).Distinct().ToArray()
: excludeOnlyTheseContentIds;
var excludeContentIds = excludeHistoricalContentIds.AppendRange(excludeReportContentIds).Distinct().ToArray();
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 logic for excluding content from a linked report.

Fixed logic for excluding content from above sections.

@Fosol Fosol merged commit 8e8046d into bcgov:dev Sep 4, 2024
2 checks passed
@Fosol Fosol deleted the exclude branch September 4, 2024 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant