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

In Category filter, I dont want to operator suggestion in dropdown #1446

Closed
2 tasks done
vamshisai98 opened this issue Aug 30, 2024 · 6 comments
Closed
2 tasks done
Labels
triage We discuss this topic in our internal weekly wait for response Wait for author response

Comments

@vamshisai98
Copy link

Prerequisites

  • I have read the Contributing Guidelines.
  • I have not leaked any internal/restricted information like screenshots, videos, code snippets, links etc.

What happened?

In Category filter, I am using Equal Operator by default. But I see Not Equal Operator as suggestion in the drop down. Not able to disable it.

Equal_operator

What type of frontend framework are you seeing the problem on?

Angular

Which version of iX do you use?

v2.4.1

Code to produce this issue.

<ix-category-filter id="category-filter-search__ix-category-filter" [placeholder]="placeholder"
      [repeatCategories]="repeatCategories" [categories]="categories" [filterState]="filterState"
      (categoryChanged)="handleCategoryChange($event)" (filterChanged)="handleFilterChange($event)"
      (inputChanged)="handleInputChange($event)"></ix-category-filter>


  public filterState: {tokens:[],categories:[]} = {
    tokens: [],
    categories: [],
  };
  public categories: Categories = {
    ID_1: {
      label: 'Applications',
      options: [],
    },
    ID_2: {
      label: 'DeviceTypes',
      options: [],
    },
  };
@vamshisai98 vamshisai98 added the triage We discuss this topic in our internal weekly label Aug 30, 2024
@matthiashader
Copy link
Collaborator

matthiashader commented Sep 2, 2024

Hello @vamshisai98, thanks for reaching out. You can just overwrite the staticOperator property, like
<IxCategoryFilter placeholder="Filter by" repeatCategories={true} filterState={filter} categories={categories} staticOperator={LogicalFilterOperator.EQUAL} ></IxCategoryFilter>
This way the "!=" isn't displayed anymore.

@matthiashader matthiashader added the wait for response Wait for author response label Sep 2, 2024
@vamshisai98
Copy link
Author

vamshisai98 commented Sep 5, 2024

Hey thanks, Tried that but I dont think its solving my issue. For instance this is how it is showing after I updated to adding staticOperator={LogicalFilterOperator.EQUAL}

Uploading ix-category-filter-equal-operator.PNG…

@matthiashader
Copy link
Collaborator

Hello @vamshisai98. I got you now, currently there is no really nice solutio. I think one option that would pass the logic would be to set the statcOperator to "0", but I will create a ticket for this!

@matthiashader
Copy link
Collaborator

Hello @vamshisai98, this should be fixed with the latest version:
image

@vamshisai98
Copy link
Author

Hi @matthiashader ---> I have updated my ix version to - 2.5.0. I still the issue persist. Is there anything I need to change in the below code to resolve it?

<ix-category-filter
id="category-filter-search__ix-category-filter"
[placeholder]="placeholder"
[repeatCategories]="repeatCategories"
[categories]="categories"
[filterState]="filterState"
(categoryChanged)="handleCategoryChange($event)"
(filterChanged)="handleFilterChange($event)"
(inputChanged)="handleInputChange($event)"
label-categories="Select a category"
static-operator="LogicalFilterOperator.EQUAL"
>

I have tried       **static-operator="0"** as well

@nuke-ellington
Copy link
Collaborator

@vamshisai98 staticOperator="Equal" should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage We discuss this topic in our internal weekly wait for response Wait for author response
Projects
None yet
Development

No branches or pull requests

3 participants