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

Sync upstream dec 24th #253

Merged
merged 14 commits into from
Dec 25, 2024

Conversation

HungNgien
Copy link
Contributor

@HungNgien HungNgien commented Dec 24, 2024

Commit Hash Commit Message
032a20d Make all style checkers happy
b91a59e update frab export; stop validating while schema is broken
ab4b3a3 Fix typo
1f49646 Make header and footer links configurable
beb59d4 Explicitly depend on setuptools
f7e3b21 Update django-i18nfield requirement from ~=1.9.0 to >=1.9,<1.11
a4f6ec9 Show avatar clear checkbox when allowed
fe5b486 Fix code style
b74f573 Remove pytest-rerunfailures
d8db093 Bump nanoid from 3.3.6 to 3.3.8 in /src/pretalx/frontend/schedule-editor
9eb27cd Update translations
5776504 Fix typo
16009f9 Translations update: Portuguese, Vietnamese

Summary by Sourcery

Add header and footer links to event settings.

New Features:

  • Configurable header and footer links have been added to the event settings.

Tests:

  • Updated tests to reflect the changes in event settings.

Copy link

sourcery-ai bot commented Dec 24, 2024

Reviewer's Guide by Sourcery

This pull request introduces configurable header and footer links to the event settings page, updates the schedule export to include these links, and refactors the event settings form to use formsets for managing the links.

Sequence diagram for saving event links

sequenceDiagram
    actor O as Organizer
    participant F as EventSettingsForm
    participant H as HeaderLinkFormset
    participant Ft as FooterLinkFormset
    participant DB as Database
    O->>F: Submit form
    F->>H: Validate header links
    F->>Ft: Validate footer links
    alt Validation successful
        F->>DB: Save form data
        H->>DB: Save header links
        Ft->>DB: Save footer links
        DB-->>O: Success message
    else Validation failed
        F-->>O: Error message
    end
Loading

Class diagram for the new EventExtraLink model

classDiagram
    class EventExtraLink {
        +event: ForeignKey
        +label: I18nCharField
        +url: URLField
        +role: CharField
        +created: DateTimeField
        +updated: DateTimeField
    }
    class Event {
        +extra_links: RelatedManager
    }
    Event "1" -- "*" EventExtraLink : has
    note for EventExtraLink "Represents configurable links
shown in header or footer
role can be 'header' or 'footer'"
Loading

File-Level Changes

Change Details Files
Added header and footer links to event settings
  • Added formsets for header and footer links to the event settings form.
  • Added fields for header and footer links to the event settings model.
  • Added views to handle saving and displaying header and footer links.
  • Updated context processors to include header and footer links on all public pages.
  • Updated the base template to display header links.
  • Created a migration to add the EventExtraLink model.
  • Created a template for rendering the event links formset.
  • Added new EventExtraLink model to store the links.
  • Refactored the event settings form to use formsets for managing the links.
src/pretalx/orga/templates/orga/settings/form.html
src/pretalx/orga/forms/event.py
src/pretalx/orga/views/event.py
src/pretalx/event/models/event.py
src/pretalx/common/context_processors.py
src/pretalx/common/templates/common/base.html
/dev/null
src/pretalx/orga/templates/orga/includes/event_links_formset.html
src/pretalx/event/migrations/0038_eventextralink.py
Refactored event settings form
  • Created a helper function get_settings_form_data to simplify form submission.
  • Simplified form submission by using the get_settings_form_data helper function.
  • Added fieldsets to group related settings in the form.
  • Improved the organization of the event settings form by grouping related settings into fieldsets.
src/tests/orga/views/test_orga_views_event.py
src/pretalx/orga/templates/orga/settings/form.html
Updated schedule export
  • Added header and footer links to the schedule export data.
  • Updated tests to include header and footer links in the exported schedule data.
  • Included header and footer links in the schedule export data.
  • Updated schedule export tests to reflect the changes in the exported data.
src/pretalx/schedule/exporters.py
src/tests/agenda/test_agenda_schedule_export.py
Updated dependencies and fixed code style
  • Updated django-i18nfield requirement from ~=1.9.0 to >=1.9,<1.11.
  • Explicitly depend on setuptools.
  • Bump nanoid from 3.3.6 to 3.3.8 in /src/pretalx/frontend/schedule-editor.
  • Fixed typo.
  • Fixed code style.
  • Made all style checkers happy.
  • Removed pytest-rerunfailures.
  • Added styling for initial images in forms.
  • Improved styling for image clearing checkboxes.
  • Improved avatar image clearing checkbox display.
  • Added room slug property.
  • Removed duplicate script tag.
pyproject.toml
src/pretalx/person/models/user.py
src/pretalx/cfp/templates/cfp/event/user_submission_edit.html
src/pretalx/frontend/schedule-editor/package-lock.json
src/pretalx/common/css/_forms.css
src/pretalx/common/templates/common/widgets/image_input.html
src/pretalx/static/common/css/avatar.css
.github/workflows/tests.yml
src/pretalx/schedule/models/room.py
Updated tests and fixed query counts
  • Updated query counts in multiple test files.
  • Fixed flaky tests.
  • Prefetch event extra links in middleware.
  • Adjusted database query counts in tests to account for changes in database access patterns.
src/tests/agenda/views/test_agenda_talks.py
src/tests/agenda/views/test_agenda_schedule.py
src/tests/agenda/views/test_agenda_feedback.py
src/tests/common/test_common_auth.py
src/tests/agenda/views/test_agenda_widget.py
src/tests/orga/views/test_orga_views_cfp.py
src/pretalx/common/middleware/event.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@HungNgien HungNgien marked this pull request as ready for review December 24, 2024 03:45
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @HungNgien - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@mariobehling mariobehling merged commit bc1cc16 into fossasia:development Dec 25, 2024
10 of 11 checks passed
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.

4 participants