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

adds components dropdown and contains not operator #1439

Merged
merged 5 commits into from
Oct 10, 2024

Conversation

tillyw
Copy link
Contributor

@tillyw tillyw commented Oct 3, 2024

Associated issues

fixes cityofaustin/atd-data-tech#19052

Testing

URL to test:

https://deploy-preview-1439--atd-moped-main.netlify.app/

Steps to test:

  • note the number of records in the project view with no filters applied
  • add an advanced filter for 'components' 'contains', select an option and note the number of records
  • replace the filter with the same query but using the 'does not contain' operator, and note whether the number of records makes up the difference. also check to make sure records with no value in the 'component' field appear.
  • repeat the steps with the 'is' and 'is not' operators for a different field (such as 'type')
  • confirm that fields with the 'is' and 'contains' operators also include their opposites

Ship list

  • Code reviewed
  • Product manager approved
  • Product manager checked DB view dependencies
  • Product manager added to QA test script if applicable
    • Added to the existing "contains" test to check the sum of "contains" and "does not contain" to make sure it equals the total number of projects

@tillyw tillyw added the WIP Work in progress label Oct 3, 2024
@tillyw tillyw removed the WIP Work in progress label Oct 8, 2024
Copy link
Member

@chiaberry chiaberry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test instructions say to repeat the steps with "is" and "is not" but I don't see them in the components drop down options
Screenshot 2024-10-09 at 2 14 17 PM
I dont see that requirement in the issue, so I dont know if its okay its not there or if its an oversight

@@ -63,6 +63,11 @@ const makeAdvancedSearchWhereFilters = (filters) =>
}
}
let whereString = `${field}: { ${gqlOperator}: ${value} }`;
// If we would like to return results that do not contain a particular string ('_nilike'), we should return null values as well
if (gqlOperator.includes("_nilike")) {
const whereStringWithNullValues = `_or: [ { ${whereString} }, { ${field}: { ${`_is_null`}: true } }]`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice touch 👌

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to that! I tested stacking filters to exclude overlapping matches, and this works so well! 🚀

Screenshot 2024-10-09 at 5 49 57 PM

It is great that this change covers both the "is not" and "does not contain" operators too!

Copy link
Contributor

@roseeichelmann roseeichelmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks and works great! i noticed what chia pointed out too but im approving on the assumption that you meant to write "is blank" and "is not blank" in the test instructions since adding is and is not isn't in the issue requirements

@tillyw
Copy link
Contributor Author

tillyw commented Oct 9, 2024

oops sorry @chiaberry, i meant to check one of the other fields that has 'is' and 'is not' options (such as 'type') since this pr also corrects an issue where records with null values were not being returned under the 'is not' condition. made a correction in the instructions - thanks for catching that!

Copy link
Member

@chiaberry chiaberry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification Tilly! I tested with Lead is not COA ATD and got all the results, whereas in staging you only get 179 results

🚢 🚢

Copy link
Collaborator

@mddilley mddilley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Such an improvement! I tested using every type of field search (date, string, string that is a concatenated list, and number) and all operators with and without dropdown options, and I see this working exactly as expected. 🚢 🚀 🙌

@@ -63,6 +63,11 @@ const makeAdvancedSearchWhereFilters = (filters) =>
}
}
let whereString = `${field}: { ${gqlOperator}: ${value} }`;
// If we would like to return results that do not contain a particular string ('_nilike'), we should return null values as well
if (gqlOperator.includes("_nilike")) {
const whereStringWithNullValues = `_or: [ { ${whereString} }, { ${field}: { ${`_is_null`}: true } }]`;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to that! I tested stacking filters to exclude overlapping matches, and this works so well! 🚀

Screenshot 2024-10-09 at 5 49 57 PM

It is great that this change covers both the "is not" and "does not contain" operators too!

@tillyw
Copy link
Contributor Author

tillyw commented Oct 10, 2024

thanks y'all! gonna go ahead and merge this one :)

@tillyw tillyw merged commit 7021c0b into main Oct 10, 2024
4 checks passed
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.

Update components advanced search with dropdown options and add contains not operator
4 participants