feat: AdvancedRequestModal preselects the calculated routing rule on create - #2832
Closed
Mczubi wants to merge 3 commits into
Closed
Conversation
…ule on create Implemented a new route GET /api/v1/request/resolved-route which returns the calculated output of the routing rule. This route then is used by the request modal to determine the correct initial setting for a newly created request. This grants admin users the possibility to have the same qol feature as a non admin one. re seerr-team#2452
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Reasoning
I discovered that there was an PR open which would solve most of the issues i have with assigning the correct service / profile automatically.
Testing this feature i saw that for non admin users, restricted to making only requests, this worked perfectly.
The rules were calculated correctly and the request could get approved by an admin.
But when using an administrative user, the advanced request modal would always fallback to the initial settings.
In other words, it did not use the calculation functionality introduced by the rules routing feature.
As this was a major letdown, i decided to implement a feature that would allow an admin user to also have the calculated default preselected, but still granting him the option to change the reasoning of the automation.
Detail
Implemented a new route GET /api/v1/request/resolved-route which returns the calculated output of
the routing rule using the same logic as the post request route.
This route then is used by the request modal to determine the correct
initial setting for a newly created request.
This grants admin users the same quality of life feature as a non admin one has.
This PR is a follow-up to PR #2452.
It adds preselection for advanced requests which depends on the changes introduced there.
How Has This Been Tested?
Tests were performed manually by performing the request creation action with both admin and non admin user.
Test instance was connected to my local running Sonarr / Radarr instances and ran against both of them.
Each new request created through my test instance landed on the correct Instance either chosen by the auto calculated rules or by the manual override performed by an admin user.
No affect was noticed on any other component throughout testing
Screenshots / Logs (if applicable)
Checklist:
Ran cypress and all seemed fine
pnpm buildpnpm i18n:extract