| value = int(self.graph_runtime_state.variable_pool.convert_template(self._node_data.extract_by.serial).text) | value = int(self.graph_runtime_state.variable_pool.convert_template(self._node_data.extract_by.serial).text) | ||||
| if value < 1: | if value < 1: | ||||
| raise ValueError(f"Invalid serial index: must be >= 1, got {value}") | raise ValueError(f"Invalid serial index: must be >= 1, got {value}") | ||||
| if value > len(variable.value): | |||||
| raise InvalidKeyError(f"Invalid serial index: must be <= {len(variable.value)}, got {value}") | |||||
| value -= 1 | value -= 1 | ||||
| if len(variable.value) > int(value): | |||||
| result = variable.value[value] | |||||
| else: | |||||
| result = "" | |||||
| result = variable.value[value] | |||||
| return variable.model_copy(update={"value": [result]}) | return variable.model_copy(update={"value": [result]}) | ||||
| useEffect(() => { | useEffect(() => { | ||||
| if (isSelected && !noAutoScroll) | if (isSelected && !noAutoScroll) | ||||
| listItemRef.current?.scrollIntoView({ behavior: 'instant' }) | listItemRef.current?.scrollIntoView({ behavior: 'instant' }) | ||||
| // eslint-disable-next-line react-hooks/exhaustive-deps | |||||
| }, []) | }, []) | ||||
| return ( | return ( |
| else { | else { | ||||
| setSelectedTime(prev => prev ? getDateWithTimezone({ date: prev, timezone }) : undefined) | setSelectedTime(prev => prev ? getDateWithTimezone({ date: prev, timezone }) : undefined) | ||||
| } | } | ||||
| // eslint-disable-next-line react-hooks/exhaustive-deps | |||||
| }, [timezone]) | }, [timezone]) | ||||
| const handleClickTrigger = (e: React.MouseEvent) => { | const handleClickTrigger = (e: React.MouseEvent) => { |
| showInstallFromMarketplace() | showInstallFromMarketplace() | ||||
| } | } | ||||
| })() | })() | ||||
| // eslint-disable-next-line react-hooks/exhaustive-deps | |||||
| }, [packageId, bundleInfo]) | }, [packageId, bundleInfo]) | ||||
| const { | const { |
| refreshPluginList(category ? { category } as any : undefined, !category) | refreshPluginList(category ? { category } as any : undefined, !category) | ||||
| } | } | ||||
| } | } | ||||
| // eslint-disable-next-line react-hooks/exhaustive-deps | |||||
| }, [isRefetching]) | }, [isRefetching]) | ||||
| const handleRefetch = useCallback(() => { | const handleRefetch = useCallback(() => { |