odoo/o-spreadsheet#3776

Created by BI, Adrien Minne (adrm)
Merged at af6740dbce0fa81acaa24816e7b3ee8e2a892426

Statuses:

label
odoo:master-table-color-custom-colors-adrm
head
55c3f0430efa68c21eecd96eeba42cdd7982cf0c
merged
1 year ago by BI, Lucas Lefèvre (lul)
odoo/o-spreadsheet
master #3776

[IMP] tables: set table color in custom colors

Description:

[IMP] table: add table colors to custom colors

When inserting a table with a style in the sheet, it could be useful
for the user to be able to paint cells in the same colors as the table
cells.

This commit adds the table colors to the custom colors plugin, so they
are available to the user.

Another idea would have been to replace the color pickers colors by
the table colors. But then we end up with dull and sad colors in the
color picker so we gave up on that.

Also fixed some bugs and strange behaviors in the custom colors plugin:
- we compute and store the custom colors at each finalize, but the
getter getCustomColors was re-computing the colors instead of using
the stored ones.
- the colors stored by the plugin weren't loaded at import until a
command modifying the colors was executed.
- the colors were filtered/validated multiple times (once when computing
the colors, and once when adding them to the plugin state).
- the colors were sorted, then added to a POJO, making the sorting useless.

[IMP] colors: reduce number of custom colors

This commit aims to reduce the number of custom colors during a
normal use of a spreadsheet and in the demo by replacing custom colors
by colors present in the color picker.

The following were changed:
- default scorecard baseline colors
- CF up/down arrows icons
- lot of demo data colors and their equivalent in the demo test xlsx

Task: : 3775936

review checklist

  • [ ] feature is organized in plugin, or UI components
  • [ ] support of duplicate sheet (deep copy)
  • [ ] in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • [ ] in model/UI: ranges are strings (to show the user)
  • [ ] undo-able commands (uses this.history.update)
  • [ ] multiuser-able commands (has inverse commands and transformations where needed)
  • [ ] new/updated/removed commands are documented
  • [ ] exportable in excel
  • [ ] translations (_t("qmsdf %s", abc))
  • [ ] unit tested
  • [ ] clean commented code
  • [ ] track breaking changes
  • [ ] doc is rebuild (npm run doc)
  • [ ] status is correct in Odoo