-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[PM-13014] - Add CanToggleStatus property to PolicyRepsonseModel based on Policy Validators #4940
base: main
Are you sure you want to change the base?
Conversation
…Added mappings wrapped in feature flag.
… same type of policy validator into its DI.
New Issues
Fixed Issues
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4940 +/- ##
=======================================
Coverage 42.56% 42.57%
=======================================
Files 1387 1389 +2
Lines 64653 64678 +25
Branches 5936 5940 +4
=======================================
+ Hits 27521 27536 +15
- Misses 35908 35916 +8
- Partials 1224 1226 +2 ☔ View full report in Codecov by Sentry. |
...Core/AdminConsole/OrganizationFeatures/Policies/PolicyValidators/SingleOrgPolicyValidator.cs
Outdated
Show resolved
Hide resolved
…om List endpoint. Added new details model for single policy response. Validator now returns after first error.
# Conflicts: # src/Api/AdminConsole/Controllers/PoliciesController.cs
throw new ArgumentException($"'{nameof(policy)}' must be of type '{nameof(PolicyType.SingleOrg)}'.", nameof(policy)); | ||
} | ||
|
||
return new PolicyDetailResponseModel(policy, await hasVerifiedDomainsQuery.HasVerifiedDomainsAsync(policy.OrganizationId)); |
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.
I think the bool needs to be inverted:
- has verified domains => can't toggle state
- does not have verified domains => can toggle state
(Probably a drawback of a bool that defaults to true
, I didn't realise that when I suggested the naming. But no need to spend more time on it.)
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.
No changes required, but I am interested in the decision to use an extension method here vs. a static method on the class itself. I can make some guesses but would like to hear your thoughts.
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.
Api request/response models live in the Api
project.
🎟️ Tracking
PM-13014
📔 Objective
This will add a
CanToggleStatus
flag to thePolicyResponseModel
to inform clients on whether or not they will be allowed to change the status of the policy (enable/disable). This is using the newPolicyValidator#ValidateAsync
methods to determine if it can be changed. This is limited toSingle Org Policy
for now.⏰ Reminders before review
🦮 Reviewer guidelines
:+1:
) or similar for great changes:memo:
) or ℹ️ (:information_source:
) for notes or general info:question:
) for questions:thinking:
) or 💭 (:thought_balloon:
) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:
) for suggestions / improvements:x:
) or:warning:
) for more significant problems or concerns needing attention:seedling:
) or ♻️ (:recycle:
) for future improvements or indications of technical debt:pick:
) for minor or nitpick changes