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

Thr 18 dev feature h5p editor #4525

Merged
merged 181 commits into from
Nov 8, 2023
Merged

Conversation

casparneumann-cap
Copy link
Contributor

@casparneumann-cap casparneumann-cap commented Nov 7, 2023

Description

New PR based on #4337

Links to Tickets or other pull requests

BC-5852

Changes

Datasecurity

Deployment

New Repos, NPM pakages or vendor scripts

Approval for review

  • DEV: If api was changed - generate-client:server was executed in vue frontend and changes were tested and put in a PR with the same branch name.
  • QA: In addition to review, the code has been manually tested (if manual testing is possible)
  • All points were discussed with the ticket creator, support-team or product owner. The code upholds all quality guidelines from the PR-template.

Notice: Please remove the WIP label if the PR is ready to review, otherwise nobody will review it.

ssmid and others added 30 commits June 7, 2023 11:35
* Created H5P microservice

* Add kubernetes files for h5p microservice

* Added @lumieducation/h5p-server package

* Don't use mock auth for testing

* Fix api tests to use new TestApiClient

* WIP: H5P editor: temp file storage

* WIP: H5P editor: added data classes

* resolve merge conflict leftovers

* h5p editor: temp file storage implementation completed

* h5p editor: temp file storage tests added

* h5p editor: temp file storage moved

* h5p editor: temp storage files moved

* Update temporary-file-storage.ts

Create temporary file folder

---------

Co-authored-by: Marvin Rode <[email protected]>
Co-authored-by: Marvin Rode (Cap) <[email protected]>
Co-authored-by: Andre Blome <[email protected]>
Co-authored-by: Stephan Krause <[email protected]>
* Created H5P microservice

* Add kubernetes files for h5p microservice

* Added @lumieducation/h5p-server package

* add ContentStorage with interface IContentStorage

* add addContent()

* implement addFile(), contentExists(), deleteContent()

* implement deleteFile(), fileExists()

* add getFileStats(), getFileStream()

* add getMetadata(), getParameters(), getUsage()

* add getUserPermissions(), listContent()

* add listFiles(), sanitizeFilename()

* refactor sanitizeFileneame

* add user check for getMetadata and getParameters

* fix existsOrCreateDir

* fix deleteContent and fileExists

* fix fileExists and contentExists, refactor methods

* add unit tests for contentStorage

* delete comments in addFile

* fix addFile test and change descriptions

* fix getUsage

* fix getUsage test

* delete TODO

* add error message to contentExists + tests

* add test for empty contentId at fileEsists

* remove unused private sanitize method

* adjust errorhandling + add tests for error cases

* add tests and fix error cases

* replace math.random

* change regex in checkfilename

* refactor tests and content storage implementation

* change any values to unknown

* fix create content id

* refactor and fix exist boolean in createContentId

* fix test can not createContentId

* create folder if content will be created

* Allow files in subdirectories

---------

Co-authored-by: Marvin Rode <[email protected]>
Co-authored-by: Marvin Rode (Cap) <[email protected]>
* Implemented library storage

* Tests for librray storage

* full test coverage

* Moved files

---------

Co-authored-by: Stephan Krause <[email protected]>
* Created H5P microservice

* Add kubernetes files for h5p microservice

* Added @lumieducation/h5p-server package

* Don't use mock auth for testing

* add ContentStorage with interface IContentStorage

* Fix api tests to use new TestApiClient

* WIP: H5P editor: temp file storage

* WIP: H5P editor: added data classes

* add addContent()

* implement addFile(), contentExists(), deleteContent()

* implement deleteFile(), fileExists()

* add getFileStats(), getFileStream()

* add getMetadata(), getParameters(), getUsage()

* add getUserPermissions(), listContent()

* add listFiles(), sanitizeFilename()

* refactor sanitizeFileneame

* Implemented library storage

* add user check for getMetadata and getParameters

* fix existsOrCreateDir

* h5p editor: added deployment which uses existing template

* fix deleteContent and fileExists

* Tests for librray storage

* resolve merge conflict leftovers

* fix fileExists and contentExists, refactor methods

* add unit tests for contentStorage

* delete comments in addFile

* fix addFile test and change descriptions

* fix getUsage

* fix getUsage test

* delete TODO

* full test coverage

* Moved files

* Implemented library storage

* Tests for librray storage

* full test coverage

* Moved files

* add error message to contentExists + tests

* add test for empty contentId at fileEsists

* remove unused private sanitize method

* adjust errorhandling + add tests for error cases

* add tests and fix error cases

* replace math.random

* change regex in checkfilename

* delete unused code

