From b890a5e8f94b9b1cfdb9dd9d9a5f2e1c3eb78123 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 23 Apr 2022 16:30:55 +0200 Subject: [PATCH] fixes --- .github/workflows/main.yml | 9 +-------- CONTRIBUTING.md | 2 +- Message/Request/Request.js | 4 ++-- Model/Action/Event/Prevent.js | 2 +- Model/Action/Message/Request.js | 2 +- UI/Component/AdvancedInput.js | 4 +--- UI/Component/AdvancedSelect.js | 4 +--- UI/Component/Form.js | 10 +++++----- UI/Component/Table.js | 2 +- 9 files changed, 14 insertions(+), 25 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 014b3e0..0aec9ab 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -44,11 +44,4 @@ jobs: env: VALIDATE_ALL_CODEBASE: false DEFAULT_BRANCH: develop - GITHUB_TOKEN: ${{ secrets.GH_PAT }} - custom: - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, 'NO_CI')" - steps: - - name: Js inspection - run: | - if [[ $(grep -rlni "onafterprint=\|onbeforeprint=\|onbeforeunload=\|onerror=\|onhaschange=\|onload=\|onmessage=\|onoffline=\|ononline=\|onpagehide=\|onpageshow=\|onpopstate=\|onredo=\|onresize=\|onstorage=\|onund=o\|onunload=\|onblur=\|onchage=\|oncontextmenu=\|onfocus=\|onformchange=\|onforminput=\|oninput=\|oninvalid=\|onreset=\|onselect=\|onsubmit=\|onkeydown=\|onkeypress=\|onkeyup=\|onclick=\|ondblclic=k\|ondrag=\|ondragend=\|ondragenter=\|ondragleave=\|ondragover=\|ondragstart=\|ondrop=\|onmousedown=\|onmousemove=\|onmouseout=\|onmouseover=\|onmouseup=\|onmousewheel=\|onscroll=\|onabor=t\|oncanplay=\|oncanplaythrough=\|ondurationchange=\|onemptied=\|onended=\|onerror=\|onloadeddata=\|onloadedmetadata=\|onloadstart=\|onpause=\|onplay=\|onplaying=\|onprogress=\|onratechange=\|onreadystatechange=\|onseeked=\|onseeking=\|onstalled=\|onsuspend=\|ontimeupdate=\|onvolumechange=" --include=*.js ./) -ne "" ]]; then exit 1; fi + GITHUB_TOKEN: ${{ secrets.GH_PAT }} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4bbb819..e237dc9 100755 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,7 +31,7 @@ In rare cases errors, failures or warnings during the automatic inspection are Automated checks which are run during the review process: ```sh -php ./vendor/bin/phpcs ./ --standard="Build/Config/phpcs.xml" +php ./vendor/bin/phpcs --severity=1 ./ --standard="Build/Config/phpcs.xml" npx eslint ./ -c ./Build/Config/.eslintrc.json ``` diff --git a/Message/Request/Request.js b/Message/Request/Request.js index 3b24ff7..980dd17 100755 --- a/Message/Request/Request.js +++ b/Message/Request/Request.js @@ -383,8 +383,8 @@ export class Request } } - console.log(UriFactory.build(this.uri)); - console.log(this.xhr); + window.omsApp.logger.log(UriFactory.build(this.uri)); + window.omsApp.logger.log(this.xhr); this.xhr.onreadystatechange = function () { diff --git a/Model/Action/Event/Prevent.js b/Model/Action/Event/Prevent.js index 81ac9fd..4d4068c 100755 --- a/Model/Action/Event/Prevent.js +++ b/Model/Action/Event/Prevent.js @@ -11,7 +11,7 @@ export function preventEvent (action, callback, id) { 'use strict'; - console.log('prevented'); + window.omsApp.logger.log('prevented'); jsOMS.preventAll(action.data); diff --git a/Model/Action/Message/Request.js b/Model/Action/Message/Request.js index 8d64e1a..aa1c1e2 100755 --- a/Model/Action/Message/Request.js +++ b/Model/Action/Message/Request.js @@ -16,7 +16,7 @@ export function requestAction (action, callback) const request = new Request(action.uri, action.method, action.request_type); request.setSuccess(function (xhr) { - console.log(xhr.responseText); + window.omsApp.logger.log(xhr.responseText); callback(JSON.parse(xhr.responseText)); }); diff --git a/UI/Component/AdvancedInput.js b/UI/Component/AdvancedInput.js index c1d25da..7277980 100755 --- a/UI/Component/AdvancedInput.js +++ b/UI/Component/AdvancedInput.js @@ -154,12 +154,10 @@ export class AdvancedInput */ remoteCallback (self, data) { - console.log(data); + window.omsApp.logger.log(data); data = JSON.parse(data.response)[0]; const dataLength = data.length; - console.table(data); - // if dropdown == true if (self.dropdownElement.getAttribute('data-active') === 'true') { while (self.dataListBody.firstChild) { diff --git a/UI/Component/AdvancedSelect.js b/UI/Component/AdvancedSelect.js index 2a0e61c..9bedf65 100755 --- a/UI/Component/AdvancedSelect.js +++ b/UI/Component/AdvancedSelect.js @@ -133,12 +133,10 @@ export class AdvancedSelect * @since 1.0.0 */ remoteCallback (self, data) { - console.log(data); + window.omsApp.logger.log(data); data = JSON.parse(data.response)[0]; const dataLength = data.length; - console.table(data); - // if dropdown == true if (self.dropdownElement.getAttribute('data-active') === 'true') { while (self.dataListBody.firstChild) { diff --git a/UI/Component/Form.js b/UI/Component/Form.js index c631811..ec755f1 100755 --- a/UI/Component/Form.js +++ b/UI/Component/Form.js @@ -140,7 +140,7 @@ export class Form * (e.g. table row (tr), div, ...) */ const elementContainer = remove.closest(document.getElementById(id).getAttribute('data-ui-element')); - console.log(document.getElementById(id).getAttribute('data-ui-element')); + window.omsApp.logger.log(document.getElementById(id).getAttribute('data-ui-element')); elementContainer.parentNode.removeChild(elementContainer); }; @@ -293,7 +293,7 @@ export class Form ); } - console.log(remoteUrls); + window.omsApp.logger.log(remoteUrls); UriFactory.setQuery('$id', response.get('response').id); @@ -610,7 +610,7 @@ export class Form ); } - console.log(remoteUrls); + window.omsApp.logger.log(remoteUrls); UriFactory.setQuery('$id', response.get('response').id); @@ -790,7 +790,7 @@ export class Form request.setMethod(form.getMethod()); request.setSuccess(function (xhr) { - console.log(xhr.response); + window.omsApp.logger.log(xhr.response); if (xhr.getResponseHeader('content-type') === 'application/octet-stream') { const blob = new Blob([xhr.response], { type: 'application/octet-stream' }); @@ -832,7 +832,7 @@ export class Form ); } } catch (e) { - console.log(e); + window.omsApp.logger.log(e); Logger.instance.error('Invalid form response. \n' + 'URL: ' + form.getAction() + '\n' diff --git a/UI/Component/Table.js b/UI/Component/Table.js index 0c8f37b..fdd7bdf 100755 --- a/UI/Component/Table.js +++ b/UI/Component/Table.js @@ -160,7 +160,7 @@ export class Table button.addEventListener('click', function (event) { - console.log(exports.serialize()); + window.omsApp.logger.log(exports.serialize()); /** * @todo Karaka/jsOMS#90 * Implement export