Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 of 2 tasks
cb149 opened this issue Nov 3, 2021 · 1 comment · Fixed by #19411
Closed
1 of 2 tasks

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

cb149 opened this issue Nov 3, 2021 · 1 comment · Fixed by #19411
Labels
area:UI Related to UI/UX. For Frontend Developers. kind:bug This is a clearly a bug

Comments

@cb149
Copy link

cb149 commented Nov 3, 2021

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

@josh-fell
Copy link
Contributor

@cb149 A PR has been opened to correct this issue. There is a reset of field performed when switch connection types, however, the logic was querying for an incorrect label attribute in the Connection form.

Thanks for reporting this issue. Nice catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:UI Related to UI/UX. For Frontend Developers. kind:bug This is a clearly a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants