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

feat: expose updated event on mgt components #3357

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

ThomasPe
Copy link

@ThomasPe ThomasPe commented Jan 3, 2025

makes existing updated event of MgtBaseTaskComponent accessible on MgtPerson control

Closes #3352

PR Type

Feature

Description of the changes

updated will fire whenever the control is re-rendered, e.g. when switching from loading to displaying the downloaded data.

PR checklist

  • Project builds (yarn build) and changes have been tested in at least two supported browsers (Edge + non-Chromium based browser)
  • All public APIs (classes, methods, etc) have been documented following the jsdoc syntax
  • Stories have been added and existing stories have been tested
  • Added appropriate documentation. Docs PR:
  • License header has been added to all new source files (yarn setLicense)
  • Contains NO breaking changes

Other information

makes updated event of MgtBaseTaskComponent accessible on Person control
@ThomasPe ThomasPe requested a review from a team as a code owner January 3, 2025 22:26
@ThomasPe
Copy link
Author

ThomasPe commented Jan 3, 2025

@musale turns out there's already an updated event that's simply not exposed. Please check if that's a route that would be acceptable for you.

@ThomasPe
Copy link
Author

ThomasPe commented Jan 3, 2025

@microsoft-github-policy-service agree

@@ -75,6 +75,7 @@ export const registerMgtPersonComponent = () => {
* @class MgtPerson
* @extends {MgtTemplatedComponent}
*
* @fires {CustomEvent<null>} updated - Fired when the component is updated
Copy link
Contributor

Choose a reason for hiding this comment

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

Add this to the https://github.com/microsoftgraph/microsoft-graph-toolkit/blob/main/packages/mgt-element/src/components/baseTaskComponent.ts file then re-run yarn build. This will generate the props for all components that fire the event. Then add this comment on the components whose generated files have been updated for consistent documentation.

Suggested change
* @fires {CustomEvent<null>} updated - Fired when the component is updated
* @fires {CustomEvent<undefined>} updated - Fired when the component is updated

@musale
Copy link
Contributor

musale commented Jan 6, 2025

@musale turns out there's already an updated event that's simply not exposed. Please check if that's a route that would be acceptable for you.

Thank you for surfacing this. I have left some comments. This is a really good catch.

@ThomasPe
Copy link
Author

ThomasPe commented Jan 7, 2025

I updated the components as suggested. Do you want me to add the update events to all components in Storybook as well?

@musale
Copy link
Contributor

musale commented Jan 8, 2025

I updated the components as suggested. Do you want me to add the update events to all components in Storybook as well?

Yes, that would be very helpful.

@musale musale changed the title feat: expose updated event on MgtPerson feat: expose updated event on mgt components Jan 8, 2025
@ThomasPe
Copy link
Author

ThomasPe commented Jan 8, 2025

updated all the stories

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Rendered / Loaded event for Person control
2 participants