Skip to content

Commit e231bf8

Browse files
bgantzlercah-brian-gantzlerRobbieTheWagner
authored
Fixed deprecations this.property-fallback, with, and positional linkt… (#831)
* Fixed deprecations this.property-fallback, with, and positional linkto parms * Update tests/acceptance/sandbox/api/guides-test.js * Update index.js Co-authored-by: Brian Gantzler <brian.gantzler@cardinalhealth.com> Co-authored-by: Robert Wagner <rwwagner90@gmail.com>
1 parent 3364352 commit e231bf8

File tree

26 files changed

+149
-146
lines changed

26 files changed

+149
-146
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@
2424
/.node_modules.ember-try/
2525
/bower.json.ember-try
2626
/package.json.ember-try
27+
28+
# intellij
29+
/.idea/
30+
ember-cli-addon-docs.iml
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
<h1 class="docs-h1" data-test-class-name>{{class.name}}</h1>
1+
<h1 class="docs-h1" data-test-class-name>{{@class.name}}</h1>
22

33
{{! wrapping in a div seems to work around https://github.com/ember-learn/ember-cli-addon-docs/issues/7 }}
4-
<div data-test-class-description>{{{class.description}}}</div>
4+
<div data-test-class-description>{{{@class.description}}}</div>
55

6-
{{#if (or (and class.exportType showImportPaths) hasToggles)}}
6+
{{#if (or (and @class.exportType @showImportPaths) this.hasToggles)}}
77
<Api::XMetaPanel as |panel|>
8-
{{#if class.exportType}}
8+
{{#if @class.exportType}}
99
<panel.header>
1010
Import Path
1111
</panel.header>
1212

13-
<Api::XImportPath @item={{class}} />
13+
<Api::XImportPath @item={{@class}} />
1414
{{/if}}
1515

16-
{{#if hasToggles}}
16+
{{#if @hasToggles}}
1717
<panel.header>
1818
Show
1919
</panel.header>
2020

21-
{{#if hasToggles}}
21+
{{#if @hasToggles}}
2222
<Api::XToggles @toggles={{hash
23-
inherited=(if class.hasInherited showInherited)
24-
protected=(if class.hasProtected showProtected)
25-
private=(if class.hasPrivate showPrivate)
26-
deprecated=(if class.hasDeprecated showDeprecated)
23+
inherited=(if @class.hasInherited this.showInherited)
24+
protected=(if @class.hasProtected this.showProtected)
25+
private=(if @class.hasPrivate this.showPrivate)
26+
deprecated=(if @class.hasDeprecated this.showDeprecated)
2727
}} />
2828
{{/if}}
2929
{{/if}}
3030
</Api::XMetaPanel>
3131
{{/if}}
3232

33-
{{#if hasContents}}
33+
{{#if this.hasContents}}
3434
<Api::XSections @sections={{hash
35-
constructors=class.constructors
36-
fields=class.fields
37-
accessors=class.accessors
38-
methods=class.methods
35+
constructors=@class.constructors
36+
fields=@class.fields
37+
accessors=@class.accessors
38+
methods=@class.methods
3939
}} />
4040
{{/if}}

addon/components/api/x-component/template.hbs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
{{! wrapping in a div seems to work around https://github.com/ember-learn/ember-cli-addon-docs/issues/7 }}
44
<div data-test-component-name>{{{@component.description}}}</div>
55

6-
{{#if hasToggles}}
6+
{{#if this.hasToggles}}
77
<Api::XMetaPanel as |panel|>
88
<panel.header>
99
Show
1010
</panel.header>
1111

1212
{{#if hasToggles}}
1313
<Api::XToggles @toggles={{hash
14-
inherited=(if component.hasInherited showInherited)
15-
internal=(if component.hasInternal showInternal)
16-
protected=(if component.hasProtected showProtected)
17-
private=(if component.hasPrivate showPrivate)
18-
deprecated=(if component.hasDeprecated showDeprecated)
14+
inherited=(if @component.hasInherited this.showInherited)
15+
internal=(if @component.hasInternal this.showInternal)
16+
protected=(if @component.hasProtected this.showProtected)
17+
private=(if @component.hasPrivate this.showPrivate)
18+
deprecated=(if @component.hasDeprecated this.showDeprecated)
1919
}} @onToggle={{action "updateFilter"}} />
2020
{{/if}}
2121
</Api::XMetaPanel>
@@ -24,11 +24,11 @@
2424

2525
{{#if hasContents}}
2626
<Api::XSections @sections={{hash
27-
constructors=constructors
28-
yields=yields
29-
arguments=arguments
30-
fields=fields
31-
accessors=accessors
32-
methods=methods
27+
constructors=this.constructors
28+
yields=this.yields
29+
arguments=this.arguments
30+
fields=this.fields
31+
accessors=this.accessors
32+
methods=this.methods
3333
}} />
3434
{{/if}}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Api::XSections @sections={{hash
2-
classes=module.classes
3-
components=module.components
4-
functions=module.functions
5-
variables=module.variables
2+
classes=@module.classes
3+
components=@module.components
4+
functions=@module.functions
5+
variables=@module.variables
66
}} />

addon/components/api/x-section/template.hbs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
11
<div data-test-item class="docs-pb-8">
22
<h3
3-
id={{item.name}}
4-
data-text={{item.name}}
3+
id={{@item.name}}
4+
data-text={{@item.name}}
55
data-test-item-header
66
class="docs-h3 docs-font-mono docs-font-normal"
77
>
8-
{{#if (eq item.exportType "default")}}
8+
{{#if (eq @item.exportType "default")}}
99
<span class="docs-border docs-border-grey-light docs-align-text-top docs-leading-loose docs-text-xxs docs-pl-2 docs-mr-2 docs-py-1 docs-rounded">
1010
Default
1111
</span>
1212
{{/if}}
1313

14-
{{#if (or item.isClass item.isComponent)}}
15-
<LinkTo @route="docs.api.item" @model={{concat "modules/" item.id}} class="hover:underline">
16-
<strong>{{item.name}}</strong>
14+
{{#if (or @item.isClass item.isComponent)}}
15+
<LinkTo @route="docs.api.item" @model={{concat "modules/" @item.id}} class="hover:underline">
16+
<strong>{{@item.name}}</strong>
1717
</LinkTo>
1818
{{else}}
19-
<a href="#{{item.name}}" class="heading-anchor">
20-
{{type-signature item}}
19+
<a href="#{{@item.name}}" class="heading-anchor">
20+
{{type-signature @item}}
2121
</a>
2222
{{/if}}
2323
</h3>
2424

2525
<p data-test-item-description>
26-
{{{item.description}}}
26+
{{{@item.description}}}
2727
</p>
2828

29-
{{#if (or (and item.exportType showImportPaths) shouldDisplayParams)}}
29+
{{#if (or (and @item.exportType this.showImportPaths) this.shouldDisplayParams)}}
3030
<Api::XMetaPanel as |panel|>
31-
{{#if item.exportType}}
31+
{{#if @item.exportType}}
3232
<panel.header>
3333
Import Path
3434
</panel.header>
3535

36-
<Api::XImportPath @item={{item}} />
36+
<Api::XImportPath @item={{@item}} />
3737
{{/if}}
3838

39-
{{#if shouldDisplayParams}}
39+
{{#if this.shouldDisplayParams}}
4040
<panel.header>
4141
Params
4242
</panel.header>
4343

4444
<table class="docs-mb-6" data-test-item-params>
4545
<tbody>
46-
{{#each item.params as |param|}}
46+
{{#each @item.params as |param|}}
4747
<tr data-test-item-param>
4848
<td><span class="docs-font-mono docs-font-bold docs-border-r docs-border-grey-light docs-pr-2">{{param.name}}</span></td>
4949
<td><span class="docs-font-mono docs-border-r docs-border-grey-light docs-px-2">{{param.type}}</span></td>

addon/components/api/x-toggles/template.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<ul class="docs-mb-6">
2-
{{#each-in toggles as |key toggle|}}
2+
{{#each-in @toggles as |key toggle|}}
33
{{#if (not-eq toggle undefined)}}
44
<li class="docs-inline docs-ml-4">
55
<label data-test-toggle>
66
<input type="checkbox"
77
checked={{toggle}}
8-
onclick={{action onToggle key}}
8+
onclick={{action @onToggle key}}
99
class="docs-mr-1"
1010
>
1111

addon/components/docs-demo/template.hbs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
{{yield (hash
44
example=(component "docs-demo/x-example")
5-
snippet=(component "docs-demo/x-snippet" did-init=(action "registerSnippet") activeSnippet=activeSnippet)
5+
snippet=(component "docs-demo/x-snippet" did-init=(action "registerSnippet") activeSnippet=this.activeSnippet)
66
)}}
77

88
<div>
9-
{{#if (and snippets (gt snippets.length 1))}}
9+
{{#if (and this.snippets (gt this.snippets.length 1))}}
1010
<nav class="
1111
docs-demo__snippets-nav docs-py-2 docs-px-4 docs-font-medium
1212
docs-bg-black docs-tracking-tight docs-border-b
1313
docs-border-grey-darkest
1414
">
15-
{{#each snippets as |snippet|}}
15+
{{#each this.snippets as |snippet|}}
1616
<button {{action "selectSnippet" snippet}}
1717
class="
1818
docs-mr-4 docs-text-xs docs-no-underline outline-none
@@ -29,7 +29,7 @@
2929
</nav>
3030
{{/if}}
3131

32-
{{#each snippets as |snippet|}}
32+
{{#each this.snippets as |snippet|}}
3333
{{#if snippet.isActive}}
3434
<div class="
3535
docs-demo__snippet-wrapper docs-bg-code-base docs-rounded-b

addon/components/docs-header/link/template.hbs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
{{#if href}}
1+
{{#if @href}}
22

3-
<a href={{href}}
3+
<a href={{@href}}
44
class="
55
docs-px-4 docs-py-5 docs-transition docs-uppercase docs-text-xxs docs-font-bold
66
docs-text-grey-darkest docs-no-underline hover:docs-text-brand
7-
{{if push "docs-ml-auto"}}
7+
{{if this.push "docs-ml-auto"}}
88
"
9-
data-test-id={{data-test-id}}>
9+
data-test-id={{this.data-test-id}}>
1010
{{yield}}
1111
</a>
1212

13-
{{else if on-click}}
13+
{{else if @on-click}}
1414

15-
<a {{action on-click}}
15+
<a {{action @on-click}}
1616
href="#"
1717
class="
1818
docs-px-4 docs-py-5 docs-transition docs-uppercase docs-text-xxs docs-font-bold
1919
docs-text-grey-darkest docs-no-underline hover:docs-text-brand
20-
{{if push "docs-ml-auto"}}
20+
{{if this.push "docs-ml-auto"}}
2121
"
22-
data-test-id={{data-test-id}}>
22+
data-test-id={{this.data-test-id}}>
2323
{{yield}}
2424
</a>
2525

2626
{{else}}
2727

28-
<LinkTo @route={{route}} class={{concat "docs-px-4 docs-py-5 docs-transition docs-uppercase docs-text-xxs
29-
docs-font-bold docs-no-underline " (if (not (eq route "index")) (if isActive "docs-text-brand" "docs-text-grey-darkest hover:docs-text-brand") "docs-text-grey-darkest")}} data-test-id={{data-test-id}}>
28+
<LinkTo @route={{@route}} class={{concat "docs-px-4 docs-py-5 docs-transition docs-uppercase docs-text-xxs
29+
docs-font-bold docs-no-underline " (if (not (eq @route "index")) (if this.isActive "docs-text-brand" "docs-text-grey-darkest hover:docs-text-brand") "docs-text-grey-darkest")}} data-test-id={{this.data-test-id}}>
3030
{{yield}}
3131
</LinkTo>
3232

addon/components/docs-header/search-box/template.hbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
so we stick with the dumb html element. Maybe there's a way to disable them
88
and get the convenient two-way binding.
99
--}}
10-
<input oninput={{action on-input value="target.value"}}
11-
value={{query}}
10+
<input oninput={{action @on-input value="target.value"}}
11+
value={{@query}}
1212
type="text"
13-
disabled={{fetchProject.isRunning}}
13+
disabled={{this.fetchProject.isRunning}}
1414
placeholder="SEARCH"
1515
class="docs-w-24 docs-text-xxs docs-p-2 docs-pl-6 docs-rounded focus:docs-bg-grey-lighter outline-none"
1616
data-search-box-input

addon/components/docs-header/search-result/template.hbs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
<div {{on "click" this.onClick}} {{on "mouseenter" this.onMouseEnter}}>
22
{{#link-to
3-
params=linkArgs
3+
params=this.linkArgs
44
class=(concat
55
"docs-block docs-py-2 docs-px-3 docs-text-black docs-no-underline hover:docs-bg-grey-lighter "
6-
(if selected "docs-bg-grey-lighter")
6+
(if @selected "docs-bg-grey-lighter")
77
)
88
}}
99
<div class="docs-flex docs-items-center">
10-
{{svg-jar icon height=28 width=28 class="docs-mr-2 docs-flex-no-shrink"}}
10+
{{svg-jar this.icon height=28 width=28 class="docs-mr-2 docs-flex-no-shrink"}}
1111
<span class="docs-truncate">
12-
{{#if titleMatchesQuery}}
13-
{{{highlightedTitle}}}
12+
{{#if this.titleMatchesQuery}}
13+
{{{this.highlightedTitle}}}
1414
{{else}}
15-
{{result.document.title}}
15+
{{this.result.document.title}}
1616
{{/if}}
1717
</span>
1818
</div>
19-
20-
{{#if (not titleMatchesQuery)}}
19+
20+
{{#if (not this.titleMatchesQuery)}}
2121
<small class="docs-text-grey-dark docs-inline-block">
22-
{{{bestMatch}}}
22+
{{{this.bestMatch}}}
2323
</small>
2424
{{/if}}
2525
{{/link-to}}

0 commit comments

Comments
 (0)