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

New Props for Facet Term's Icon Style and Persist Active Terms #90

Merged
merged 10 commits into from
Dec 1, 2021

Conversation

utku-ozturk
Copy link
Member

@utku-ozturk utku-ozturk commented Nov 23, 2021

Pls handle this PR with its FF pair.

New props added to extend FacetList and Term components' styling:

  • useRadioButton: Show either checkbox (False) or radio icon (True) for term component - it is only for styling, not intended to implement single selection (radio) or multiple selection (checkbox)
  • persistSelectedTerms: if True selected/omitted terms are escalated to top, otherwise each term is rendered in regular order. Moreover, inline search options are not displayed if it is False.

PS: 0.1.28b2 released for testing

Screen Shot 2021-11-23 at 22 16 16

const selected = (status !== 'none');
const count = (term && term.doc_count) || 0;
const isRadio = termIconStyle === 'radio';
Copy link
Collaborator

@alexkb0009 alexkb0009 Nov 24, 2021

Choose a reason for hiding this comment

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

(Low priority / not too important, especially if realistically planning on adding more termIconStyle options in near future..).

Try to avoid passing down string props if can, in favor of boolean, if what we ultimately need is boolean (better performance in memoized components). Could probably simplify this and just have either props.useRadioIcon (w defaultProps.useRadioIcon=false).

Copy link
Member Author

Choose a reason for hiding this comment

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

@alexkb0009 Yes, definitely makes sense. Replaced termIconStyle w/ useRadioButton.

@alexkb0009
Copy link
Collaborator

alexkb0009 commented Nov 24, 2021

Looks good, want to check on hotseat but then good to merge I think. I'll test this on CGAP shortly done (just made sure runs/compiles, didn't test the new feature).
Would also glance @ PR #88 if have time, it affects couple of same files as touched here.

@alexkb0009
Copy link
Collaborator

Also should update babel version to the latest on fourfront and local machines (or at least to versions used on CGAP), then I think we would have less differences in /es/ compiled files.

@utku-ozturk
Copy link
Member Author

Also should update babel version to the latest on fourfront and local machines (or at least to versions used on CGAP), then I think we would have less differences in /es/ compiled files.

Great! It reduced es files having diff from 48 to 29.

@utku-ozturk utku-ozturk merged commit 55fbc75 into master Dec 1, 2021
@utku-ozturk utku-ozturk deleted the spc_micrometa_updates branch December 1, 2021 08:48
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