Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: JacaScript Rewrite #2

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a2eb670
setup karma and rollup
lenadax Aug 16, 2021
cdd0961
es6 structure
lenadax Jan 20, 2022
e1cb3c5
rollup output to resources
lenadax Jan 20, 2022
4bf27dd
move karma and rollup conf
lenadax Jan 21, 2022
22c3d4e
housekeeping
lenadax Mar 15, 2022
b8db253
add test and coverage shell scripts
lenadax Mar 17, 2022
8f59afb
update autoWatch config
lenadax Mar 17, 2022
0f6556c
use root vars with fallback
lenadax Apr 19, 2022
3caa9dc
change fallback color to bs5 blue
lenadax May 4, 2022
4fa75f3
housekeeping
lenadax May 5, 2022
e280f98
test setup
lenadax May 5, 2022
fe827c9
add github tests
lenadax May 6, 2022
a0dea79
add js action
lenadax May 10, 2022
915377a
Merge pull request #3 from conestack/js_action
rnixx May 11, 2022
66333f3
ensure correct location of node_modules
lenadax May 12, 2022
aebb050
"Restore bdajax compat"
rnixx May 20, 2022
1920a8e
"Simplify IIFE bundle outro"
rnixx May 20, 2022
6400417
"Karma coverage validation script formatting"
rnixx May 20, 2022
c1be88a
"Consistent naming when attaching yafowil widget instance to DOM elem"
rnixx May 20, 2022
24ec0cc
"Register resources with webresource"
rnixx May 21, 2022
77f5a37
Update bundle
rnixx May 23, 2022
959ea2d
"Update webresource registration"
rnixx May 25, 2022
7d58797
"Add path to webresource groups"
rnixx May 25, 2022
72db961
"Adopt webresource registrations"
rnixx May 28, 2022
eb8692a
"Install webresource from repo for tests"
rnixx May 29, 2022
14679ed
"Add resource tests"
rnixx May 30, 2022
6f906ce
"dedicated widget import in tests"
rnixx May 30, 2022
c7125bf
Resource group name is widget name.
rnixx May 30, 2022
8929ed9
added hook for yawofil.widget.array
toalba Dec 15, 2022
c26fe2d
tests coverage
lenadax Dec 19, 2022
7d5493a
improve array subscribers
lenadax Dec 22, 2022
9f9f207
add missing newline
lenadax Dec 22, 2022
6a80464
Use yafowil_array.inside_template API to check whether widget gets in…
lenadax Mar 9, 2023
255c98a
compiled js
lenadax Mar 9, 2023
42628ed
Merge pull request #4 from conestack/array_hook
rnixx Mar 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/test_js.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: JS Test multiselect

on:
push:
paths:
- '**.js'

jobs:
test:
name: TEST MULTISELECT

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install
run: |
npm --save-dev install \
qunit \
karma \
karma-qunit \
karma-coverage \
karma-chrome-launcher \
karma-module-resolver-preprocessor
npm --no-save install https://github.com/jquery/jquery#main

- name: Run tests
run: |
node_modules/karma/bin/karma start js/karma.conf.js

- name: Run coverage
run: |
npm run karma-test:coverage
52 changes: 52 additions & 0 deletions .github/workflows/test_py.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Test multiselect

on:
push:
paths:
- '**.py'

jobs:
test:
name: Test ${{ matrix.python }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest

python:
- "2.7"
- "3.7"
- "3.8"
- "3.9"
- "3.10"

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Install
run: |
pip install wheel
pip install coverage
pip install lxml
pip install zope.testrunner
pip install https://github.com/conestack/webresource/archive/master.zip
pip install https://github.com/conestack/yafowil/archive/master.zip
pip install -e .[test]
- name: Run tests
run: |
python --version
python -m yafowil.widget.multiselect.tests
- name: Run coverage
run: |
coverage run --source=src/yafowil/widget/multiselect --omit=src/yafowil/widget/multiselect/example.py -m yafowil.widget.multiselect.tests
coverage report --fail-under=99
24 changes: 9 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
*~
*#*
*.egg-info
*.pyc
*.pyo
*.mo
*.egg-info
/develop-eggs/
/parts/
/bin/
/eggs/
/downloads/
/var/
/.coverage
/dist/
/.installed.cfg
/.pydevproject
/.project
/.DS_Store
/.mr.developer.cfg
/htmlcov/
/js/karma/
/node_modules/
/package-lock.json
/py2/
/py3/
/pypy3/
9 changes: 7 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
Changes
=======

1.4 (unreleased)
2.0 (unreleased)
----------------

- No changes yet.
- Extend JS by ``multiselect_on_array_add`` and ``register_array_subscribers``
functions to enable usage in ``yafowil.widget.array``.
[lenadax]

- Rewrite JavaScript using ES6.
[lenadax]


1.3 (2018-07-16)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ License
=======

Copyright (c) 2012-2021, BlueDynamics Alliance, Austria, Germany, Switzerland
Copyright (c) 2021, Yafowil Contributors
Copyright (c) 2021-2022, Yafowil Contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ Contributors
- Robert Niederreiter

- Georg Bernhard

- Lena Daxenbichler
170 changes: 0 additions & 170 deletions bootstrap.py

This file was deleted.

32 changes: 0 additions & 32 deletions buildout.cfg

This file was deleted.

17 changes: 17 additions & 0 deletions js/karma-coverage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const percentage = {
lines: 100,
statements: 100,
functions: 100,
branches: 100
}
var summary = require('./karma/coverage/coverage-summary.json');

for (let res in summary.total) {
if (summary.total[res].pct < percentage[res]) {
throw new Error(
`Coverage too low on ${res},
expected: ${percentage[res]},
got: ${summary.total[res].pct}`
);
}
}
Loading