Skip to content

Conversation

rmbh-odoo
Copy link
Contributor

Description:

Current behavior before PR:

  • CF and DV side panels combined the list and editor into a single panel.
  • The editor could not be opened directly.
  • Logic for the main panel and editor was mixed, reducing modularity.

Desired behavior after PR is merged:

  • Split CF and DV into separate main and editor panels.
  • Panels can be opened or replaced directly with openSidePanel / replaceSidePanel.
  • Use a store to manage the CF editor state.
  • Refactor related test cases.

Task: 4982596

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

@robodoo
Copy link
Collaborator

robodoo commented Sep 22, 2025

Pull request status dashboard

Copy link
Contributor Author

@rmbh-odoo rmbh-odoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi 👋
Here are some comments to help speed up the review process.

Comment on lines -162 to +140
describe("Conditional format list", () => {
let sheetId: UID;
describe("Conditional formatting list panel", () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn’t remove any test cases; I only reordered them based on the preferred environment and titles. 😑

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, I used a store to separate business logic from UI logic, and it was also needed to handle the undo operation.

Comment on lines +583 to +584
// TODO: add manage rule in (sleection/sheet) feature like excel does
const rules = env.model.getters.getConditionalFormats(sheetId);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

We can improve this by adding an option to manage rules at the selection or sheet level,
as shown in the attached image.

Copy link
Contributor

@dhrp-odoo dhrp-odoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋

maybe the ConditionalFormattingPanel and DataValidationPanel might no longer be needed, since you’re already switching between panels directly through the side panel.

Also found a bug:

  • Add enough cfs so the side panel shows a scrollbar
  • Drag the first item to the bottom
  • The panel doesn’t scroll down automatically

@rmbh-odoo rmbh-odoo force-pushed the master-ref-cf-dv-side-panel-rmbh branch from 38253d8 to 593d218 Compare September 26, 2025 10:26
@rmbh-odoo
Copy link
Contributor Author

maybe the ConditionalFormattingPanel and DataValidationPanel might no longer be needed, since you’re already switching between panels directly through the side panel.

I removed the list panel because it has become useless.
However, we cannot remove the main panels, since doing so would add more complexity to the preview panel. 😐

Before this commit:
- The data validation side panel and its editor were combined in a
  single panel.
- This prevented opening the editor directly.
- The behavior was inconsistent with pivot and other panels, and the
  structure was less modular.

After this commit:
- The data validation panel and the editor are now separate panels.
- Panels can be opened or replaced using `openSidePanel` and `replaceSidePanel`.
- Any panel can now be opened directly when needed.

Task: 4982596
@rmbh-odoo rmbh-odoo force-pushed the master-ref-cf-dv-side-panel-rmbh branch from 593d218 to b5c5b44 Compare September 30, 2025 09:10
Before this commit:
- The cf side panel handled both list and editor in a single panel.
- The logic of the main panel and the editor was mixed,
  preventing direct access to the editor.
- Business and UI logic for the editor were coupled.

After this commit:
- Use a store to manage the state of the editor panel.
- Make the main panel and editor panel independent.
- Change undo behavior in the editor to redirect back to the main panel.
- Refactor related test cases.

Task: 4982596
Before this commit:
- The conditional formatting editor used the class name o-cf-ruleEditor.
- The rule editor itself was named o-cf-editor,
  which was inconsistent and confusing.

After this commit:
- CSS classes are renamed to match their actual purpose,
  improving consistency and readability.

Task: 4982596
@rmbh-odoo rmbh-odoo force-pushed the master-ref-cf-dv-side-panel-rmbh branch from b5c5b44 to 1cdf54f Compare September 30, 2025 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants