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 topic score rules #650

Merged
merged 1 commit into from
Apr 3, 2023
Merged

Fix topic score rules #650

merged 1 commit into from
Apr 3, 2023

Conversation

Fosol
Copy link
Collaborator

@Fosol Fosol commented Apr 3, 2023

Fixing topic score rules admin page validation. Also defaulting advanced filter to source.

Add DB migration 1.0.10.

image

image

@Fosol Fosol added the bug Something isn't working label Apr 3, 2023
@Fosol Fosol self-assigned this Apr 3, 2023
@Fosol Fosol requested a review from jdtoombs as a code owner April 3, 2023 18:58
Add DB migration 1.0.10
pageMax: yup
.string()
.optional()
.when('pageMin', (pageMin: string, schema: any) => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Validation to ensure the max page is greater than the minimum page.

rPageMax !== undefined &&
(vPage === 0 || vPage < rPageMin || vPage > rPageMax)) ||
(cPageMin !== undefined &&
vcPage !== cPageMin &&
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Handle letter comparison too.

@@ -31,7 +31,7 @@ export const initialContentState: IContentState = {
sort: [],
},
filterAdvanced: {
fieldType: fieldTypes[3].value,
fieldType: fieldTypes[1].value,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Default is source

@@ -11,8 +11,8 @@ public override void Configure(EntityTypeBuilder<TopicScoreRule> builder)
builder.Property(m => m.SourceId).IsRequired();
builder.Property(m => m.SeriesId);
builder.Property(m => m.Section).HasMaxLength(100);
builder.Property(m => m.PageMin);
builder.Property(m => m.PageMax);
builder.Property(m => m.PageMin).HasMaxLength(5);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Change to string value. I don't know how this wasn't included in my prior PR. I think there was a git merge issue I must have run into because I did convert this to a string at one point.

@Fosol Fosol merged commit 2f6ddac into bcgov:dev Apr 3, 2023
@Fosol Fosol deleted the fix branch April 3, 2023 19:18
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