Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop' of https://github.com/h-da/geli into feature/#599
Browse files Browse the repository at this point in the history
-Dedicated-File-Screen

# Conflicts:
#	app/webFrontend/src/app/course/course-detail/course-detail.component.ts
#	app/webFrontend/src/app/course/course-detail/download-course-dialog/download-course-dialog.component.ts
  • Loading branch information
HPunktOchs committed May 15, 2018
2 parents 5a349d6 + 276743a commit 31eef06
Show file tree
Hide file tree
Showing 38 changed files with 457 additions and 416 deletions.
6 changes: 4 additions & 2 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@

## Additional info:

------
_Please tag this issue if you are sure to which tag(s) it belongs._
<!--
ATTENTION:
Please tag this issue if you are sure to which tag(s) it belongs.
-->
8 changes: 5 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Closes #
## Known Issues:
_NONE_

------
_Remember to prefix your PR-Title with `⚠ WIP: ` if you still work on it.
If you have reached a final state, remove the prefix._
<!--
ATTENTION:
Remember to prefix your PR-Title with `⚠ WIP: ` if you still work on it.
If you have reached a final state, remove the prefix.
-->
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ script:
- sed -i 's/$TRAVIS_COMMIT/'$TRAVIS_COMMIT'/' src/server.ts
- npm run test # run backend test
- cd ..
- .travis/apidoc-check.sh
# run frontend-tests and return back to root for following steps
- cd app/webFrontend
- npm run lint # run linter
Expand Down
21 changes: 21 additions & 0 deletions .travis/apidoc-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# Path to this file
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Path the script was called from
IPWD="$(pwd)"
# Import shared vars
. ${DIR}/_shared-vars.sh


echo
echo "+++ Check API-Doc +++"
echo

if ([ "$TRAVIS_PULL_REQUEST" != "false" ] && [ "$TRAVIS_BRANCH" == "develop" ]) || ([ "$TRAVIS_PULL_REQUEST" != "false" ] && [ "$TRAVIS_BRANCH" == "master" ]); then
echo "+ detected pull request from ($TRAVIS_PULL_REQUEST_BRANCH) to $TRAVIS_BRANCH"
cd api
npm run apidoc
else
echo -e "${YELLOW}+ WARNING: No Pull Request agiainst Develop or Master -> skipping automate api doc check${NC}";
fi
2 changes: 1 addition & 1 deletion .travis/changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ elif [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ "$TRAVIS_BRANCH" == "master" ];
echo "+ detected pull request from ($TRAVIS_PULL_REQUEST_BRANCH) to $TRAVIS_BRANCH"
curl --silent https://raw.githubusercontent.com/h-da/geli/$TRAVIS_BRANCH/CHANGELOG.md \
| diff CHANGELOG.md - \
| grep -P '^< ## \[\d{1,3}\.\d{1,3}\.\d{1,3}\] - \d{4}-\d{2}-\d{2} - .{10,}' - -q
| grep -P '^< ## \[\[\d{1,3}\.\d{1,3}\.\d{1,3}\].*\] - \d{4}-\d{2}-\d{2} - .{10,}' - -q

if [[ $? == 0 ]]; then
echo -e "${GREEN}+ Update in CHANGELOG.md found, exit${NC}"
Expand Down
58 changes: 45 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,27 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

<!--
################################################################################
### PLEASE LINK THE ISSUES IF THERE IS ONE, OTHERWISE LINK THE PULL-REQUESTS ###
################################################################################
-->

