jh242 commented on code in PR #27805:
URL: https://github.com/apache/airflow/pull/27805#discussion_r1035309251


##########
airflow/www/static/js/trigger.js:
##########
@@ -20,13 +20,24 @@
 /* global document, CodeMirror, window */
 
 const textArea = document.getElementById('json');
+const recentConfigList = document.getElementById('recent_configs');
 const minHeight = 300;
 const maxHeight = window.innerHeight - 450;
 const height = maxHeight > minHeight ? maxHeight : minHeight;
 
 CodeMirror.fromTextArea(textArea, {
   lineNumbers: true,
-  mode: { name: 'javascript', json: true },
+  mode: {
+    name: 'javascript',
+    json: true,
+  },
   gutters: ['CodeMirror-lint-markers'],
   lint: true,
-}).setSize(null, height);
+})
+  .setSize(null, height);
+
+function setRecentConfig(e) {
+  document.querySelector('.CodeMirror').CodeMirror.setValue(e.target.value);

Review Comment:
   Hey yeah! I wanted to do this as well, but code formatting is a function 
that CodeMirror no longer supports. The other alternative is adding another JS 
library just to do this formatting, but I don't think we need this overhead 
(let me know if we already have one that can do it!).
   
   The other alternative is writing a bespoke function to do JSON formatting 
but I didn't think it was worth the trouble.



-- 
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]

Reply via email to