mirror of
https://github.com/dadosfera/maestro.git
synced 2026-10-18 20:19:08 +00:00
Merge pull request #209 from dadosfera/feat/google-sheets-link
Feat/google sheets link
This commit is contained in:
@@ -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,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
export function getObjValueFromPath<T>(data: { object: T; path: string }): T {
|
||||
export function getObjValueFromPath<T extends object>(data: {
|
||||
object: T;
|
||||
path: string;
|
||||
}): any {
|
||||
const { object, path } = data;
|
||||
const keys = path.split('.');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user