## [NEXT]
### Changed
- Migrate MatSnackBar to SnackBarService. [#724](https://github.com/h-da/geli/pull/724)
- Reload user list after deleting an account. [#724](https://github.com/h-da/geli/pull/724)
- Validate form before submit when creating a new course. [#724](https://github.com/h-da/geli/pull/724)
- Validate :id for CourseController details route. [#724](https://github.com/h-da/geli/pull/724)
- Another MatSnackBar to SnackBarService migration. [#730](https://github.com/h-da/geli/pull/730)
- `getNotificationSettings` does not create new notification settings. [#731](https://github.com/h-da/geli/issues/731)
- Remove `isCourseTeacherOrAdmin` and `isMemberOfCourse`from UserService. [#731](https://github.com/h-da/geli/issues/731)

### Fixed
- Fixed broken notification settings. [#731](https://github.com/h-da/geli/issues/731)
- Fixed broken Apidoc [#737](https://github.com/h-da/geli/issues/737)

## [[0.7.0](https://github.com/h-da/geli/releases/tag/v0.7.0)] - 2018-05-05 - SS 18 intermediate Release
### Added
- Added a Dedicated Filefiew and restyled the Course section. [#599] (https://github.com/h-da/geli/issues/599)
- Added the possibility to sort all courses alphabetically. [#567](https://github.com/h-da/geli/issues/567)
Expand All @@ -15,7 +35,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Added details of courseAdmin and teacher to course detail view. on click profiles are shown.[#598](https://github.com/h-da/geli/issues/598)
- Added small auto linting scripts to package.json [#688](https://github.com/h-da/geli/issues/688)
- Added changed size of drop down arrows for better usability. [#686](https://github.com/h-da/geli/issues/686)
- Added new contributors [#624](https://github.com/h-da/geli/issues/624)
- Added the date and the teacher under each unit [#582](https://github.com/h-da/geli/issues/582)
- Added E-Mail validation to reset password [#597](https://github.com/h-da/geli/issues/597)
- Added Language code to header [#554](https://github.com/h-da/geli/issues/554)
- Added icon for access key [#547](https://github.com/h-da/geli/issues/574)
- Unit visibility toggle [#582](https://github.com/h-da/geli/issues/582)

### Changed
- Refactored or slightly altered various course & user related APIs. [#654](https://github.com/h-da/geli/issues/654) [#691](https://github.com/h-da/geli/issues/691)
Expand All @@ -27,7 +52,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Refactored register and resend activation to use geli email validator with top level domain check. [#713](https://github.com/h-da/geli/issues/713)

### Fixed
- Fixed Course progress mechanism
- Fixed route `/users/roles` [#204](https://github.com/h-da/geli/issues/204)
- Fixed profile picture will be deleted after changing any other profile data [#504](https://github.com/h-da/geli/issues/504)
- Fixed some UI issues in create code kata unit [#543](https://github.com/h-da/geli/issues/543)
- Fixed reading wrong error message across the whole application [#572](https://github.com/h-da/geli/issues/572)
- Fixed admin can changed his own role [#606](https://github.com/h-da/geli/issues/606)
- Fixed a typo in admin panel [#533](https://github.com/h-da/geli/issues/533)
- Fixed an admin cannot delete any courses [#647](https://github.com/h-da/geli/issues/647)
- Fixed some issues with download a course [#659](https://github.com/h-da/geli/issues/659)
- Fixed an issue with deleting a course and the notification was not triggered [#642](https://github.com/h-da/geli/issues/543)
- Fixed Course progress mechanism [#593](https://github.com/h-da/geli/issues/593)
- Fixed wasteful course data usage via specialized course model interfaces. [#654](https://github.com/h-da/geli/issues/654)
- Fixed a broken documentation link. [#583](https://github.com/h-da/geli/issues/583)
- Limited the first and last name to 64 characters in the registration- and edit page. [#585](https://github.com/h-da/geli/issues/585)
Expand All @@ -42,21 +76,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed `.travis.yml`. [#706](https://github.com/h-da/geli/pull/706)
- Fixed wording of progress display on profile page. [#715](https://github.com/h-da/geli/issues/715)
- Fixed form validator in create task [#579](https://github.com/h-da/geli/issues/579)

### Added
- Unit visibility toggle [#582](https://github.com/h-da/geli/issues/582)
- Fixed Mongoose pre hook usage [#680](https://github.com/h-da/geli/issues/680) [#677](https://github.com/h-da/geli/issues/677)

### Security
- Fixed numerous severe user related security issues. [#691](https://github.com/h-da/geli/issues/691) [#709](https://github.com/h-da/geli/pull/709)
- Fixed multiple severe course related security issues. [#594](https://github.com/h-da/geli/issues/594) [#653](https://github.com/h-da/geli/issues/653) [#691](https://github.com/h-da/geli/issues/691)
- Updated the dependencies for security. [#661](https://github.com/h-da/geli/issues/661)

## [0.6.0] - 2018-03-31 - Introduces MediaManager and some minor changes
## [[0.6.0](https://github.com/h-da/geli/releases/tag/v0.6.0)] - 2018-03-31 - Introduces MediaManager and some minor changes
### Added
- MediaManager for file management in courses


## [0.5.0] - 2018-03-24 - WS 17/18 intermediate Release
## [[0.5.0](https://github.com/h-da/geli/releases/tag/v0.5.0)] - 2018-03-24 - WS 17/18 intermediate Release
### Added
- selective download of the course
- progress dashboard for teacher
Expand All @@ -70,7 +102,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- adds imprint


## [0.4.0] - 2017-12-04 - WS 17/18 Second feature release
## [[0.4.0](https://github.com/h-da/geli/releases/tag/v0.4.0)] - 2017-12-04 - WS 17/18 Second feature release
### Added
- Responsivness improved
- leave course function
Expand All @@ -84,31 +116,31 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- randomize tasks after validation


## [0.3.1] - 2017-11-05 - Dynamic db name update
## [[0.3.1](https://github.com/h-da/geli/releases/tag/v0.3.1)] - 2017-11-05 - Dynamic db name update
### Added
- The possibility to use a other database name then 'test'


## [0.3.0] - 2017-11-02
## [[0.3.0](https://github.com/h-da/geli/releases/tag/v0.3.0)] - 2017-11-02
### Added
- a lot of major bugfixes and optimizations


## [0.2.2] - 2017-10-19 - Security improvements
## [[0.2.2](https://github.com/h-da/geli/releases/tag/v0.2.2)] - 2017-10-19 - Security improvements
### Added
- security for free courses


## [0.2.1] - 2017-10-03 - First Live-Ready release
## [[0.2.1](https://github.com/h-da/geli/releases/tag/v0.2.1)] - 2017-10-03 - First Live-Ready release
### Added
- first live functionality


## [0.2.0] - 2017-06-29 - Almost production ready
## [[0.2.0](https://github.com/h-da/geli/releases/tag/v0.2.0)] - 2017-06-29 - Almost production ready
### Added
- Many new feature for production


## [0.1.0] - 2017-05-11 - Basics implemented
## [[0.1.0](https://github.com/h-da/geli/releases/tag/v0.1.0)] - 2017-05-11 - Basics implemented
### Added
- Many basic implementations of ground functionality
42 changes: 21 additions & 21 deletions api/package-lock.json

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

8 changes: 4 additions & 4 deletions api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "geli-api",
"version": "0.6.0",
"version": "0.7.0",
"license": "GPL-3.0",
"repository": "h-da/geli",
"description": "This is the API-Package.json for geli.",
Expand Down Expand Up @@ -43,7 +43,7 @@
"jsonwebtoken": "^8.2.1",
"migrate-mongoose": "^3.2.2",
"moment": "^2.22.1",
"mongoose": "^5.0.15",
"mongoose": "^5.0.17",
"morgan": "^1.9.0",
"multer": "^1.3.0",
"node-file-cache": "^1.0.2",
Expand All @@ -70,7 +70,7 @@
"@types/fs-extra": "^5.0.2",
"@types/jsonwebtoken": "^7.2.7",
"@types/mocha": "^5.2.0",
"@types/mongoose": "^5.0.10",
"@types/mongoose": "^5.0.12",
"@types/morgan": "1.7.35",
"@types/nodemailer": "^4.6.0",
"@types/passport": "^0.4.5",
Expand All @@ -81,7 +81,7 @@
"@types/winston": "^2.3.9",
"chai": "4.1.2",
"chai-http": "^4.0.0",
"coveralls": "^3.0.0",
"coveralls": "^3.0.1",
"gulp": "3.9.1",
"gulp-apidoc": "^0.2.7",
"gulp-istanbul": "1.1.3",
Expand Down
8 changes: 4 additions & 4 deletions api/src/controllers/CourseController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export class CourseController {
* @apiError NotFoundError Includes implicit authorization check. (In getCourse helper method.)
* @apiError ForbiddenError (Redundant) Authorization check.
*/
@Get('/:id')
@Get('/:id([a-fA-F0-9]{24})')
async getCourseView(@Param('id') id: string, @CurrentUser() currentUser: IUser): Promise<ICourseView> {
const course = await this.getCourse(id, currentUser);

Expand Down Expand Up @@ -482,7 +482,7 @@ export class CourseController {
* @apiParam {Object} data Data (with access key).
* @apiParam {IUser} currentUser Currently logged in user.
*
* @apiSuccess {{}} result Empty object.
* @apiSuccess {Object} result Empty object.
*
* @apiSuccessExample {json} Success-Response:
* {}
Expand Down Expand Up @@ -533,7 +533,7 @@ export class CourseController {
* @apiParam {Object} data Body.
* @apiParam {IUser} currentUser Currently logged in user.
*
* @apiSuccess {{}} result Empty object.
* @apiSuccess {Object} result Empty object.
*
* @apiSuccessExample {json} Success-Response:
* {}
Expand Down Expand Up @@ -653,7 +653,7 @@ export class CourseController {
* @apiParam {String} id Course ID.
* @apiParam {IUser} currentUser Currently logged in user.
*
* @apiSuccess {{}} result Empty object.
* @apiSuccess {Object} result Empty object.
*
* @apiSuccessExample {json} Success-Response:
* {}
Expand Down
14 changes: 6 additions & 8 deletions api/src/controllers/UnitController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,21 @@ export class UnitController {
*/
@Authorized(['teacher', 'admin'])
@Post('/')
addUnit(@Body() data: any, @CurrentUser() currentUser: IUser) {
async addUnit(@Body() data: any, @CurrentUser() currentUser: IUser) {
// discard invalid requests
this.checkPostParam(data);
// Set current user as creator, old unit's dont have a creator
data.model.unitCreator = currentUser._id;

return Unit.create(data.model)
.then((createdUnit) => {
return this.pushToLecture(data.lectureId, createdUnit);
})
.catch((err) => {
try {
const createdUnit = await Unit.create(data.model);
return await this.pushToLecture(data.lectureId, createdUnit);
} catch (err) {
if (err.name === 'ValidationError') {
throw err;
} else {
throw new BadRequestError(err);
}
});
}
}

/**
Expand Down
Loading

0 comments on commit 31eef06

Please sign in to comment.