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

Coachmark: Migrate Coachmark and associated components to function components #13626

Merged
merged 73 commits into from Aug 5, 2020

Conversation

MLoughry
Copy link
Contributor

@MLoughry MLoughry commented Jun 16, 2020

Pull request checklist

Description of changes

This change migrates Coachmark and its associated components Beak and PositioningContainer to function components in the react-next package.

Focus areas to test

(optional)

Copy link
Collaborator

@leddie24 leddie24 left a comment

Choose a reason for hiding this comment

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

I don't see any issues with this PR. To be transparent, I'm not the original codeowner of the previous implementation; John Miller built most of the core functionality, and I took over after he left. As per @ecraig12345 's suggestion, I'm more than happy to jump on a call if we want to discuss anything in detail, but this LGTM.

@MLoughry
Copy link
Contributor Author

MLoughry commented Aug 4, 2020

@ecraig12345 @xugao Could either of you approve the Screener additions?

@ecraig12345
Copy link
Member

It looks like someone rejected the "Coachmark: Expanded: Default" for current Coachmark because it's not actually showing the expanded coachmark. And in the CoachmarkNext expanded state, I'm not seeing the beak.

image

@ecraig12345
Copy link
Member

Actually never mind, I don't see a beak on the example on the website either, so maybe the CoachmarkNext one is okay. But I still think the Coachmark current expanded is wrong.
image

@MLoughry
Copy link
Contributor Author

MLoughry commented Aug 4, 2020

@ecraig12345 I replied to @xugao about that very issue:

Yes, there's a logic bug in the original OUFR control when you provide isCollapsed={false} to start with. I fixed the bug when I migrated the control.

@ecraig12345
Copy link
Member

Oh sorry, I missed that. Maybe we should remove the screener state for now so we're not checking in an incorrect state?

@ecraig12345
Copy link
Member

I accepted the CoachmarkNext expanded state.


// @TODO rename to reflect the name of this class
private _contentHost = React.createRef<HTMLDivElement>();
function useTargets({ target }: IPositioningContainerProps, positionedHost: React.RefObject<HTMLDivElement | null>) {
Copy link
Member

Choose a reason for hiding this comment

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

This is optional, but since PositioningContainer is a fork of Callout, would it be possible to reuse any of the hooks from Callout here? Seems like a pretty easy way to actually start taking advantage of the potential hooks provide for sharing logic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ecraig12345 I'll do this in a PR fixing ContextualMenu's UNSAFE methods. Since this change has a package.json change that causes conflicts after every publish, I'd like to merge this today.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good.

@MLoughry MLoughry merged commit 3ac6336 into microsoft:master Aug 5, 2020
@msft-github-bot
Copy link
Contributor

🎉office-ui-fabric-react@v7.126.0 has been released which incorporates this pull request.:tada:

Handy links:

tmaster628 pushed a commit to tmaster628/fluentui that referenced this pull request Aug 12, 2020
…mponents (microsoft#13626)

* Copy Coachmark code to react-next to stage migration

* Change files

* Migrate Beak to function component

* Add stub function component for PositioningContainer

* Hoist default props and contentHost ref

* Hoist several refs

* Fix lint issues

* Hoist event logic

* Update API

* Cleanup

* Hoist heightOffset logic

* Finish migration (with issues)

* Revert to LKG, fixing example import

* Hoist positionedHost ref

* Hoist target refs

* Hoist positions state

* Hoist setInitialFocus

* Hoist maxHeight

* Hoist auto-dismiss events

* Hoist heightOffset

* Complete PositioningContainer migration

* Remove extraneous shouldComponentUpdate

* Hoist generic function

* Create stub function component

* Hoist entityInnerHostElementRef

* Hoist isCollapsed state

* Hoist positioned data

* Hoist beak positioning logic

* Hoist dismiss public method

* Hoist document event logic

* Hoist proximity handlers

* Hoist aria text logic

* Cleanup unused state

* Hoist autofocus logic

* Hoist last of state

* Finish migration

* Forward ref

* Update API

* Change files

* Add Screener test

* Fix lint error

* Fix cropping of Coachmark story

* Fix case where Coahmark starts expanded

* Fix API file

* Pull from react-next

* Fix bad merge

* Duplicate Coachamrk Screener test for OUFR

* Remove headers

* Handle removed props

* Deprecate Beak componentRef

* Update packages/react-next/src/components/Coachmark/Coachmark.base.tsx

Co-authored-by: Elizabeth Craig <ecraig12345@gmail.com>

* Fix eslint deprecation errors

* Change files

* Update API

* Fix build error

* Fix build issues

* Remove rejected screener story

Co-authored-by: Elizabeth Craig <ecraig12345@gmail.com>
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.

Coachmark: strict mode compliance (UNSAFE_)
6 participants