Skip to content

Commit

Permalink
Add comments for spacing
Browse files Browse the repository at this point in the history
Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>
  • Loading branch information
huyaboo committed Mar 29, 2024
1 parent 3dcf3a0 commit c000459
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/core/server/saved_objects/import/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
import { parse, stringify } from 'hjson';
import { SavedObject, SavedObjectsClientContract } from '../types';

/**
* Given a Vega spec, the new datasource (by name), and spacing,
*
* @param {string} spec - the stringified Vega spec (HJSON or JSON)
* @param {string} newDataSourceName - the datasource name to append
* @param {number} [spacing=2] - how large the indenting should be after updating the spec (should be set to > 0 for a readable spec)
*/
export interface UpdateDataSourceNameInVegaSpecProps {
spec: string;
newDataSourceName: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export const getSavedObjectsWithDataSource = (
const updatedVegaSpec = updateDataSourceNameInVegaSpec({
spec: vegaSpec,
newDataSourceName: dataSourceTitle,
// Spacing of 1 prevents the Sankey visualization in logs data from exceeding the default url length and breaking
spacing: 1,
});

Expand Down

0 comments on commit c000459

Please sign in to comment.