Skip to content

Commit fbc729a

Browse files
CopilotApollon77
andcommitted
Fix adminUI and related fields merging during adapter upload
- Add replaceAttributes list to extendCommon method - Include adminUI, adminTab, and adminColumns in replacement list - These fields are now completely replaced instead of merged - Preserves backward compatibility for other object merging - Fixes issue where old adminUI configs persisted after removal Co-authored-by: Apollon77 <[email protected]>
1 parent dbf5ad4 commit fbc729a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/cli/src/lib/setup/setupUpload.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,13 +670,20 @@ export class Upload {
670670
'tier',
671671
];
672672

673+
// Object attributes that should be completely replaced, not merged
674+
const replaceAttributes = ['adminUI', 'adminTab', 'adminColumns'];
675+
673676
for (const [attr, attrData] of Object.entries(additional)) {
674677
// preserve these attributes, except, they were undefined before and preserve titleLang if current titleLang is of type string (changed by user)
675678
if (preserveAttributes.includes(attr) || (attr === 'titleLang' && typeof target[attr] === 'string')) {
676679
if (target[attr] === undefined) {
677680
target[attr] = attrData;
678681
}
679-
} else if (typeof attrData !== 'object' || attrData instanceof Array) {
682+
} else if (
683+
typeof attrData !== 'object' ||
684+
attrData instanceof Array ||
685+
replaceAttributes.includes(attr)
686+
) {
680687
try {
681688
target[attr] = attrData;
682689

0 commit comments

Comments
 (0)