odoo/o-spreadsheet#5993

Created by BI, Adrien Minne (adrm)
Merged at 3c76bb711098e9a57f6d4e37c854781414d34104

Statuses:

label
odoo:master-data-filter-rule-adrm
head
8fdbfad587b9ce37c190f313b58e7eeb0f2bcf53
merged
8 months ago by BI, Rémi Rahir (rar)
odoo/o-spreadsheet
master #5993

[IMP] filter: allow filter by criterion

Description:

[IMP] filter: allow filter by criterion

With this commit, it is now possible to filter a table based on a
criterion, eg. filters all the values greater than 10.

[REF] filter: add FilterValueList component

This commit moves the part of the filter menu dealing with the list
of filtered values to a separate component.

Also fixed the hover style of the sort buttons in the filter menu.

[REF] conditional format: use same code as data validation

This commit refactors the conditional format to use the same code as
the data validation to compute the CellIs rule operators.

This required a small fix in behavior of data validation to have a
correct behavior that matches the CFs. Now the data validation rule
are type sensitive, ="13" won't match a criterion isEqual 13.

[REF] data validation: make criterion component names more generic

This commit rename all the data_validation_criterion components to
criterion components, since they will be used for more than just data
validation.

[MOV] data validation: make criterion file names generic

This commit rename all the data_validation_criterion files to
criterion files, since they will be used for more than just data
validation.

[REF] conditional_format: rename types to match data validation

This commit renames the types of the conditional format operators
to match the data validation operators, that way we can reuse the
same code for both features.

[FIX] popover: adapt position if child is resized

The popover component would only update its position at useEffect.
But if the child component is resized, useEffect would not be called.

This commit adds a resize observer to the popover component to update
its position when the child is resized.

[FIX] hook: remove wrong useAbsoluteBoundingRect hook

The hook useAbsoluteBoundingRect is updated when the component is
mounted/patched. But that's not enough: a HTML element can change
boundingRect without a owl rendering. That happens if the element
is inside a bootstrap collapsible, which never trigger an owl
rendering.

Task: 4592118

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