more tests and some fixes

This commit is contained in:
Dennis Eichhorn 2024-04-24 03:20:47 +00:00
parent d2e2bf97df
commit 34298dd7c5
8 changed files with 18 additions and 53 deletions

View File

@ -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 }}

View File

@ -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]);
};
/**

View File

@ -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:
}

View File

@ -1,4 +1,4 @@
import { GeneralUI } from "../../../UI/GeneralUI.js";
import { GeneralUI } from '../../../UI/GeneralUI.js';
/**
* Get value from dom.

View File

@ -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) {

View File

@ -1,4 +1,3 @@
import { jsOMS } from '../../../Utils/oLib.js';
/**
* Prevent UI action.
*

View File

@ -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?

View File

@ -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 = '';
}