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

Formula helpers and named expressions (part 2) #192

Merged
merged 25 commits into from Feb 26, 2020

Conversation

swistak35
Copy link
Contributor

Context

  • Adds more validation rules for named expressions
  • Provides functionality to calculate fire-and-forget formula
  • Doesn't like internal representation of workbook named expressions (sheet with ID = -1)

This changes a little bit the output of changes when doing CRUD operations, but the class which is returned now is compatible (in terms of API) with previously returned object.

How has this been tested?

Tests

Related issue(s):

  1. Formula helpers #24
  2. Named Expressions and Structured References #126

Checklist:

  • My code follows the code style of this project,
  • My change requires a change to the documentation,
  • I described the modification in the CHANGELOG.md file.

@@ -54,6 +56,14 @@ describe('Named expressions', () => {
}).toThrowError("Name of Named Expression '1definitelyIncorrectName' is invalid")
})

it('when adding named expression, only formulas are accepted', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this limitation necessary? Named expressions should accept any expression, not only formulas. Values, other named expressions, constant arrays, ranges should be supported as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Note: normalizeFormula, validateFormula, calculateFormula as indicated by their names should support only formulas, those should not change. My comment is for named expressions only

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 thought that we want to focus on formulas for now, we can surely change that to accept values too

src/HyperFormula.ts Show resolved Hide resolved
return this.address.sheet
}

public get value() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should ExportedNamedExpressionChange have value alias as well?

Or we don't need newValue when we have value? It's a little bit confusing why we have both while they are always equal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wojciechczerniak only for compatibility reasons (I didn't want to break the integration), I'd leave only newValue as it betters conveys intent, but the value is already there, if our current integration doesn't rely on that then I will gladly fallback to newValue only

Copy link
Contributor

Choose a reason for hiding this comment

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

@jansiegel has to review the integration anyway. A lot has changed since we did it, and since we haven't released HF or HOT integration yet so we should break the compatibility if it's necessary. Better now than later or keeping it. Maintaining the unnecessary code is a chore.

@swistak35 swistak35 merged commit e1d91aa into develop Feb 26, 2020
@swistak35 swistak35 deleted the rl/formula-helpers-part-2 branch February 26, 2020 23:40
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.

None yet

2 participants