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 settings for the admin #516

Merged
merged 64 commits into from
Aug 1, 2020
Merged

Add settings for the admin #516

merged 64 commits into from
Aug 1, 2020

Conversation

Dudrie
Copy link
Collaborator

@Dudrie Dudrie commented Jul 17, 2020

🎫 Description

Add a system that allows the admin to change some settings without tinkering with configuration files. More infos in the issue #503.

This PR also changes some style and QoL related things.

🔒 Closes

The component got unusable if it was in preview mode and the value got resetted to ''.

Now, the button component stays clickable if the user is in preview mode, regardless of the value of the input.
@Dudrie Dudrie added 🗄 server Issue is related to the sever 💻 client Issue is related to the client ⚙ configurable Issue is related to a behaviour which is configurable through a setting. labels Jul 17, 2020
@Dudrie Dudrie self-assigned this Jul 17, 2020
Dudrie added 24 commits July 17, 2020 22:26
Message get a colroed 'label' prefix instead of getting colored as a whole.
The first is the format SettingsServer the last (new one) will be used for the admin settings.
This allows the admin to define the default settings before the first start of the server.
This combines the ones from the config file with the internal ones used as a fallback.
This replaces the (default) usage of the MemoryStore of express-session.
This also extends the eslint scripts in the server package.json to include the test/ folder.
This also adds the usage of the defaultTeamSize.
The roles in the DTO should be a standard JS array. However, besides failing tests, this did not have any implications for the app because the type information was lost by strinigfying the response bodies to JSON anyway.
This helper allows a unified check if the current user is allowed to excuse a student.
Trying to load the settings before logging in results in a 401 error code and the settings were never re-fetched.
Dudrie added 26 commits July 29, 2020 23:42
This also changes a lot of the logic in this service and cleans it up. This way it is more maintainable and readable (and hopefully less error prone).
If no fields where given to the SettingsModel constructor an empty object was assigned to mailingConfig instead of undefined.
This also changes the order of the inputs on the email settings.
- Mailing is disabled (this also disables the button to send the credentials to all users) OR
- User has no email address OR
- User has no temporary password.

The reason is displayed to the user as secondary text except for the first one.
@Dudrie Dudrie marked this pull request as ready for review August 1, 2020 19:29
@Dudrie Dudrie merged commit 7cb08a8 into v2 Aug 1, 2020
@Dudrie Dudrie deleted the issue-503-Settings_for_the_admin branch August 1, 2020 19:32
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 ⚙ configurable Issue is related to a behaviour which is configurable through a setting. 🗄 server Issue is related to the sever
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Make mailing settings optional
1 participant