Skip to content

Commit f0552e1

Browse files
[autofix.ci] apply automated fixes (attempt 2/3)
1 parent 2752406 commit f0552e1

4 files changed

Lines changed: 45 additions & 15 deletions

File tree

src/frontend/src/components/core/dropdownComponent/index.tsx

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,14 @@ export default function Dropdown({
114114
// Utility functions
115115
const filterMetadataKeys = (
116116
metadata: Record<string, any> = {},
117-
excludeKeys: string[] = ["api_endpoint", "icon", "status", "org_id", "id", "updated_at"],
117+
excludeKeys: string[] = [
118+
"api_endpoint",
119+
"icon",
120+
"status",
121+
"org_id",
122+
"id",
123+
"updated_at",
124+
],
118125
) => {
119126
return Object.fromEntries(
120127
Object.entries(metadata).filter(([key]) => !excludeKeys.includes(key)),
@@ -271,10 +278,10 @@ export default function Dropdown({
271278
handleNodeClass,
272279
postTemplateValue,
273280
setErrorData,
274-
undefined, // parameterName
275-
undefined, // callback
276-
undefined, // toolMode
277-
true, // isRefresh
281+
undefined, // parameterName
282+
undefined, // callback
283+
undefined, // toolMode
284+
true, // isRefresh
278285
)?.then(() => {
279286
setTimeout(() => {
280287
setRefreshOptions(false);
@@ -287,7 +294,13 @@ export default function Dropdown({
287294

288295
const metadata = filteredMetadata[index];
289296
const metadataEntries = Object.entries(metadata)
290-
.filter(([key, value]) => value !== null && key !== "icon" && key !== "id" && key !== "updated_at")
297+
.filter(
298+
([key, value]) =>
299+
value !== null &&
300+
key !== "icon" &&
301+
key !== "id" &&
302+
key !== "updated_at",
303+
)
291304
.map(([key, value]) => {
292305
const displayValue =
293306
typeof value === "string" && value.length > 20
@@ -498,7 +511,12 @@ export default function Dropdown({
498511
<CommandItem
499512
value={option}
500513
onSelect={(currentValue) => {
501-
onSelect(currentValue, undefined, undefined, filteredMetadata?.[index]);
514+
onSelect(
515+
currentValue,
516+
undefined,
517+
undefined,
518+
filteredMetadata?.[index],
519+
);
502520
setOpen(false);
503521
setWaitingForResponse(false);
504522
}}

src/frontend/src/components/core/parameterRenderComponent/components/dropdownComponent/index.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,15 @@ export default function DropdownComponent({
2424
hasRefreshButton,
2525
...baseInputProps
2626
}: InputProps<string, DropDownComponentType>) {
27-
const onChange = (value: any, dbValue?: boolean, skipSnapshot?: boolean, selectedMetadata?: any) => {
28-
const changes: Record<string, any> = {
29-
value,
30-
load_from_db: dbValue
27+
const onChange = (
28+
value: any,
29+
dbValue?: boolean,
30+
skipSnapshot?: boolean,
31+
selectedMetadata?: any,
32+
) => {
33+
const changes: Record<string, any> = {
34+
value,
35+
load_from_db: dbValue,
3136
};
3237
// If metadata provided, include it as selected_metadata
3338
if (selectedMetadata !== undefined) {

src/frontend/src/controllers/API/queries/nodes/use-post-template-value.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ export const usePostTemplateValue: useMutationFunctionType<
3737
const { mutate } = UseRequestProcessor();
3838
const getNode = useFlowStore((state) => state.getNode);
3939
const flowId = useFlowsManagerStore((state) => state.currentFlowId);
40-
const folderId = useFlowsManagerStore((state) => state.currentFlow?.folder_id);
40+
const folderId = useFlowsManagerStore(
41+
(state) => state.currentFlow?.folder_id,
42+
);
4143

4244
const postTemplateValueFn = async (
4345
payload: IPostTemplateValue,
@@ -47,8 +49,8 @@ export const usePostTemplateValue: useMutationFunctionType<
4749
if (!template) return;
4850
const preparedTemplate = {
4951
...template,
50-
...(flowId ? { _frontend_node_flow_id: {value: flowId} } : {}),
51-
...(folderId ? { _frontend_node_folder_id: {value: folderId} } : {}),
52+
...(flowId ? { _frontend_node_flow_id: { value: flowId } } : {}),
53+
...(folderId ? { _frontend_node_folder_id: { value: folderId } } : {}),
5254
is_refresh: payload.is_refresh,
5355
};
5456
const lastUpdated = new Date().toISOString();

src/frontend/src/types/components/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,12 @@ export type DropDownComponent = {
6363
handleNodeClass: (value: any, code?: string, type?: string) => void;
6464
options: string[];
6565
optionsMetaData?: any[];
66-
onSelect: (value: string, dbValue?: boolean, snapshot?: boolean, selectedMetadata?: any) => void;
66+
onSelect: (
67+
value: string,
68+
dbValue?: boolean,
69+
snapshot?: boolean,
70+
selectedMetadata?: any,
71+
) => void;
6772
editNode?: boolean;
6873
id?: string;
6974
children?: ReactNode;

0 commit comments

Comments
 (0)