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 wizard / UI to generate multiple tutorials & users at once #381

Merged
merged 113 commits into from
Jun 26, 2020

Conversation

Dudrie
Copy link
Collaborator

@Dudrie Dudrie commented May 29, 2020

🎫 Description

This PR implements the neccessary steps to support the easy generation of multiple users & multiple tutorials.

Server side changes

  • Add /tutorial/generate@POST route which generates multiple tutorials (only accessible by admins).
  • Add /user/generate@POST route which creates multiple users based on the given DTOs (only accessible by admins).

Client side changes

  • Add UI to generate multiple tutorials at once inside the TutorialManagement view.
  • Add UI/wizard to import user data in CSV form to create multiple users at once.
  • Add keyboard support for all DatePickers & TimePickers in the whole app.
  • Change SheetSelector to show a loading indicator while loading sheets from the server.

🔒 Closes

@Dudrie Dudrie added 🌟 enhancement New feature or request 🗄 server Issue is related to the sever 💻 client Issue is related to the client 🎆 QOL Issue is related to a quality of life improvment labels May 29, 2020
@Dudrie Dudrie self-assigned this May 29, 2020
@Dudrie Dudrie force-pushed the issue-346-Automatically_create_users_tutorials branch from 2d12efa to b318e2c Compare May 29, 2020 15:41
@Dudrie Dudrie force-pushed the issue-346-Automatically_create_users_tutorials branch from e1e4de2 to 5b8e98c Compare June 1, 2020 14:19
Dudrie added 22 commits June 8, 2020 14:13
This pipe uses the class-transformer options and does validate the incoming object before (!) converting it to a class with the NestJS' build in ValidationPipe.
This takes in the DTO and generates multiple tutorials according to the provided information. Returns all created tutorials.
This is a first draft of the component which gets adjusted as needed.
All "children" (ie step components) can now use some functionalities provided by a special context. These functionalities can be used to customize when and if the "Next-Button" actually resolves it's action (ie waiting for a fetch with moving forward if the fetch was successful).
This is without functionality and TabPanels for the weekdays, yet.
This splits up the code into several smaller components.
This also adds sorting of the excluded dates / intervals. Intervals take their starting (!) date for sorting.
Dudrie added 24 commits June 23, 2020 19:25
This shows a simple "yes/no"-Dialog with customizable button labels aswell as title and content. The showConfirmationDialog returns a Promise<boolean> which is true if the user clicked "yes" and false in all other cases.
This would allow to display row-specific errors later.
This tries to map slot names to existing tutorials. If they match the tutorial's ID is added to the form data of that user.
This lets the user choose a .csv file. If "valid" (against a simple MIME type check) the content of the file will be set as csvInput - if later will be overridden by this action the user has to confirm the override.
This makes it easier to access different types of snackbares from one hook (normal, error or with list).

Additionally a new useSnackbarWithList() hook was added to ease the process of creating a SnackbarWithList.
Related components are those which either use the SnackbarWithList component or which previously used both hooks: useSnackbar() and useErrorSnackbar().

This reduces the code for all components that use the SnackbarWithList component about a few lines.
This changes the return type to an array of object s which can include a value or an error message each. This way the user can be informed about which users where created and which were not (due to failure).
Now, the tests check if the correct ValueOrError object gets returned with the anticipated error message.
This basicly reverts the previous change but with the addition of deleting all created users before throwing the error. This effectively reverts the DB back into it's state before the request.
SelectInterval: Fix not propagating invalid intervals properly if start or end date are "null". If one of those are "null" an invalid Interval with a corresponding message is created and set as value.

WeekdayBox: Sorting failed if one of the intervals where invalid. Now, invalid intervals get sorted to the top of the list.
@Dudrie Dudrie marked this pull request as ready for review June 26, 2020 13:55
@Dudrie Dudrie merged commit 993767b into v2 Jun 26, 2020
@Dudrie Dudrie deleted the issue-346-Automatically_create_users_tutorials branch June 26, 2020 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 client Issue is related to the client 🌟 enhancement New feature or request 🎆 QOL Issue is related to a quality of life improvment 🗄 server Issue is related to the sever
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Automatically create users & tutorials Import Users from CSV file
1 participant