diff --git a/README.md b/README.md index e2609fb..81dd8bc 100644 --- a/README.md +++ b/README.md @@ -49,13 +49,13 @@ for more example I invite to tests data: [click here and check `Renderer` folder | Navigation | [EndRowCell](./src/cell/EndRowCell.ts) | 2 | `#! END_ROW` | Go to the beginning of next row | | | Worksheet
Navigation
Loop | [FinishCell](./src/cell/FinishCell.ts) | 7 | `#! FINISH conditionPath` | Finish rendering for current worksheet and:
1) go to next worksheet if `conditionPath===true`
2) repeat this template worksheet again (`conditionPath === false`) - looping through worksheets
3) finished whole rendering when this worksheet is the last one. | **Examples:**
`#! FINISHED ` or `#! FINISHED itemFromLoop.__iterated` | | Worksheet | [WsNameCell](./src/cell/WsNameCell.ts) | 13 | `#! WS_NAME pathToVariable` | Set worksheet's name. | **Examples:**
`#! WS_NAME worksheetName`
`#! WS_NAME item.title`
`#! WS_NAME translatedNames.0` | -| Loop | **TODO: describe it!** [DumpColsCell](./src/cell/DumpColsCell.ts) | | | | | +| Loop | [DumpColsCell](./src/cell/DumpColsCell.ts) | 10 | `#! DUMP_COLS pathToArray` | Useful for writing through multiple columns. It put each value of array to next column. | [Example](./tests/integration/data/Renderer011-DumpCols/) | | Loop | **TODO: tests done: simple, stripped; tests todo: nested, with formula, special fields, through worksheets,** [ForEachCell](./src/cell/ForEachCell.ts) | 6 | #! FOR_EACH item items | Begin the loop named `item`, set the first element of `items` into `item` and go to the beginning of next line.| Connected to: `ContinueCell`, `EndLoopCell`, `DeleteCell`, `FinishedCell`, `SumCell`, `AverageCell`. | | Loop | [ContinueCell](./src/cell/ContinueCell.ts) | 9 | `#! CONTINUE item` | Iterate to next element of loop named `item` (check `ForEachCell` for more information) and navigate to the beginning of new line. | | | Loop | [EndLoopCell](./src/cell/EndLoopCell.ts) | 8 | `#! END_LOOP item` | Mark cell when the loop `item` finished. | | | Aggregation| [SumCell](./src/cell/SumCell.ts) | 11 | `#! SUM item` | Write sum formulae for current column and the `item`'s rows. | [Example](./tests/integration/data/Renderer007-ForEach-Sum/) | | Aggregation | [AverageCell](./src/cell/AverageCell.ts) | 12 | `#! AVERAGE item` | Write average formulae for current column and the `item`'s rows. | [Example](./tests/integration/data/Renderer009-ForEach-Average/) | -| View Model | **TODO: test - nested loop** [DeleteCell](./src/cell/DeleteCell.ts) | 14 | `#! DELETE pathToVariable` | Delete variable, useful for nested loops.| [Example](./tests/integration/data/Renderer009-ForEach-Average/) | +| View Model | [DeleteCell](./src/cell/DeleteCell.ts) | 14 | `#! DELETE pathToVariable` | Delete variable, useful for nested loops.| [Example](./tests/integration/data/Renderer009-ForEach-Average/) | ## Commands [PREVIOUS VERSION]: diff --git a/tests/integration/data/Renderer011-DumpCols/expected.xlsx b/tests/integration/data/Renderer011-DumpCols/expected.xlsx new file mode 100644 index 0000000..2ccfc38 Binary files /dev/null and b/tests/integration/data/Renderer011-DumpCols/expected.xlsx differ diff --git a/tests/integration/data/Renderer011-DumpCols/template.xlsx b/tests/integration/data/Renderer011-DumpCols/template.xlsx new file mode 100644 index 0000000..0abba99 Binary files /dev/null and b/tests/integration/data/Renderer011-DumpCols/template.xlsx differ diff --git a/tests/integration/data/Renderer011-DumpCols/viewModel.json b/tests/integration/data/Renderer011-DumpCols/viewModel.json new file mode 100644 index 0000000..b9bf64f --- /dev/null +++ b/tests/integration/data/Renderer011-DumpCols/viewModel.json @@ -0,0 +1,103 @@ +{ + "days": [ + "01/04/2020", + "02/04/2020", + "03/04/2020", + "04/04/2020", + "05/04/2020", + "06/04/2020", + "07/04/2020" + ], + "stats": [ + { + "name": "p3r.io", + "views": [ + 128, + 256, + 512, + 1024, + 2048, + 4096, + 8182 + ], + "unique": [ + 16, + 32, + 64, + 128, + 256, + 512, + 1024 + ], + "actions": [ + 2, + 4, + 8, + 16, + 32, + 64, + 128 + ] + }, + { + "name": "siemienik.pl", + "views": [ + 28, + 56, + 112, + 124, + 148, + 196, + 182 + ], + "unique": [ + 6, + 2, + 4, + 28, + 56, + 12, + 24 + ], + "actions": [ + 1, + 2, + 2, + 6, + 2, + 4, + 28 + ] + }, + { + "name": "github.com/siemienik", + "views": [ + 1128, + 1256, + 1512, + 11024, + 12048, + 14096, + 18182 + ], + "unique": [ + 116, + 132, + 164, + 1128, + 1256, + 1512, + 11024 + ], + "actions": [ + 12, + 14, + 18, + 116, + 132, + 164, + 1128 + ] + } + ] +} \ No newline at end of file