-
Notifications
You must be signed in to change notification settings - Fork 53
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
Eventyay Common: Create an event dashboard #505
base: development
Are you sure you want to change the base?
Conversation
Reviewer's Guide by SourceryThis pull request introduces an event dashboard, enhancing the user interface with a new overview page for event components (tickets, talks, videos). It also includes a fix for a CSS conflict related to the info box. Class diagram for EventIndexView and related componentsclassDiagram
class EventIndexView {
+template_name: str
+get_context_data()
-_get_user_permissions()
-_collect_dashboard_widgets()
-_filter_log_entries()
-_check_event_statuses()
+rearrange(widgets)
}
class Event {
+talk_schedule_url
+talk_session_url
+talk_speaker_url
+talk_dashboard_url
+talk_settings_url
}
class TemplateView {
+get_context_data()
}
EventIndexView --|> TemplateView
EventIndexView ..> Event: uses
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this 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: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
widgets.extend(result) | ||
return self.rearrange(widgets) | ||
|
||
def _filter_log_entries( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (performance): Consider caching ContentType lookups as class attributes to avoid repeated database queries
Move the ContentType.objects.get_for_model() calls outside the method and store them as class attributes. This will prevent executing the same queries multiple times.
Suggested implementation:
return []
# Cache ContentType lookups at class level
order_content_type = ContentType.objects.get_for_model(Order)
invoice_content_type = ContentType.objects.get_for_model(Invoice)
checkin_content_type = ContentType.objects.get_for_model(Checkin)
item_content_type = ContentType.objects.get_for_model(Item)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
request = self.request
You'll also need to:
- Add imports for ContentType and the models (Order, Invoice, Checkin, Item) at the top of the file if not already present
- Update any places in the code where ContentType.objects.get_for_model() is called to use these class attributes instead
- Make sure these models are the correct ones being used in the log entries - adjust the model list according to what's actually being filtered in the log entries
@media (min-width: $screen-xs-min) and (max-width: $screen-xs-max) { | ||
.dashboard .widget-container.widget-small.no-padding.column { | ||
margin-right: 0px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Add media query for screens smaller than xs breakpoint
Consider adding a media query for screens smaller than $screen-xs-min to ensure proper layout on very small devices.
@media (min-width: $screen-xs-min) and (max-width: $screen-xs-max) { | |
.dashboard .widget-container.widget-small.no-padding.column { | |
margin-right: 0px; | |
@media (max-width: $screen-xs-min - 1) { | |
.dashboard .widget-container.widget-small.no-padding.column { | |
margin-right: 0px; | |
} | |
} | |
@media (min-width: $screen-xs-min) and (max-width: $screen-xs-max) { | |
.dashboard .widget-container.widget-small.no-padding.column { | |
margin-right: 0px; |
There was a problem hiding this 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 - here's some feedback:
Overall Comments:
- Consider enhancing error handling in utility functions like get_subevent() to properly propagate errors to the UI rather than just logging them. This would improve the user experience when invalid data is provided.
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
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Event dashboard
Fix css conflict of info box
This PR resolves #455
Summary by Sourcery
Introduce an event dashboard to provide a comprehensive overview of event details, including tickets, talks, and videos, along with quick access to each component.
New Features:
Tests: