Skip to content

fix: support single-sheet and multi-sheet configs via getSheetByName#922

Open
kptdobe wants to merge 2 commits intomainfrom
sheetfix
Open

fix: support single-sheet and multi-sheet configs via getSheetByName#922
kptdobe wants to merge 2 commits intomainfrom
sheetfix

Conversation

@kptdobe
Copy link
Copy Markdown
Contributor

@kptdobe kptdobe commented May 7, 2026

Issue

Customer reported issue: library (blocks, templates, icons...) is not loaded if the repo config has only one "library" sheet.

Summary

  • Adds getSheetByName(json, name) utility to blocks/shared/utils.js that resolves a named sheet from both single-sheet configs (validated via ':sheetname') and multi-sheet configs (via named key)
  • Fixes fetchLibraryConfig in da-library/helpers/helpers.js which previously destructured library directly from the config, breaking when the config is a single-sheet file
  • Adds null guard for missing site config (configs[1])

Test plan

  • getSheetByName unit tests covering: multi-sheet hit, multi-sheet miss, single-sheet name match, single-sheet name mismatch, single-sheet no :sheetname, single-sheet no data
  • All 1311 existing tests continue to pass

Test page: https://sheetfix--da-live--adobe.aem.live/edit#/doe-app-svc/da-sws-tester2/index

🤖 Generated with Claude Code

Adds getSheetByName util that resolves a named sheet from both single-sheet
(via :sheetname) and multi-sheet (via named key) config JSON. Fixes
fetchLibraryConfig which previously assumed multi-sheet only.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aem-code-sync
Copy link
Copy Markdown

aem-code-sync Bot commented May 7, 2026

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-sync branch
Commits

@kptdobe kptdobe requested review from auniverseaway and chrischrischris and removed request for auniverseaway May 7, 2026 07:07
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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