Skip to content

refactor: use common resourcelist component for showing and filtering role resources - #2407

Merged
mgunnerud merged 3 commits into
mainfrom
refactor/use-common-resource-list-component
Jul 27, 2026
Merged

refactor: use common resourcelist component for showing and filtering role resources#2407
mgunnerud merged 3 commits into
mainfrom
refactor/use-common-resource-list-component

Conversation

@mgunnerud

@mgunnerud mgunnerud commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Description

  • Use common resourcelist component for showing and filtering role resources. This also adds the service owner filter to the dialog
  • Remove old code which is no longer in use after the refactor
image

Related Issue(s)

  • #{issue number}

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

Summary by CodeRabbit

  • Refactor
    • Replaced the role resources list with a shared resource-list experience.
    • Removed the previous list components and their associated styling and stories.
    • Resource loading and empty states are now handled consistently by the shared resource-list interface.
    • Removed the resource search controls from the role details view.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 179d8623-e780-4112-9dc9-b0d9390008bf

📥 Commits

Reviewing files that changed from the base of the PR and between 5400748 and ccd2f5f.

📒 Files selected for processing (9)
  • src/components/index.ts
  • src/features/amUI/common/DelegationModal/AccessPackages/useResourceList.tsx
  • src/features/amUI/common/DelegationModal/Role/RoleInfo.module.css
  • src/features/amUI/common/DelegationModal/Role/RoleResourcesSection.tsx
  • src/features/amUI/common/List/List.module.css
  • src/features/amUI/common/List/List.stories.tsx
  • src/features/amUI/common/List/List.tsx
  • src/features/amUI/common/List/ListItem.tsx
  • src/features/amUI/common/List/index.ts
💤 Files with no reviewable changes (8)
  • src/features/amUI/common/List/ListItem.tsx
  • src/components/index.ts
  • src/features/amUI/common/List/List.tsx
  • src/features/amUI/common/List/index.ts
  • src/features/amUI/common/List/List.stories.tsx
  • src/features/amUI/common/List/List.module.css
  • src/features/amUI/common/DelegationModal/AccessPackages/useResourceList.tsx
  • src/features/amUI/common/DelegationModal/Role/RoleInfo.module.css

📝 Walkthrough

Walkthrough

Role resource rendering now delegates search-independent display, loading, and empty states to ResourceList. The previous useResourceList hook, List components, Storybook story, exports, and related CSS are removed.

Changes

Resource list consolidation

Layer / File(s) Summary
Resource rendering migration
src/features/amUI/common/DelegationModal/Role/RoleResourcesSection.tsx
Replaces local search, filtering, loading, and list markup with ResourceList, configured with translated empty-state text and non-interactive compact rendering.
Legacy list cleanup
src/components/index.ts, src/features/amUI/common/List/*, src/features/amUI/common/DelegationModal/AccessPackages/useResourceList.tsx, src/features/amUI/common/DelegationModal/Role/RoleInfo.module.css
Removes obsolete list components, exports, Storybook coverage, resource mapping hook, and unused role resource styles.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: kind/chore

Suggested reviewers: sonwit, allinox

Poem

Old lists fade away,
ResourceList takes the stage,
Search and styles depart,
Cleaner paths remain.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main refactor to use the shared ResourceList for role resources and filtering.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/use-common-resource-list-component

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


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.

@mgunnerud

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@mgunnerud
mgunnerud requested a review from sonwit July 27, 2026 11:51

@sonwit sonwit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼 Veldig bra!

@mgunnerud
mgunnerud merged commit d3c720a into main Jul 27, 2026
5 checks passed
@mgunnerud
mgunnerud deleted the refactor/use-common-resource-list-component branch July 27, 2026 14:12
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.

2 participants