diff --git a/outlook/.eslintrc.json b/outlook/.eslintrc.json index f88422a81..72639bbfd 100644 --- a/outlook/.eslintrc.json +++ b/outlook/.eslintrc.json @@ -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" - } - } -} \ No newline at end of file + ] +} diff --git a/outlook/.hintrc b/outlook/.hintrc new file mode 100644 index 000000000..57be52563 --- /dev/null +++ b/outlook/.hintrc @@ -0,0 +1,8 @@ +{ + "extends": [ + "development" + ], + "hints": { + "typescript-config/strict": "off" + } +} diff --git a/outlook/README.md b/outlook/README.md index 0ff970c58..32728e318 100644 --- a/outlook/README.md +++ b/outlook/README.md @@ -4,7 +4,7 @@ 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. @@ -12,34 +12,8 @@ The code is based on the [Office Addin API](https://docs.microsoft.com/en-us/off - 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 @@ -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 ` -Then publish it -> `npm run-script deploy -- -r -b ` +### 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 diff --git a/outlook/assets/avatar_grey.png b/outlook/assets/avatar_grey.png deleted file mode 100644 index 52d106166..000000000 Binary files a/outlook/assets/avatar_grey.png and /dev/null differ diff --git a/outlook/assets/caveat.ttf b/outlook/assets/caveat.ttf new file mode 100644 index 000000000..11c6af4ab Binary files /dev/null and b/outlook/assets/caveat.ttf differ diff --git a/outlook/assets/company_image.png b/outlook/assets/company_image.png deleted file mode 100644 index 0a52179c7..000000000 Binary files a/outlook/assets/company_image.png and /dev/null differ diff --git a/outlook/assets/odoo-128.png b/outlook/assets/icon-128.png similarity index 100% rename from outlook/assets/odoo-128.png rename to outlook/assets/icon-128.png diff --git a/outlook/assets/odoo-16.png b/outlook/assets/icon-16.png similarity index 100% rename from outlook/assets/odoo-16.png rename to outlook/assets/icon-16.png diff --git a/outlook/assets/odoo-32.png b/outlook/assets/icon-32.png similarity index 100% rename from outlook/assets/odoo-32.png rename to outlook/assets/icon-32.png diff --git a/outlook/assets/odoo-64.png b/outlook/assets/icon-64.png similarity index 100% rename from outlook/assets/odoo-64.png rename to outlook/assets/icon-64.png diff --git a/outlook/assets/odoo-80.png b/outlook/assets/icon-80.png similarity index 100% rename from outlook/assets/odoo-80.png rename to outlook/assets/icon-80.png diff --git a/outlook/assets/login.svg b/outlook/assets/login.svg new file mode 100644 index 000000000..f1b0bf0c8 --- /dev/null +++ b/outlook/assets/login.svg @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The power of Odooin your inbox + + + + + + + + + + + + + for Outlook + + + diff --git a/outlook/assets/odoo-full.png b/outlook/assets/odoo-full.png deleted file mode 100644 index 86dbb7e13..000000000 Binary files a/outlook/assets/odoo-full.png and /dev/null differ diff --git a/outlook/assets/person.png b/outlook/assets/person.png new file mode 100644 index 000000000..6513bb2d4 Binary files /dev/null and b/outlook/assets/person.png differ diff --git a/outlook/assets/social/crunchbase.ico b/outlook/assets/social/crunchbase.ico deleted file mode 100644 index 9cf19b93e..000000000 Binary files a/outlook/assets/social/crunchbase.ico and /dev/null differ diff --git a/outlook/assets/social/facebook.ico b/outlook/assets/social/facebook.ico deleted file mode 100644 index 8ce319b8f..000000000 Binary files a/outlook/assets/social/facebook.ico and /dev/null differ diff --git a/outlook/assets/social/linkedin.ico b/outlook/assets/social/linkedin.ico deleted file mode 100644 index 3988a3d7a..000000000 Binary files a/outlook/assets/social/linkedin.ico and /dev/null differ diff --git a/outlook/assets/social/twitter.ico b/outlook/assets/social/twitter.ico deleted file mode 100644 index eeae0a0cc..000000000 Binary files a/outlook/assets/social/twitter.ico and /dev/null differ diff --git a/outlook/assets/spinner-2.gif b/outlook/assets/spinner-2.gif deleted file mode 100644 index fe692e92d..000000000 Binary files a/outlook/assets/spinner-2.gif and /dev/null differ diff --git a/outlook/assets/spinner-black.gif b/outlook/assets/spinner-black.gif deleted file mode 100644 index 2a57ad944..000000000 Binary files a/outlook/assets/spinner-black.gif and /dev/null differ diff --git a/outlook/assets/spinner.gif b/outlook/assets/spinner.gif index 527f38d31..46a7fb331 100644 Binary files a/outlook/assets/spinner.gif and b/outlook/assets/spinner.gif differ diff --git a/outlook/babel.config.json b/outlook/babel.config.json new file mode 100644 index 000000000..ce63f5eca --- /dev/null +++ b/outlook/babel.config.json @@ -0,0 +1,13 @@ +{ + "presets": [ + [ + "@babel/preset-env", + { + "targets": { + "esmodules": false + } + } + ], + "@babel/preset-typescript" + ] +} diff --git a/outlook/manifest.xml b/outlook/manifest.xml index 27cf865bf..7f4fd53ab 100644 --- a/outlook/manifest.xml +++ b/outlook/manifest.xml @@ -1,16 +1,16 @@ c5549a21-aefb-4ba8-ae7c-b77bceab4023 - 2.0.1 + 3.0.1 Odoo en-US - - - - + + + + - https://localhost:3000 + https://localhost:3000/ @@ -32,63 +32,7 @@ - false - - - - - - - - - - - - -