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

Provide export of personal schedule #168

Merged
merged 1 commit into from
Aug 2, 2024

Conversation

odkhang
Copy link
Collaborator

@odkhang odkhang commented Aug 2, 2024

This PR closes/references issue #162 . It does so by:

  • Add 4 options in drop down for user's favorite session.

image

  • Require user to login in order to use this feature, if User not logged in, redirect to login page.

How has this been tested?

Checklist

  • I have added tests to cover my changes.

Summary by Sourcery

Add personal schedule export functionality with support for XML, XCal, JSON, and iCal formats. Require user login to access these features and filter exported events based on user favorites.

New Features:

  • Introduce new export options for personal schedules, including XML, XCal, JSON, and iCal formats.
  • Add a requirement for users to log in to access personal schedule export features.

Enhancements:

  • Update the schedule export functionality to filter events based on user favorites.

Copy link

sourcery-ai bot commented Aug 2, 2024

Reviewer's Guide by Sourcery

This pull request introduces new data exporters for personal schedules, allowing users to export their favorite sessions. It includes changes to the export system, user login handling, and UI updates to support these new features.

File-Level Changes

Files Changes
src/pretalx/schedule/exporters.py
src/pretalx/schedule/signals.py
src/pretalx/agenda/views/schedule.py
Introduced new data exporters for personal schedules and integrated them with the existing export system, including user login and favorite talks filtering.
src/pretalx/agenda/templates/agenda/header_row.html
src/pretalx/static/common/scss/_pretalx.scss
Updated the export menu in the UI to include new personal schedule export options and added corresponding CSS styling.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

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 @odkhang - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider refactoring the new exporters to reduce code duplication. A more generic approach that can handle both full and personalized schedules might be more maintainable.
  • The XML and XCal filtering could be inefficient for large schedules. Consider filtering the data before generating the XML for better performance.
  • Please add unit tests to cover the new functionality and ensure it doesn't break existing features.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 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 to tell me if it was helpful.

Comment on lines +148 to +151
class MyFrabXmlExporter(FrabXmlExporter):
identifier = "schedule-my.xml"
verbose_name = "My XML (frab compatible)"
favs_retrieve = True
Copy link

Choose a reason for hiding this comment

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

suggestion: Consider using a design pattern to reduce code duplication

The new MyFrabXmlExporter, MyFrabXCalExporter, and MyFrabJsonExporter classes all follow the same pattern of subclassing and setting favs_retrieve = True. Consider using a mixin or a factory pattern to reduce code duplication and improve maintainability.

class FavsRetrieveMixin:
    favs_retrieve = True

class MyFrabXmlExporter(FavsRetrieveMixin, FrabXmlExporter):
    identifier = "schedule-my.xml"
    verbose_name = "My XML (frab compatible)"

@mariobehling mariobehling merged commit 0f66669 into fossasia:development Aug 2, 2024
3 of 9 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.

3 participants