mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-01-11 17:58:41 +00:00
more tests and some fixes
This commit is contained in:
parent
d2e2bf97df
commit
34298dd7c5
48
.github/workflows/main.yml
vendored
48
.github/workflows/main.yml
vendored
|
|
@ -3,45 +3,9 @@ name: CI
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
codestyle-tests:
|
general_module_workflow_js:
|
||||||
runs-on: ubuntu-latest
|
uses: Karaka-Management/Karaka/.github/workflows/js_template.yml@develop
|
||||||
if: "!contains(github.event.head_commit.message, 'NO_CI')"
|
secrets:
|
||||||
steps:
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Checkout Repository
|
GH_PAT: ${{ secrets.GH_PAT }}
|
||||||
uses: actions/checkout@main
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
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 }}
|
|
||||||
|
|
@ -17,7 +17,7 @@ export class Response
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
constructor (data)
|
constructor (data = {})
|
||||||
{
|
{
|
||||||
/** @type {Object} responses */
|
/** @type {Object} responses */
|
||||||
this.responses = data;
|
this.responses = data;
|
||||||
|
|
@ -34,7 +34,9 @@ export class Response
|
||||||
*/
|
*/
|
||||||
get (id = null)
|
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]);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ export function domChangeAttribute (action, callback, id)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (action.subtype) {
|
switch (action.subtype) {
|
||||||
case 'remove':
|
case 'remove': {
|
||||||
const old = fill[i].getAttribute(action.attr);
|
const old = fill[i].getAttribute(action.attr);
|
||||||
|
|
||||||
if (old !== null && old.match(new RegExp('(\\s|^)' + action.value + '(\\s|$)')) !== null) {
|
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());
|
fill[i].setAttribute(action.attr, old.replace(reg, '').trim());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case 'add':
|
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;
|
break;
|
||||||
case 'set':
|
case 'set':
|
||||||
fill[i].setAttribute(action.attr, action.value)
|
fill[i].setAttribute(action.attr, action.value);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { GeneralUI } from "../../../UI/GeneralUI.js";
|
import { GeneralUI } from '../../../UI/GeneralUI.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get value from dom.
|
* Get value from dom.
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
import { jsOMS } from '../../../Utils/oLib.js';
|
|
||||||
/**
|
/**
|
||||||
* Prevent UI action.
|
* Prevent UI action.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
import { jsOMS } from '../../../Utils/oLib.js';
|
|
||||||
/**
|
/**
|
||||||
* Prevent UI action.
|
* Prevent UI action.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user