diff --git a/.gitignore b/.gitignore index 55371e5..20335c7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules -.vscode \ No newline at end of file +.vscode +.idea \ No newline at end of file diff --git a/README.md b/README.md index 5c08550..6b118dd 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,39 @@ # Outlook Plugin + + +# Outlook Plugin Lokale Development & Test Setup + +Deze instructies helpen je om de Outlook plugin lokaal te draaien, publiekelijk toegankelijk te maken via ngrok (of een vergelijkbare tool), en de manifest file aan te passen voor lokale debugging. + +--- + +## Stappen +### 1. URL's in project aanpassen +Start een tunnel van je lokale omgeving zodat hij publiekelijk toegangelijk is.
**(Je kan hiervoor expose of ngrok gebruiken)** + +Verander de URL's in ``src/taskpane/taskpane.js`` naar jouw tunnel URL. + +**Voorbeeld**: +```js +const localApiUrl = "https://ewn51fphu7.sharedwithexpose.com/api/zoek_bestelling"; +const orderUrlEdit = "https://ewn51fphu7.sharedwithexpose.com/bestellingen/edit/"; +const orderUrlIndex = "https://ewn51fphu7.sharedwithexpose.com/bestellingen"; +const apiCredentialUrl = "https://ewn51fphu7.sharedwithexpose.com/api/api_credentials"; +``` + +### 2.Manifest.xml aanpassen +Ga naar ``manifest.xml`` in de root folder. +Verander elke URL genaamd: ```https://outlookplugin.ovas.nl``` naar ``https://localhost:3000`` + + +### 3. Lokale server draaien +Start je lokale development server, bijvoorbeeld op poort 8080: + +```bash +npm run start +```` + ## Overzicht De gehele sourcecode van de plugin bevindt zich op: src/taskpane @@ -7,7 +41,7 @@ De gehele sourcecode van de plugin bevindt zich op: src/taskpane In die folder heb je de HTML, CSS & JS bestanden. Zodra er aanpassingen zijn gemaakt moet je het volgende commando runnen; -```console +```bash npm run build ``` diff --git a/dist/manifest.xml b/dist/manifest.xml index 3980e86..acdc800 100644 --- a/dist/manifest.xml +++ b/dist/manifest.xml @@ -6,11 +6,11 @@ en-US - - + + - https://outlookplugin.ovas.nl + https://localhost:3000 @@ -23,7 +23,7 @@
- + 250
@@ -70,13 +70,13 @@
- - - + + + - - + + diff --git a/manifest.xml b/manifest.xml index 3980e86..acdc800 100644 --- a/manifest.xml +++ b/manifest.xml @@ -6,11 +6,11 @@ en-US - - + + - https://outlookplugin.ovas.nl + https://localhost:3000 @@ -23,7 +23,7 @@
- + 250
@@ -70,13 +70,13 @@
- - - + + + - - + + diff --git a/src/taskpane/taskpane.js b/src/taskpane/taskpane.js index ee9c5f0..e6ec2c7 100644 --- a/src/taskpane/taskpane.js +++ b/src/taskpane/taskpane.js @@ -9,10 +9,10 @@ import axios from "axios"; // axios conf axios.defaults.headers.common["api-language"] = "nl"; -const localApiUrl = "https://backoffice.sociale-controle.nl/api/zoek_bestelling"; -const orderUrlEdit = "https://backoffice.sociale-controle.nl/bestellingen/edit/"; -const orderUrlIndex = "https://backoffice.sociale-controle.nl/bestellingen"; -const apiCredentialUrl = "https://backoffice.sociale-controle.nl/api/api_credentials"; +const localApiUrl = "https://ewn51fphu7.sharedwithexpose.com/api/zoek_bestelling"; +const orderUrlEdit = "https://ewn51fphu7.sharedwithexpose.com/bestellingen/edit/"; +const orderUrlIndex = "https://ewn51fphu7.sharedwithexpose.com/bestellingen"; +const apiCredentialUrl = "https://ewn51fphu7.sharedwithexpose.com/api/api_credentials"; Office.onReady((info) => { if (info.host === Office.HostType.Outlook) { @@ -25,20 +25,25 @@ export async function run() { // Set load animation in button loadAnimation(true); + // btoa(getLastName(Office.context.mailbox.item.sender.displayName)) + // btoa(getInitials(Office.context.mailbox.item.sender.displayName)) + // btoa(Office.context.mailbox.item.sender.emailAddress) + //senderName: btoa(Office.context.mailbox.item.sender.displayName) + let searchInfo = { - senderLastName: btoa(getLastName(Office.context.mailbox.item.sender.displayName)), - senderInitials: btoa(getInitials(Office.context.mailbox.item.sender.displayName)), - senderName: btoa(Office.context.mailbox.item.sender.displayName), - senderEmail: btoa(Office.context.mailbox.item.sender.emailAddress), + senderLastName: btoa("DIT BESTAAT SWS NIET"), + senderInitials: btoa("NAHH"), + senderName: btoa("NO WAY DAT DIT BESTAAT!"), + senderEmail: btoa("Anjameijer1958@outlook.com"), senderSubject: btoa(Office.context.mailbox.item.subject), - postalCodes: {}, + postalCodes: btoa(["1234AA, 0910AA"]), }; - searchInfo.postalCodes = await new Promise((resolve) => { - Office.context.mailbox.item.body.getAsync("text", function (async) { - resolve(getPostalCodesFromText(async.value)); - }); - }); + // searchInfo.postalCodes = await new Promise((resolve) => { + // Office.context.mailbox.item.body.getAsync("text", function (async) { + // resolve(getPostalCodesFromText(async.value)); + // }); + // }); // Make API call to see if we can find an order for the e-mail. let results;