diff --git a/samples/react-securitygrid/package-lock.json b/samples/react-securitygrid/package-lock.json index 9c1e7f51a..e6b8a4269 100644 --- a/samples/react-securitygrid/package-lock.json +++ b/samples/react-securitygrid/package-lock.json @@ -10001,9 +10001,9 @@ } }, "i": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/i/-/i-0.3.6.tgz", - "integrity": "sha1-2WyScyB28HJxG2sQ/X1PZa2O4j0=", + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/i/-/i-0.3.7.tgz", + "integrity": "sha512-FYz4wlXgkQwIPqhzC5TdNMLSE5+GS1IIDJZY/1ZiEPCT2S3COUVZeT5OW4BmW4r5LHLQuOosSwsvnroG9GR59Q==", "dev": true }, "iconv-lite": { diff --git a/samples/react-securitygrid/package.json b/samples/react-securitygrid/package.json index c4c15b014..0e846e606 100644 --- a/samples/react-securitygrid/package.json +++ b/samples/react-securitygrid/package.json @@ -43,7 +43,7 @@ "@types/mocha": "2.2.38", "ajv": "~5.2.2", "gulp": "~3.9.1", - "i": "0.3.6", + "i": "0.3.7", "npm": "6.14.6", "tslint-microsoft-contrib": "5.0.0" }, diff --git a/samples/react-teams-lead-dashboard/README.md b/samples/react-teams-lead-dashboard/README.md index e99a4b7df..193a12457 100644 --- a/samples/react-teams-lead-dashboard/README.md +++ b/samples/react-teams-lead-dashboard/README.md @@ -2,7 +2,7 @@ ## Summary -This sample shows how to initegrate SharePoint Framework, PnP React Controls, and Microsoft Graph Toolkit in a solution available for SharePoint web parts or Microsoft Teams personal application. +This sample shows how to integrate SharePoint Framework, PnP React Controls, and Microsoft Graph Toolkit in a solution available for SharePoint web parts or Microsoft Teams personal application. ![Lead Assist Dashboard](./assets/LeadAssistDashboard_overview.png) @@ -73,7 +73,9 @@ This web part illustrates the following concepts: - [Building for Microsoft Teams](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/build-for-teams-overview) - [Use Microsoft Graph in your solution](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/using-microsoft-graph-apis) - [Publish SharePoint Framework applications to the Marketplace](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/publish-to-marketplace-overview) -- [Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) - Guidance, tooling, samples and open-source controls for your Microsoft 365 development +- [The easiest way to store user settings of your Microsoft 365 app +](https://blog.mastykarz.nl/easiest-store-user-settings-microsoft-365-app/ ) +- [Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) ## Disclaimer diff --git a/samples/react-teams-lead-dashboard/assets/LeadAssistDashboard_overview.png b/samples/react-teams-lead-dashboard/assets/LeadAssistDashboard_overview.png index 40857357d..90c177e46 100644 Binary files a/samples/react-teams-lead-dashboard/assets/LeadAssistDashboard_overview.png and b/samples/react-teams-lead-dashboard/assets/LeadAssistDashboard_overview.png differ diff --git a/samples/react-teams-lead-dashboard/config/package-solution.json b/samples/react-teams-lead-dashboard/config/package-solution.json index 5cecd1caf..d3316a531 100644 --- a/samples/react-teams-lead-dashboard/config/package-solution.json +++ b/samples/react-teams-lead-dashboard/config/package-solution.json @@ -3,7 +3,7 @@ "solution": { "name": "lead-assist-client-side-solution", "id": "c311a0fc-3dcb-4316-a798-fd7d8a6d5344", - "version": "1.0.11.0", + "version": "1.0.13.0", "includeClientSideAssets": true, "skipFeatureDeployment": true, "isDomainIsolated": false, diff --git a/samples/react-teams-lead-dashboard/package.json b/samples/react-teams-lead-dashboard/package.json index 1491a3d78..6241377e6 100644 --- a/samples/react-teams-lead-dashboard/package.json +++ b/samples/react-teams-lead-dashboard/package.json @@ -1,6 +1,6 @@ { "name": "lead-assist", - "version": "1.0.11", + "version": "1.0.13", "private": true, "main": "lib/index.js", "scripts": { diff --git a/samples/react-teams-lead-dashboard/src/services/SettingsService.tsx b/samples/react-teams-lead-dashboard/src/services/SettingsService.tsx index fe984f60a..6a4465d29 100644 --- a/samples/react-teams-lead-dashboard/src/services/SettingsService.tsx +++ b/samples/react-teams-lead-dashboard/src/services/SettingsService.tsx @@ -2,15 +2,16 @@ import { HttpClient, MSGraphClient } from "@microsoft/sp-http"; export default class SettingsService { /** - * Get the application settings from drive + * Get the application settings from OneDrive * @param graphClient Graph client to be used for the request * @param httpClient Http client to be used for the request + * @param settingsFilename Name of the file to read the settings from * @returns Object representing the JSON settings file */ - public static async getSettings(graphClient: MSGraphClient, httpClient: HttpClient): Promise { + public static async getSettings(graphClient: MSGraphClient, httpClient: HttpClient, settingsFilename: string): Promise { // Get approot files const approotFiles = await graphClient - .api('/me/drive/special/approot/children') + .api(`/me/drive/special/approot/children?$filter=name%20eq%20'${settingsFilename}'`) .version("v1.0") .get(); @@ -30,14 +31,15 @@ export default class SettingsService { } /** - * Save the specified settings to drive + * Save the specified settings to OneDrive * @param graphClient Graph client to be used for the request * @param settings Object representing the settings to be saved on the JSON settings file + * @param settingsFilename Name of the file to store the settings on */ - public static async saveSiteUrl(graphClient: MSGraphClient, settings: any) { + public static async saveSettings(graphClient: MSGraphClient, settings: any, settingsFilename: string) { // Save the settings in the application dedicated folder await graphClient - .api('/me/drive/special/approot:/settings.json:/content') + .api(`/me/drive/special/approot:/${settingsFilename}:/content`) .version("v1.0") .header('content-type', 'text/plain') .put(JSON.stringify(settings)); diff --git a/samples/react-teams-lead-dashboard/src/webparts/leadAssistDashboard/LeadAssistDashboardWebPart.ts b/samples/react-teams-lead-dashboard/src/webparts/leadAssistDashboard/LeadAssistDashboardWebPart.ts index a6f82d464..3dab35f75 100644 --- a/samples/react-teams-lead-dashboard/src/webparts/leadAssistDashboard/LeadAssistDashboardWebPart.ts +++ b/samples/react-teams-lead-dashboard/src/webparts/leadAssistDashboard/LeadAssistDashboardWebPart.ts @@ -39,7 +39,7 @@ export default class LeadAssistDashboardWebPart extends BaseClientSideWebPart
- { SettingsService.saveSiteUrl(this.props.graphClient, { siteUrl: this.state.siteUrl }); }} /> + { SettingsService.saveSettings(this.props.graphClient, { siteUrl: this.state.siteUrl }, 'lead_dashboard_settings.json'); }} />
; } diff --git a/samples/react-teams-lead-dashboard/src/webparts/leadAssistDashboardSettings/LeadAssistDashboardSettingsWebPart.ts b/samples/react-teams-lead-dashboard/src/webparts/leadAssistDashboardSettings/LeadAssistDashboardSettingsWebPart.ts index 80e2eca7b..190037eac 100644 --- a/samples/react-teams-lead-dashboard/src/webparts/leadAssistDashboardSettings/LeadAssistDashboardSettingsWebPart.ts +++ b/samples/react-teams-lead-dashboard/src/webparts/leadAssistDashboardSettings/LeadAssistDashboardSettingsWebPart.ts @@ -28,7 +28,7 @@ export default class LeadAssistDashboardSettingsWebPart extends BaseClientSideWe const graphClient = await this.context.msGraphClientFactory.getClient(); // Get the settings - const settings = await SettingsService.getSettings(graphClient, this.context.httpClient); + const settings = await SettingsService.getSettings(graphClient, this.context.httpClient, 'lead_dashboard_settings.json'); // If there are settings specified if (settings) {