push
github
72 of 100 branches covered (72.0%)
Branch coverage included in aggregate %.
0 of 743 new or added lines in 22 files covered. (0.0%)
54 existing lines in 21 files now uncovered.386 of 1694 relevant lines covered (22.79%)
6.85 hits per line
NEW
|
import PanelComponent from "./panel.jsx";
|
|
2 |
|
|
3 |
class StoryListComponent { |
× |
NEW
|
oninit({ attrs: { app } }) {
|
× |
5 |
this.app = app;
|
× |
6 |
} |
× |
7 |
|
|
8 |
async selectStory(storyItemElement) { |
× |
9 |
await this.app.selectStory(Number(storyItemElement.dataset.index));
|
× |
10 |
await this.app.save();
|
× |
11 |
PanelComponent.closeAllPanels(); |
× |
12 |
} |
× |
13 |
|
|
14 |
view() { |
× |
NEW
|
return (
|
× |
NEW
|
<div className="story-list-container">
|
× |
NEW
|
<h2>Story List</h2> |
× |
NEW
|
<ul |
× |
NEW
|
className="story-list"
|
× |
NEW
|
onclick={({ target }) => |
× |
NEW
|
this.selectStory(target.closest(".story-list-item")) |
× |
22 |
} |
|
23 |
> |
|
NEW
|
{this.app.stories.map((storyMetadata, s) => {
|
× |
NEW
|
return (
|
× |
NEW
|
<li className="story-list-item" data-index={s}>
|
× |
NEW
|
{storyMetadata.name} |
× |
NEW
|
</li> |
× |
29 |
); |
|
NEW
|
})} |
× |
NEW
|
</ul> |
× |
NEW
|
</div> |
× |
33 |
); |
|
UNCOV
34
|
} |
× |
UNCOV
35
|
} |
× |
36 |
|
|
37 |
export default StoryListComponent; |
× |