Skip to content

Conversation

@ivarne
Copy link
Member

@ivarne ivarne commented Nov 20, 2025

Application metadata allows the following boolean parameters https://github.com/Altinn/altinn-storage/blob/c6918a3422b29501eeb1ff8b41e592deaf9f248f/src/Storage.Interface/Models/ApplicationLogic.cs#L44-L56

Also added description and title for queryParameters on selection components

Description

Related Issue(s)

  • closes #{issue number}

Verification/QA

  • Manual functionality testing
    • I have tested these changes manually
    • Creator of the original issue (or service owner) has been contacted for manual testing (or will be contacted when released in alpha)
    • No testing done/necessary
  • Automated tests
    • Unit test(s) have been added/updated
    • Cypress E2E test(s) have been added/updated
    • No automatic tests are needed here (no functional changes/additions)
    • I want someone to help me make some tests
  • UU/WCAG (follow these guidelines until we have our own)
    • I have tested with a screen reader/keyboard navigation/automated wcag validator
    • No testing done/necessary (no DOM/visual changes)
    • I want someone to help me perform accessibility testing
  • User documentation @ altinn-studio-docs
    • Has been added/updated
    • No functionality has been changed/added, so no documentation is needed
    • I will do that later/have created an issue
  • Support in Altinn Studio
    • Issue(s) created for support in Studio
    • This change/feature does not require any changes to Altinn Studio
  • Sprint board
    • The original issue (or this PR itself) has been added to the Team Apps project and to the current sprint board
    • I don't have permissions to do that, please help me out
  • Labels
    • I have added a kind/* and backport* label to this PR for proper release notes grouping
    • I don't have permissions to add labels, please help me out

Summary by CodeRabbit

Release Notes

  • New Features

    • Added configuration controls to restrict user permissions for creating and deleting specific data element types, enabling more granular access management.
    • Enhanced data fetching with improved query parameter support for more flexible URL-based data retrieval configurations.
  • Refactor

    • Modernized parameter handling system with updated query parameter mappings.

✏️ Tip: You can customize this high-level summary in your review settings.

Application metadata allows the following boolean parameters
https://github.com/Altinn/altinn-storage/blob/c6918a3422b29501eeb1ff8b41e592deaf9f248f/src/Storage.Interface/Models/ApplicationLogic.cs#L44-L56

Also added description and title for queryParameters on selection components
@ivarne ivarne requested a review from olemartinorg November 20, 2025 15:18
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 20, 2025

📝 Walkthrough

Walkthrough

Schema file adds two new boolean properties (disallowUserCreate and disallowUserDelete) to the applicationLogic definition for expanded validation capabilities. Separately, TypeScript codegen file replaces a deprecated mapping property with a new queryParameters property in the ISelectionComponent interface for query string parameter mapping.

Changes

Cohort / File(s) Summary
Schema updates
schemas/json/application/application-metadata.schema.v1.json
Added two boolean properties to definitions/applicationLogic: disallowUserCreate and disallowUserDelete positioned after autoDeleteOnProcessEnd to control user creation and deletion permissions for data elements
Code generation property replacement
src/codegen/Common.ts
Replaced deprecated mapping property (type IMapping) in ISelectionComponent with new optional queryParameters property (type IQueryParameters) to represent query string parameters appended to the URL during option fetching

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify correct property types and placement in schema file
  • Confirm queryParameters property correctly replaces deprecated mapping functionality
  • Ensure no unintended breaking changes from property replacement in TypeScript interface

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Update json schemas' is vague and overly generic, failing to specify which schemas were updated or what the primary changes were. Use a more specific title that describes the main changes, such as 'Add disallowUserCreate/Delete properties and queryParameters description to schemas' or similar.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The description provides context via an external link and mentions the changes, but the verification/QA section is largely incomplete with no checkboxes marked and no issue number provided.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/update-schema-user-create

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (1)
src/codegen/Common.ts (1)

374-382: Consider removing duplicate title and description.

The title and description set on lines 378-381 duplicate what's already defined in the IQueryParameters type definition (lines 298-301). This duplication could lead to maintenance issues if the descriptions need to be updated in the future and one location is missed.

If the duplication is necessary for schema generation purposes, consider adding a comment explaining why. Otherwise, apply this diff to remove the redundant calls:

 new CG.prop(
   'queryParameters',
   CG.common('IQueryParameters')
-    .optional()
-    .setTitle('Query parameters')
-    .setDescription(
-      'A mapping of query string parameters to values. Will be appended to the URL when fetching options.',
-    ),
+    .optional(),
 ),
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 31dc201 and 23a0118.

📒 Files selected for processing (2)
  • schemas/json/application/application-metadata.schema.v1.json (1 hunks)
  • src/codegen/Common.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/codegen/Common.ts (1)
src/codegen/CG.ts (1)
  • CG (25-57)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Type-checks, eslint, unit tests and SonarCloud
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Install
🔇 Additional comments (1)
schemas/json/application/application-metadata.schema.v1.json (1)

462-471: Schema properties are valid; backend alignment verification requires manual review.

The two boolean properties (disallowUserCreate and disallowUserDelete) are correctly defined at lines 462-471 with proper types, titles, and descriptions. The JSON schema is valid.

However, the backend alignment verification referenced in the PR objectives (Altinn storage commit c6918a3, ApplicationLogic.cs) cannot be completed in this sandbox environment, as the backend repository is external to this codebase. Verify manually that these schema properties match the corresponding fields in the referenced backend model.

@sonarqubecloud
Copy link

@olemartinorg olemartinorg added kind/bug Something isn't working backport This PR should be cherry-picked onto older release branches labels Nov 21, 2025
@olemartinorg
Copy link
Contributor

Btw, the test failures were fixed in #3863. It should be safe to just merge this as-is.

@olemartinorg
Copy link
Contributor

@ivarne I'll leave it to you to merge this when ready. Since it's still open I'll assume you either forgot about it or that there's something left to do.

@ivarne ivarne merged commit ac3683d into main Dec 3, 2025
20 of 27 checks passed
@ivarne ivarne deleted the chore/update-schema-user-create branch December 3, 2025 11:06
github-actions bot pushed a commit that referenced this pull request Dec 3, 2025
Application metadata allows the following boolean parameters
https://github.com/Altinn/altinn-storage/blob/c6918a3422b29501eeb1ff8b41e592deaf9f248f/src/Storage.Interface/Models/ApplicationLogic.cs#L44-L56

Also added description and title for queryParameters on selection components
@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

Automatic backport successful!

A backport PR has been automatically created for the release/v4.23 release branch.

The release branch release/v4.23 already existed and was updated.

The cherry-pick was clean with no conflicts. Please review the backport PR when it appears.

ivarne added a commit that referenced this pull request Dec 3, 2025
Application metadata allows the following boolean parameters
https://github.com/Altinn/altinn-storage/blob/c6918a3422b29501eeb1ff8b41e592deaf9f248f/src/Storage.Interface/Models/ApplicationLogic.cs#L44-L56

Also added description and title for queryParameters on selection components
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR should be cherry-picked onto older release branches kind/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants