This is an automated email from the ASF dual-hosted git repository.
bbovenzi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 2b33f02539a UI: Open provider connection fields by default and title
them by connection type (#74273)
2b33f02539a is described below
commit 2b33f02539a077cd36516a5b84d8ea3e3ef594a0
Author: Kaxil Naik <[email protected]>
AuthorDate: Mon Oct 5 19:23:51 2026 +0100
UI: Open provider connection fields by default and title them by connection
type (#74273)
Provider fields declared under conn-fields were grouped in a collapsed
"Extra Fields" section, hiding settings such as the Pydantic AI model
when creating a connection. The section is now titled after the
connection type and opens by default. The accordion renders once the
connection type metadata has loaded so the saved extras are not reset
when the title changes.
---
.../airflow/ui/public/i18n/locales/ar/admin.json | 1 -
.../airflow/ui/public/i18n/locales/ca/admin.json | 1 -
.../airflow/ui/public/i18n/locales/de/admin.json | 1 -
.../airflow/ui/public/i18n/locales/el/admin.json | 1 -
.../airflow/ui/public/i18n/locales/en/admin.json | 2 +-
.../airflow/ui/public/i18n/locales/es/admin.json | 1 -
.../airflow/ui/public/i18n/locales/fr/admin.json | 1 -
.../airflow/ui/public/i18n/locales/he/admin.json | 1 -
.../airflow/ui/public/i18n/locales/hi/admin.json | 1 -
.../airflow/ui/public/i18n/locales/hu/admin.json | 1 -
.../airflow/ui/public/i18n/locales/it/admin.json | 1 -
.../airflow/ui/public/i18n/locales/ja/admin.json | 1 -
.../airflow/ui/public/i18n/locales/ko/admin.json | 1 -
.../airflow/ui/public/i18n/locales/nl/admin.json | 1 -
.../airflow/ui/public/i18n/locales/pl/admin.json | 1 -
.../airflow/ui/public/i18n/locales/pt/admin.json | 1 -
.../airflow/ui/public/i18n/locales/ru/admin.json | 1 -
.../airflow/ui/public/i18n/locales/th/admin.json | 1 -
.../airflow/ui/public/i18n/locales/tr/admin.json | 1 -
.../ui/public/i18n/locales/zh-CN/admin.json | 1 -
.../ui/public/i18n/locales/zh-TW/admin.json | 1 -
.../src/pages/Connections/ConnectionForm.test.tsx | 121 +++++++++++++++++++++
.../ui/src/pages/Connections/ConnectionForm.tsx | 11 +-
23 files changed, 129 insertions(+), 25 deletions(-)
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/ar/admin.json
b/airflow-core/src/airflow/ui/public/i18n/locales/ar/admin.json
index 333e9729e1d..6a7543eb678 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/ar/admin.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/ar/admin.json
@@ -45,7 +45,6 @@
"connectionIdRequired": "مطلوب معرِّف الموَّصل",
"connectionIdRequirement": "لا يمكن أن يحتوي معرِّف الموَّصل على مسافات
فقط",
"connectionTypeRequired": "مطلوب نوع الموَّصل",
- "extraFields": "حقول إضافية",
"extraFieldsJson": "JSON حقول إضافية بصيغة",
"helperText": "نوع الموَّصل مفقود؟ تأكد من تثبيت حزمة Airflow المناسبة.",
"helperTextForRedactedFields": "لن تتغير الحقول المحجوبة ('***') إذا لم
يتم تعديلها.",
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/ca/admin.json
b/airflow-core/src/airflow/ui/public/i18n/locales/ca/admin.json
index 9fd0a2bcc9f..67fd8f6a241 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/ca/admin.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/ca/admin.json
@@ -35,7 +35,6 @@
"connectionIdRequired": "L'ID de connexió és obligatori",
"connectionIdRequirement": "L'ID de connexió no pot tenir únicament
espais",
"connectionTypeRequired": "El tipus de connexió és obligatori",
- "extraFields": "Camps addicionals",
"extraFieldsJson": "Camps addicionals JSON",
"helperText": "Falta el tipus de connexió? Assegureu-vos d'haver
instal·lat el paquet de proveïdors d'Airflow corresponent.",
"helperTextForRedactedFields": "Els camps redactats ('***') romandran
sense canvis si no es modifiquen.",
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/de/admin.json
b/airflow-core/src/airflow/ui/public/i18n/locales/de/admin.json
index 257600a5127..9595ca2e55d 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/de/admin.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/de/admin.json
@@ -35,7 +35,6 @@
"connectionIdRequired": "Verbindungs-ID ist erforderlich",
"connectionIdRequirement": "Die Verbindungs-ID kann nicht nur aus
Leerzeichen bestehen",
"connectionTypeRequired": "Die Auswahl eines Verbindungstyps ist
erforderlich",
- "extraFields": "Weitere Felder",
"extraFieldsJson": "JSON Ansicht der weiteren Felder",
"helperText": "Fehlt ein Verbindungstyp? Stellen Sie sicher, dass die
notwendigen Provider-Pakete installiert sind.",
"helperTextForRedactedFields": "Unkenntlich gemachte Felder ('***')
bleiben unverändert, wenn sie nicht bearbeitet werden.",
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/el/admin.json
b/airflow-core/src/airflow/ui/public/i18n/locales/el/admin.json
index 80101be8f3f..cbaa0f941c9 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/el/admin.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/el/admin.json
@@ -33,7 +33,6 @@
"connectionIdRequired": "Το ID Σύνδεσης είναι υποχρεωτικό",
"connectionIdRequirement": "Το ID Σύνδεσης δεν μπορεί να περιέχει μόνο
κενά",
"connectionTypeRequired": "Ο Τύπος Σύνδεσης είναι υποχρεωτικός",
- "extraFields": "Επιπλέον Πεδία",
"extraFieldsJson": "Επιπλέον Πεδία JSON",
"helperText": "Λείπει ο Τύπος Σύνδεσης; Βεβαιωθείτε ότι έχετε
εγκαταστήσει το ανάλογο πακέτο Airflow Παρόχων.",
"helperTextForRedactedFields": "Τα πεδία που έχουν αποκρυφθεί ('***') θα
παραμείνουν αμετάβλητα αν δεν τροποποιηθούν.",
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/en/admin.json
b/airflow-core/src/airflow/ui/public/i18n/locales/en/admin.json
index ae0f534150e..d04f24fc855 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/en/admin.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/en/admin.json
@@ -34,8 +34,8 @@
"form": {
"connectionIdRequired": "Connection ID is required",
"connectionIdRequirement": "Connection ID cannot contain only spaces",
+ "connectionTypeFields": "{{connectionType}} Fields",
"connectionTypeRequired": "Connection Type is required",
- "extraFields": "Extra Fields",
"extraFieldsJson": "Extra Fields JSON",
"helperText": "Connection type missing? Make sure you have installed the
corresponding Airflow Providers Package.",
"helperTextForRedactedFields": "Redacted fields ('***') will remain
unchanged if not modified.",
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/es/admin.json
b/airflow-core/src/airflow/ui/public/i18n/locales/es/admin.json
index 71cc2bf2c0a..12563e30d11 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/es/admin.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/es/admin.json
@@ -35,7 +35,6 @@
"connectionIdRequired": "El ID de la conexión es requerido",
"connectionIdRequirement": "El ID de la conexión no puede contener solo
espacios",
"connectionTypeRequired": "El Tipo de Conexión es requerido",
- "extraFields": "Campos Extra",
"extraFieldsJson": "Campos Extra (tipo JSON)",
"helperText": "¿Falta el Tipo de conexión? Asegúrate de haber instalado
el paquete de proveedores de Airflow correspondiente.",
"helperTextForRedactedFields": "Los campos redactados ('***')
permanecerán sin cambios si no se modifican.",
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/fr/admin.json
b/airflow-core/src/airflow/ui/public/i18n/locales/fr/admin.json
index ebbd92d3b75..bee891965d5 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/fr/admin.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/fr/admin.json
@@ -36,7 +36,6 @@
"connectionIdRequired": "L'ID de la connexion est requis",
"connectionIdRequirement": "L'ID de la connexion ne peut pas contenir
uniquement des espaces",
"connectionTypeRequired": "Le type de la connexion est requis",
- "extraFields": "Champs Supplémentaires",
"extraFieldsJson": "Champs Supplémentaires JSON",
"helperText": "Le type de la connexion est manquant ? Assurez-vous
d'avoir installé le package Airflow Providers correspondant.",
"helperTextForRedactedFields": "Les champs masqués ('***') resteront
inchangés s'ils ne sont pas modifiés.",
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/he/admin.json
b/airflow-core/src/airflow/ui/public/i18n/locales/he/admin.json
index b37d0763911..16b7917f38e 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/he/admin.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/he/admin.json
@@ -36,7 +36,6 @@
"connectionIdRequired": "נדרש מזהה חיבור",
"connectionIdRequirement": "מזהה חיבור אינו יכול להכיל רווחים בלבד",
"connectionTypeRequired": "נדרש סוג חיבור",
- "extraFields": "שדות נוספים",
"extraFieldsJson": "שדות נוספים JSON",
"helperText": "סוג החיבור המבוקש חסר? וודא שהתקנת את חבילת העזר המתאימה",
"helperTextForRedactedFields": "שדות שהוסתרו ('***') יישארו ללא שינוי אם
לא בוצע בהם עדכון",
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/hi/admin.json
b/airflow-core/src/airflow/ui/public/i18n/locales/hi/admin.json
index be6ce0b48c9..97b86f55527 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/hi/admin.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/hi/admin.json
@@ -33,7 +33,6 @@
"connectionIdRequired": "कनेक्शन ID आवश्यक है",
"connectionIdRequirement": "कनेक्शन ID में केवल अंतरिक्ष कुंजियाँ नहीं
हो सकते",
"connectionTypeRequired": "कनेक्शन प्रकार आवश्यक है",
- "extraFields": "अतिरिक्त फ़ील्ड",
"extraFieldsJson": "अतिरिक्त फ़ील्ड JSON",
"helperText": "कनेक्शन प्रकार गायब है? सुनिश्चित करें कि आपने संबंधित
Airflow Providers Package इंस्टॉल किया है।",
"helperTextForRedactedFields": "संपादित फ़ील्ड ('***') अपरिवर्तित रहेंगे
यदि संशोधित नहीं किए गए।",
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/hu/admin.json
b/airflow-core/src/airflow/ui/public/i18n/locales/hu/admin.json
index 20e946afbc6..a677ff6d716 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/hu/admin.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/hu/admin.json
@@ -33,7 +33,6 @@
"connectionIdRequired": "Kapcsolat azonosító szükséges",
"connectionIdRequirement": "Kapcsolat azonosító nem tartalmazhat
szóközöket",
"connectionTypeRequired": "Kapcsolat típus szükséges",
- "extraFields": "Extra mezők",
"extraFieldsJson": "Extra mezők JSON",
"helperText": "Hiányzó kapcsolat típus? Győződjön meg róla, hogy a
megfelelő Airflow Providers Package telepítésre került.",
"helperTextForRedactedFields": "A kitakart mezők ('***') változatlanok
maradnak, ha nem módosítja őket.",
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/it/admin.json
b/airflow-core/src/airflow/ui/public/i18n/locales/it/admin.json
index d31a165d423..9a94e11b7ff 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/it/admin.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/it/admin.json
@@ -38,7 +38,6 @@
"connectionIdRequired": "L'ID della connessione è obbligatorio",
"connectionIdRequirement": "L'ID della connessione non può contenere
solo spazi",
"connectionTypeRequired": "Il tipo di connessione è obbligatorio",
- "extraFields": "Campi Extra",
"extraFieldsJson": "Campi Extra JSON",
"helperText": "Il tipo di connessione è mancante? Assicurati di aver
installato il pacchetto corrispondente di Airflow Providers.",
"helperTextForRedactedFields": "I campi redatti ('***') rimarranno
invariati se non modificati.",
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/ja/admin.json
b/airflow-core/src/airflow/ui/public/i18n/locales/ja/admin.json
index 5599888fdfb..37198a90100 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/ja/admin.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/ja/admin.json
@@ -32,7 +32,6 @@
"connectionIdRequired": "接続 ID は必須です",
"connectionIdRequirement": "空白文字だけの接続 ID は認められません",
"connectionTypeRequired": "接続タイプは必須です",
- "extraFields": "追加項目",
"extraFieldsJson": "追加項目 (JSON 形式)",
"helperText": "接続タイプが見つかりませんか?対応する Airflow Providers
パッケージがインストールされていることを確認してください",
"helperTextForRedactedFields": "非表示の項目 ('***') は、編集しなければ以前の値がそのまま使われます",
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/ko/admin.json
b/airflow-core/src/airflow/ui/public/i18n/locales/ko/admin.json
index a0c355cad9b..cad7342d096 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/ko/admin.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/ko/admin.json
@@ -35,7 +35,6 @@
"connectionIdRequired": "커넥션 ID는 필수 항목입니다",
"connectionIdRequirement": "커넥션 ID는 공백만으로 구성될 수 없습니다",
"connectionTypeRequired": "커넥션 유형은 필수 항목입니다",
- "extraFields": "추가 필드",
"extraFieldsJson": "추가 필드 JSON",
"helperText": "커넥션 유형이 보이지 않나요? 해당 Airflow Provider 패키지가 설치되어 있는지
확인하세요.",
"helperTextForRedactedFields": "('***')로 마스킹된 필드는 수정하지 않으면 그대로 유지됩니다.",
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/nl/admin.json
b/airflow-core/src/airflow/ui/public/i18n/locales/nl/admin.json
index 8fe68c13cef..cd4ae693e81 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/nl/admin.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/nl/admin.json
@@ -33,7 +33,6 @@
"connectionIdRequired": "Connectie ID is verplicht",
"connectionIdRequirement": "Connectie ID kan niet bestaan uit enkel
spaties",
"connectionTypeRequired": "Connectie type is verplicht",
- "extraFields": "Extra velden",
"extraFieldsJson": "Extra velden JSON",
"helperText": "Missend connectie type? Controller of je de bijbehorende
Airflow Providers Package hebt geïnstalleerd.",
"helperTextForRedactedFields": "Gemaskeerde velden ('***') blijven
onveranderd als ze niet worden gewijzigd.",
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/pl/admin.json
b/airflow-core/src/airflow/ui/public/i18n/locales/pl/admin.json
index 4c25406d7d2..bacc73d773e 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/pl/admin.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/pl/admin.json
@@ -43,7 +43,6 @@
"connectionIdRequired": "Identyfikator połączenia jest wymagany",
"connectionIdRequirement": "Identyfikator połączenia nie może zawierać
wyłącznie spacji",
"connectionTypeRequired": "Typ połączenia jest wymagany",
- "extraFields": "Dodatkowe pola",
"extraFieldsJson": "Dodatkowe pola JSON",
"helperText": "Brakuje typu połączenia? Upewnij się, że zainstalowałeś
odpowiedniego dostawcę.",
"helperTextForRedactedFields": "Ukryte pola ('***') nie bedą zapisane
jeśli nie zostaną zmienione.",
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/pt/admin.json
b/airflow-core/src/airflow/ui/public/i18n/locales/pt/admin.json
index 81978d5e785..9a5d0f0a94e 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/pt/admin.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/pt/admin.json
@@ -39,7 +39,6 @@
"connectionIdRequired": "ID da Conexão é obrigatório",
"connectionIdRequirement": "ID da Conexão não pode conter somente
espaços",
"connectionTypeRequired": "Tipo de Conexão é obrigatório",
- "extraFields": "Campos Extra",
"extraFieldsJson": "Campos Extra JSON",
"helperText": "Tipo de conexão faltando? Certifique-se de ter instalado
o pacote do provider correspondente ao Airflow.",
"helperTextForRedactedFields": "Os campos redigidos ('***') permanecerão
inalterados se não forem modificados.",
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/ru/admin.json
b/airflow-core/src/airflow/ui/public/i18n/locales/ru/admin.json
index 36a230cf704..32bbb001830 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/ru/admin.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/ru/admin.json
@@ -39,7 +39,6 @@
"connectionIdRequired": "ID соединения обязателен",
"connectionIdRequirement": "ID соединения не может состоять только из
пробелов",
"connectionTypeRequired": "Тип соединения обязателен",
- "extraFields": "Дополнительные поля",
"extraFieldsJson": "Дополнительные поля JSON",
"helperText": "Отсутствует тип соединения? Убедитесь, что вы установили
соответствующий пакет Airflow Providers.",
"helperTextForRedactedFields": "Скрытые поля ('***') останутся без
изменений, если их не редактировать.",
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/th/admin.json
b/airflow-core/src/airflow/ui/public/i18n/locales/th/admin.json
index d75abf63e81..26f182e42d5 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/th/admin.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/th/admin.json
@@ -32,7 +32,6 @@
"connectionIdRequired": "กรุณาระบุ ID การเชื่อมต่อ",
"connectionIdRequirement": "ID การเชื่อมต่อไม่สามารถมีช่องว่างได้",
"connectionTypeRequired": "กรุณาระบุประเภทการเชื่อมต่อ",
- "extraFields": "ฟิลด์เพิ่มเติม",
"extraFieldsJson": "ฟิลด์เพิ่มเติมในรูปแบบ JSON",
"helperText": "ไม่พบประเภทการเชื่อมต่อ?
โปรดตรวจสอบให้แน่ใจว่าคุณได้ติดตั้ง Airflow Providers Package
ที่เกี่ยวข้องแล้ว",
"helperTextForRedactedFields": "ฟิลด์ที่ถูกซ่อน ('***')
จะไม่ถูกเปลี่ยนแปลงหากไม่ได้แก้ไข",
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/tr/admin.json
b/airflow-core/src/airflow/ui/public/i18n/locales/tr/admin.json
index 0ebff63e4fa..72013169158 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/tr/admin.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/tr/admin.json
@@ -33,7 +33,6 @@
"connectionIdRequired": "Bağlantı Kimliği gerekli",
"connectionIdRequirement": "Bağlantı Kimliği sadece boşluklardan
oluşamaz",
"connectionTypeRequired": "Bağlantı Tipi gerekli",
- "extraFields": "Ek Alanlar",
"extraFieldsJson": "Ek Alanlar JSON",
"helperText": "Bağlantı tipi eksik mi? İlgili Airflow Providers paketini
yüklediğinizden emin olun.",
"helperTextForRedactedFields": "Gizlenmiş alanlar ('***')
değiştirilmedikçe kaydedilmeyecektir.",
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/zh-CN/admin.json
b/airflow-core/src/airflow/ui/public/i18n/locales/zh-CN/admin.json
index 4f11428308c..e378d540b27 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/zh-CN/admin.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/zh-CN/admin.json
@@ -35,7 +35,6 @@
"connectionIdRequired": "连接 ID 是必填的",
"connectionIdRequirement": "连接 ID 不能只包含空格",
"connectionTypeRequired": "连接类型是必填的",
- "extraFields": "额外字段",
"extraFieldsJson": "额外字段 JSON",
"helperText": "找不到连接类型?请确保您已安装对应的 Airflow 整合套件。",
"helperTextForRedactedFields": "已遮蔽的字段 ('***') 若未修改,将保持不变。",
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/admin.json
b/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/admin.json
index 16565f3bfbb..2f915a51339 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/admin.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/admin.json
@@ -35,7 +35,6 @@
"connectionIdRequired": "連線 ID 是必填的",
"connectionIdRequirement": "連線 ID 不能只包含空格",
"connectionTypeRequired": "連線類型是必填的",
- "extraFields": "額外欄位",
"extraFieldsJson": "額外欄位 JSON",
"helperText": "找不到連線類型?請確保您已安裝對應的 Airflow 整合套件。",
"helperTextForRedactedFields": "已遮蔽的欄位 ('***') 若未修改,將保持不變。",
diff --git
a/airflow-core/src/airflow/ui/src/pages/Connections/ConnectionForm.test.tsx
b/airflow-core/src/airflow/ui/src/pages/Connections/ConnectionForm.test.tsx
new file mode 100644
index 00000000000..66714c35844
--- /dev/null
+++ b/airflow-core/src/airflow/ui/src/pages/Connections/ConnectionForm.test.tsx
@@ -0,0 +1,121 @@
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import "@testing-library/jest-dom";
+import { render, screen } from "@testing-library/react";
+import { beforeEach, describe, expect, it, vi } from "vitest";
+
+import i18n from "src/i18n/config";
+import type { ConnectionMetaEntry } from "src/queries/useConnectionTypeMeta";
+import { paramPlaceholder } from "src/queries/useParamStore";
+import { Wrapper } from "src/utils/Wrapper";
+
+import adminLocale from "../../../public/i18n/locales/en/admin.json";
+import ConnectionForm from "./ConnectionForm";
+import type { ConnectionBody } from "./Connections";
+
+const { mockUseConnectionTypeMeta } = vi.hoisted(() => ({
+ mockUseConnectionTypeMeta: vi.fn(),
+}));
+
+vi.mock("src/queries/useConnectionTypeMeta", () => ({
+ useConnectionTypeMeta: mockUseConnectionTypeMeta,
+}));
+
+vi.mock("src/queries/useConfig.tsx", () => ({
+ useConfig: () => false,
+}));
+
+const pydanticAiMeta: ConnectionMetaEntry = {
+ connection_type: "pydanticai",
+ default_conn_name: "pydanticai_default",
+ extra_fields: {
+ model: {
+ description: "Model in provider:name format",
+ schema: { ...paramPlaceholder.schema, title: "Model", type: ["string",
"null"] },
+ value: null,
+ },
+ },
+ hook_class_name:
"airflow.providers.common.ai.hooks.pydantic_ai.PydanticAIHook",
+ hook_name: "Pydantic AI",
+ standard_fields: {},
+};
+
+const loadedMeta = {
+ formattedData: { pydanticai: pydanticAiMeta },
+ hookNames: { pydanticai: "Pydantic AI" },
+ isPending: false,
+ keysList: ["pydanticai"],
+};
+
+const pendingMeta = { formattedData: {}, hookNames: {}, isPending: true,
keysList: [] };
+
+const pydanticAiConnection: ConnectionBody = {
+ conn_type: "pydanticai",
+ connection_id: "decision_default",
+ description: "",
+ extra: JSON.stringify({ model: "openai:gpt-5" }),
+ host: "",
+ login: "",
+ password: "",
+ port: "",
+ schema: "",
+ team_name: "",
+};
+
+const renderForm = () => (
+ <ConnectionForm
+ error={undefined}
+ initialConnection={pydanticAiConnection}
+ isEditMode
+ isPending={false}
+ mutateConnection={vi.fn()}
+ />
+);
+
+describe("ConnectionForm", () => {
+ beforeEach(() => {
+ i18n.addResourceBundle("en", "admin", adminLocale, true, true);
+ });
+
+ it("titles the provider fields section after the connection type and opens
it by default", () => {
+ mockUseConnectionTypeMeta.mockReturnValue(loadedMeta);
+
+ render(renderForm(), { wrapper: Wrapper });
+
+ expect(screen.getByRole("button", { name: "Pydantic AI Fields"
})).toHaveAttribute(
+ "aria-expanded",
+ "true",
+ );
+ expect(screen.getByRole("button", { name: "Standard Fields"
})).toHaveAttribute("aria-expanded", "true");
+ });
+
+ it("keeps the saved extra and opens the section when hook metadata loads
after the form mounts", () => {
+ mockUseConnectionTypeMeta.mockReturnValue(pendingMeta);
+ const { rerender } = render(renderForm(), { wrapper: Wrapper });
+
+ mockUseConnectionTypeMeta.mockReturnValue(loadedMeta);
+ rerender(renderForm());
+
+ expect(screen.getByRole("button", { name: "Pydantic AI Fields"
})).toHaveAttribute(
+ "aria-expanded",
+ "true",
+ );
+
expect(document.querySelector<HTMLInputElement>("#element_model")).toHaveValue("openai:gpt-5");
+ });
+});
diff --git
a/airflow-core/src/airflow/ui/src/pages/Connections/ConnectionForm.tsx
b/airflow-core/src/airflow/ui/src/pages/Connections/ConnectionForm.tsx
index 9ca8faadff7..bdd46efb968 100644
--- a/airflow-core/src/airflow/ui/src/pages/Connections/ConnectionForm.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/Connections/ConnectionForm.tsx
@@ -76,6 +76,9 @@ const ConnectionForm = ({
const selectedConnType = watch("conn_type"); // Get the selected connection
type
const standardFields = connectionTypeMeta[selectedConnType]?.standard_fields
?? {};
const paramsDic = { paramsDict:
connectionTypeMeta[selectedConnType]?.extra_fields ?? {} };
+ const connectionTypeFieldsSection =
translate("connections.form.connectionTypeFields", {
+ connectionType: hookNameMap[selectedConnType] ?? selectedConnType,
+ });
const [formErrors, setFormErrors] = useState(false);
const multiTeamEnabled = Boolean(useConfig("multi_team"));
@@ -207,10 +210,11 @@ const ConnectionForm = ({
}}
/>
- {selectedConnType ? (
+ {selectedConnType && !isMetaPending ? (
<Accordion.Root
collapsible
- defaultValue={["standardFields"]}
+ defaultValue={["standardFields", connectionTypeFieldsSection]}
+ key={selectedConnType}
mb={4}
mt={4}
size="lg"
@@ -223,9 +227,8 @@ const ConnectionForm = ({
</Accordion.ItemContent>
</Accordion.Item>
<FlexibleForm
-
flexibleFormDefaultSection={translate("connections.form.extraFields")}
+ flexibleFormDefaultSection={connectionTypeFieldsSection}
initialParamsDict={paramsDic}
- key={selectedConnType}
setError={setFormErrors}
subHeader={isEditMode ?
translate("connections.form.helperTextForRedactedFields") : undefined}
/>