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

API fix #687

Merged
merged 27 commits into from
Jun 17, 2021
Merged

API fix #687

merged 27 commits into from
Jun 17, 2021

Conversation

izulin
Copy link
Collaborator

@izulin izulin commented Jun 6, 2021

Context

Fixes API of getFillRangeData so it conforms to how we pass ranges.

How has this been tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature or improvement (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Additional language file or change to the existing one (translations)

Other: change to API.

Related issue(s):

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.

@codecov
Copy link

codecov bot commented Jun 6, 2021

Codecov Report

Merging #687 (97ceab9) into develop (ee22e12) will decrease coverage by 0.13%.
The diff coverage is 75.36%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #687      +/-   ##
===========================================
- Coverage    92.27%   92.14%   -0.14%     
===========================================
  Files          166      166              
  Lines        39412    39548     +136     
  Branches      3575     3606      +31     
===========================================
+ Hits         36368    36442      +74     
- Misses        3038     3100      +62     
  Partials         6        6              
Impacted Files Coverage Δ
src/interpreter/Interpreter.ts 51.42% <0.00%> (ø)
src/interpreter/plugin/NumericAggregationPlugin.ts 92.17% <66.66%> (+0.01%) ⬆️
src/AbsoluteCellRange.ts 86.17% <71.42%> (-0.49%) ⬇️
src/Cell.ts 94.76% <75.00%> (-0.79%) ⬇️
src/HyperFormula.ts 97.53% <75.11%> (-1.26%) ⬇️
src/DependencyGraph/DependencyGraph.ts 86.08% <92.30%> (+0.12%) ⬆️
src/DependencyGraph/Graph.ts 92.98% <100.00%> (-0.07%) ⬇️
src/index.ts 100.00% <100.00%> (ø)
src/parser/RowAddress.ts 91.34% <0.00%> (-1.93%) ⬇️
src/parser/addressRepresentationConverters.ts 88.32% <0.00%> (-0.51%) ⬇️
... and 1 more

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jun 9, 2021

This pull request introduces 1 alert when merging 0db693e into 6f64f7c - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jun 9, 2021

This pull request introduces 1 alert when merging 53a5af5 into 6f64f7c - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jun 10, 2021

This pull request introduces 1 alert when merging 3284b60 into 6f64f7c - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jun 10, 2021

This pull request introduces 1 alert when merging d3c36c1 into 6f64f7c - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

Copy link
Contributor

@wojciechczerniak wojciechczerniak left a comment

Choose a reason for hiding this comment

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

LGTM from API pov 👍

I'm adding @kirszenbaum as reviewer as he's responsible for the docs, and we're touching public API here. We probably should check if we're not using those methods anywhere in docs

CHANGELOG.md Outdated Show resolved Hide resolved
src/HyperFormula.ts Show resolved Hide resolved
src/HyperFormula.ts Outdated Show resolved Hide resolved
@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jun 11, 2021

This pull request introduces 1 alert when merging 831818a into 0041732 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

CHANGELOG.md Outdated
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **Breaking change**: Changed API of many sheet-related methods to take sheetId instead of sheetName as an argument. (#645)
- **Breaking change**: Removed support for matrix formulas (`{=FORMULA}`) notation. Engine now supports formulas returning array of values (instead of only scalars). (#652)
- **Breaking change**: Removed numeric matrix detection along with matrixDetection and matrixDetectionThreshold config options. (#669)
- **Breaking change**: Changed API of many function to take SimpleCellRange type argument instead of corner + width + height. (#687)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- **Breaking change**: Changed API of many function to take SimpleCellRange type argument instead of corner + width + height. (#687)
- **Breaking change**: Changed API of the following methods to take `SimpleCellRange` type argument: `copy`, `cut`, `getCellDependents`, `getCellPrecedents`, `getFillRangeData`, `getRangeFormulas`, `getRangeSerialized`, `getRangeValues`, `isItPossibleToMoveCells`, `isItPossibleToSetCellContents`, `moveCells`. (#687)

Copy link
Contributor

Choose a reason for hiding this comment

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

@wojciechczerniak FYI: The release note gets kinda long when we list all affected methods

@izulin Looking at the API ref, I think there are two more code examples that need updating. GitHub doesn't allow me to suggest changes to those lines, so I'm listing them here:

getRangeFormulas

In HyperFormula.ts, change line 2259 from:
* const rangeFormulas = hfInstance.getRangeFormulas({ sheet: 0, col: 0, row: 0 }, 2, 2);
to:
* const rangeFormulas = hfInstance.getRangeFormulas({start: { sheet: 0, col: 0, row: 0 }, end: { sheet: 0, col: 1, row: 1 }});

getRangeSerialized

In HyperFormula.ts, change line 2289 from:
* const rangeSerialized = hfInstance.getRangeSerialized({ sheet: 0, col: 0, row: 0 }, 2, 2);
to:
* const rangeSerialized = hfInstance.getRangeSerialized({start: { sheet: 0, col: 0, row: 0 }, end: { sheet: 0, col: 1, row: 1 }});

izulin and others added 2 commits June 14, 2021 15:31
Co-authored-by: kirszenbaum <jakub.wisniewski@handsontable.com>
Co-authored-by: Wojciech Czerniak <wojciech.czerniak@gmail.com>
@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jun 14, 2021

This pull request introduces 2 alerts when merging ca619d0 into 9831e63 - view on LGTM.com

new alerts:

  • 1 for Syntax error
  • 1 for Unused variable, import, function or class

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jun 14, 2021

This pull request introduces 1 alert when merging 47252a7 into 9831e63 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jun 14, 2021

This pull request introduces 1 alert when merging a0af181 into 9831e63 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

Copy link
Contributor

@wojciechczerniak wojciechczerniak left a comment

Choose a reason for hiding this comment

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

At this point we validate all arguments? Maybe we have to update changelog entry "Added validation of API argument types for simple types." then?

@@ -892,6 +905,9 @@ export class HyperFormula implements TypedEmitter {
*
* @param {Partial<ConfigParams>} newParams configuration options to be updated or added
*
* @throws [[ExpectedValueOfTypeError]] when some parameters of config are of wrong type (e.g. currencySymbol)
* @throws [[ConfigValueEmpty]] when some parameters of config are of invalid value (e.g. currencySymbol)
Copy link
Contributor

Choose a reason for hiding this comment

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

"value empty" error for "invalid value" ? This line may not be correct

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no, it's actually like that: if you try to provide "" as a currencySymbol then you get this error

src/HyperFormula.ts Outdated Show resolved Hide resolved
src/HyperFormula.ts Outdated Show resolved Hide resolved
@@ -2699,26 +2754,30 @@ export class HyperFormula implements TypedEmitter {
*
* @category Helpers
*/
public getCellDependents(address: SimpleCellAddress | AbsoluteCellRange): (AbsoluteCellRange | SimpleCellAddress)[] {
public getCellDependents(address: SimpleCellAddress | SimpleCellRange): (SimpleCellRange | SimpleCellAddress)[] {
Copy link
Contributor

Choose a reason for hiding this comment

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

@kirszenbaum Probably for another issue, should we add another example with SimpleCellRange as input? Currently only SimpleCellAddress is demonstrated

Copy link
Contributor

Choose a reason for hiding this comment

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

@@ -2730,20 +2789,22 @@ export class HyperFormula implements TypedEmitter {
*
* @category Helpers
*/
public getCellPrecedents(address: SimpleCellAddress | AbsoluteCellRange): (AbsoluteCellRange | SimpleCellAddress)[] {
public getCellPrecedents(address: SimpleCellAddress | SimpleCellRange): (SimpleCellRange | SimpleCellAddress)[] {
Copy link
Contributor

Choose a reason for hiding this comment

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

@kirszenbaum Same here, we may show another way to use this method in the @example tag

Copy link
Contributor

Choose a reason for hiding this comment

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

src/HyperFormula.ts Show resolved Hide resolved
src/HyperFormula.ts Outdated Show resolved Hide resolved
src/HyperFormula.ts Outdated Show resolved Hide resolved
@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jun 15, 2021

This pull request introduces 1 alert when merging e2ced12 into 8f02f1d - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

src/HyperFormula.ts Outdated Show resolved Hide resolved
src/HyperFormula.ts Outdated Show resolved Hide resolved
src/HyperFormula.ts Outdated Show resolved Hide resolved
src/HyperFormula.ts Outdated Show resolved Hide resolved
src/HyperFormula.ts Outdated Show resolved Hide resolved
src/HyperFormula.ts Outdated Show resolved Hide resolved
src/HyperFormula.ts Outdated Show resolved Hide resolved
src/HyperFormula.ts Outdated Show resolved Hide resolved
izulin and others added 9 commits June 17, 2021 12:43
Co-authored-by: Wojciech Czerniak <wojciech.czerniak@gmail.com>
Co-authored-by: Wojciech Czerniak <wojciech.czerniak@gmail.com>
Co-authored-by: Wojciech Czerniak <wojciech.czerniak@gmail.com>
Co-authored-by: Wojciech Czerniak <wojciech.czerniak@gmail.com>
Co-authored-by: Wojciech Czerniak <wojciech.czerniak@gmail.com>
Co-authored-by: Wojciech Czerniak <wojciech.czerniak@gmail.com>
Co-authored-by: Wojciech Czerniak <wojciech.czerniak@gmail.com>
Co-authored-by: Wojciech Czerniak <wojciech.czerniak@gmail.com>
@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jun 17, 2021

This pull request introduces 1 alert when merging 97ceab9 into ee22e12 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

Copy link
Contributor

@wojciechczerniak wojciechczerniak left a comment

Choose a reason for hiding this comment

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

👍

@izulin izulin merged commit 6a4121a into develop Jun 17, 2021
@izulin izulin deleted the pu/apifix branch June 17, 2021 11:53
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