Skip to content

chore(filters): Prepare filtered search component for new tokens

Illya Klymov requested to merge xanf-update-value-to-value-data into master

Related issue: #590 (closed)

This MR prepares filtered search components for new components with operators part.

  • Before: { type: 'token type', value: 'something' }
  • After: { type: 'token type', value: { data: 'something' } }

In order to prepare for tokens with operators we refactor each token value to be an object with 'data' field (instead of plain string)

Additionally this MR adds two new elements:

  • support for unique tokens which could appear only one (pass unique to token config)
  • support for disabled tokens (disabled tokens could appear in search field but will never appear in autocomplete list) - for fine-grained control on which tokens are currently available to end user

Also there is a change in events: instead of create event, which emitted list of tokens to be created, new split event is introduced which emits plain strings - so components are not aware of term token

Edited by Illya Klymov

Merge request reports