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

refactor(all): add events collection. Home page based on user.role #14

Merged
merged 6 commits into from
Nov 21, 2024

Conversation

ZL-Asica
Copy link
Member

@ZL-Asica ZL-Asica commented Nov 21, 2024

  • Refactored Home:

    • Adjusted logic to render DonorDashboard or OrganizationDashboard based on user.role.
  • Firebase Updates:

    • Added an events collection to centralize event management.
    • Updated the user schema:
      • Added joinedEvents as an array of event IDs for both DonorProfile and OrganizationProfile.
  • Component Updates:

    • Updated DonationModal to align with the new DonationEvent schema (1:1 relationship between donor and event).
    • Enhanced Schedule to fetch and display events dynamically, adding visual indicators for event dates on the calendar.
  • Hook Improvements:

    • Enhanced useEvents to handle creating, updating, and deleting events in the events collection.
    • Streamlined useUser for role-based event logic.
  • Type Updates:

    • Simplified and refined the DonationEvent type for better clarity and alignment with the new schema.

Breaking Changes:

  • Migrated to a centralized events collection; users now reference events via joinedEvents.

@ZL-Asica ZL-Asica added bug Something isn't working enhancement New feature or request labels Nov 21, 2024
Copy link

This PR is too large and may need to be broken into smaller pieces.

marycaserio and others added 5 commits November 21, 2024 13:13
- Remove extra `SavedContext` and corresponde `useSaved` hook.
- Create `useSavedOrgs` hook to directly use `UserContext` to handle global state.

- Add auto-fetch `organizationProfiles` into `UserContext` every time session refresh and listen to firebase updates.
- Directly saved to `Session storage` which will save quotas and ensure speed.
…n `user.role`

BREAKING CHANGE: Schema modified. Now all user have joinedEvents array which only have eventID correspond to the event they have joined. Also, `events` collection added to firebase which have all the events. Home page is now based on `user.role`. If user is donor, they will see the `DonorDashboard` and if user is organization, they will see `OrganizationDashboard`.
Copy link

This PR is too large and may need to be broken into smaller pieces.

Copy link

🚀 Preview for this PR is available at: https://openhands-48a60--pr-14-2qh7mtgh.web.app

🧪 Test Results

Tests Passed: All tests passed successfully!


🎨 Prettier Format Check

Prettier: No formatting issues found!

🎨 Lint Check

Lint: No linting issues found!

Copy link

This PR is too large and may need to be broken into smaller pieces.

Copy link

🚀 Preview for this PR is available at: https://openhands-48a60--pr-14-2qh7mtgh.web.app

🧪 Test Results

Tests Passed: All tests passed successfully!


🎨 Prettier Format Check

Prettier: No formatting issues found!

🎨 Lint Check

Lint: No linting issues found!

@ZL-Asica ZL-Asica merged commit 22e849c into main Nov 21, 2024
3 checks passed
@ZL-Asica ZL-Asica deleted the refactor/base branch November 21, 2024 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants