+ {this.state.mailMetadata !== null &&
+
+
{strings.SaveInfo}
+
+
{strings.On} {this.state.mailMetadata.savedDate.toLocaleDateString()}
+
}
{this.state.showSuccess &&
{
+ private graphClientReady = () => {
this.setState((prevState: IOutlook2SharePointState, props: IOutlook2SharePointProps) => {
return {
graphController: this.graphController
};
});
+ if (this.saveMetadata) {
+ this.getMetadata();
+ }
}
private showError = (message: string) => {
@@ -172,4 +190,17 @@ export default class Outlook2SharePoint extends React.Component {
+ if (response !== null) {
+ this.setState((prevState: IOutlook2SharePointState, props: IOutlook2SharePointProps) => {
+ return {
+ mailMetadata: response
+ };
+ });
+ }
+ });
+ }
}
diff --git a/samples/react-outlook-copy2teams/src/webparts/outlook2SharePoint/components/Teams.tsx b/samples/react-outlook-copy2teams/src/webparts/outlook2SharePoint/components/Teams.tsx
index 80937b65a..1e40c7dc9 100644
--- a/samples/react-outlook-copy2teams/src/webparts/outlook2SharePoint/components/Teams.tsx
+++ b/samples/react-outlook-copy2teams/src/webparts/outlook2SharePoint/components/Teams.tsx
@@ -5,6 +5,7 @@ import { Spinner, SpinnerSize } from 'office-ui-fabric-react/lib/Spinner';
import Breadcrumb from './controls/Breadcrumb';
import Folder from './Folder';
import styles from './Groups.module.scss';
+import * as strings from 'Outlook2SharePointWebPartStrings';
import { ITeamsProps } from './ITeamsProps';
import { ITeamsState } from './ITeamsState';
import { IFolder } from '../../../model/IFolder';
@@ -16,6 +17,7 @@ export default class Teams extends React.Component {
folders: [],
grandParentFolder: null,
parentFolder: null,
+ selectedTeamName: '',
showSpinner: false
};
}
@@ -50,7 +52,7 @@ export default class Teams extends React.Component {
{
{ this.state.showSpinner && (
-
+
) }
@@ -77,20 +79,15 @@ export default class Teams extends React.Component {
});
}
- private getGroupDrives = (group: IFolder) => {
- let nextParent: IFolder = null;
- this.state.folders.forEach((fldr) => {
- if (fldr.id === group.id) {
- nextParent = fldr;
- }
- });
+ private getGroupDrives = (group: IFolder) => {
this.props.graphController.getGroupDrives(group).then((folders) => {
if (folders.length > 0) {
this.setState((prevState: ITeamsState, props: ITeamsProps) => {
return {
folders: folders,
grandParentFolder: null,
- parentFolder: group
+ parentFolder: group,
+ selectedTeamName: group.name
};
});
}
@@ -122,7 +119,6 @@ export default class Teams extends React.Component {
}
}
-
private showRoot = () => {
this.getTeams();
}
@@ -142,7 +138,11 @@ export default class Teams extends React.Component {
showSpinner: true
};
});
- this.props.graphController.retrieveMimeMail(this.state.parentFolder.driveID, this.state.parentFolder.id, this.props.mail, this.saveMailCallback);
+ this.props.graphController.retrieveMimeMail(this.state.parentFolder.driveID, this.state.parentFolder.id, this.props.mail, this.saveMailCallback)
+ .then((response: string) => {
+ const saveLocationDisplayName = `${this.state.selectedTeamName} ...> ${this.state.grandParentFolder.name} > ${this.state.parentFolder.name}`;
+ this.props.graphController.saveMailMetadata(this.props.mail.id, saveLocationDisplayName, this.state.parentFolder.webUrl, new Date());
+ });
}
private saveMailCallback = (message: string) => {
@@ -152,10 +152,10 @@ export default class Teams extends React.Component {
};
});
if (message.indexOf('Success') > -1) {
- this.props.successCallback(message);
+ this.props.successCallback(strings.SuccessMessage);
}
else {
- this.props.errorCallback(message);
+ this.props.errorCallback(strings.ErrorMessage);
}
}
}
\ No newline at end of file
diff --git a/samples/react-outlook-copy2teams/src/webparts/outlook2SharePoint/loc/en-us.js b/samples/react-outlook-copy2teams/src/webparts/outlook2SharePoint/loc/en-us.js
index 89f98bc1e..2b6d4536f 100644
--- a/samples/react-outlook-copy2teams/src/webparts/outlook2SharePoint/loc/en-us.js
+++ b/samples/react-outlook-copy2teams/src/webparts/outlook2SharePoint/loc/en-us.js
@@ -1,7 +1,14 @@
define([], function() {
return {
- "PropertyPaneDescription": "Description",
- "BasicGroupName": "Group Name",
- "DescriptionFieldLabel": "Description Field"
+ "PropertyPaneDescription": "Copy to OneDrive/Teams",
+ "BasicGroupName": "Configuration",
+ "SaveMetadataFieldLabel": "Save Metadata on copied mail",
+ "SaveInfo": "You already saved this mail",
+ "To": "to",
+ "On": "on",
+ "SaveLabel": "Save here",
+ "SpinnerLabel": "Processing request",
+ "SuccessMessage": "Success",
+ "ErrorMessage": "Error occured"
}
});
\ No newline at end of file
diff --git a/samples/react-outlook-copy2teams/src/webparts/outlook2SharePoint/loc/mystrings.d.ts b/samples/react-outlook-copy2teams/src/webparts/outlook2SharePoint/loc/mystrings.d.ts
index 42c888ca3..5a64a0a41 100644
--- a/samples/react-outlook-copy2teams/src/webparts/outlook2SharePoint/loc/mystrings.d.ts
+++ b/samples/react-outlook-copy2teams/src/webparts/outlook2SharePoint/loc/mystrings.d.ts
@@ -1,7 +1,14 @@
declare interface IOutlook2SharePointWebPartStrings {
PropertyPaneDescription: string;
BasicGroupName: string;
- DescriptionFieldLabel: string;
+ SaveMetadataFieldLabel: string;
+ SaveInfo: string;
+ To: string;
+ On: string;
+ SaveLabel: string;
+ SpinnerLabel: string;
+ SuccessMessage: string;
+ ErrorMessage: string;
}
declare module 'Outlook2SharePointWebPartStrings' {