Skip to content

Commit 01e5771

Browse files
[Chore] Modify API Templates
1 parent 4c878d6 commit 01e5771

File tree

5 files changed

+88
-88
lines changed

5 files changed

+88
-88
lines changed

addon/components/sequential-render.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{{yield (hash
22
content=this.content
33
isContentLoading=this.isContentLoading
4-
render-content=(component "sequential-render/content"
4+
contentTemplate=(component "sequential-render/content"
55
isFullFilled=this.isFullFilled
66
showFadedState=this.showFadedState
77
)
8-
loader-state=(component "sequential-render/loader-state"
8+
loaderTemplate=(component "sequential-render/loader-state"
99
isFullFilled=this.isFullFilled
1010
)
1111
retry=this.retry

addon/components/sequential-render.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,24 @@
1818
@getData={{this.executePromise}}
1919
@renderCallback={{action 'contentRenderCallback'}} as |renderHash|
2020
>
21-
<renderHash.loader-state>
21+
<renderHash.loaderTemplate>
2222
// Handle loading state if required
23-
</renderHash.loader-state>
24-
<renderHash.render-content @loaderClass="loader-fade">
23+
</renderHash.loaderTemplate>
24+
<renderHash.contentTemplate @loaderClass="loader-fade">
2525
// Use renderHash.content to render the content.
2626
// Use renderHash.isContentLoading to act based on the data loading state.
2727
// Use renderHash.retry action to retrigger data fetch and rendering as applicable.
28-
{{/renderHash.render-content}}
28+
</renderHash.contentTemplate>
2929
</SequentialRender>
3030
```
3131
@class sequential-render
3232
@public
3333
@yield {Hash} renderHash
3434
@yield {Any} renderHash.content The response from performing getData.
3535
@yield {boolean} renderHash.isContentLoading Flag to check the loading state of the data fetch.
36-
@yield {component} renderHash.render-content Block component used to render the content of the item.
36+
@yield {component} renderHash.contentTemplate Block component used to render the content of the item.
3737
Accepts loaderClass as an argument. This class can be used to style the subsequent loading states for the item during rerender.
38-
@yield {component} renderHash.loader-state Block component used to render the loading state of the item.
38+
@yield {component} renderHash.loaderTemplate Block component used to render the loading state of the item.
3939
@yield {action} renderHash.retry Exposes an action which can be used to retry the data fetch + render process without affecting the queue / app render states..
4040
*/
4141

tests/dummy/app/components/example-optimized/template.hbs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div class="flex1 schoolroom__mainpanel">
55
<h2 class="maintitle">Dumbledore's Army</h2>
66
<SequentialRender @renderPriority={{0}} @taskName="getSpellWork" @getData={{@getSpellWork}} as |spellHash|>
7-
<spellHash.render-content>
7+
<spellHash.contentTemplate>
88
{{#each @spellWork as |spell|}}
99
<div class="card">
1010
<div class="title">
@@ -15,10 +15,10 @@
1515
</div>
1616
</div>
1717
{{/each}}
18-
</spellHash.render-content>
19-
<spellHash.loader-state>
18+
</spellHash.contentTemplate>
19+
<spellHash.loaderTemplate>
2020
<div class="loader"></div>
21-
</spellHash.loader-state>
21+
</spellHash.loaderTemplate>
2222
</SequentialRender>
2323
</div>
2424
<div class="schoolroom__sidepane">
@@ -27,18 +27,18 @@
2727
Participants
2828
</h4>
2929
<SequentialRender @renderPriority={{1}} @taskName="getParticipants" @getData={{@getParticipants}} as |participantsHash|>
30-
<participantsHash.render-content>
30+
<participantsHash.contentTemplate>
3131
<div class="element-flex avatarpane">
3232
{{#each @participantsList as |person|}}
3333
<div class="avatar-item" aria-label={{person.name}}>
3434
<img class="element-flex avatar-image-wrapper" src={{person.avatar}} alt={{person.name}}>
3535
</div>
3636
{{/each}}
3737
</div>
38-
</participantsHash.render-content>
39-
<participantsHash.loader-state>
38+
</participantsHash.contentTemplate>
39+
<participantsHash.loaderTemplate>
4040
<div class="loader"></div>
41-
</participantsHash.loader-state>
41+
</participantsHash.loaderTemplate>
4242
</SequentialRender>
4343
</div>
4444

@@ -47,14 +47,14 @@
4747
Quick Notes
4848
</h4>
4949
<SequentialRender @renderPriority={{1}} @taskName="getNotes" @getData={{@getNotes}} as |notesHash|>
50-
<notesHash.render-content>
50+
<notesHash.contentTemplate>
5151
<div class="editor" contenteditable="true">
5252
{{@notes}}
5353
</div>
54-
</notesHash.render-content>
55-
<notesHash.loader-state>
54+
</notesHash.contentTemplate>
55+
<notesHash.loaderTemplate>
5656
<div class="loader"></div>
57-
</notesHash.loader-state>
57+
</notesHash.loaderTemplate>
5858
</SequentialRender>
5959
</div>
6060
</div>

tests/dummy/app/templates/docs/usage.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ In this example, the critical or hero element is the content inside the left pan
3838
```
3939
<div class="flex1 schoolroom__mainpanel">
4040
<h2 class="maintitle">Dumbledore's Army</h2>
41-
<sequential-render
41+
<SequentialRender
4242
renderPriority={{0}}
4343
taskName="getSpellWork"
4444
getData={{this.getSpellWork}} as |spellHash|
4545
>
46-
<spellHash.render-content>
46+
<spellHash.contentTemplate>
4747
{{#each this.spellWork as |spell|}}
4848
<div class="card">
4949
<div class="title">
@@ -54,11 +54,11 @@ In this example, the critical or hero element is the content inside the left pan
5454
</div>
5555
</div>
5656
{{/each}}
57-
</spellHash.render-content>
58-
<spellHash.loader-state>
57+
</spellHash.contentTemplate>
58+
<spellHash.loaderTemplate>
5959
// ...Loader
60-
</spellHash.loader-state>
61-
</sequential-render>
60+
</spellHash.loaderTemplate>
61+
</SequentialRender>
6262
</div>
6363
```
6464

0 commit comments

Comments
 (0)