Skip to content

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

Open
annabellewright wants to merge 7 commits into
masterfrom
BWAP-806
Open

BWAP-806 updating paginator component to hand textField properties#1242
annabellewright wants to merge 7 commits into
masterfrom
BWAP-806

Conversation

@annabellewright

@annabellewright annabellewright commented Jul 14, 2021

Copy link
Copy Markdown

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

Comment thread src/components/Paginator/Paginator.tsx Outdated
event: React.FocusEvent | React.FormEvent;
}
): void => {
console.log(pageNum);

Copy link
Copy Markdown
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

@trippygif Bryan Yoelin (trippygif) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great work!

onSubmit={this.handleTextFieldChange}
isDisabled={isDisabled}
isDisabled={isDisabled || textFieldProps.isDisabled}
{...textFieldProps}

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread src/components/Paginator/Paginator.tsx Outdated
} from '../SingleSelect/SingleSelect';
import TextField, { ITextFieldProps } from '../TextField/TextField';
import TextField, {
ITextFieldProps,

Copy link
Copy Markdown
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
Copy Markdown
Author

Choose a reason for hiding this comment

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

Removed with ITextFieldPropsWithPassThroughs

Comment thread src/components/Paginator/Paginator.tsx Outdated
type ShowTotalObjects = (count: number) => string;

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Comment thread src/components/Paginator/Paginator.tsx Outdated
onBlur={this.handleTextFieldChange}
onSubmit={this.handleTextFieldChange}
isDisabled={isDisabled}
isDisabled={isDisabled || textFieldProps.isDisabled}

Copy link
Copy Markdown
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

codesandbox-ci Bot commented Aug 19, 2021

Copy link
Copy Markdown

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.

@tsantef Tim Santeford (tsantef) left a comment

Copy link
Copy Markdown
Member

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.


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

interface IExtendedTextFieldProps extends Omit<ITextFieldProps, 'value'> {

@tsantef Tim Santeford (tsantef) Sep 13, 2021

Copy link
Copy Markdown
Member

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?

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