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

B2B-2150 fix types and simplify getFilterMoreList within ShippingLists #249

Merged
merged 14 commits into from
Feb 24, 2025

Conversation

leeBigCommerce
Copy link
Contributor

@leeBigCommerce leeBigCommerce commented Feb 11, 2025

Jira: B2B-2150

N.B. - this might be easy enough to read as one change, rather than 1 commit at a time

What/Why?

  • getFilterMoreList created a list of filters that was transformed within the view
  • this PR moves all transformations into the getFilterMoreList (now the return function of a hook)
  • this simplifies the view and takes a step towards more typesafety to help find our IO boundary
  • Further work needed within B3Filter to workout if or not getFilterMoreList's interface can be further simplified

Rollout/Rollback

  • Revert this PR

Testing

  • Manual Testing

@leeBigCommerce leeBigCommerce marked this pull request as ready for review February 11, 2025 23:00
@leeBigCommerce leeBigCommerce requested review from icatalina and a team as code owners February 11, 2025 23:00
@@ -54,6 +54,7 @@ function ShoppingLists() {
const [deleteOpen, setDeleteOpen] = useState<boolean>(false);
const [deleteItem, setDeleteItem] = useState<null | ShoppingListsItemsProps>(null);
const [filterMoreInfo, setFilterMoreInfo] = useState<Array<any>>([]);
const getFilterMoreList = useGetFilterMoreList();
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 do we want to push this to useData as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right now it's full of building blocks for visual concerns, rather than data we'd expect from I/O:

{
        name: 'createdBy',
        required: false,
        default: '',
        fieldType: 'dropdown',
        options: newCreatedByUsers,
        replaceOptions: { label: 'createdBy', value: 'createdBy' },
        xs: 12,
        variant: 'filled',
        size: 'small',
        label: b3Lang('global.shoppingLists.filter.createdBy'),
      }

my hope is that we can instead move these values out and closer to JSX that requires them, eventually making this hook redundant 🤞

Copy link
Contributor

Choose a reason for hiding this comment

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

fair point

@leeBigCommerce leeBigCommerce merged commit 5d91986 into main Feb 24, 2025
6 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.

2 participants