Skip to content

Commit

Permalink
Test Tree Generator (#102)
Browse files Browse the repository at this point in the history
* Update docs and logging

* wip

* Accept 0/1 values for bool

* Work on tree_generator

* Repair make_ficture for fmea

* Migrate fixture geneerators for store and departments

* Add fmea_XL

* Cleanup json files

* Fix sorting of columns with undefined entries

* Add blind text

* Use random generator from nutree
  • Loading branch information
mar10 committed Sep 12, 2024
1 parent a4f929f commit a0a11e2
Show file tree
Hide file tree
Showing 40 changed files with 7,152 additions and 24,559 deletions.
19 changes: 8 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
__pycache__
.DS_Store
.pyftpsync-meta.json
.venv/
*.log
/.settings
/archive
/build
/test/triage
/node_modules
/site/
*.log
sauce_connect.*
.pyftpsync-meta.json
.DS_Store
/test/fixtures
/test/triage
docs/tutorial/FT_*.md
__pycache__
test/generator/fixture.json
test/generator/fixture*.json
test/issue_*.*
docs/assets/ajax_1M_3_6.json
playwright-report/
test-results/
.venv/
test/issue_*.*
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
12 changes: 10 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,19 @@
"version": "0.2.0",
"configurations": [
{
"type": "pwa-chrome",
"name": "Python Debugger: Current File with Arguments",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"args": ["${command:pickArgs}"]
},
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
}
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
"**/dist": true,
"**/docs/api": true
},
"explorer.excludeGitIgnore": false
"explorer.excludeGitIgnore": false,
"editor.formatOnSave": true,
"black-formatter.importStrategy": "fromEnvironment"
}
Binary file added .yarn/install-state.gz
Binary file not shown.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ First release.
> This section will be removed after the beta phase. <br>
> Note that semantic versioning rules are not strictly followed during this phase.
- v0.11.1: Accept `0`/`1` for known boolean node property values (allowing for
more compact JSON sources).
- v0.11.1: Fix passing `checkbox: 'radio'`.
- v0.11.1: Fix sorting boolean and undefined column values.
- v0.11.1: Improve random data generation in demos.

- v0.11.0: BREAKING
Renamed `tree.options.resizableColumns` to `columnsResizable`.
- v0.11.0: Add support for icon buttons in column headers (menu, sort, filter).
Expand Down
6 changes: 3 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ verify_ssl = true
name = "pypi"

[packages]
fabulist = "*"
nutree = "*"
# fabulist = "*"
"nutree[all]" = ">=0.9"
mkdocs = "*"
mkdocs-material = "*"

[dev-packages]
black = "*"
black = "24.8"

[requires]
python_version = "3.12"
Expand Down
507 changes: 280 additions & 227 deletions Pipfile.lock

Large diffs are not rendered by default.

228 changes: 0 additions & 228 deletions docs/assets/ajax-tree-editable.json

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions docs/assets/json/tree_department_M_t_c.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/demo/demo-editable.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ new mar10.Wunderbaum({

// The JSON only contains a list of nested node dicts, but no types or
// column definitions:
// source: "../assets/fixture_department_1k_3_6_p.json",
// source: "../assets/json/fixture_department_1k_3_6_p.json",
source:
// "../assets/fixture_department_1k_3_6_flat_comp.json",
// "../assets/json/fixture_department_1k_3_6_flat_comp.json",
// "https://cdn.jsdelivr.net/gh/mar10/assets@master/wunderbaum/fixture_department_1k_3_6_flat_comp.json",
"https://cdn.jsdelivr.net/gh/mar10/assets@master/wunderbaum/fixture_department_1k_3_6_p.json",
types: {
Expand Down
16 changes: 13 additions & 3 deletions docs/demo/demo-fixedcol.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ new mar10.Wunderbaum({
// source: "../assets/ajax_1k_3_54.json",
// Columns- and types-definition are part of the Ajax response:
source:
"https://cdn.jsdelivr.net/gh/mar10/assets@master/wunderbaum/ajax_1k_3_54_t_c.json",
// "https://cdn.jsdelivr.net/gh/mar10/assets@master/wunderbaum/ajax_1k_3_54_t_c.json",
"../../test/fixtures/tree_department_M_t_c.json",
debugLevel: 5,
// header: false,
connectTopBreadcrumb: document.getElementById("parentPath"),
Expand Down Expand Up @@ -62,14 +63,23 @@ new mar10.Wunderbaum({
},
lazyLoad: function (e) {
console.log(e.type, e);
// return { url: "../assets/ajax-lazy-products.json" };
// return { url: "../assets/json/ajax-lazy-products.json" };
return new Promise((resolve, reject) => {
setTimeout(() => {
// reject("Epic fail")
resolve({ url: "../assets/ajax-lazy-products.json" });
resolve({ url: "../assets/json/ajax-lazy-products.json" });
}, 1500);
});
},
buttonClick: function (e) {
console.log(e.type, e);
if (e.command === "sort") {
e.tree.sortByProperty({ colId: e.info.colId, updateColInfo: true });
} else if (e.command === "menu") {
// eslint-disable-next-line no-alert
alert("Menu clicked");
}
},
change: function (e) {
const info = e.info;
const colId = info.colId;
Expand Down
9 changes: 4 additions & 5 deletions docs/demo/demo-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ document.getElementById("demo-info").innerHTML = `
new mar10.Wunderbaum({
id: "demo",
element: document.getElementById("demo-tree"),
// source: "../assets/ajax-tree-editable.json",
source: "../assets/ajax-tree-products.json",
source: "../assets/json/ajax-tree-products.json",
debugLevel: 5,
connectTopBreadcrumb: document.getElementById("parentPath"),
checkbox: true,
Expand Down Expand Up @@ -126,12 +125,12 @@ new mar10.Wunderbaum({
},
lazyLoad: function (e) {
console.log(e.type, e);
// return { url: "../assets/ajax-lazy-products.json" };
// return { url: "../assets/json/ajax-lazy-products.json" };
return new Promise((resolve, reject) => {
setTimeout(() => {
// reject("Epic fail")
// resolve({ url: "../assets/ajax-lazy-products.json", params: {foo: 42} , options:{method: "PUT"}});
resolve({ url: "../assets/ajax-lazy-products.json" });
// resolve({ url: "../assets/json/ajax-lazy-products.json", params: {foo: 42} , options:{method: "PUT"}});
resolve({ url: "../assets/json/ajax-lazy-products.json" });
}, 1500);
});
},
Expand Down
Loading

0 comments on commit a0a11e2

Please sign in to comment.