From 1cd5c0b2a8991bbd16a4728b49db6306452ea1f8 Mon Sep 17 00:00:00 2001 From: foxriver76 Date: Wed, 27 Mar 2024 08:20:57 +0100 Subject: [PATCH 1/2] fix preserve logic for titleLang - closes #2604 --- packages/cli/src/lib/setup/setupUpload.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/lib/setup/setupUpload.ts b/packages/cli/src/lib/setup/setupUpload.ts index 9e1912210..a22ea6bbe 100644 --- a/packages/cli/src/lib/setup/setupUpload.ts +++ b/packages/cli/src/lib/setup/setupUpload.ts @@ -669,7 +669,7 @@ export class Upload { for (const [attr, attrData] of Object.entries(additional)) { // preserve these attributes, except, they were undefined before and preserve titleLang if current titleLang is of type string (changed by user) - if (preserveAttributes.includes(attr) || (attr === 'titleLang' && typeof attrData === 'string')) { + if (preserveAttributes.includes(attr) || (attr === 'titleLang' && typeof target[attr] === 'string')) { if (target[attr] === undefined) { target[attr] = attrData; } @@ -795,6 +795,7 @@ export class Upload { * @param name * @param ioPack * @param _logger + * @param logger */ async upgradeAdapterObjects( name: string, From 4ee12e771174adfa2ad8ba7d789f5ca397ae1332 Mon Sep 17 00:00:00 2001 From: foxriver76 Date: Wed, 27 Mar 2024 08:26:35 +0100 Subject: [PATCH 2/2] fix some jsdoc and ts-expect-error --- packages/cli/src/lib/setup/setupUpload.ts | 24 +++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/packages/cli/src/lib/setup/setupUpload.ts b/packages/cli/src/lib/setup/setupUpload.ts index a22ea6bbe..f6eba98ce 100644 --- a/packages/cli/src/lib/setup/setupUpload.ts +++ b/packages/cli/src/lib/setup/setupUpload.ts @@ -260,8 +260,8 @@ export class Upload { /** * Uploads a file * - * @param source - * @param target + * @param source source path + * @param target target path */ async uploadFile(source: string, target: string): Promise { target = target.replace(/\\/g, '/'); @@ -483,11 +483,11 @@ export class Upload { /** * Upload given adapter * - * @param adapter - * @param isAdmin - * @param forceUpload - * @param subTree - * @param _logger + * @param adapter adapter name + * @param isAdmin if admin folder should be uploaded too + * @param forceUpload if upload should be forced + * @param subTree subtree path to upload + * @param _logger logger instance */ async uploadAdapter( adapter: string, @@ -576,8 +576,7 @@ export class Upload { }); } // Set indicator to 0 - // @ts-expect-error fixed with #1917 - await this.states.setStateAsync(uploadID, 0, true); + await this.states.setState(uploadID, { val: 0, ack: true }); } let result; @@ -792,10 +791,9 @@ export class Upload { /** * Create object from io-package json * - * @param name - * @param ioPack - * @param _logger - * @param logger + * @param name adapter name + * @param ioPack IoPack content + * @param logger logger instance */ async upgradeAdapterObjects( name: string,