rickychen-infinirc commented on code in PR #58757:
URL: https://github.com/apache/airflow/pull/58757#discussion_r2567652638
##########
airflow-core/src/airflow/ui/src/pages/Variables/ManageVariable/EditVariableButton.tsx:
##########
@@ -36,6 +36,14 @@ type Props = {
const EditVariableButton = ({ disabled, variable }: Props) => {
const { t: translate } = useTranslation("admin");
const { onClose, onOpen, open } = useDisclosure();
+ const formatValue = (value: string): string => {
+ try {
+ const parsed = JSON.parse(value);
+ return JSON.stringify(parsed, null, 2);
+ } catch {
Review Comment:
Thanks for the review! I've already fixed this in the latest commit. The
formatValue function now:
- Is moved to outer scope
- Has proper type annotation (const parsed: unknown)
- Uses undefined instead of null
Please check the updated code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]