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

5430 other petitioners ui #5570

Merged
merged 10 commits into from
Jun 22, 2020
Merged

5430 other petitioners ui #5570

merged 10 commits into from
Jun 22, 2020

Conversation

sutt0n
Copy link

@sutt0n sutt0n commented Jun 22, 2020

image

image

expect(result.showOtherPetitioners).toEqual(false);
});

it('paginates if showingAdditionalPetitioners is false', () => {

Choose a reason for hiding this comment

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

How about if showingAdditionalPetitioners is false, but there aren't enough otherPetitioners to paginate?

Copy link
Author

Choose a reason for hiding this comment

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

There's no logic to check the length to paginate or not. It's a "show 4 or show all" kinda thing

>
<address aria-labelledby="secondary-label">
{otherPetitioner.name &&
OtherPetitionerDisplay(otherPetitioner, constants)}

Choose a reason for hiding this comment

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

I find this passing through of constants in props a bit strange. Could you just import them from state directly in the component where you need them?

Copy link
Author

Choose a reason for hiding this comment

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

This was copied and pasted after I consolidated the AddressDisplay components that was defined in two differently spots, but yeah, I'll do that. 😄

toggleShowAdditionalPetitionersSequence();
}}
>
<FontAwesomeIcon icon={['far', 'address-card']} size="sm" />

Choose a reason for hiding this comment

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

You can include this icon on the Button rather than directly importing the FontAwesomeIcon here.

@sutt0n sutt0n merged commit 816d56b into develop Jun 22, 2020
@sutt0n sutt0n deleted the 5430-other-petitioners-ui branch June 22, 2020 18:32
Comment on lines +11 to +14
const showingAdditionalPetitioners =
get(state.showingAdditionalPetitioners) || false;

store.set(state.showingAdditionalPetitioners, !showingAdditionalPetitioners);

Choose a reason for hiding this comment

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

I think there's a store.toggle method for just this purpose -- assuming the tests pass, means fewer lines of code, better coverage by tiny percentages. :D

Comment on lines +24 to +25
<p>
<span className="address-line">{contact.address1}</span>

Choose a reason for hiding this comment

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

nit: For both this and the OtherPetitionerDisplay, this could be a good opportunity to create a common component for AddressDisplay. Perhaps then this component could be named ContactDisplay? Devex, if you like.

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.

4 participants