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

BWAP-806 updating paginator component to hand textField properties #1242

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

annabellewright
Copy link

@annabellewright annabellewright commented Jul 14, 2021

PR Checklist

Storybook can be viewed here:

  • Manually tested across supported browsers

    • [ x] Chrome
    • Firefox
    • Safari
  • [ x] Unit tests written (common at minimum)

  • [ x] PR has one of the semver- labels

  • Two core team engineer approvals

  • One core team UX approval

@@ -242,6 +246,7 @@ class Paginator extends React.Component<IPaginatorProps, IPaginatorState> {
event: React.FocusEvent | React.FormEvent;
}
): void => {
console.log(pageNum);
Copy link
Contributor

Choose a reason for hiding this comment

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

might want to remove the log statement here unless it's intentional

Copy link
Contributor

@trippygif trippygif left a comment

Choose a reason for hiding this comment

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

Great work!

onBlur={this.handleTextFieldChange}
onSubmit={this.handleTextFieldChange}
isDisabled={isDisabled}
isDisabled={isDisabled || textFieldProps.isDisabled}
{...textFieldProps}
Copy link
Contributor

Choose a reason for hiding this comment

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

this change of order would result in textFieldProps.isDisabled taking precedence over isDisabled.
if not intentional change, would leave the spread operator on the line above

Copy link
Author

Choose a reason for hiding this comment

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

Good callout. Updated and added a test case as an example for this.

@@ -11,7 +11,10 @@ import {
SingleSelectDumb as SingleSelect,
ISingleSelectState,
} from '../SingleSelect/SingleSelect';
import TextField, { ITextFieldProps } from '../TextField/TextField';
import TextField, {
ITextFieldProps,
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: are both ITextFieldProps/ITextFieldPropsWithPassThroughs still used? else can be removed from the imports

Copy link
Author

Choose a reason for hiding this comment

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

Removed with ITextFieldPropsWithPassThroughs

@@ -35,6 +38,10 @@ type IPaginatorSingleSelectProps = Partial<ISingleSelectProps>;

type ShowTotalObjects = (count: number) => string;

interface IExtendedTextFieldProps extends Omit<ITextFieldProps, 'value'> {
value?: string | number;
Copy link
Contributor

Choose a reason for hiding this comment

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

is this being done just to allow number as a type on value?

Copy link
Author

Choose a reason for hiding this comment

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

Updated to only allow string as an optional value

}}
TextField={{
value: 3,
isDisabled: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

unless covered by another storybook example - also include an example if isDisabled: false (assume it is covered as the default value)

Copy link
Author

Choose a reason for hiding this comment

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

Covered by new storybook example

onBlur={this.handleTextFieldChange}
onSubmit={this.handleTextFieldChange}
isDisabled={isDisabled}
isDisabled={isDisabled || textFieldProps.isDisabled}
Copy link
Contributor

Choose a reason for hiding this comment

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

can this be covered in a test case?

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 19, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@yasskin yasskin requested a review from lennoxdavidjr August 20, 2021 00:18
Copy link
Member

@tsantef tsantef left a comment

Choose a reason for hiding this comment

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

What specific problem in the UI is this change trying to solve, what's the use case? I'm just curious because this component has been around for a long time without this modification.

@@ -27,6 +27,10 @@ type IPaginatorSingleSelectProps = Partial<ISingleSelectProps>;

type ShowTotalObjects = (count: number) => string;

interface IExtendedTextFieldProps extends Omit<ITextFieldProps, 'value'> {
Copy link
Member

@tsantef tsantef Sep 13, 2021

Choose a reason for hiding this comment

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

Why do you need to redefine the value field?

@tsantef tsantef self-requested a review September 13, 2021 16:36
@yasskin yasskin requested a review from n8thegr8 January 27, 2022 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Paginator text field properties are overwritten
6 participants