* change regex in checkfilename

* refactor tests and content storage implementation

* change any values to unknown

* fix create content id

* Fix issues from merging main into THR-2

* refactor and fix exist boolean in createContentId

* fix test can not createContentId

* Stubbed endpoints

* Editor and Player service

* Added H5P Usecase

* h5p editor: temp file storage implementation completed

* h5p editor: temp file storage tests added

* h5p editor: temp file storage moved

* h5p editor: temp storage files moved

* File streaming

* Post Ajax endpoint

* Merge branch 'THR-8-h5p-api-endpoints' of github.com:hpi-schul-cloud/schulcloud-server into THR-5-h5p-implementation-endpoints

* Remove @nestjs/serve-static dependency

* Editor working more reliably

* Disable saving of userstate

* Organized code

* More organization

* Tests for getAjax usecase

* add tests for h5p controller

* Tests and organization

* add import of FilesStorageAMQPModule to h5p-editor module

* Switched over to storage implementations

* Organized modules

* change stringPath of createNewEditor

* Testing for files in UC

* Testing content parameters in UC

* change AjaxPostBodyParams to undefined if empty

* change save api endpoint

* Fixed file streaming

* Fixed h5p uploading

* Update temporary-file-storage.ts

Create temporary file folder

* merge save and create endpoints to one get and post endpoint

* create folder if content will be created

* adjust paths at api tests

* rename usecase to getH5pEditor

* Use real user

* Allow files in subdirectories

* Testing for h5p files

* API tests for internal AJAX endpoint

* Test range requests for storages

* add unit-tests to usecases

* add api tests for h5p endpoints

* add api test save or create

* adjust create or save api test

---------

Co-authored-by: Marvin Rode <[email protected]>
Co-authored-by: Marvin Rode (Cap) <[email protected]>
Co-authored-by: Andre Blome <[email protected]>
* Add "List" and "Head" Methods to S3ClientAdapter

* H5P Content Storage now uses S3 Bucket and database

* Added database repo for H5P metadata
* Necessary changes to support H5P on the client
* Created H5P microservice

* Add kubernetes files for h5p microservice

* Added @lumieducation/h5p-server package

* Don't use mock auth for testing

* Fix api tests to use new TestApiClient

* WIP: H5P editor: temp file storage

* WIP: H5P editor: added data classes

* resolve merge conflict leftovers

* h5p editor: temp file storage implementation completed

* h5p editor: temp file storage tests added

* h5p editor: temp file storage moved

* h5p editor: temp storage files moved

* h5p editor: temp file storage changed to use s3

* h5p editor: s3 config and adapter injection handled

* h5p editor: temp file storage fixes

* h5p editor: temp file storage: repo method renamed to findByUserAndFilename()

* change to correct Buckets names

* change to correct Bucket name

* initial commit

* Merge remote-tracking branch 'origin/THR-18-dev-feature-h5p-editor' into THR-25-temp-storage-s3

* Update configs

* Update module and fix all tests

* Fix module config

* Fix Library Entity from THR-18

* Updated Tests

* Remove console output

* Remove config from development.json

* Remove unused config file

* Organized all files for H5P module

---------

Co-authored-by: Marvin Rode <[email protected]>
Co-authored-by: Marvin Rode (Cap) <[email protected]>
Co-authored-by: Andre Blome <[email protected]>
Co-authored-by: Majed Mak <[email protected]>
Co-authored-by: Majed Aitwni <[email protected]>
* adjust controller and uc for language params

* refactor h5p-editor service

* use userService in getUserLanguage()

* use env available languages

* Refactor merging

* resolve bugs in uc tests

* change h5p-editor dto

* delete await from editor + player declarations

---------

Co-authored-by: Marvin Rode <[email protected]>
Co-authored-by: Marvin Rode (Cap) <[email protected]>
Co-authored-by: Andre Blome <[email protected]>
Co-authored-by: Majed Aitwni <[email protected]>
* Library storage THR-34 hotfixes

* Fix small bugs in LibraryStorageService

* Update Tests

* resolved PR comments
Copy link

sonarqubecloud bot commented Nov 8, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@casparneumann-cap casparneumann-cap merged commit 301324f into main Nov 8, 2023
45 of 46 checks passed
@casparneumann-cap casparneumann-cap deleted the THR-18-dev-feature-h5p-editor branch November 8, 2023 08:37
@casparneumann-cap casparneumann-cap restored the THR-18-dev-feature-h5p-editor branch November 8, 2023 08:37
@melchma-Cap melchma-Cap deleted the THR-18-dev-feature-h5p-editor branch November 8, 2023 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants