Skip to content

Issue 158: Added TemplateFormulaCell #160

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

Merged
merged 8 commits into from
Feb 12, 2021

Conversation

Siemienik
Copy link
Owner

@Siemienik Siemienik commented Feb 11, 2021

resolves #158

image

@codecov
Copy link

codecov bot commented Feb 11, 2021

Codecov Report

Merging #160 (edb276f) into master (d34e73f) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #160   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           52        53    +1     
  Lines         1011      1036   +25     
  Branches       139       146    +7     
=========================================
+ Hits          1011      1036   +25     
Flag Coverage Δ
xlsx-import 100.00% <ø> (ø)
xlsx-renderer 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/xlsx-renderer/src/cell/VariableCell.ts 100.00% <ø> (ø)
packages/xlsx-renderer/src/CellTemplatePool.ts 100.00% <100.00%> (ø)
packages/xlsx-renderer/src/cell/NormalCell.ts 100.00% <100.00%> (ø)
...ages/xlsx-renderer/src/cell/TemplateFormulaCell.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d34e73f...edb276f. Read the comment docs.

| Content | [FormulaCell](./src/cell/FormulaCell.ts) | 4 | Cell.type eq. formulae | It handles correctly formulas inside and outside of loops - when rows were shifted compared to the template. | *It is used automatically when formulae from the template being rendered* <br/> [Example](./tests/integration/data/Renderer010-Formula)|
| Content | [HyperlinkCell](./src/cell/HyperlinkCell.ts) | 6 | `#! HYPERLINK pathToLabel pathToTarget` | Create a hyperlink. | *Paths resolve exactly same as VariableCell* |
| Content | [FormulaCell](./src/cell/FormulaCell.ts) | 5 | Cell.type eq. formulae | It handles correctly formulas inside and outside of loops - when rows were shifted compared to the template. | *It is used automatically when formulae from the template being rendered* <br/> [Example](./tests/integration/data/Renderer010-Formula)|
| Content | [TemplateFormulaCell](./src/cell/TemplateFormulaCell.ts) | 4 | Starts with `#= ` | This one allows you to put a template string into a cell as a formula. To write in a variable use `${patToVariable}`. | **Example:**<br/> `#= ${summaryFormula}(A2:A${tem.__endOutput.r})` gives something like `=MAX(A2:A2910)` <br/> [Example](./tests/integration/data/Renderer017-TemplateFormula)|
Copy link
Owner Author

Choose a reason for hiding this comment

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

This line was added, others lines have only changed Matching Order

Copy link

@jasonclake jasonclake left a comment

Choose a reason for hiding this comment

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

Looks good! Very minor typos noted (just proving that I read through your work :) opens up a lot of flexibility

@Siemienik Siemienik merged commit caf8796 into master Feb 12, 2021
@Siemienik Siemienik deleted the feature/158-template-formula-cell branch February 12, 2021 10:04
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.

Add TemplateFormulaCell : Possibility to add a template for a custom formula
2 participants