Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] errors: display error origin position #5413

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

LucasLefevre
Copy link
Collaborator

Description:

Purpose

Let's say a cell is evaluated to an error because one of its inputs is an error itself. The tooltip shows the error message, but you don't know where it comes from.

If the formula has many reference, you have to check every one of those references to find the original error.

As an example, if the formula =IF(OR(AND($D21<G$17,$D21>I$1),AND(I$1<$E21,I$1>$D21)),1,"") results with an error. Where does it come from ? D21 ? J1 ? I1 ? E21 ? 

Spec

Add below the error message the cell from which the error is coming from. The cell reference should be clickable to jump to cell.
Task: 4452745

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 Jan 7, 2025

Pull request status dashboard

@LucasLefevre LucasLefevre force-pushed the master-error-origin-lul branch from 9f6c114 to 30f3c79 Compare January 7, 2025 08:49
Purpose
-------

Let's say a cell is evaluated to an error because one of its inputs is an
error itself. The tooltip shows the error message, but you don't know where
it comes from.

If the formula has many reference, you have to check every one of those
references to find the original error.

As an example, if the formula =IF(OR(AND($D21<G$17,$D21>I$1),AND(I$1<$E21,I$1>$D21)),1,"")
results with an error. Where does it come from ? D21 ? J1 ? I1 ? E21 ? 

Spec
----

Add below the error message the cell from which the error is coming from.
The cell reference should be clickable to jump to cell.

Task: 4452745
@LucasLefevre LucasLefevre force-pushed the master-error-origin-lul branch from 30f3c79 to 078bee3 Compare January 7, 2025 08:58
Copy link
Collaborator

@rrahir rrahir left a comment

Choose a reason for hiding this comment

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

the builder seems useless?

title: _t("Error"),
message: cell.message,
});
evaluationError = cell;
}

const validationErrorMessage = getters.getInvalidDataValidationMessage(position);
Copy link
Collaborator

Choose a reason for hiding this comment

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

just inject that value directly to the errorTooltip component as you did with the EvaluationError. The builder is no longer relevant if it only manages a single case. Or you could keep the builder and have it yield a component... but the former seems easier

Comment on lines -1089 to -1090
// TO DO: add tests for exp format (ex: 4E10)
// RO DO: add tests for DATE string format (ex match: "28 02 2020")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

5 years old TODOs... 😛

@LucasLefevre LucasLefevre force-pushed the master-error-origin-lul branch 2 times, most recently from ef182a0 to a7bf79f Compare January 7, 2025 12:37
Since the previous commit, the ErrorToolTip component is no longer
completely independant from the source of errors (it needs to know the evaluation
error).

So the remaining use of the "generic part" is now only for data validation.
A generic system for a single use case is not a generic system. Let's make
it more direct and move everything to the component.

Task: 4452745
@LucasLefevre LucasLefevre force-pushed the master-error-origin-lul branch from a7bf79f to dba11ab Compare January 7, 2025 12:37
@LucasLefevre
Copy link
Collaborator Author

robodoo rebase-ff

@robodoo
Copy link
Collaborator

robodoo commented Jan 8, 2025

Merge method set to rebase and fast-forward.

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