flexibelere-search #1
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
node_modules
|
||||
.vscode
|
||||
.idea
|
||||
36
README.md
36
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.<br><small>**(Je kan hiervoor expose of ngrok gebruiken)**</small>
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
|
||||
18
dist/manifest.xml
vendored
18
dist/manifest.xml
vendored
@@ -6,11 +6,11 @@
|
||||
<DefaultLocale>en-US</DefaultLocale>
|
||||
<DisplayName DefaultValue="Order finder OVAS"/>
|
||||
<Description DefaultValue="Vind bestellingen die eventueel bij de e-mail horen"/>
|
||||
<IconUrl DefaultValue="https://outlookplugin.ovas.nl/assets/icon-64.png"/>
|
||||
<HighResolutionIconUrl DefaultValue="https://outlookplugin.ovas.nl/assets/icon-128.png"/>
|
||||
<IconUrl DefaultValue="https://localhost:3000/assets/icon-64.png"/>
|
||||
<HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/icon-128.png"/>
|
||||
<SupportUrl DefaultValue="https://ovas.nl"/>
|
||||
<AppDomains>
|
||||
<AppDomain>https://outlookplugin.ovas.nl</AppDomain>
|
||||
<AppDomain>https://localhost:3000</AppDomain>
|
||||
</AppDomains>
|
||||
<Hosts>
|
||||
<Host Name="Mailbox"/>
|
||||
@@ -23,7 +23,7 @@
|
||||
<FormSettings>
|
||||
<Form xsi:type="ItemRead">
|
||||
<DesktopSettings>
|
||||
<SourceLocation DefaultValue="https://outlookplugin.ovas.nl/taskpane.html"/>
|
||||
<SourceLocation DefaultValue="https://localhost:3000/taskpane.html"/>
|
||||
<RequestedHeight>250</RequestedHeight>
|
||||
</DesktopSettings>
|
||||
</Form>
|
||||
@@ -70,13 +70,13 @@
|
||||
</Hosts>
|
||||
<Resources>
|
||||
<bt:Images>
|
||||
<bt:Image id="Icon.16x16" DefaultValue="https://outlookplugin.ovas.nl/assets/icon-16.png"/>
|
||||
<bt:Image id="Icon.32x32" DefaultValue="https://outlookplugin.ovas.nl/assets/icon-32.png"/>
|
||||
<bt:Image id="Icon.80x80" DefaultValue="https://outlookplugin.ovas.nl/assets/icon-80.png"/>
|
||||
<bt:Image id="Icon.16x16" DefaultValue="https://localhost:3000/assets/icon-16.png"/>
|
||||
<bt:Image id="Icon.32x32" DefaultValue="https://localhost:3000/assets/icon-32.png"/>
|
||||
<bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/icon-80.png"/>
|
||||
</bt:Images>
|
||||
<bt:Urls>
|
||||
<bt:Url id="Commands.Url" DefaultValue="https://outlookplugin.ovas.nl/commands.html"/>
|
||||
<bt:Url id="Taskpane.Url" DefaultValue="https://outlookplugin.ovas.nl/taskpane.html"/>
|
||||
<bt:Url id="Commands.Url" DefaultValue="https://localhost:3000/commands.html"/>
|
||||
<bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html"/>
|
||||
</bt:Urls>
|
||||
<bt:ShortStrings>
|
||||
<bt:String id="GroupLabel" DefaultValue="OVAS (Zoek bestellingen)"/>
|
||||
|
||||
18
manifest.xml
18
manifest.xml
@@ -6,11 +6,11 @@
|
||||
<DefaultLocale>en-US</DefaultLocale>
|
||||
<DisplayName DefaultValue="Order finder OVAS"/>
|
||||
<Description DefaultValue="Vind bestellingen die eventueel bij de e-mail horen"/>
|
||||
<IconUrl DefaultValue="https://outlookplugin.ovas.nl/assets/icon-64.png"/>
|
||||
<HighResolutionIconUrl DefaultValue="https://outlookplugin.ovas.nl/assets/icon-128.png"/>
|
||||
<IconUrl DefaultValue="https://localhost:3000/assets/icon-64.png"/>
|
||||
<HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/icon-128.png"/>
|
||||
<SupportUrl DefaultValue="https://ovas.nl"/>
|
||||
<AppDomains>
|
||||
<AppDomain>https://outlookplugin.ovas.nl</AppDomain>
|
||||
<AppDomain>https://localhost:3000</AppDomain>
|
||||
</AppDomains>
|
||||
<Hosts>
|
||||
<Host Name="Mailbox"/>
|
||||
@@ -23,7 +23,7 @@
|
||||
<FormSettings>
|
||||
<Form xsi:type="ItemRead">
|
||||
<DesktopSettings>
|
||||
<SourceLocation DefaultValue="https://outlookplugin.ovas.nl/taskpane.html"/>
|
||||
<SourceLocation DefaultValue="https://localhost:3000/taskpane.html"/>
|
||||
<RequestedHeight>250</RequestedHeight>
|
||||
</DesktopSettings>
|
||||
</Form>
|
||||
@@ -70,13 +70,13 @@
|
||||
</Hosts>
|
||||
<Resources>
|
||||
<bt:Images>
|
||||
<bt:Image id="Icon.16x16" DefaultValue="https://outlookplugin.ovas.nl/assets/icon-16.png"/>
|
||||
<bt:Image id="Icon.32x32" DefaultValue="https://outlookplugin.ovas.nl/assets/icon-32.png"/>
|
||||
<bt:Image id="Icon.80x80" DefaultValue="https://outlookplugin.ovas.nl/assets/icon-80.png"/>
|
||||
<bt:Image id="Icon.16x16" DefaultValue="https://localhost:3000/assets/icon-16.png"/>
|
||||
<bt:Image id="Icon.32x32" DefaultValue="https://localhost:3000/assets/icon-32.png"/>
|
||||
<bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/icon-80.png"/>
|
||||
</bt:Images>
|
||||
<bt:Urls>
|
||||
<bt:Url id="Commands.Url" DefaultValue="https://outlookplugin.ovas.nl/commands.html"/>
|
||||
<bt:Url id="Taskpane.Url" DefaultValue="https://outlookplugin.ovas.nl/taskpane.html"/>
|
||||
<bt:Url id="Commands.Url" DefaultValue="https://localhost:3000/commands.html"/>
|
||||
<bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html"/>
|
||||
</bt:Urls>
|
||||
<bt:ShortStrings>
|
||||
<bt:String id="GroupLabel" DefaultValue="OVAS (Zoek bestellingen)"/>
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user