MD.OFFICE
FAL

2026-03-27

  • Implemented Autocomplete Widget Renderer:
    • Created a new standalone AutocompleteFieldComponent to handle streaming search and dynamic suggestions.
    • Decided against BaseSelectFieldComponent inheritance to avoid pre-fetching logic and maintain a cleaner, RxJS-driven architecture.
    • Built a robust RxJS pipeline using Subject, debounceTime, and switchMap to handle API search requests with automatic cancellation of in-flight requests.
    • Implemented AutocompleteFieldConfig with support for both endpoint URLs and cURL-based data fetching.
    • Added custom validation logic for uniqueness, ensuring selected values are checked against the suggestion set.
    • Ensured error state preservation so that required and other validators are not cleared when custom duplicate errors are applied.
  • Unit Testing for Autocomplete:
    • Created autocomplete-field.component.jest.spec.ts with 100% coverage for the search pipeline, selection logic, and error handling.
    • Updated field-registry.jest.spec.ts to include parity checks for the new widget.
  • Dynaforms Schema Updates:
    • Registered the autocomplete type in FieldRegistryService.
    • Updated FormElementConfig and FieldType unions in form-element-config.types.ts.