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

Field Deletion Warning when editing Connections #41144

Merged
merged 10 commits into from
Aug 14, 2024

Conversation

lh5844
Copy link
Contributor

@lh5844 lh5844 commented Jul 30, 2024

The issue mentions that fields backed by the BS3TextFieldWidget cannot be deleted once populated. To delete those fields, the user must delete the connection and create a new one. The "Changed Row" message displayed after a row is edited is misleading.

Therefore, as a temporary fix, I have created a warning that always shows when the user is editing a connection form as shown below.

image

What I tried to do was get the specific fields that were populated and issue a warning with those field names when the user tries to delete them. However, I'm having trouble figuring out how to do that check when the user clicks the 'Save' button. So, I have a warning of the currently populated fields that can be modified but not deleted after the user clicks 'Save' shown below.

image

related: #40105


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@boring-cyborg boring-cyborg bot added area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues labels Jul 30, 2024
airflow/www/views.py Outdated Show resolved Hide resolved
airflow/www/views.py Outdated Show resolved Hide resolved
@RNHTTR
Copy link
Contributor

RNHTTR commented Jul 31, 2024

@lh5844 can you also add a unit test please?

@lh5844
Copy link
Contributor Author

lh5844 commented Jul 31, 2024

@lh5844 can you also add a unit test please?

Because I've kept the general warning and that change is made in the connection_form.js, there don't seem to be any unit tests for any javascript files. So, I'll leave it at that. Correct if I'm wrong though

@lh5844 lh5844 marked this pull request as ready for review July 31, 2024 18:31
@bbovenzi
Copy link
Contributor

One last comment. Otherwise lgtm!

Co-authored-by: Brent Bovenzi <brent.bovenzi@gmail.com>
@lh5844
Copy link
Contributor Author

lh5844 commented Aug 14, 2024

Thank you for your suggestion! It definitely made it more concise. With that, it should be ready to be merged!

@bbovenzi bbovenzi added this to the Airflow 2.10.1 milestone Aug 14, 2024
@bbovenzi bbovenzi merged commit c7eba18 into apache:main Aug 14, 2024
49 checks passed
bbovenzi added a commit to astronomer/airflow that referenced this pull request Aug 14, 2024
* able to change the 'Changed Row' display message after edit

* added message in connection form to warn of empty fields

* attempt to warn the specific fields cannot be empty

* revert change because need to check fields before save is clicked

* issues warning for specific fields that can't be deleted after save

* removed the individual warnings

* changed status to concise string

* added more concise suggestion

Co-authored-by: Brent Bovenzi <brent.bovenzi@gmail.com>

---------

Co-authored-by: Brent Bovenzi <brent.bovenzi@gmail.com>
uranusjr pushed a commit to astronomer/airflow that referenced this pull request Aug 15, 2024
* able to change the 'Changed Row' display message after edit

* added message in connection form to warn of empty fields

* attempt to warn the specific fields cannot be empty

* revert change because need to check fields before save is clicked

* issues warning for specific fields that can't be deleted after save

* removed the individual warnings

* changed status to concise string

* added more concise suggestion

Co-authored-by: Brent Bovenzi <brent.bovenzi@gmail.com>

---------

Co-authored-by: Brent Bovenzi <brent.bovenzi@gmail.com>
bbovenzi added a commit to astronomer/airflow that referenced this pull request Aug 15, 2024
* able to change the 'Changed Row' display message after edit

* added message in connection form to warn of empty fields

* attempt to warn the specific fields cannot be empty

* revert change because need to check fields before save is clicked

* issues warning for specific fields that can't be deleted after save

* removed the individual warnings

* changed status to concise string

* added more concise suggestion

Co-authored-by: Brent Bovenzi <brent.bovenzi@gmail.com>

---------

Co-authored-by: Brent Bovenzi <brent.bovenzi@gmail.com>
Artuz37 pushed a commit to Artuz37/airflow that referenced this pull request Aug 19, 2024
* able to change the 'Changed Row' display message after edit

* added message in connection form to warn of empty fields

* attempt to warn the specific fields cannot be empty

* revert change because need to check fields before save is clicked

* issues warning for specific fields that can't be deleted after save

* removed the individual warnings

* changed status to concise string

* added more concise suggestion

Co-authored-by: Brent Bovenzi <brent.bovenzi@gmail.com>

---------

Co-authored-by: Brent Bovenzi <brent.bovenzi@gmail.com>
bbovenzi added a commit that referenced this pull request Aug 19, 2024
* able to change the 'Changed Row' display message after edit

* added message in connection form to warn of empty fields

* attempt to warn the specific fields cannot be empty

* revert change because need to check fields before save is clicked

* issues warning for specific fields that can't be deleted after save

* removed the individual warnings

* changed status to concise string

* added more concise suggestion



---------

Co-authored-by: Lucy Hu <90779522+lh5844@users.noreply.github.com>
molcay pushed a commit to VladaZakharova/airflow that referenced this pull request Aug 19, 2024
* able to change the 'Changed Row' display message after edit

* added message in connection form to warn of empty fields

* attempt to warn the specific fields cannot be empty

* revert change because need to check fields before save is clicked

* issues warning for specific fields that can't be deleted after save

* removed the individual warnings

* changed status to concise string

* added more concise suggestion

Co-authored-by: Brent Bovenzi <brent.bovenzi@gmail.com>

---------

Co-authored-by: Brent Bovenzi <brent.bovenzi@gmail.com>
romsharon98 pushed a commit to romsharon98/airflow that referenced this pull request Aug 20, 2024
* able to change the 'Changed Row' display message after edit

* added message in connection form to warn of empty fields

* attempt to warn the specific fields cannot be empty

* revert change because need to check fields before save is clicked

* issues warning for specific fields that can't be deleted after save

* removed the individual warnings

* changed status to concise string

* added more concise suggestion

Co-authored-by: Brent Bovenzi <brent.bovenzi@gmail.com>

---------

Co-authored-by: Brent Bovenzi <brent.bovenzi@gmail.com>
@utkarsharma2 utkarsharma2 added type:improvement Changelog: Improvements type:misc/internal Changelog: Misc changes that should appear in change log and removed type:improvement Changelog: Improvements labels Aug 30, 2024
utkarsharma2 pushed a commit that referenced this pull request Sep 2, 2024
* able to change the 'Changed Row' display message after edit

* added message in connection form to warn of empty fields

* attempt to warn the specific fields cannot be empty

* revert change because need to check fields before save is clicked

* issues warning for specific fields that can't be deleted after save

* removed the individual warnings

* changed status to concise string

* added more concise suggestion



---------

Co-authored-by: Lucy Hu <90779522+lh5844@users.noreply.github.com>
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. area:webserver Webserver related Issues type:misc/internal Changelog: Misc changes that should appear in change log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants