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

Streamline defining and usage of preferences #1072

Merged
merged 14 commits into from
Jan 15, 2025
Merged

Conversation

elfjes
Copy link
Collaborator

@elfjes elfjes commented Dec 9, 2024

  • Render all preferences at page load instead of through ajax requests
  • Funnel all preferences update requests through a single view/endpoint
  • Introduces a dataclass to hold preference meta information so that this can be stored directly in the Preference class:
@dataclasses.dataclass
class PreferenceField:
    form: forms.Form
    choices: Optional[Sequence] = None
    default: Optional[Any] = None
    partial_response_template: Optional[str] = None

@elfjes elfjes marked this pull request as draft December 9, 2024 14:34
@elfjes elfjes marked this pull request as ready for review December 10, 2024 13:09
@codecov-commenter
Copy link

codecov-commenter commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 78.08219% with 16 lines in your changes missing coverage. Please review.

Project coverage is 80.12%. Comparing base (84da7a2) to head (e0e4557).

Files with missing lines Patch % Lines
src/argus/htmx/user/views.py 33.33% 10 Missing ⚠️
src/argus/auth/models.py 83.33% 4 Missing ⚠️
src/argus/auth/context_processors.py 85.71% 1 Missing ⚠️
src/argus/auth/utils.py 95.83% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1072      +/-   ##
==========================================
+ Coverage   79.83%   80.12%   +0.28%     
==========================================
  Files         145      141       -4     
  Lines        5267     5248      -19     
==========================================
  Hits         4205     4205              
+ Misses       1062     1043      -19     

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

@hmpf hmpf requested a review from a team December 11, 2024 09:31
@hmpf hmpf added frontend Affects frontend performance labels Dec 11, 2024
@elfjes elfjes changed the title Simplify preferences Streamline defining and usage of preferences Dec 11, 2024
src/argus/auth/utils.py Outdated Show resolved Hide resolved
src/argus/auth/models.py Show resolved Hide resolved
@hmpf
Copy link
Contributor

hmpf commented Jan 8, 2025

I'll do a manual test also.

src/argus/auth/models.py Show resolved Hide resolved
@hmpf hmpf merged commit 7af4523 into Uninett:master Jan 15, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants