diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 569d914..a575251 100755 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,45 +3,9 @@ name: CI on: [push, pull_request] jobs: - codestyle-tests: - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, 'NO_CI')" - steps: - - name: Checkout Repository - uses: actions/checkout@main - with: - fetch-depth: 1 - - name: Checkout Build Repository - uses: actions/checkout@main - with: - fetch-depth: 1 - ref: develop - repository: Karaka-Management/Build - path: Build - - name: Install NPM - uses: actions/setup-node@v3 - with: - node-version: '14' - cache: 'npm' - - run: npm install - - name: eslint - run: npx eslint ./ -c Build/Config/.eslintrc.json -# linting: -# runs-on: ubuntu-latest -# if: "!contains(github.event.head_commit.message, 'NO_CI')" -# strategy: -# fail-fast: false -# max-parallel: 3 -# steps: -# - name: Checkout Repository -# uses: actions/checkout@main -# with: -# fetch-depth: 0 -# submodules: recursive -# token: ${{ secrets.GH_TOKEN }} -# - name: Lint Code Base -# uses: github/super-linter/slim@v4 -# env: -# VALIDATE_ALL_CODEBASE: false -# DEFAULT_BRANCH: develop -# GITHUB_TOKEN: ${{ secrets.GH_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/Message/Response/Response.js b/Message/Response/Response.js index 9cd28f1..f758d8e 100755 --- a/Message/Response/Response.js +++ b/Message/Response/Response.js @@ -17,7 +17,7 @@ export class Response * * @since 1.0.0 */ - constructor (data) + constructor (data = {}) { /** @type {Object} responses */ this.responses = data; @@ -34,7 +34,9 @@ export class Response */ get (id = null) { - return id === null ? this.responses : (typeof this.responses[id] === 'undefined' ? null : this.responses[id]); + return id === null + ? this.responses + : (typeof this.responses[id] === 'undefined' ? null : this.responses[id]); }; /** diff --git a/Model/Action/Dom/ChangeAttribute.js b/Model/Action/Dom/ChangeAttribute.js index a2e605b..d912b38 100644 --- a/Model/Action/Dom/ChangeAttribute.js +++ b/Model/Action/Dom/ChangeAttribute.js @@ -26,7 +26,7 @@ export function domChangeAttribute (action, callback, id) } switch (action.subtype) { - case 'remove': + case 'remove': { const old = fill[i].getAttribute(action.attr); if (old !== null && old.match(new RegExp('(\\s|^)' + action.value + '(\\s|$)')) !== null) { @@ -35,11 +35,12 @@ export function domChangeAttribute (action, callback, id) fill[i].setAttribute(action.attr, old.replace(reg, '').trim()); } break; + } case 'add': - fill[i].setAttribute(action.attr, jsOMS.trim(fill[i].getAttribute(action.attr) + ' ' + action.value)) + fill[i].setAttribute(action.attr, jsOMS.trim(fill[i].getAttribute(action.attr) + ' ' + action.value)); break; case 'set': - fill[i].setAttribute(action.attr, action.value) + fill[i].setAttribute(action.attr, action.value); break; default: } diff --git a/Model/Action/Dom/GetValue.js b/Model/Action/Dom/GetValue.js index 714cd61..dd823ea 100755 --- a/Model/Action/Dom/GetValue.js +++ b/Model/Action/Dom/GetValue.js @@ -1,4 +1,4 @@ -import { GeneralUI } from "../../../UI/GeneralUI.js"; +import { GeneralUI } from '../../../UI/GeneralUI.js'; /** * Get value from dom. diff --git a/Model/Action/Event/If.js b/Model/Action/Event/If.js index 9387739..1eda2c2 100644 --- a/Model/Action/Event/If.js +++ b/Model/Action/Event/If.js @@ -1,4 +1,3 @@ -import { jsOMS } from '../../../Utils/oLib.js'; /** * Prevent UI action. * @@ -22,7 +21,7 @@ export function ifAction (action, callback, id) } else if (conditions[i].comp === '!=' && data !== conditions[i].value) { action.key = conditions[i].jump - 1; break; - } else if(conditions[i].comp === '>' && data > conditions[i].value) { + } else if (conditions[i].comp === '>' && data > conditions[i].value) { action.key = conditions[i].jump - 1; break; } else if (conditions[i].comp === '<' && data < conditions[i].value) { diff --git a/Model/Action/Event/Jump.js b/Model/Action/Event/Jump.js index 60aaf82..92d829b 100644 --- a/Model/Action/Event/Jump.js +++ b/Model/Action/Event/Jump.js @@ -1,4 +1,3 @@ -import { jsOMS } from '../../../Utils/oLib.js'; /** * Prevent UI action. * diff --git a/UI/Component/Form.js b/UI/Component/Form.js index 9ef43b8..e225a7c 100755 --- a/UI/Component/Form.js +++ b/UI/Component/Form.js @@ -1015,7 +1015,7 @@ export class Form this.formActionAdd(self, event, id, elementIndex); } else if ((elementIndex = Array.from(self.forms[id].getSave()).indexOf(event.target)) !== -1) { this.formActionSave(self, event, id, elementIndex); - //self.submit(self.forms[id], self.forms[id].getSubmit()[elementIndex]); + // self.submit(self.forms[id], self.forms[id].getSubmit()[elementIndex]); } else if ((elementIndex = Array.from(self.forms[id].getCancel()).indexOf(event.target)) !== -1) { jsOMS.preventAll(event); // @todo currently only handling update cancel, what about add cancel? diff --git a/Views/FormView.js b/Views/FormView.js index 216e80d..21428ad 100755 --- a/Views/FormView.js +++ b/Views/FormView.js @@ -594,7 +594,7 @@ export class FormView if (elements[i].tagName.toLowerCase() === 'canvas') { elements[i].clearRect(0, 0, elements[i].width, elements[i].height); - } else if(elements[i].tagName.toLowerCase() === 'textarea') { + } else if (elements[i].tagName.toLowerCase() === 'textarea') { elements[i].innerHTML = ''; }