Skip to content

Commit

Permalink
fix(): source link and source title transform
Browse files Browse the repository at this point in the history
  • Loading branch information
jordantsanz committed Jun 28, 2024
1 parent 9f8456e commit c7dbe9a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,17 @@ export function editorToMetric(
expressionSet,
allowExpressionSet,
statistic,
// if we are in dynamic mode and have a link, then we use that link
// otherwise we use manually input sourceLink on card config
sourceLink:
values.type === "dynamic" && sourceLink ? sourceLink : config.sourceLink,
sourceTitle:
values.type === "dynamic" && sourceTitle
? sourceTitle
: config.sourceTitle,
allowLink:
values.type === "dynamic" ? config.allowDynamicLink : config.allowLink,
type: values.type,
dynamicMetric,
};

return { metric, displayConfig };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@ export function metricToEditor(
expressionSet,
allowExpressionSet,
fieldType,
sourceLink: displayConfig.sourceLink,
sourceTitle: displayConfig.sourceTitle,
},
...editor,
sourceLink: undefined,
sourceTitle: undefined,
};
break;

Expand Down

0 comments on commit c7dbe9a

Please sign in to comment.