odoo / mail-client-extensions

Other
27 stars 54 forks source link

[REF] oulook: enforce guidelines with prettier and refactor the structure of the project #18

Closed std-odoo closed 2 years ago

std-odoo commented 3 years ago

Purpose

Enforce guidelines on the project with prettier, and refactor most components.

Specification

Prettier

A code formatter has been configured, but never used. So, currently, the code has no real guidelines and some part of the code are very hard to read (very long line, indentation issues...).

To solve this, we configured properly prettier and run it on the code (this increase a lot the diff of this PR but the code is way cleaner like this).

Refactoring

Refactor most of the components. Some components have a lot of redundancy (TaskListItemn, LeadListItem...) and we should in that case make a common widget. Or sometimes we try to make a common component when it's counterproductive (CompanyCard and ProfileCard).

We also use new Typescript syntax (arrow functions, async / await...) as it help for readability. We remove useless state / properties, remove Typescript when it can be done in pure CSS.

Fix

Fix some bugs related to the enrichment (an error was returned by Odoo and never displayed on the add-on, so the user didn't know why the enrichment failed) or the "Create and Enrich" button should not be visible if the contact doesn't exist in the Odoo database.

Task-2601837