Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions outlook/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
{
"parser": "@typescript-eslint/parser",
"plugins": [
"react",
"@typescript-eslint",
"office-addins"
],
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
},
"project": "./tsconfig.json"
},
"extends": [
"plugin:office-addins/react"
],
"settings": {
"react": {
"version": "detect"
}
}
}
]
}
8 changes: 8 additions & 0 deletions outlook/.hintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": [
"development"
],
"hints": {
"typescript-config/strict": "off"
}
}
53 changes: 12 additions & 41 deletions outlook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,16 @@

The plugin allows integration with various Odoo apps and modules like CRM, project ...

The code is based on the [Office Addin API](https://docs.microsoft.com/en-us/office/dev/add-ins/) and
The code is based on the [Office Addin API](https://docs.microsoft.com/en-us/office/dev/add-ins/) and
[the react framework](https://reactjs.org/) with typescript.


## To be able to serve the add-in locally for development

- cd to the add-in sources directory
- `npm install`
- `npm run-script dev-server`
- `npm run dev-server`

## To be able to use, test and debug the plugin with a linux OS

- cd to the add-in sources directory
- `npm install`
- open the `node_modules/office-addin-dev-certs/lib/verify.js` file
- inside the file, in the switch clause located in the `getVerifyCommand()` function add the following :

```bash
case "linux":
return `[ -f /usr/local/share/ca-certificates/office-addin-dev-certs/${defaults.caCertificateFileName} ] && openssl x509 -in /usr/local/share/ca-certificates/office-addin-dev-certs/${defaults.caCertificateFileName} -checkend 86400 -noout`;
```

- open the `node_modules/office-addin-dev-certs/lib/install.js` file
- inside the file, in the switch clause add the following:

```bash
case "linux":
return `sudo cp ${caCertificatePath} /usr/local/share/ca-certificates && sudo /usr/sbin/update-ca-certificates`;
```

## To be able to serve the add-in

- cd to the addin-in sources directory
- `npm install`
- `npm run-script build -- --env.DOMAIN=127.0.0.1:8080` (replace `127.0.0.1:8080` with the actual domain)
- serve the dist folder

## To add the add-in in outlook for the web

Expand All @@ -58,29 +32,26 @@ case "linux":
- Click "Mail" > "Customize actions"
- Under the section "Message surface", check "Odoo for Outlook".

## Build for production
Edit `webpack.config.js` and set the production URL in `urlProd`, then run:
> `npm run build`

## Technical remarks

### About translations
The plugin relies on the Odoo database to fetch translations. These translations are fetched during the login process
The plugin relies on the Odoo database to fetch translations. These translations are fetched during the login process
and then cashed and updated at the plugin's initialization if necessary.

Translations are provided in the `translations_outlook.xml` file located in each of the plugin modules

For more details about translations see: https://github.com/odoo/mail-client-extensions/blob/master/outlook/src/utils/Translator.ts


### Prettier
Before committing, please run prettier to automatically format your code
> `npm run-script prettier`

### Deploy on Github Page
Github provides a service to host static website. It can be used to serve the files of
the add-in and so to serve the add-in for testing.

First build the add-in
> `npm run-script build`
> `npm run prettier`

Then replace the default domain (localhost) of the add-in by the domain of your Github Page
> `./replaceDomain.sh <domain>`

Then publish it
> `npm run-script deploy -- -r <repository> -b <branch>`
### Documentation
- https://learn.microsoft.com/en-us/office/dev/add-ins/quickstarts/outlook-quickstart-yo
- https://storybooks.fluentui.dev/react/?path=/docs/components-text--docs
Binary file removed outlook/assets/avatar_grey.png
Binary file not shown.
Binary file added outlook/assets/caveat.ttf
Binary file not shown.
Binary file removed outlook/assets/company_image.png
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
75 changes: 75 additions & 0 deletions outlook/assets/login.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed outlook/assets/odoo-full.png
Binary file not shown.
Binary file added outlook/assets/person.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed outlook/assets/social/crunchbase.ico
Binary file not shown.
Binary file removed outlook/assets/social/facebook.ico
Binary file not shown.
Binary file removed outlook/assets/social/linkedin.ico
Binary file not shown.
Binary file removed outlook/assets/social/twitter.ico
Binary file not shown.
Binary file removed outlook/assets/spinner-2.gif
Binary file not shown.
Binary file removed outlook/assets/spinner-black.gif
Binary file not shown.
Binary file modified outlook/assets/spinner.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions outlook/babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"esmodules": false
}
}
],
"@babel/preset-typescript"
]
}
85 changes: 14 additions & 71 deletions outlook/manifest.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0" xsi:type="MailApp">
<Id>c5549a21-aefb-4ba8-ae7c-b77bceab4023</Id>
<Version>2.0.1</Version>
<Version>3.0.1</Version>
<ProviderName>Odoo</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="Odoo for Outlook"/>
<Description DefaultValue="Odoo for Outlook."/>
<IconUrl DefaultValue="https://localhost:3000/assets/odoo-64.png"/>
<HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/odoo-128.png"/>
<DisplayName DefaultValue="Odoo"/>
<Description DefaultValue="Odoo for Outlook"/>
<IconUrl DefaultValue="https://localhost:3000/assets/icon-64.png"/>
<HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/icon-128.png"/>
<SupportUrl DefaultValue="https://www.odoo.com/help"/>
<AppDomains>
<AppDomain>https://localhost:3000</AppDomain>
<AppDomain>https://localhost:3000/</AppDomain>
</AppDomains>
<Hosts>
<Host Name="Mailbox"/>
Expand All @@ -32,63 +32,7 @@
<Rule xsi:type="RuleCollection" Mode="Or">
<Rule xsi:type="ItemIs" ItemType="Message" FormType="Read"/>
</Rule>
<DisableEntityHighlighting>false</DisableEntityHighlighting>
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
<Requirements>
<bt:Sets DefaultMinVersion="1.3">
<bt:Set Name="Mailbox"/>
</bt:Sets>
</Requirements>
<Hosts>
<Host xsi:type="MailHost">
<DesktopFormFactor>
<FunctionFile resid="Commands.Url"/>
<ExtensionPoint xsi:type="MessageReadCommandSurface">
<OfficeTab id="TabDefault">
<Group id="msgReadGroup">
<Label resid="GroupLabel"/>
<Control xsi:type="Button" id="msgReadOpenPaneButton">
<Label resid="TaskpaneButton.Label"/>
<Supertip>
<Title resid="TaskpaneButton.Label"/>
<Description resid="TaskpaneButton.Tooltip"/>
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16"/>
<bt:Image size="32" resid="Icon.32x32"/>
<bt:Image size="64" resid="Icon.64x64"/>
<bt:Image size="80" resid="Icon.80x80"/>
<bt:Image size="128" resid="Icon.128x128"/>
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="Taskpane.Url"/>
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
</DesktopFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="Icon.16x16" DefaultValue="https://localhost:3000/assets/odoo-16.png"/>
<bt:Image id="Icon.32x32" DefaultValue="https://localhost:3000/assets/odoo-32.png"/>
<bt:Image id="Icon.64x64" DefaultValue="https://localhost:3000/assets/odoo-64.png"/>
<bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/odoo-80.png"/>
<bt:Image id="Icon.128x128" DefaultValue="https://localhost:3000/assets/odoo-128.png"/>
</bt:Images>
<bt:Urls>
<bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html"/>
</bt:Urls>
<bt:ShortStrings>
<bt:String id="GroupLabel" DefaultValue="Odoo for Outlook"/>
<bt:String id="TaskpaneButton.Label" DefaultValue="Open contact profile"/>
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="TaskpaneButton.Tooltip" DefaultValue="Opens a pane displaying all available options."/>
</bt:LongStrings>
</Resources>
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
<Requirements>
<bt:Sets DefaultMinVersion="1.3">
Expand All @@ -98,12 +42,11 @@
<Hosts>
<Host xsi:type="MailHost">
<DesktopFormFactor>
<FunctionFile resid="Commands.Url"/>
<ExtensionPoint xsi:type="MessageReadCommandSurface">
<OfficeTab id="TabDefault">
<Group id="msgReadGroup">
<Group id="msgComposeGroup">
<Label resid="GroupLabel"/>
<Control xsi:type="Button" id="msgReadOpenPaneButton">
<Control xsi:type="Button" id="msgComposeOpenPaneButton">
<Label resid="TaskpaneButton.Label"/>
<Supertip>
<Title resid="TaskpaneButton.Label"/>
Expand All @@ -129,11 +72,11 @@
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="Icon.16x16" DefaultValue="https://localhost:3000/assets/odoo-16.png"/>
<bt:Image id="Icon.32x32" DefaultValue="https://localhost:3000/assets/odoo-32.png"/>
<bt:Image id="Icon.64x64" DefaultValue="https://localhost:3000/assets/odoo-64.png"/>
<bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/odoo-80.png"/>
<bt:Image id="Icon.128x128" DefaultValue="https://localhost:3000/assets/odoo-128.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.64x64" DefaultValue="https://localhost:3000/assets/icon-64.png"/>
<bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/icon-80.png"/>
<bt:Image id="Icon.128x128" DefaultValue="https://localhost:3000/assets/icon-128.png"/>
</bt:Images>
<bt:Urls>
<bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html"/>
Expand All @@ -148,4 +91,4 @@
</Resources>
</VersionOverrides>
</VersionOverrides>
</OfficeApp>
</OfficeApp>
Loading