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

Fix issue schedule on organiser interface loading eternally #205

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

lcduong
Copy link
Contributor

@lcduong lcduong commented Sep 27, 2024

This PR closes/references issue #202 . It does so by add the base path for API call

How has this been tested?

Checklist

  • I have added tests to cover my changes.

Summary by Sourcery

Resolve the eternal loading issue in the organiser interface by incorporating a base path for API requests, ensuring correct URL formation for fetching data.

Bug Fixes:

  • Fix the issue of the schedule on the organiser interface loading indefinitely by adding a base path for API calls.

Copy link

sourcery-ai bot commented Sep 27, 2024

Reviewer's Guide by Sourcery

This pull request addresses an issue with the schedule loading indefinitely on the organiser interface. The main change involves adding a base path for API calls, which affects how the event slug is determined and how API endpoints are constructed.

Sequence Diagram

sequenceDiagram
    participant Client
    participant API
    Client->>API: Determine eventSlug
    Note over Client,API: Use basePath if present
    Client->>API: Construct API URL with basePath
    Client->>API: Make API request (e.g., fetchTalks)
    API-->>Client: Return response
Loading

File-Level Changes

Change Details Files
Introduction of a base path for API calls
  • Added a 'basePath' constant using an environment variable or defaulting to '/talk'
  • Modified the 'eventSlug' determination to account for the base path
  • Updated API endpoint URLs to include the base path
src/pretalx/frontend/schedule-editor/src/api.js
Adjustment of API endpoint construction
  • Modified 'fetchTalks' function to use the new base path
  • Updated 'fetchAvailabilities' function to use the new base path
  • Changed 'fetchWarnings' function to include the base path
  • Adjusted 'fetchRooms' function to incorporate the base path
src/pretalx/frontend/schedule-editor/src/api.js

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.

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

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

Overall Comments:

  • Please add tests to cover this change, especially to verify that the API calls work correctly with and without a base path.
  • Consider using a more robust method to extract the event slug, such as a URL parsing library, instead of relying on splitting the pathname.
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 to tell me if it was helpful.

@mariobehling mariobehling merged commit 02bcbf4 into fossasia:development Sep 27, 2024
8 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.

2 participants