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

Add stores for data #22

Merged
merged 40 commits into from
Aug 30, 2024
Merged

Add stores for data #22

merged 40 commits into from
Aug 30, 2024

Conversation

MaHaWo
Copy link
Collaborator

@MaHaWo MaHaWo commented Aug 27, 2024

This is all somewhat tentative since I'm not proficient with web data management yet

what it does currently


  • goal: add svelte stores for children and content which can later be used to fetch and store data from the backend.
  • use svelte-stores to store global data in and 'emulate' backend calls.
  • There is no fixed API for yet for how these calls should be made in the end. Currently there's just some add , remove and fetch functions that operate directly on the prepopulated stores that contains only dummy data. For this reason, this PR doesn´t close the Dummy backend #10 yet.
    • 2 stores: children (contains userkey -> array of children objects, which are themselves dictionaries), content (contains data: surveys -> objects).
  • currently there are no subscriptions because the stores do not change values at runtime yet.
  • move dummy data defined in the components into the stores and use via the respective stores then.
  • create a dynamic routing for children and surveys: Children summary page and survey pages are created dynamically depending on the data in the stores. This currently uses load to pass data from page to page --> is there something better or is this acceptable?
  • add tests for functionality of stores where deemed relevant.
  • use typescript in the xStore and xStore.test files (will slowly migate <script> blocks and .js files to typescript as things get refactored).
  • there is no user store yet. This is because the user data management system is the least clear to me and the current login/register pages need deeper refactoring. For this reason, the child registration page does not make use of the childrenstore either.
  • error handling is missing still.

Sorry this got so ugly, I went back and forth a lot on it...

@MaHaWo MaHaWo linked an issue Aug 27, 2024 that may be closed by this pull request
@MaHaWo
Copy link
Collaborator Author

MaHaWo commented Aug 28, 2024

from here onwards in next PRs:


  • refactor registration and login pages such that one by one they get fully functional.
  • add childrenregistration functionality first because the store is already there.
  • add user store.
  • add functionality to the user login/registration pages.

@MaHaWo MaHaWo requested a review from lkeegan August 28, 2024 14:12
@MaHaWo
Copy link
Collaborator Author

MaHaWo commented Aug 30, 2024

@lkeegan Is there something to do here still?

Copy link
Member

@lkeegan lkeegan left a comment

Choose a reason for hiding this comment

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

lgtm

@MaHaWo MaHaWo merged commit a4c7b2e into main Aug 30, 2024
3 checks passed
@MaHaWo MaHaWo deleted the add-stores-for-data branch August 30, 2024 09:04
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.

Add svelte stores for data storage.
2 participants