dingo4dev opened a new pull request, #62882: URL: https://github.com/apache/airflow/pull/62882
This pull request introduces improved handling and formatting for JSON values in the variable management UI, making it easier for users to input, validate, and format JSON data. The changes include a new `ValueField` component with formatting and validation features, utility functions for JSON validation and formatting, and automated minification of JSON before submission. Comprehensive tests for these utilities are also added. **JSON Utility Functions:** * Created `isJsonString`, `prettifyJson`, and `minifyJson` utility functions in `utils/json.ts` for validating, formatting, and minifying JSON strings. * Exported these JSON utilities from the main `utils/index.ts` file for use throughout the codebase. **Form Submission Enhancement:** * Updated the variable form submission logic to automatically minify valid JSON values before sending them to the backend, ensuring consistent data formatting. **Testing:** * Added comprehensive tests for the new JSON utility functions in `utils/json.test.ts`, covering validation, formatting, and minification scenarios. <img width="1470" height="836" alt="Screenshot 2026-03-05 at 12 22 25 AM" src="https://github.com/user-attachments/assets/f02802f0-2a1a-49cd-ba89-b5abd1f6c14e" /> --- <img width="1463" height="834" alt="Screenshot 2026-03-05 at 12 50 34 AM" src="https://github.com/user-attachments/assets/db931a88-451b-4bad-bde5-781ef94b276d" /> --- <img width="1469" height="831" alt="image" src="https://github.com/user-attachments/assets/05754971-a00f-4d66-a673-46811e149e35" /> ##### Was generative AI tooling used to co-author this PR? - [X] Yes (please specify the tool below) Generated-by: copilot -- 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]
