Skip to content

Commit

Permalink
Merge pull request #963 from Dudrie/issue-957-Change_DB_to_SQL
Browse files Browse the repository at this point in the history
Change DB to SQL
  • Loading branch information
nk-coding authored Oct 22, 2022
2 parents 195900c + 03c068c commit f313021
Show file tree
Hide file tree
Showing 343 changed files with 17,108 additions and 23,674 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ indent_size = 2

[*.config.js]
indent_size = 2

[*.md]
indent_size = 3
118 changes: 59 additions & 59 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,70 +4,70 @@ root: true
parser: '@typescript-eslint/parser' # Specifies the ESLint parser

plugins:
- 'react'
- 'import'
- 'react'
- 'import'

extends:
- 'plugin:react/recommended' # Uses the recommended rules from @eslint-plugin-react
- 'plugin:react-hooks/recommended'
- 'plugin:@typescript-eslint/recommended' # Uses the recommended rules from the @typescript-eslint/eslint-plugin
- 'plugin:import/typescript'
- 'prettier/@typescript-eslint' # Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
- 'plugin:prettier/recommended' # Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
- 'plugin:react/recommended' # Uses the recommended rules from @eslint-plugin-react
- 'plugin:react-hooks/recommended'
- 'plugin:@typescript-eslint/recommended' # Uses the recommended rules from the @typescript-eslint/eslint-plugin
- 'plugin:import/typescript'
# - 'prettier/@typescript-eslint' # Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
- 'plugin:prettier/recommended' # Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.

parserOptions:
ecmaVersion: 2018 # Allows for the parsing of modern ECMAScript features
sourceType: 'module' # Allows for the use of imports
ecmaVersion: 2018 # Allows for the parsing of modern ECMAScript features
sourceType: 'module' # Allows for the use of imports

rules:
# Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
'@typescript-eslint/explicit-function-return-type': 'off'
'@typescript-eslint/explicit-member-accessibility': 'off'
'@typescript-eslint/no-explicit-any': 'off'
'@typescript-eslint/no-inferrable-types': 'off'
'@typescript-eslint/no-unused-vars':
- 'warn'
- ignoreRestSiblings: true
argsIgnorePattern: '^_'
args: 'none'
'@typescript-eslint/no-use-before-define':
- 'error'
- functions: false
classes: true
variables: true
typedefs: true
'@typescript-eslint/no-parameter-properties':
- 'error'
- allows:
- 'private'
- 'readonly'
- 'private readonly'
- 'protected readonly'
'@typescript-eslint/interface-name-prefix': 'off'
'@typescript-eslint/explicit-module-boundary-types':
- 'warn'
- allowedNames: ['renderLink']
'constructor-super': 'error'
'no-console': 'error'
'no-fallthrough': 'error'
'no-useless-rename': 'warn'
'import/no-restricted-paths':
- 'error'
- zones:
- target: './client'
from: './server/src'
'import/no-unresolved': 'off'
'import/no-named-as-default': 'off'
'import/no-unused-modules':
- 'off'
- unusedExports: true
'react/display-name': 'off'
'react/jsx-no-duplicate-props':
- 'warn'
- ignoreCase: false
'react/prop-types': [0]
'prettier/prettier': 'warn'
# Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
'@typescript-eslint/explicit-function-return-type': 'off'
'@typescript-eslint/explicit-member-accessibility': 'off'
'@typescript-eslint/no-explicit-any': 'off'
'@typescript-eslint/no-inferrable-types': 'off'
'@typescript-eslint/no-unused-vars':
- 'warn'
- ignoreRestSiblings: true
argsIgnorePattern: '^_'
args: 'none'
'@typescript-eslint/no-use-before-define':
- 'error'
- functions: false
classes: true
variables: true
typedefs: true
'@typescript-eslint/no-parameter-properties':
- 'error'
- allows:
- 'private'
- 'readonly'
- 'private readonly'
- 'protected readonly'
'@typescript-eslint/interface-name-prefix': 'off'
'@typescript-eslint/explicit-module-boundary-types':
- 'warn'
- allowedNames: ['renderLink']
'constructor-super': 'error'
'no-console': 'error'
'no-fallthrough': 'error'
'no-useless-rename': 'warn'
'import/no-restricted-paths':
- 'error'
- zones:
- target: './client'
from: './server/src'
'import/no-unresolved': 'off'
'import/no-named-as-default': 'off'
'import/no-unused-modules':
- 'off'
- unusedExports: true
'react/display-name': 'off'
'react/jsx-no-duplicate-props':
- 'warn'
- ignoreCase: false
'react/prop-types': [0]
'prettier/prettier': 'warn'

