Repository navigation
fix(sap-smartedit): keep the SAP label when the entry title falls back to the id - #1156
Open
pritesh-jain-cstk wants to merge 1 commit into
Conversation
…k to the id When a type's label column is blank or shared on some rows, the api titles those entries by source id. That overwrote the only copy of the label (two nav nodes titled Accessories lost it). Such types now also map the column to source_<col>. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Keep the SAP label when an entry's title falls back to its SAP id.
The connector titles an entry by its id when the label is blank or shared, so titles stay unique. That rule stays. But it overwrote the only copy of the label: in a real electronics-spa export, two nav nodes labelled "Accessories" lost their text, and
reconcile-sap.tswarned "label not stored" twice.The content-type builder (
upload-api/migration-sap-smartedit/libs/contentTypes.ts) now adds asource_<col>field mapped to the title's source column, only on types where some row's label is blank or shared. Types whose title is made up (no label column), or where every label is unique, get nothing.Behaviour
source_title; all 19 SAP labels kept, both "Accessories" included; the 27 nodes with no label in SAP stay without one (nothing invented).ContentSlotName.source_name,ContentPage.source_titlein medium-500); translated labels are filled per locale liketitle.Testing
contentTypes.sourceLabel.test.ts(fixture intests/fixtures/sap-smartedit-source-label/, outsidefixtures/sap-smartedit/so the folder-mode parser test is unaffected).npx vitest run --no-file-parallelism. In parallel, 4–6 random failures happen on the untouched branch too (test files share onecmsMigrationDatafolder).reconcile-sap.tsPASSED with no findings.Found in an end-to-end run SAP SmartEdit → migration-v2 → Contentstack → Spartacus (Jira DX-30753, gap G28). Independent of the companion url PR; either can merge alone.
Unrelated, seen on every run with or without this change: "cs_contentslot update failed" in the api log.
🤖 Generated with Claude Code
Re-verified 2026-11-05
Re-run on this PR's head by an independent verification pass (spot-checked by re-running). Only what was run is listed as verified.
Ran on head
1c63c138,upload-api/:npx vitest run --no-file-parallelism375/375 (32 files);contentTypes.sourceLabel.test.ts4/4;tsc --noEmit0 errors.npm cifails on the lock file here and on the base ("Missing: migration-sap-smartedit@1.0.0"), sonpm installwas used. Merges cleanly with #1155.Not verified: ESLint; the electronics-spa result (19 labels kept); the parallel-mode failures; the live v2 UI run and
reconcile-sap.ts. CIsecurity-scais failing (log not yet read).