From f4cf63665a0d4baaefebb90691af0b126eeb03b2 Mon Sep 17 00:00:00 2001 From: Paolo Pialorsi Date: Thu, 7 Oct 2021 11:52:29 +0200 Subject: [PATCH] Updated react-teams-lead-dashboard sample --- .../src/services/SettingsService.tsx | 8 +++++--- .../components/LeadAssistDashboard.tsx | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/samples/react-teams-lead-dashboard/src/services/SettingsService.tsx b/samples/react-teams-lead-dashboard/src/services/SettingsService.tsx index c35b9de16..6a4465d29 100644 --- a/samples/react-teams-lead-dashboard/src/services/SettingsService.tsx +++ b/samples/react-teams-lead-dashboard/src/services/SettingsService.tsx @@ -2,9 +2,10 @@ 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, settingsFilename: string): Promise { @@ -30,11 +31,12 @@ 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, settingsFilename: string) { + 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:/${settingsFilename}:/content`) diff --git a/samples/react-teams-lead-dashboard/src/webparts/leadAssistDashboard/components/LeadAssistDashboard.tsx b/samples/react-teams-lead-dashboard/src/webparts/leadAssistDashboard/components/LeadAssistDashboard.tsx index 863050d05..95cf07e54 100644 --- a/samples/react-teams-lead-dashboard/src/webparts/leadAssistDashboard/components/LeadAssistDashboard.tsx +++ b/samples/react-teams-lead-dashboard/src/webparts/leadAssistDashboard/components/LeadAssistDashboard.tsx @@ -136,7 +136,7 @@ export default class LeadAssistDashboard extends React.Component
- { SettingsService.saveSiteUrl(this.props.graphClient, { siteUrl: this.state.siteUrl }, 'lead_dashboard_settings.json'); }} /> + { SettingsService.saveSettings(this.props.graphClient, { siteUrl: this.state.siteUrl }, 'lead_dashboard_settings.json'); }} />
; }