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

Use forms in destination page #1161

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

hmpf
Copy link
Contributor

@hmpf hmpf commented Jan 23, 2025

Depends on #936

Review file by file

Will be squashed

@hmpf hmpf requested review from stveit and johannaengland January 23, 2025 12:40
src/argus/htmx/destination/views.py Fixed Show resolved Hide resolved
src/argus/htmx/destination/views.py Fixed Show resolved Hide resolved
@hmpf hmpf force-pushed the destination-with-forms branch 5 times, most recently from 1087430 to a51d4e7 Compare January 24, 2025 11:26
hmpf and others added 2 commits January 24, 2025 12:29
.. also make it easioer to validate the settings-field with a django
form.
@hmpf hmpf force-pushed the destination-with-forms branch from a51d4e7 to b1c02c5 Compare January 24, 2025 11:32
@hmpf hmpf marked this pull request as ready for review January 24, 2025 11:32
@hmpf hmpf self-assigned this Jan 24, 2025
@hmpf hmpf added the frontend Affects frontend label Jan 24, 2025
@hmpf hmpf force-pushed the destination-with-forms branch from b1c02c5 to b4c8a33 Compare January 24, 2025 11:35
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 48.02632% with 158 lines in your changes missing coverage. Please review.

Project coverage is 77.45%. Comparing base (a3311e0) to head (b4c8a33).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/argus/htmx/destination/views.py 18.18% 90 Missing ⚠️
src/argus/notificationprofile/media/base.py 63.10% 38 Missing ⚠️
src/argus/htmx/destination/forms.py 0.00% 15 Missing ⚠️
src/argus/notificationprofile/media/email.py 80.95% 8 Missing ⚠️
src/argus/notificationprofile/media/__init__.py 42.85% 4 Missing ⚠️
src/argus/notificationprofile/serializers.py 89.47% 2 Missing ⚠️
...rc/argus/notificationprofile/media/sms_as_email.py 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1161      +/-   ##
==========================================
- Coverage   78.48%   77.45%   -1.03%     
==========================================
  Files         141      141              
  Lines        5442     5553     +111     
==========================================
+ Hits         4271     4301      +30     
- Misses       1171     1252      +81     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@stveit stveit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some issues while testing this:

Trying to update a destination gives the error "This email destination already exists." This happens if you make no changes to the form and click "update", or only change either label or the setting. But if you change both to unique values that are not used in another destination, then it updates. It seems like the validation doesn't understand that the updated destination will replace the original, and just treats it like you're trying to create a new destination with the same label and or setting.

Simultaneously, a new collapse elements is created that is empty with the title (0)

image

Another problem (relevant comment here is when you try to create a new destination (or update) with a label or email that collides with an existing destination, you get the error message "This email destination already exists", but it does not indicate in any way if the problem is the label, the email or both

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Affects frontend
Projects
Status: Ready for review
Development

Successfully merging this pull request may close these issues.

3 participants