Skip to content

Conversation

seicke
Copy link
Member

@seicke seicke commented Jun 19, 2025

Description of Changes

This PR adds validation for property value input field.
Note: Unfortunately, I haven't found an adequate js library for checking a string regarding xs data types.

This PR fixes also a bug, where updated props of SMEs will not be shown in the SubmodelElementView after clicking the save button (router.push of an unchanged path does not cause a new fetching and dipatching of the selected SME, explicit fetch and dispatch needed).

This PR also fixes the components.d.ts regarding the deleted components of PR #612.

Related Issue

Closes #446

@seicke seicke marked this pull request as ready for review June 22, 2025 07:32
@seicke seicke requested a review from aaronzi June 22, 2025 07:32
Copy link
Member

@aaronzi aaronzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR. This is a very useful addition to the BaSyx UI. I added one remark to the PropertyForm component.

@aaronzi aaronzi requested a review from Copilot June 24, 2025 19:52
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds client-side validation for the Property value input field and replaces navigation-based SME refresh with an explicit fetch-and-dispatch approach across all SubmodelElement forms to ensure updated elements are displayed.

  • Introduces validateAndCorrectInput in PropertyForm.vue with regex-based checks for all XSD data types.
  • Replaces router.push calls with fetchAndDispatchSme in all SubmodelElement form components.
  • Updates TextInput and BooleanInput components to support error messages and string-boolean handling.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/components/EditorComponents/SubmodelElements/RangeForm.vue Replaced router pushes with fetchAndDispatchSme.
src/components/EditorComponents/SubmodelElements/PropertyForm.vue Added input validation, error messaging, and SME refresh fix.
src/components/EditorComponents/SubmodelElements/MLPForm.vue Replaced router pushes with fetchAndDispatchSme.
src/components/EditorComponents/SubmodelElements/ListForm.vue Replaced router pushes with fetchAndDispatchSme.
src/components/EditorComponents/SubmodelElements/FileForm.vue Replaced router pushes with fetchAndDispatchSme.
src/components/EditorComponents/SubmodelElements/CollectionForm.vue Replaced router pushes with fetchAndDispatchSme.
src/components/EditorComponents/SubmodelElements/BlobForm.vue Replaced router pushes with fetchAndDispatchSme.
src/components/EditorComponents/InputTypes/TextInput.vue Added errorMessages prop and bound it to the field.
src/components/EditorComponents/InputTypes/BooleanInput.vue Expanded modelValue to `boolean
Comments suppressed due to low confidence (1)

aas-web-ui/src/components/EditorComponents/SubmodelElements/PropertyForm.vue:227

  • [nitpick] The new validation logic covers many data types but lacks automated tests; add unit tests for each branch (e.g., Integer, Decimal, DateTime) to ensure correctness.
    function validateAndCorrectInput(): boolean {

@seicke seicke requested a review from aaronzi June 26, 2025 11:31
@aaronzi aaronzi merged commit 220a057 into eclipse-basyx:main Aug 20, 2025
2 checks passed
@seicke seicke deleted the property-value-input-validation branch August 21, 2025 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Updating/Visualizing a property of type double
2 participants