chore: Remove ! in datafetcher

Co-authored-by: Saurabh Gore <167211619+saurabhg772244@users.noreply.github.com>
This commit is contained in:
Sidharth Vinod
2025-02-26 18:07:10 +05:30
parent 5abda14809
commit a2650adec2

View File

@@ -199,6 +199,7 @@ export const dataFetcher = (
const dbState = diagramStates.get(itemId); const dbState = diagramStates.get(itemId);
const classStr = getClassesFromDbInfo(dbState); const classStr = getClassesFromDbInfo(dbState);
const style = getStylesFromDbInfo(dbState); const style = getStylesFromDbInfo(dbState);
const config = getConfig();
log.info('dataFetcher parsedItem', parsedItem, dbState, style); log.info('dataFetcher parsedItem', parsedItem, dbState, style);
@@ -219,7 +220,7 @@ export const dataFetcher = (
nodeDb.set(itemId, { nodeDb.set(itemId, {
id: itemId, id: itemId,
shape, shape,
description: common.sanitizeText(itemId, getConfig()), description: common.sanitizeText(itemId, config),
cssClasses: `${classStr} ${CSS_DIAGRAM_STATE}`, cssClasses: `${classStr} ${CSS_DIAGRAM_STATE}`,
cssStyles: style, cssStyles: style,
}); });
@@ -251,7 +252,7 @@ export const dataFetcher = (
newNode.description = parsedItem.description; newNode.description = parsedItem.description;
} }
} }
newNode.description = common.sanitizeTextOrArray(newNode.description, getConfig()); newNode.description = common.sanitizeTextOrArray(newNode.description, config);
} }
// If there's only 1 description entry, just use a regular state shape // If there's only 1 description entry, just use a regular state shape
@@ -318,7 +319,7 @@ export const dataFetcher = (
domId: stateDomId(itemId, graphItemCount, NOTE), domId: stateDomId(itemId, graphItemCount, NOTE),
type: newNode.type, type: newNode.type,
isGroup: newNode.type === 'group', isGroup: newNode.type === 'group',
padding: getConfig().flowchart!.padding, padding: config.flowchart?.padding,
look, look,
position: parsedItem.note.position, position: parsedItem.note.position,
}; };