Microsoft Graph Toolkit v2.2.0
Announcing the general availability of Microsoft Graph Toolkit v2.2! This release introduces two new components: File and File List, a new authentication provider for MSAL 2, and a new mgt-spfx
package for working with Microsoft Graph Toolkit in SharePoint Framework.
Updating your application
To update your application to use the newest version of Microsoft Graph Toolkit, navigate to your project directory and run:
npm i @microsoft/mgt@latest
If you’re using the Toolkit via mgt-loader
, your application will be automatically updated to the newest version.
File Component
PR: #910
Docs: File Component
The File component can be used to display a single file or folder that is stored in OneDrive or a SharePoint document library. The component retrieves a file’s data from Microsoft Graph and renders the file using its name, an icon representing the file type, and other configurable properties such as the last modified date, file size, or author. As a developer, all you need to do is drop the component in your app and provide a set of identifiers or a query to the file you want to show.
File List Component
PR: #919
Docs: File List Component
The File List component builds on top of the File component and enables you to display a list of multiple files and/or folders with just one line of code. You can specify what files to show by providing a set of identifiers or a query to the desired drive or site, or you can provide an insight type such as trending, used, or shared, to show only files that are most relevant to the signed in user.
Below is an example that displays all files in the signed in user’s root drive, which is the default behavior:
To try out these components, check out the samples on our playground.
MSAL 2 Provider
PR: #969
Docs: MSAL 2 Provider
We’ve introduced a new authentication provider for MSAL 2.0. This new provider uses authorization code flow, which is more secure than the implicit grant flow used in our original MSAL provider, so we recommend the use of this provider when building web applications going forward.
If you are already using the original MSAL provider in your application, you can easily switch over with just a couple of steps by following the instructions here.
SharePoint Framework Library for Microsoft Graph Toolkit
PR: #856 (thanks @waldekmastykarz and @rabwill)
Docs: SharePoint Framework library for Microsoft Graph Toolkit
Another new feature included in this release is a new SharePoint Framework library for Microsoft Graph Toolkit. The new package allows developers to deploy the Microsoft Graph Toolkit to their tenant and reference components in any webpart, avoiding any registration conflicts and duplication across webparts. If you are looking to build SharePoint web parts that use Microsoft Graph Toolkit components, this library now makes it easier to develop and manage your web parts.
Improvements and Updates
<mgt-person>
- Added support to fetch additional person properties not available by default - #913
- Added presence to
default
template - #965 (thanks @harlankoehn) - Updated presence APIs usage from beta to v1.0 - #1014
- Added
--avatar-cursor
custom property - #1076 (thanks @NathZ1)
<mgt-people>
- Added support for additional graph queries - #963 (thanks @waldekmastykarz)
<mgt-people-picker>
- Added
user-type
\userType
to configure what type of users can be picked - #1119 - Added
default-selected-group-ids
\defaultSelectedGroupIds
to select groups on initial load - #1123 (thanks @jeroenvdmeer) - Added support for entering any email address - #1069
<teams-channel-picker>
- Updated scopes to Channel.ReadBasic.All and Team.ReadBasic.All - #943 (thanks @Abderahman88)
- the developer must opt in to use the new scopes to avoid breaking changes - #1120
<mgt-file-list>
- Added custom properties to style file border - #1075 (thanks @aaclage)
- Added
reload
method to clear cache and reload state - #1151 (thanks @aaclage)
MsalProvider
mgt-react
General
- Replaced Microsoft Graph Beta Types with npm package to removed dependency on git - #929
- Added provider type to SdkVersion header for analytics - #956
- Added
requiredScopes
static getter to all component to get all required scopes for that type of component - #999 (thanks @waldekmastykarz)
Bug Fixes
- [mgt-agenda] - Fixed handling of UTC dates - #944 (thanks @waldekmastykarz)
- [mgt-person] - Fixed avatar presence style - #952
- [mgt-person] - Fixed avatar image for legacy accounts - #968
- [mgt-person] - Fixed unnecessary image fetching when
avatarType
is set to initials - #1006 - [mgt-people-picker] - Fixed
selectedUsersById
parameter types - #961 (thanks @Alikont) - [mgt-people-picker] - Fixed keyboard tab navigation - #1002
- [mgt-people-picker] - Fixed exceptions thrown when user has not consented to people scopes - #1118
- [mgt-person-card] - Fixed displaying profile information - #1005
- [mgt-file-list] - Fixed state not refreshing when
pageSize
changed - #1112 (thanks @aaclage) - [mgt-file-list] - Fixed highlight state for clicked file - #1151 (thanks @aaclage)
- [mgt-file] - Fixed OneNote icon not rendering - #1098 (thanks @aaclage)
- [mgt-file] - Fixed folder names with dot and upper case file extensions - #1146 (thanks @aaclage)
- Fixed caching bug when IndexedDB is not supported - #1016