Skip to content

Slider - mergestyle conversion#5379

Merged
kenotron merged 8 commits intomicrosoft:masterfrom
kenotron:slider
Jun 29, 2018
Merged

Slider - mergestyle conversion#5379
kenotron merged 8 commits intomicrosoft:masterfrom
kenotron:slider

Conversation

@kenotron
Copy link
Copy Markdown
Contributor

@kenotron kenotron commented Jun 28, 2018

Pull request checklist

  • Addresses an existing issue: Fixes #0000
  • Include a change request file using $ npm run change

Description of changes

This converts slider to use mergestyles

Focus areas to test

(optional)

Microsoft Reviewers: Open in CodeFlow

@kenotron kenotron requested a review from JasonGore June 28, 2018 22:22
}

const getClassNames = classNamesFunction<ISliderStyleProps, ISliderStyles>();
@customizable('Label', ['theme', 'styles'])
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.

I thought we were no longer using this decorator? Styled is doing the same thing...

rootIsDisabled: disabled,
rootIsEnabled: !disabled,
rootIsVertical: vertical,
rootIsHorizontal: !vertical,
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.

I know it was in original code, but isn't it enough to just have one of each of these variables in the styles props interface? Seems redundant...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

um very much agreed. I'm gonna clean this up

props.rootIsVertical && {
marginRight: 8
},
className,
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.

Provided className should be listed last to make sure it gets priority in styling... also, is there a test for a provided className?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

className=
ms-Slider
ms-Slider-enabled
ms-Slider-row
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.

Two undefineds in original seem to imply custom classNames.. I'd recommend modifying the test to supply them so they show up in the output

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually these undefined's were actually extraneos because they are actually toggles of each other (disabled vs enabled, etc).

{
"packageName": "office-ui-fabric-react",
"comment": "Convert Slider to merge-styles",
"type": "patch"
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.

I think this should be minor since interfaces changed

rootIsVertical?: boolean;
showTransitions?: boolean;
showValue?: boolean;
}
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.

I know this was already here but we've been doing something like this to more tightly bind it to the component's props interface:

export type ITeachingBubbleStyleProps =
  Required<Pick<ITeachingBubbleProps, 'theme'>> &
  Pick<ITeachingBubbleProps, 'hasCondensedHeadline' | 'hasSmallHeadline' | 'isWide'> & {
    /** Class name for callout. */
    'calloutClassName'?: string
  };

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

width: 30,
lineHeight: '1' // using a string here meaning it's relative to the size of the font
},
props.vertical
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.

Just a nit, but why not destructure all of these?

@kenotron kenotron merged commit c7f0b5d into microsoft:master Jun 29, 2018
@kenotron kenotron deleted the slider branch June 29, 2018 16:57
Markionium added a commit to Markionium/office-ui-fabric-react that referenced this pull request Jul 1, 2018
* master: (151 commits)
  Css updates for card components (microsoft#5393)
  DatePicker MergeStyles step 2 - Converts scss to js styles (microsoft#5362)
  Update stale with 60 day comment and updated ignored label names. (microsoft#5388)
  replaced await for ie compat syntax - but still needs promise (microsoft#5387)
  Slider - mergestyle conversion (microsoft#5379)
  Applying package updates.
  Enabling publishing for charting and gridlayout. (microsoft#5378)
  TilesList: fadeOut overlay. (microsoft#5381)
  Pivot: JS Styling (microsoft#5324)
  ShimmeredDetailsList: wrapper for DetailsList with Shimmer. (microsoft#5374)
  dashboard-grid-layout improved example (microsoft#5373)
  Applying package updates.
  Addressing Issue microsoft#5165 - Using Customizer with Nav Component (microsoft#5361)
  Applying package updates.
  Address issue microsoft#5353 (microsoft#5359)
  Change log to trigger release (microsoft#5358)
  Fluent updates (microsoft#5357)
  TextField render value undefined as empty string (microsoft#5349)
  Applying package updates.
  DetailsColumn: css class changes to show gripper when hover on draggable columns (microsoft#5309)
  ...
@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants