Skip to content

Relabeling in Connection form causes falsely named fields (UI only) #19386

@cb149

Description

@cb149

Apache Airflow version

2.2.0

Operating System

Ubuntu

Versions of Apache Airflow Providers

No response

Deployment

Other

Deployment details

airflow standalone

What happened

Relabeling of fields in Add Connection never gets reverted, so switching connection types results in the form showing wrong field names.

What you expected to happen

Changing connection type while adding a connection should show the fields/fieldnames for that connection.

How to reproduce

  1. Install microsoft-azure and docker provider package (or any provider package that has relabeling)
  2. Click Add a new record in the Connections UI
  3. This will default to connection type Azure
  4. Change connection type to HTTP or other connection with Login and/or Password
  5. Login and Password fields now show as Azure Client ID and Azure Secret
  6. Change connection type to Docker
  7. Change connection type to HTTP again
  8. Host will now show as Registry URL, Login will show Username and Password fields still shows Azure Secret

Anything else

If I am not mistaken, the issues is with the code in connection_form.js

if (connection.relabeling) {
      Object.keys(connection.relabeling).forEach((field) => {
        const label = document.querySelector(`label[for='${field}']`);
        label.dataset.origText = label.innerText;
        label.innerText = connection.relabeling[field];
      });
}

and there should probably be a reset to the default label texts before it.

Also, when trying to open a provider issue the newest available Airflow version in the version selector is 2.1.4

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:UIRelated to UI/UX. For Frontend Developers.kind:bugThis is a clearly a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions