Skip to content

Chore/refactor duplications - #92

Open
pablo-schmeiser wants to merge 16 commits into
HaDiNet:masterfrom
pablo-schmeiser:chore/refactor-duplications
Open

Chore/refactor duplications#92
pablo-schmeiser wants to merge 16 commits into
HaDiNet:masterfrom
pablo-schmeiser:chore/refactor-duplications

Conversation

@pablo-schmeiser

Copy link
Copy Markdown
Collaborator

This pull request introduces a new user theme preference feature, improves test coverage and reporting, and adds comprehensive documentation and metrics for testing quality. It also includes UI refinements for login pages and codebase cleanup.

User Theme Preference Feature:

  • Added a theme_preference field to the User model with options for 'light', 'dark', and 'auto', including a migration and admin registration update. [1] [2] [3]

Testing Quality and Coverage Improvements:

  • Added .coveragerc for coverage configuration and enabled the django-coverage-plugin in development and test dependencies. [1] [2]
  • Introduced docs/testing_quality.md with a detailed scorecard for behavior-focused testing quality metrics, and linked it from development and README docs. [1] [2] [3] [4]
  • Added comprehensive tests for authentication and SSO login flows in accounts/tests/test_auth_views.py.

UI and Template Refinements:

  • Unified login page backgrounds by adding the login-surface class to relevant login form containers for consistent theming. [1] [2] [3] [4] [5]

Codebase Cleanup:

  • Updated admin registration for the User model to use the shared register_models utility.

Documentation Improvements:

  • Updated documentation navigation to include a dedicated "Testing Quality Scorecard" section.

- Add non-field error handling and improve already present error handling in shift creation
- Remove green hghlighting for valid, but optional form fields and removing green checkmark from optional form select fields
This is a combination of 5 commits.
- chore: Create Mixins for shared, inherited behavior
- chore: Refactor shared membership inheritance
- chore: Register models to admin view in helper function
- chore: Refactor URL patterns to use shared organization CRUD helper
- chore: Refactor URL patterns to utilize organization_crud_paths for events and shifts
This is a combination of 3 commits.
- fix: Group details were not reachable due to same url
- fix: Correct inheritance order for OrganizationCreateUpdateMixin
- fix: Refactor delete view classes to fix inheritance issue
This is a combination of 3 commits.
- chore: Refactor form templates to use shared remove/restore button component
- chore: Refactor often reused buttons to deduplicate code and fix modal backdrop behavior
	NOTE: Modal is now top-level to correct behavior. Temporary patch for iOS was removed and should be tested on iOS in the future.
- chore: Refactor modal trigger components to reduce duplication and improve maintainability
This is a combination of 9 commits.
- chore: Add coverage configuration and update dependencies for testing
- test: Add set_language to tests
- test: Add unit tests for user and membership forms to improve coverage
- test: Add unit tests for user authentication and email confirmation flows
- fix: Update SSO login condition to check if OAUTH is enabled
- test: Add unit tests for SSO login and protected content views
- test: Consolidate DOM manipulation tests and improve structure
	- Introduced a new `dom-harness.cjs` file to centralize DOM-related utilities for testing.
	- Created various test files for different components, including formset, modal handlers, navigation, sliders, save and restore functionality, and theme toggle.
	- Refactored class list and element creation logic to reduce duplication across tests.
	- Enhanced test setups to better simulate user interactions and DOM events.
	- Improved assertions for clarity and accuracy in testing expected behaviors.
- test: Add unit tests for BaseMixin and permission handling in views
- docs: Add Testing Quality Scorecard documentation
- Removed member_shift_summary template and integrated its functionality into shift_users_summary.
- Updated templates to use shift_users_summary for displaying user shifts.
- Added non-org participants to summary.
- Introduced tests for shift_users_summary functionality and filtering behavior.

@pablo-schmeiser pablo-schmeiser left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Since this PR looks imposing, the tests and changes to the CSS are basically irrelevant, and the rest is mostly straight forward refactorings and updated .po files for localization.

Comment thread src/shiftings/static/js/theme-toggle.js Outdated
Comment thread src/shiftings/static/js/theme-toggle.js Outdated

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

While an improvement, this could still be solved nicer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant