Skip to content

Commit 51faba7

Browse files
CopilotApollon77GermanBluefox
authored
Fix adminUI and related object fields not being replaced during adapter upload (#3096)
* Initial plan * 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]> * Add changelog entry for adminUI fix Co-authored-by: Apollon77 <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Apollon77 <[email protected]> Co-authored-by: Ingo Fischer <[email protected]> Co-authored-by: Bluefox <[email protected]>
1 parent ab98d23 commit 51faba7

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
-->
66

77
## __WORK IN PROGRESS__
8+
* (@copilot) Fixed adminUI, adminTab, and adminColumns configurations being incorrectly preserved during adapter uploads
89
* (@foxriver76) Added objects warn limit per instance
910
* (@Apollon77) Allows only numbers for `ts` and `lc` fields in state when provided for setState
1011
* (@GermanBluefox) Added typing for `visIconSets` in `io-package.json`(for vis-2 SVG icon sets)

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)