sp-starter-kit icon indicating copy to clipboard operation
sp-starter-kit copied to clipboard

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

Open waldekmastykarz opened this issue 4 years ago • 18 comments

Category

  • [x] Feature request

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! ❤️

waldekmastykarz avatar Oct 26 '20 13:10 waldekmastykarz

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

ghost avatar Oct 26 '20 13:10 ghost

@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.

eoverfield avatar Oct 26 '20 17:10 eoverfield

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 avatar Oct 28 '20 12:10 waldekmastykarz

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?

waldekmastykarz avatar Oct 28 '20 12:10 waldekmastykarz

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

panjkov avatar Oct 28 '20 13:10 panjkov

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

waldekmastykarz avatar Oct 28 '20 14:10 waldekmastykarz

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.

eoverfield avatar Oct 28 '20 16:10 eoverfield

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

waldekmastykarz avatar Nov 02 '20 13:11 waldekmastykarz

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?

waldekmastykarz avatar Nov 03 '20 16:11 waldekmastykarz

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.

eoverfield avatar Nov 03 '20 17:11 eoverfield

~~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.

waldekmastykarz avatar Nov 04 '20 08:11 waldekmastykarz

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

rabwill avatar Nov 05 '20 08:11 rabwill

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?

waldekmastykarz avatar Nov 05 '20 12:11 waldekmastykarz

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.

eoverfield avatar Nov 05 '20 23:11 eoverfield

@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.

waldekmastykarz avatar Nov 09 '20 14:11 waldekmastykarz

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

eoverfield avatar Aug 18 '21 21:08 eoverfield

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

DonKirkham avatar Feb 16 '22 13:02 DonKirkham

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

DonKirkham avatar Feb 16 '22 14:02 DonKirkham