pnp / sp-starter-kit

Modern SharePoint Starter Kit - End-to-end showcase solution to get started with modern experiences.
MIT License
759 stars 534 forks source link

💡 Enhancement: update web parts that use Microsoft Graph to use Microsoft Graph Toolkit #452

Open waldekmastykarz opened 3 years ago

waldekmastykarz commented 3 years ago

Category

Describe the solution you'd like

It would be awesome to replace the manual calls to Microsoft Graph that some of the web parts are doing with Microsoft Graph Toolkit React components. We can look at using specific MGT components or the generic Get component where no exact component is available yet. MGT would allow us to simplify the code and lower the maintenance effort of it. It would also be a nice showcase of how easy it is to connect to Microsoft 365 using Graph and the available tools.

If you're okay with this, ideally, we'd break up this issue into component-specific issues so that we can track them independently and others can help too. I'd be happy to help with the implementation! ❤️

ghost commented 3 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

eoverfield commented 3 years ago

@waldekmastykarz I very much support this approach. @AJIXuMuK updated the Personal tasks webpart in V2 to use the graph toolkit, I would like to see this updated to use the latest Graph toolkit, and then we normalize all of the other webparts that also rely on Graph to use a similar approach.

I see the following webparts that could use assistance to a version 2.1 of each webpart.

react-personal-calendar react-personal-contacts react-personal-email react-personal-tasks react-recent-contacts react-recently-used-documents react-recently-visited-sites

I'd suggest you pick off one of these, update using the preferred method, and let's get a PR in so the community can help test. Once validated, everyone is welcome to claim a webpart and update. Let's use this thread for now if anyone want's to volunteer.

waldekmastykarz commented 3 years ago

Let me start with picking up react-personal-tasks and then I will take another one. Would you like to track all the work here or shall we create a separate issue for each web part?

waldekmastykarz commented 3 years ago

If I look at solution/src/webparts/personalTasks and source/react-personal-tasks they seem to be different. Is that on purpose or should they be the same and this is something that simply slipped through?

panjkov commented 3 years ago

@waldekmastykarz /solution/src/webparts is v1. Current version (V2) is under source/react-personal-tasks

waldekmastykarz commented 3 years ago

Cool, so I reckon v1 stays as-is and whatever changes we do, land on v2, right?

eoverfield commented 3 years ago

Please ignore V1 solution found in the solution folder. We need to deprecate that soon from the master branch and then remove it at some point.

Starting with the personal tasks sounds great to me! Thank you for the guidance.

waldekmastykarz commented 3 years ago

Personal tasks is upgraded. Let me take react-personal-calendar

waldekmastykarz commented 3 years ago

I've just noticed that the mgt-agenda component, that we'd use in the react-personal-calendar web part, doesn't support timezones add the moment. We'll be working to add support for it in the mgt-agenda component shortly, but for now we'd either put this web part on hold or settle on not using timezones for the time being. Any preference @bcameron1231, @eoverfield?

eoverfield commented 3 years ago

I am inclined to update the webpart now, documenting the current limitation in the webpart's readme. My reasoning is that this is still a very good technology demonstrator and we want to promote the latest components released by the Graph team.

waldekmastykarz commented 3 years ago

I'll try to submit a PR to MGT to add this functionality.

PR submitted at https://github.com/microsoftgraph/microsoft-graph-docs/pull/10530. Let's see how quickly it'll get processed and if we can perhaps use a preview version of the toolkit with this functionality.

rabwill commented 3 years ago

I am happy to pick up something as well to transform it to MGT react.

waldekmastykarz commented 3 years ago

I've updated @eoverfield original comment listing the web parts ticking of those I've picked up already. I'd suggest you can pick up anything else from the list, right @eoverfield?

eoverfield commented 3 years ago

Yes, please @rabwill post here as a comment what you want to take so that others know. Then when you are ready submit a PR and we will look to merge as quickly as possible. Thanks.

waldekmastykarz commented 3 years ago

@eoverfield the PR with adding support for preferred timezones to MGT has been merged and a new release is available. With that, we shouldn't be missing any functionality after the migration.

eoverfield commented 3 years ago

Long overdue update. Upgraded personal calendar and personals tasks to use mgt 2.2.1 which solved many other underlying issues.

DonKirkham commented 2 years ago

Since I have been working with the react-personal-contacts webpart, I will upgrade it to use MGT too.

DonKirkham commented 2 years ago

Actually, I have been working with react-people-directory, so I will upgrade that one first to MGT, then look at react-personal-contacts.