-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat(webapi): Add flag for disabling SystemLabel reset #1921
Conversation
📝 WalkthroughWalkthroughThis pull request introduces enhancements to control the system label reset functionality. A new constant is added to clearly document the admin scope requirement for disabling the reset, while multiple command and request classes are extended with a new boolean property, Changes
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Patch/PatchDialogsController.cs (1)
66-72
: Update API documentation to include the new parameter.The new
disableSystemLabelReset
parameter should be documented in the method's remarks section to inform API consumers about its purpose and behavior.Apply this diff to update the documentation:
/// Patches a dialog aggregate with a RFC6902 JSON Patch document. The patch document must be a JSON array of RFC6902 operations. /// See [https://tools.ietf.org/html/rfc6902](https://tools.ietf.org/html/rfc6902) for more information. /// /// Optimistic concurrency control is implemented using the If-Match header. Supply the Revision value from the GetDialog endpoint to ensure that the dialog is not modified/deleted by another request in the meantime. + /// + /// The disableSystemLabelReset parameter allows administrators to prevent the system label from being reset during the update. /// </remarks>src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/UpdateDialogCommand.cs (1)
174-177
: Consider making UpdateLabel method private.Since UpdateLabel is only called from within the Handle method, it should be marked as private to better encapsulate the implementation.
- private void UpdateLabel(DialogEntity dialog) + private static void UpdateLabel(DialogEntity dialog)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
src/Digdir.Domain.Dialogporten.Application/Common/Authorization/Constants.cs
(1 hunks)src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/UpdateDialogCommand.cs
(4 hunks)src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Create/CreateDialogActivityEndpoint.cs
(2 hunks)src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Create/CreateDialogTransmissionEndpoint.cs
(2 hunks)src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Patch/PatchDialogsController.cs
(2 hunks)src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Update/UpdateDialogEndpoint.cs
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Dry run deploy apps / Deploy web-api-eu to test
- GitHub Check: build / build-and-test
🔇 Additional comments (10)
src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Update/UpdateDialogEndpoint.cs (2)
42-43
: LGTM! Command initialization looks good.The new
DisableSystemLabelReset
property is correctly initialized with a default value offalse
, following the same pattern asDisableAltinnEvents
.
75-76
: LGTM! Property declaration is consistent.The new property follows the same pattern as
DisableAltinnEvents
, using the[HideFromDocs]
attribute and nullable boolean type.src/Digdir.Domain.Dialogporten.Application/Common/Authorization/Constants.cs (1)
20-21
: LGTM! Clear and consistent error message.The new constant follows the same pattern as other admin scope requirement messages, providing clear feedback to users.
src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Create/CreateDialogTransmissionEndpoint.cs (2)
69-70
: LGTM! Command initialization looks good.The new
DisableSystemLabelReset
property is correctly initialized with a default value offalse
, following the same pattern asDisableAltinnEvents
.
102-103
: LGTM! Property declaration is consistent.The new property follows the same pattern as
DisableAltinnEvents
, using the[HideFromDocs]
attribute and nullable boolean type.src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Create/CreateDialogActivityEndpoint.cs (2)
69-70
: LGTM! Command initialization looks good.The new
DisableSystemLabelReset
property is correctly initialized with a default value offalse
, following the same pattern asDisableAltinnEvents
.
104-105
: LGTM! Property declaration is consistent.The new property follows the same pattern as
DisableAltinnEvents
, using the[HideFromDocs]
attribute and nullable boolean type.src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Patch/PatchDialogsController.cs (1)
92-99
: LGTM!The command initialization correctly handles the new
DisableSystemLabelReset
property, maintaining backward compatibility with a default value of false.src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/UpdateDialogCommand.cs (2)
23-34
: LGTM!The new property is well-integrated into the command class, following the existing pattern.
71-74
: LGTM!The permission check correctly enforces that only administrators can disable the system label reset.
🤖 I have created a release *beep* *boop* --- ## [1.55.0](v1.54.0...v1.55.0) (2025-02-20) ### Features * **webapi:** Add flag for disabling SystemLabel reset ([#1921](#1921)) ([a5689f2](a5689f2)) ### Bug Fixes * **webapi:** Add missing 404 status code in activity list swagger schema ([#1924](#1924)) ([8f382cd](8f382cd)) * **webapi:** Add missing status codes in swagger docs for transmissions endpoints ([#1926](#1926)) ([2458d6a](2458d6a)) ### Miscellaneous Chores * **ci:** Releasing NuGet depends on app-deploy ([#1920](#1920)) ([37f9990](37f9990)) * **ci:** Use correct project path for NuGet publishing ([#1925](#1925)) ([7507187](7507187)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Description
Related Issue(s)
Verification
Documentation
docs
-directory, Altinnpedia or a separate linked PR in altinn-studio-docs., if applicable)