refactor(flowsContext.tsx): remove file name from components before creating data URI
The `removeFileNameFromComponents` function is added to remove the file name from the components in the `clonedFlow` object before creating the data URI. This ensures that the file name is not included in the exported flow data. refactor(genericModal/index.tsx): fix formatting of genericModalPropsType The formatting of the `genericModalPropsType` interface is fixed to improve readability and maintain consistency with the codebase.
This commit is contained in:
parent
2a8c972d49
commit
7d2e67ec77
1 changed files with 8 additions and 1 deletions
|
|
@ -33,6 +33,7 @@ import {
|
||||||
addVersionToDuplicates,
|
addVersionToDuplicates,
|
||||||
checkOldEdgesHandles,
|
checkOldEdgesHandles,
|
||||||
createFlowComponent,
|
createFlowComponent,
|
||||||
|
removeFileNameFromComponents,
|
||||||
scapeJSONParse,
|
scapeJSONParse,
|
||||||
scapedJSONStringfy,
|
scapedJSONStringfy,
|
||||||
updateEdgesHandleIds,
|
updateEdgesHandleIds,
|
||||||
|
|
@ -251,9 +252,15 @@ export function FlowsProvider({ children }: { children: ReactNode }) {
|
||||||
flowName: string,
|
flowName: string,
|
||||||
flowDescription?: string
|
flowDescription?: string
|
||||||
) {
|
) {
|
||||||
|
let clonedFlow = cloneDeep(flow);
|
||||||
|
removeFileNameFromComponents(clonedFlow);
|
||||||
// create a data URI with the current flow data
|
// create a data URI with the current flow data
|
||||||
const jsonString = `data:text/json;chatset=utf-8,${encodeURIComponent(
|
const jsonString = `data:text/json;chatset=utf-8,${encodeURIComponent(
|
||||||
JSON.stringify({ ...flow, name: flowName, description: flowDescription })
|
JSON.stringify({
|
||||||
|
...clonedFlow,
|
||||||
|
name: flowName,
|
||||||
|
description: flowDescription,
|
||||||
|
})
|
||||||
)}`;
|
)}`;
|
||||||
|
|
||||||
// create a link element and set its properties
|
// create a link element and set its properties
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue