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

Add dropdown by state to filter flags #433

Merged
merged 3 commits into from
Feb 26, 2021
Merged

Add dropdown by state to filter flags #433

merged 3 commits into from
Feb 26, 2021

Conversation

juanantoniocid
Copy link
Contributor

Description

In the home page we currently have a first row to add new flags and a second row to search for flags. We have modified the second row in order to show a dropdown list in which we can see the values [All the flags, Enabled flags, Disabled flags] being the value All the flags the one selected by default.

As the current API supports the boolean parameter enabled to filter flags by enabled and disabled, we only needed to change the GUI to add the filter.

Motivation and Context

The number of flags is growing and as this is a service shared by all of our customers, it is expected it will continue growing in the future. To do it easier to work with Flagr we want to provide a way of filtering flags by status (enabled / disabled).

How Has This Been Tested?

  1. I added four flags: Flag Y1, Flag Y2, Flag Z1 and Flag Z2.
  2. I enabled flags Flag Y1 and Flag Z1.
  3. I selected Enabled flags and only Flag Y1 and Flag Z1 were shown (as expected).
  4. I selected Disabled flags and only Flag Y2 and Flag Z2 were shown (as expected).
  5. I selected All the flags and the four flags were shown (as expected).
  6. I filtered by the term "Z" and only Flag Z1 and Flag Z2 were shown (as expected).
  7. I selected Enabled flags and only Flag Z1 was shown (as expected).
  8. I selected Disabled flags and only Flag Z2 was shown (as expected).
  9. I removed the term "Z"only Flag Z1 and Flag Z2 were shown (as expected).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@zhouzhuojie
Copy link
Collaborator

Thanks for the PR. What do you think if we just add a filter for the "Enabled" column in the flags table?

E.g.
https://element.eleme.cn/#/en-US/component/table#filter

For example from element's documentation:
image

I think we may just need to add the filter and something like "All", "Enabled", and "Disabled" for the filters.

      :filters=...
      :filter-method=...
      filter-placement=...

@juanantoniocid
Copy link
Contributor Author

Thanks for the PR. What do you think if we just add a filter for the "Enabled" column in the flags table?

For sure! I'll take a look and I'll be back with the suggested changes.

@juanantoniocid
Copy link
Contributor Author

juanantoniocid commented Feb 25, 2021

I have done the commit 44b6b7e to filter flags by state, using a filter for the "Enabled" column in the flags table as suggested above.

[Update]: Sorry for the inconveniences but in f3293c1 I used a better name for the function.

@codecov-io
Copy link

Codecov Report

Merging #433 (44b6b7e) into master (cff1f32) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #433   +/-   ##
=======================================
  Coverage   81.75%   81.75%           
=======================================
  Files          27       27           
  Lines        1611     1611           
=======================================
  Hits         1317     1317           
  Misses        214      214           
  Partials       80       80           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cff1f32...44b6b7e. Read the comment docs.

@zhouzhuojie
Copy link
Collaborator

lgtm

@zhouzhuojie zhouzhuojie merged commit dc12231 into openflagr:master Feb 26, 2021
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.

3 participants