Skip to content
Snippets Groups Projects

F query form

Merged
Timm Fitschenrequested to merge
f-query-form into dev
All threads resolved!

Summary

  • Added QueryForm component as per caosdb/customers/leibniz-zmt/management#191
  • Added linting (npm run lint)
  • Added testing (npm test -- --coverage)
  • Styling has been done with npx prettier -w src/
  • New implementation of Await component (needed by the map, I only moved it here)

See caosdb-webui!96 (merged) and https://gitlab.indiscale.com/caosdb/src/caosdb-webui-legacy-adapter/-/tree/main

Focus

  • Many changes due to auto-formatting with npx prettier -w src/. Can be ignored.
  • Important changes in QueryForm.jsx and QueryForm.helpers.js

Known Issues:

  • reference filter are not fully supported yet (you can trick the current implementation by using datatype "text" for a reference property).
  • back-references are not supported
  • datetime has a simple text field. maybe that should be smarter in the future
  • form validation does not work (so you could put anything into the filter inputs)

Test Environment

  • Mock up: npm run mock go to either http://localhost:[port]/ or http://localhost:[port]/page.html to see a mock up.
    1. Pack with npm pack.
    2. Then install this packge into the legacy adapter.
    3. Then npm run build to build the legacy adapter.
    4. Create a conf/ext/json/query-form-tabs.json, see example below which works for the demo profile
    5. Set build property BUILD_MODULE_LEGACY_QUERY_FORM=DISABLED.
    6. Copy the query-form.bundle.js into your webinterface (src/ext/js/) (and make it if necessary)

Example Tabs config. No config means not tabs.

[
  {
    "id": "manufacturer",
    "recordType": "Manufacturer",
    "label": "Manufacturer",
    "description": "Show matching manufacturers",
    "filterDefinitions": [
      {
        "property": "longitude",
        "min": -180.0,
        "max": 180.0,
        "unit": "°",
        "datatype": "double"
      }, {
        "property": "latitude",
        "min": -90.0,
        "max": 90.0,
        "unit": "°",
        "datatype": "double"
      }
    ]
  }, {
    "id": "musicalinstrument",
    "recordType": "MusicalInstrument",
    "label": "Musical Instrument",
    "description": "Show only matching musical instruments",
    "filterDefinitions": [
      {
        "property": "price",
        "datatype": "double",
        "step": 0.01,
        "unit": "€",
        "min": 0.0
      }, {
        "property": "manufacturer",
        "datatype": "text"
      }, {
        "property": "electric",
        "datatype": "boolean"
      }
    ]
  }
]

Check List for the Author

Please, prepare your MR for a review. Be sure to write a summary and a focus and create gitlab comments for the reviewer. They should guide the reviewer through the changes, explain your changes and also point out open questions. For further good practices have a look at our review guidelines

  • Reference related issues
  • Up-to-date CHANGELOG.md (or not necessary)
  • Annotations in code (Gitlab comments)
    • Intent of new code
    • Problems with old code
    • Why this implementation?

Check List for the Reviewer

  • I understand the intent of this MR
  • Up-to-date CHANGELOG.md (or not necessary)
  • The test environment setup works and the intended behavior is reproducible in the test environment
  • In-code documentation and comments are up-to-date.
  • Check: Are there specifications? Are they satisfied?

For further good practices have a look at our review guidelines.

Edited by Florian Spreckelsen

Merge request reports

Pipeline #35090 passed

Pipeline passed for 5b5faadb on f-query-form

Approved by

Merged by Florian SpreckelsenFlorian Spreckelsen Mar 31, 2023 (Mar 31, 2023 10:20am UTC)

Merge details

  • Changes merged into dev with 4cc7aa9e.
  • Deleted the source branch.

Pipeline #35193 passed

Pipeline passed for 4cc7aa9e on dev

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Timm Fitschen added 1 commit

    added 1 commit

    • a5af2bf4 - MAINT: moved code from QueryForm to QueryForm.helpers

    Compare with previous version

  • Timm Fitschen added 1 commit

    added 1 commit

    • 5b5faadb - DOC: update docs in QueryForm.helpers

    Compare with previous version

  • Timm Fitschen marked the checklist item Annotations in code (Gitlab comments) as completed

    marked the checklist item Annotations in code (Gitlab comments) as completed

  • Timm Fitschen
  • Timm Fitschen changed the description

    changed the description

  • Timm Fitschen requested review from @florian

    requested review from @florian

  • mentioned in merge request caosdb-webui!96 (merged)

  • Timm Fitschen marked the checklist item Reference related issues as completed

    marked the checklist item Reference related issues as completed

  • Timm Fitschen changed the description

    changed the description

  • Florian Spreckelsen resolved all threads

    resolved all threads

  • Florian Spreckelsen marked the checklist item I understand the intent of this MR as completed

    marked the checklist item I understand the intent of this MR as completed

  • Florian Spreckelsen marked the checklist item Up-to-date CHANGELOG.md (or not necessary) as completed

    marked the checklist item Up-to-date CHANGELOG.md (or not necessary) as completed

  • Florian Spreckelsen marked the checklist item The test environment setup works and the intended behavior is reproducible in the test as completed

    marked the checklist item The test environment setup works and the intended behavior is reproducible in the test as completed

  • Florian Spreckelsen marked the checklist item In-code documentation and comments are up-to-date. as completed

    marked the checklist item In-code documentation and comments are up-to-date. as completed

  • Florian Spreckelsen marked the checklist item Check: Are there specifications? Are they satisfied? as completed

    marked the checklist item Check: Are there specifications? Are they satisfied? as completed

  • Florian Spreckelsen approved this merge request

    approved this merge request

  • mentioned in commit 4cc7aa9e

  • mentioned in issue #2 (closed)

  • Please register or sign in to reply
    Loading