settings:
react:
version: 'detect' # Tells eslint-plugin-react to automatically detect the version of React to use
react:
version: 'detect' # Tells eslint-plugin-react to automatically detect the version of React to use
10 changes: 10 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ jobs:
uses: actions/checkout@v2 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
persist-credentials: false
- name: Start SQL Docker container
uses: mirromutth/mysql-action@v1.1
with:
host port: 3306 # Optional, default value is 3306. The port of host
container port: 3306 # Optional, default value is 3306. The port of container
character set server: 'utf8' # Optional, default value is 'utf8mb4'. The '--character-set-server' option for mysqld
collation server: 'utf8_general_ci' # Optional, default value is 'utf8mb4_general_ci'. The '--collation-server' option for mysqld
mysql version: '8.0' # Optional, default value is "latest". The version of the MySQL
mysql database: 'tms-testing-db' # Optional, default value is "test". The specified database which will be created
mysql root password: 'some-password' # Required if "mysql user" is empty, default is empty. The root superuser password
- name: Setup Node.js
uses: actions/setup-node@v2.1.5
with:
Expand Down
4 changes: 4 additions & 0 deletions .idea/Tutor-Management-System.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/prettier.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/runConfigurations/_template__of_JavaScriptTestRunnerJest.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/watcherTasks.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
git-tag-version = false
auto-install-peers = true
strict-peer-dependencies = false
4 changes: 4 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ singleQuote: true
jsxSingleQuote: true
printWidth: 100
endOfLine: auto
overrides:
- files: '*.ts'
options:
tabWidth: 4
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[yaml]": {
"editor.defaultFormatter": "redhat.vscode-yaml"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ To make commits useful and easy to read they follow a simple naming principle: T
Those fit in the sentence like this:

- _This commit will_ fix the bug in tutorial creation.
- _This commit will_ fix issue #10
- _This commit will_ add a timeout before retry to connect to MongoDB.
- _This commit will_ fix the bug in tutorial creation.
- _This commit will_ fix issue #10
- _This commit will_ add a timeout before retry to connect to MongoDB.

If you want (or need) to provide more information you can simple add a description to your commit by adding a new paragraph to the commit message:

Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ COPY client/ tms/client/
COPY server/ tms/server/
COPY scripts/ tms/scripts/

COPY .npmrc tms/
COPY package.json tms/
COPY pnpm-lock.yaml tms/
COPY pnpm-workspace.yaml tms/
Expand Down Expand Up @@ -47,6 +48,7 @@ RUN npm install -g pnpm

COPY --from=build tms/server/dist tms/server

COPY .npmrc tms/
COPY package.json /tms
COPY pnpm-lock.yaml tms/
COPY pnpm-workspace.yaml tms/
Expand Down
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
![Code Quality](https://github.com/Dudrie/Tutor-Management-System/workflows/Code%20Quality/badge.svg)
![Build and push Docker image](https://github.com/Dudrie/Tutor-Management-System/workflows/Build%20and%20push%20Docker%20image/badge.svg)

The Tutor Management System (short _TMS_) aims to be a tool used at universitites (in Germany). It can be used to track the requirements which a student has to fulfill to be allowed to attend the exam. It can (among other things) track the points gained by the students in their homeworks, how often a student attended the tutorial and how often a student presented a solution.
The Tutor Management System (short _TMS_) aims to be a tool used at universities (in Germany). It can be used to track the requirements which a student has to fulfill to be allowed to attend the exam. It can (among other things) track the points gained by the students in their homeworks, how often a student attended the tutorial and how often a student presented a solution.

## Getting Started

Expand Down
5 changes: 3 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "client-cra",
"name": "client",
"version": "0.1.0",
"private": true,
"main": "src/index.tsx",
Expand All @@ -11,6 +11,7 @@
"format": "eslint --fix \"src/**/*.ts?(x)\"",
"eslint:check": "eslint \"src/**/*.ts?(x)\"",
"prettier:check": "prettier --check \"src/**/*.ts?(x)\"",
"prettier:format": "prettier --write --loglevel warn \"./**/*.ts?(x)\"",
"ts:check": "tsc --project . --noEmit",
"ts:check:watch": "tsc --project . --noEmit -w",
"eject": "react-scripts eject"
Expand All @@ -24,7 +25,7 @@
"axios": "^0.21.1",
"clsx": "^1.1.1",
"file-saver": "^2.0.2",
"formik": "^2.2.6",
"formik": "^2.2.9",
"highlight.js": "^10.7.2",
"html-react-parser": "^1.2.1",
"i18next": "^19.8.3",
Expand Down
3 changes: 2 additions & 1 deletion client/src/components/forms/FormikBaseForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Button, Typography } from '@material-ui/core';
import { createStyles, makeStyles, Theme } from '@material-ui/core/styles';
import clsx from 'clsx';
import { Formik, FormikConfig, FormikHelpers } from 'formik';
import { FormikValues } from 'formik/dist/types';
import React from 'react';
import SubmitButton from '../loading/SubmitButton';
import FormikDebugDisplay from './components/FormikDebugDisplay';
Expand Down Expand Up @@ -48,7 +49,7 @@ export interface FormikBaseFormProps<VALUES> extends FormikConfig<VALUES> {
enableUnsavedChangesWarning?: boolean;
}

function FormikBaseForm<VALUES>({
function FormikBaseForm<VALUES extends FormikValues>({
onCancelClicked,
enableDebug,
hideSaveButton,
Expand Down
12 changes: 2 additions & 10 deletions client/src/components/forms/StudentForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,8 @@ export const CREATE_NEW_TEAM_VALUE = 'CREATE_NEW_TEAM_ACTION';
type ItemType = Team | { type: typeof CREATE_NEW_TEAM_VALUE };

export function convertFormStateToDTO(values: StudentFormState, tutorialId: string): IStudentDTO {
const {
firstname,
lastname,
iliasName,
matriculationNo,
email,
courseOfStudies,
team,
status,
} = values;
const { firstname, lastname, iliasName, matriculationNo, email, courseOfStudies, team, status } =
values;

return {
firstname,
Expand Down
Loading

0 comments on commit f313021

Please sign in to comment.