diff --git a/src/modules/pipelinesV2/pipelines.service.ts b/src/modules/pipelinesV2/pipelines.service.ts index 88f7a42..9d545c6 100644 --- a/src/modules/pipelinesV2/pipelines.service.ts +++ b/src/modules/pipelinesV2/pipelines.service.ts @@ -233,15 +233,23 @@ export class PipelinesService implements OnModuleInit { const config_controls = (connector.config_controls || []).filter( (config_control) => { const path: string = config_control.name; - if (!objHasPath({ object: { properties }, path })) return false; - const default_value = getObjValueFromPath({ + let default_value = getObjValueFromPath({ object: { properties }, path, }); - if (default_value != undefined) + + if (default_value != undefined) { + if ( + path === 'properties.spreadsheet_id' && + typeof default_value === 'string' + ) + default_value = 'https://docs.google.com/spreadsheets/d/'.concat( + default_value, + ); config_control.default_value = default_value; + } return true; }, @@ -251,7 +259,7 @@ export class PipelinesService implements OnModuleInit { pipeline: { ...pipeline, config_controls, - properties: properties, + properties, }, }; } diff --git a/src/utils/ObjValueFromPath.ts b/src/utils/ObjValueFromPath.ts index 0bdb8e9..ca83e2e 100644 --- a/src/utils/ObjValueFromPath.ts +++ b/src/utils/ObjValueFromPath.ts @@ -1,4 +1,7 @@ -export function getObjValueFromPath(data: { object: T; path: string }): T { +export function getObjValueFromPath(data: { + object: T; + path: string; +}): any { const { object, path } = data; const keys = path.split('.');