Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    • Menu
    Projects Groups Snippets
  • Sign up now
  • Login
  • Sign in / Register
  • A adblockpluscore
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 86
    • Issues 86
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Jira
    • Jira
  • Merge requests 11
    • Merge requests 11
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • eyeo
  • adblockplus
  • abc
  • adblockpluscore
  • Issues
  • #305
Closed
Open
Created Mar 03, 2021 by Manvel Saroyan@saroyanm

Access invalid option from the `InvalidFilter` instance

Background

With UI#228 UI team would like to introduce also hints for invalid filter options, see example in screenshot:

Screen_Shot_2021-03-03_at_5.09.02_PM

In order to achieve that, would be great to make first matched invalid option be available from InvalidFilter object instance.

What to change

Make invalid filter option accessible from InvalidFilter instance, i.e.:

const filter = Filter.fromText("@@||example.com^$foo");
if (filter instanceof InvalidFilter && filter.reason === "filter_unknown_option")
{
  console.log(filter.option); // foo
}

Testing

Testing this is covered by the unit tests.

To test this manually, try to create a filter with an unknown option with Filter.fromText(), and it will return an invalid filter, and the option property will be set to that unknown option.

Edited Mar 10, 2021 by Hubert Figuière
Assignee
Assign to
Time tracking