forked from langflow-ai/langflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: added analytics track and custom parameter support (langflo…
…w-ai#3617) * Added analytics track * Changed post add user to just use the function * Added tracking in various components * Added custom parameter support * Added centered footer
- Loading branch information
1 parent
32d51b6
commit 9102c62
Showing
11 changed files
with
111 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/frontend/src/customization/components/custom-parameter.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { ParameterRenderComponent } from "@/components/parameterRenderComponent"; | ||
import { handleOnNewValueType } from "@/CustomNodes/hooks/use-handle-new-value"; | ||
import { APIClassType, InputFieldType } from "@/types/api"; | ||
|
||
export function CustomParameterComponent({ | ||
handleOnNewValue, | ||
name, | ||
nodeId, | ||
templateData, | ||
templateValue, | ||
editNode, | ||
handleNodeClass, | ||
nodeClass, | ||
disabled, | ||
}: { | ||
handleOnNewValue: handleOnNewValueType; | ||
name: string; | ||
nodeId: string; | ||
templateData: Partial<InputFieldType>; | ||
templateValue: any; | ||
editNode: boolean; | ||
handleNodeClass: (value: any, code?: string, type?: string) => void; | ||
nodeClass: APIClassType; | ||
disabled: boolean; | ||
}) { | ||
return ( | ||
<ParameterRenderComponent | ||
handleOnNewValue={handleOnNewValue} | ||
name={name} | ||
nodeId={nodeId} | ||
templateData={templateData} | ||
templateValue={templateValue} | ||
editNode={editNode} | ||
handleNodeClass={handleNodeClass} | ||
nodeClass={nodeClass} | ||
disabled={disabled} | ||
/> | ||
); | ||
} | ||
|
||
export function getCustomParameterTitle({ | ||
title, | ||
nodeId, | ||
}: { | ||
title: string; | ||
nodeId: string; | ||
}) { | ||
return title; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export const track = async ( | ||
name: string, | ||
properties: Record<string, any> = {}, | ||
id: string = "", | ||
): Promise<void> => { | ||
return; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters