From 49269de22f893e6b24af006f69ec180e23744df1 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 24 Apr 2024 03:20:46 +0000 Subject: [PATCH] more tests and some fixes --- .github/workflows/main.yml | 9 +++++++-- Controller.js | 10 +++++++--- Models/CollectionMapper.php | 2 +- Models/Upload.js | 10 +++++----- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e1e05f8..278096d 100755 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,10 +13,15 @@ on: - cron: '0 0 1,15 * *' jobs: - general_module_workflow: + general_module_workflow_php: uses: Karaka-Management/Karaka/.github/workflows/php_template.yml@develop secrets: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_PAT: ${{ secrets.GH_PAT }} CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - + general_module_workflow_js: + uses: Karaka-Management/Karaka/.github/workflows/js_template.yml@develop + secrets: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_PAT: ${{ secrets.GH_PAT }} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/Controller.js b/Controller.js index e95d202..563d60a 100755 --- a/Controller.js +++ b/Controller.js @@ -10,6 +10,7 @@ Autoloader.defineNamespace('omsApp.Modules'); * @todo Create immediate text preview similar to a rich text editor or Typora. * https://github.com/Karaka-Management/oms-Editor/issues/4 */ +/* global omsApp */ omsApp.Modules.Media = class { /** * @constructor @@ -23,11 +24,14 @@ omsApp.Modules.Media = class { bind (id) { - const e = typeof id === 'undefined' ? document.getElementsByTagName('form') : [document.getElementById(id)], - length = e.length; + const e = typeof id === 'undefined' + ? document.getElementsByTagName('form') + : [document.getElementById(id)]; + + const length = e.length; for (let i = 0; i < length; ++i) { - //this.bindElement(e[i]); + // this.bindElement(e[i]); } }; diff --git a/Models/CollectionMapper.php b/Models/CollectionMapper.php index 82aca0a..e55669c 100755 --- a/Models/CollectionMapper.php +++ b/Models/CollectionMapper.php @@ -64,7 +64,7 @@ final class CollectionMapper extends MediaMapper * * As a result media files are structured by virutal path in the app, by file path on the file system * and by Collections which can have sub-collections as well. Collections allow to reference files - * in a different virtual path and are therfore similar to "symlinks", except that they don't reference + * in a different virtual path and are therefore similar to "symlinks", except that they don't reference * a file but create a new virtual media model which groups other media models together in a new virtual * path if so desired without deleting or moving the orginal media files. * diff --git a/Models/Upload.js b/Models/Upload.js index efde851..8b790b3 100755 --- a/Models/Upload.js +++ b/Models/Upload.js @@ -1,5 +1,5 @@ import { Logger } from '../../../jsOMS/Log/Logger.js'; -import { Request } from '../../../jsOMS/Message/Request/Request.js'; +import { HttpRequest } from '../../../jsOMS/Message/Request/Request.js'; import { RequestMethod } from '../../../jsOMS/Message/Request/RequestMethod.js'; import { RequestType } from '../../../jsOMS/Message/Request/RequestType.js'; @@ -154,9 +154,9 @@ export class Upload { * @todo Karaka/oms-Media#5 * Validate file type and file size on the frontend before uploading */ - const request = new HttpRequest(), - formData = new FormData(), - self = this; + const request = new HttpRequest(); + const formData = new FormData(); + const self = this; this.files.forEach(function (element, index) { @@ -187,4 +187,4 @@ export class Upload { request.send(); }; -}; \ No newline at end of file +};