Skip to content

fix(web): hide Unreviewed from the review status rule form - #5187

Open
pcbeingused333 wants to merge 2 commits into
Ericsson:masterfrom
pcbeingused333:fix/review-status-rule-unreviewed
Open

pcbeingused333 wants to merge 2 commits into
Ericsson:masterfrom
pcbeingused333:fix/review-status-rule-unreviewed

Conversation

@pcbeingused333

Copy link
Copy Markdown
Contributor

Fixes #5048

Summary

The "New/Edit review status rule" dialog listed every ReviewStatus in its select, including Unreviewed (enum value 0). The dialog's validator is v => !!v || "Review status is required", so choosing Unreviewed was rejected with "Review status is required" even though a value had been picked.

As suggested by @bruntib in the issue, Unreviewed is removed from this form instead of changing the validator or the semantics of getReviewStatusRules. SelectReviewStatus gets an excludeUnreviewed prop (default false), only EditReviewStatusRuleDialog sets it, so the report and rule filters still offer all statuses.

Test

New SelectReviewStatus.test.js (jest) checks that all statuses are offered by default and that Unreviewed is omitted, with the remaining statuses intact, when excludeUnreviewed is set. The second case fails without the change and passes with it; eslint src/components/ReviewStatus is clean.

This change and its regression test were prepared with AI assistance.

The rule dialog offered "Unreviewed" but its validator (!!v) rejects the
enum value 0, so choosing it produced "Review status is required".
Unreviewed is not a meaningful rule status, so exclude it from the form's
select via a new excludeUnreviewed prop; filters keep all statuses.

Fixes Ericsson#5048

Signed-off-by: Alex Castillo <alex.castillog33@gmail.com>
The generated report_server_types.js lives outside vue-cli, so its
require('thrift') was not found when the new unit test imported it.
Add vue-cli's node_modules to jest modulePaths.

Signed-off-by: Alex Castillo <alex.castillog33@gmail.com>
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.

getReviewStatusRules function doesn't return items with ReviewStatus UNREVIEWED

1 participant