Skip to content

fix(admin-ui): data not preloading on the Asset edit page (#2913)#2914

Merged
duttarnab merged 1 commit into
mainfrom
admin-ui-issue-2913
Jul 1, 2026
Merged

fix(admin-ui): data not preloading on the Asset edit page (#2913)#2914
duttarnab merged 1 commit into
mainfrom
admin-ui-issue-2913

Conversation

@faisalsiddique4400

@faisalsiddique4400 faisalsiddique4400 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

fix(admin-ui): data not preloading on the Asset edit page (#2913)

Summary

This PR fixes an issue where asset data was not being loaded when opening the Asset page in edit mode.

The update ensures the existing asset details are fetched correctly before rendering the edit form, allowing users to view and modify the current asset configuration without manually reloading the page.


Fix Summary

  • Fixed asset data fetching in edit mode
  • Ensured existing asset details are loaded before rendering the edit form
  • Restored pre-population of asset fields during editing
  • Corrected edit page initialization flow
  • Preserved existing asset creation behavior
  • Improved reliability of the Asset management workflow

Verification

npm run check:all

passes successfully.

  • Verified asset data is preloaded when opening an existing asset for editing
  • Verified all asset fields are populated with the existing values
  • Verified asset updates can be saved successfully
  • Verified asset creation flow remains unaffected
  • Verified no regressions in the Asset management workflow

🔗 Ticket

Closes: #2913

Summary by CodeRabbit

  • Bug Fixes
    • Improved selection fields so the currently chosen value remains visible even if it is not included in the latest list of options.
    • Made asset details load more reliably when data is returned in different response shapes, helping prevent missing or inconsistent asset information in the UI.

Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
@coderabbitai

coderabbitai Bot commented Jul 1, 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 57d3fe3c-1e6b-4802-b764-b6bc91e017cb

📥 Commits

Reviewing files that changed from the base of the PR and between d3f0ced and 41984f8.

📒 Files selected for processing (2)
  • admin-ui/app/routes/Apps/Gluu/GluuSelectRow.tsx
  • admin-ui/plugins/admin/components/Assets/AssetForm.tsx

📝 Walkthrough

Walkthrough

This PR fixes two issues: GluuSelectRow now preserves the current displayValue in the deduplicated options list even when absent from incoming values, and AssetForm derives asset data via useMemo, falling back to the full response when entries are missing, fixing asset preload in edit mode.

Changes

GluuSelectRow value resolution

Layer / File(s) Summary
Preserve current selection in options list
admin-ui/app/routes/Apps/Gluu/GluuSelectRow.tsx
Adds a resolvedValues memo that prepends the current displayValue when missing from values, and uses it for both the freeSolo options list and the <select> option rendering.

AssetForm data preload fix

Layer / File(s) Summary
Asset derivation refactor
admin-ui/plugins/admin/components/Assets/AssetForm.tsx
Renames assetPage to assetResponse and derives asset via useMemo, selecting the first entries item or falling back to the whole response cast as Document.

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

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

Poem

Two little bugs, hopped away today,
One kept my picks from drifting astray,
One let the asset page finally load,
A rabbit's delight down this code-lined road,
Thump-thump, ship it, hooray! 🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The GluuSelectRow change appears unrelated to the asset edit preloading issue and is outside the linked scope. Remove or justify the GluuSelectRow change in this PR, or split it into a separate change if it is a distinct fix.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: fixing asset data preloading on the edit page.
Linked Issues check ✅ Passed The asset edit form refactor addresses issue #2913 by deriving the current asset for preloading in edit mode.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 admin-ui-issue-2913

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.

@mo-auto mo-auto added comp-admin-ui Component affected by issue or PR kind-bug Issue or PR is a bug in existing functionality labels Jul 1, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

@duttarnab duttarnab merged commit 1e859b0 into main Jul 1, 2026
10 checks passed
@duttarnab duttarnab deleted the admin-ui-issue-2913 branch July 1, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-admin-ui Component affected by issue or PR kind-bug Issue or PR is a bug in existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(admin-ui): Data not preloading in the asset page in the editing mode.

3 participants