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

Fix custom schema validation #639

Merged
merged 9 commits into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
2 changes: 2 additions & 0 deletions nwb-guide.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ hiddenimports = [ 'email_validator', *collect_submodules('scipy.special.cython_s
datas += collect_data_files('jsonschema_specifications')
tmp_ret = collect_all('dandi')
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
tmp_ret = collect_all('pydantic')
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
tmp_ret = collect_all('keyrings')
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
tmp_ret = collect_all('unittest')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"build:mac": "npm run build && npm run build:flask && npm run build:electron:mac",
"build:linux": "npm run build && npm run build:flask && npm run build:electron:linux",
"build:flask": "python -m PyInstaller nwb-guide.spec --log-level DEBUG --clean --noconfirm --distpath ./build/flask",
"build:flask:spec:base": "pyi-makespec --name nwb-guide --onedir --collect-data jsonschema_specifications --collect-all dandi --collect-all keyrings --collect-all unittest --collect-all nwbinspector --collect-all neuroconv --collect-all pynwb --collect-all hdmf --collect-all hdmf_zarr --collect-all ndx_dandi_icephys --collect-all sklearn --collect-all ci_info ./pyflask/app.py",
"build:flask:spec:base": "pyi-makespec --name nwb-guide --onedir --collect-data jsonschema_specifications --collect-all dandi --collect-all pydantic --collect-all keyrings --collect-all unittest --collect-all nwbinspector --collect-all neuroconv --collect-all pynwb --collect-all hdmf --collect-all hdmf_zarr --collect-all ndx_dandi_icephys --collect-all sklearn --collect-all ci_info ./pyflask/app.py",
"build:flask:spec": "npm run build:flask:spec:base && python prepare_pyinstaller_spec.py",
"build:electron:win": "electron-builder build --win --publish never",
"build:electron:mac": "electron-builder build --mac --publish never",
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/stories/JSONSchemaForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,10 @@ export class JSONSchemaForm extends LitElement {

const isRow = typeof rowName === "number";

const resolvedValue = e.path.reduce((acc, token) => acc[token], resolved);
const resolvedValue = e.instance; // Get offending value
const schema = e.schema; // Get offending schema

// ------------ Exclude Certain Errors ------------

// Allow for constructing types from object types
if (e.message.includes("is not of a type(s)") && "properties" in schema && schema.type === "string")
return;
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/src/stories/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,8 @@ export class Search extends LitElement {
}}

@blur=${(blurEvent) => {
if (blurEvent.relatedTarget.classList.contains("option")) return;
const relatedTarget = blurEvent.relatedTarget;
if (relatedTarget && relatedTarget.classList.contains("option")) return;
this.submit();
}}

Expand Down
Loading