Skip to content

Fixed deprecations this.property-fallback, with, and positional linkt… #831

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 3 commits into from
May 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try

# intellij
/.idea/
ember-cli-addon-docs.iml
32 changes: 16 additions & 16 deletions addon/components/api/x-class/template.hbs
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
<h1 class="docs-h1" data-test-class-name>{{class.name}}</h1>
<h1 class="docs-h1" data-test-class-name>{{@class.name}}</h1>

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

{{#if (or (and class.exportType showImportPaths) hasToggles)}}
{{#if (or (and @class.exportType @showImportPaths) this.hasToggles)}}
<Api::XMetaPanel as |panel|>
{{#if class.exportType}}
{{#if @class.exportType}}
<panel.header>
Import Path
</panel.header>

<Api::XImportPath @item={{class}} />
<Api::XImportPath @item={{@class}} />
{{/if}}

{{#if hasToggles}}
{{#if @hasToggles}}
<panel.header>
Show
</panel.header>

{{#if hasToggles}}
{{#if @hasToggles}}
<Api::XToggles @toggles={{hash
inherited=(if class.hasInherited showInherited)
protected=(if class.hasProtected showProtected)
private=(if class.hasPrivate showPrivate)
deprecated=(if class.hasDeprecated showDeprecated)
inherited=(if @class.hasInherited this.showInherited)
protected=(if @class.hasProtected this.showProtected)
private=(if @class.hasPrivate this.showPrivate)
deprecated=(if @class.hasDeprecated this.showDeprecated)
}} />
{{/if}}
{{/if}}
</Api::XMetaPanel>
{{/if}}

{{#if hasContents}}
{{#if this.hasContents}}
<Api::XSections @sections={{hash
constructors=class.constructors
fields=class.fields
accessors=class.accessors
methods=class.methods
constructors=@class.constructors
fields=@class.fields
accessors=@class.accessors
methods=@class.methods
}} />
{{/if}}
24 changes: 12 additions & 12 deletions addon/components/api/x-component/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
{{! wrapping in a div seems to work around https://github.com/ember-learn/ember-cli-addon-docs/issues/7 }}
<div data-test-component-name>{{{@component.description}}}</div>

{{#if hasToggles}}
{{#if this.hasToggles}}
<Api::XMetaPanel as |panel|>
<panel.header>
Show
</panel.header>

{{#if hasToggles}}
<Api::XToggles @toggles={{hash
inherited=(if component.hasInherited showInherited)
internal=(if component.hasInternal showInternal)
protected=(if component.hasProtected showProtected)
private=(if component.hasPrivate showPrivate)
deprecated=(if component.hasDeprecated showDeprecated)
inherited=(if @component.hasInherited this.showInherited)
internal=(if @component.hasInternal this.showInternal)
protected=(if @component.hasProtected this.showProtected)
private=(if @component.hasPrivate this.showPrivate)
deprecated=(if @component.hasDeprecated this.showDeprecated)
}} @onToggle={{action "updateFilter"}} />
{{/if}}
</Api::XMetaPanel>
Expand All @@ -24,11 +24,11 @@

{{#if hasContents}}
<Api::XSections @sections={{hash
constructors=constructors
yields=yields
arguments=arguments
fields=fields
accessors=accessors
methods=methods
constructors=this.constructors
yields=this.yields
arguments=this.arguments
fields=this.fields
accessors=this.accessors
methods=this.methods
}} />
{{/if}}
8 changes: 4 additions & 4 deletions addon/components/api/x-module/template.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Api::XSections @sections={{hash
classes=module.classes
components=module.components
functions=module.functions
variables=module.variables
classes=@module.classes
components=@module.components
functions=@module.functions
variables=@module.variables
}} />
28 changes: 14 additions & 14 deletions addon/components/api/x-section/template.hbs
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
<div data-test-item class="docs-pb-8">
<h3
id={{item.name}}
data-text={{item.name}}
id={{@item.name}}
data-text={{@item.name}}
data-test-item-header
class="docs-h3 docs-font-mono docs-font-normal"
>
{{#if (eq item.exportType "default")}}
{{#if (eq @item.exportType "default")}}
<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">
Default
</span>
{{/if}}

{{#if (or item.isClass item.isComponent)}}
<LinkTo @route="docs.api.item" @model={{concat "modules/" item.id}} class="hover:underline">
<strong>{{item.name}}</strong>
{{#if (or @item.isClass item.isComponent)}}
<LinkTo @route="docs.api.item" @model={{concat "modules/" @item.id}} class="hover:underline">
<strong>{{@item.name}}</strong>
</LinkTo>
{{else}}
<a href="#{{item.name}}" class="heading-anchor">
{{type-signature item}}
<a href="#{{@item.name}}" class="heading-anchor">
{{type-signature @item}}
</a>
{{/if}}
</h3>

<p data-test-item-description>
{{{item.description}}}
{{{@item.description}}}
</p>

{{#if (or (and item.exportType showImportPaths) shouldDisplayParams)}}
{{#if (or (and @item.exportType this.showImportPaths) this.shouldDisplayParams)}}
<Api::XMetaPanel as |panel|>
{{#if item.exportType}}
{{#if @item.exportType}}
<panel.header>
Import Path
</panel.header>

<Api::XImportPath @item={{item}} />
<Api::XImportPath @item={{@item}} />
{{/if}}

{{#if shouldDisplayParams}}
{{#if this.shouldDisplayParams}}
<panel.header>
Params
</panel.header>

<table class="docs-mb-6" data-test-item-params>
<tbody>
{{#each item.params as |param|}}
{{#each @item.params as |param|}}
<tr data-test-item-param>
<td><span class="docs-font-mono docs-font-bold docs-border-r docs-border-grey-light docs-pr-2">{{param.name}}</span></td>
<td><span class="docs-font-mono docs-border-r docs-border-grey-light docs-px-2">{{param.type}}</span></td>
Expand Down
4 changes: 2 additions & 2 deletions addon/components/api/x-toggles/template.hbs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<ul class="docs-mb-6">
{{#each-in toggles as |key toggle|}}
{{#each-in @toggles as |key toggle|}}
{{#if (not-eq toggle undefined)}}
<li class="docs-inline docs-ml-4">
<label data-test-toggle>
<input type="checkbox"
checked={{toggle}}
onclick={{action onToggle key}}
onclick={{action @onToggle key}}
class="docs-mr-1"
>

Expand Down
8 changes: 4 additions & 4 deletions addon/components/docs-demo/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

{{yield (hash
example=(component "docs-demo/x-example")
snippet=(component "docs-demo/x-snippet" did-init=(action "registerSnippet") activeSnippet=activeSnippet)
snippet=(component "docs-demo/x-snippet" did-init=(action "registerSnippet") activeSnippet=this.activeSnippet)
)}}

<div>
{{#if (and snippets (gt snippets.length 1))}}
{{#if (and this.snippets (gt this.snippets.length 1))}}
<nav class="
docs-demo__snippets-nav docs-py-2 docs-px-4 docs-font-medium
docs-bg-black docs-tracking-tight docs-border-b
docs-border-grey-darkest
">
{{#each snippets as |snippet|}}
{{#each this.snippets as |snippet|}}
<button {{action "selectSnippet" snippet}}
class="
docs-mr-4 docs-text-xs docs-no-underline outline-none
Expand All @@ -29,7 +29,7 @@
</nav>
{{/if}}

{{#each snippets as |snippet|}}
{{#each this.snippets as |snippet|}}
{{#if snippet.isActive}}
<div class="
docs-demo__snippet-wrapper docs-bg-code-base docs-rounded-b
Expand Down
20 changes: 10 additions & 10 deletions addon/components/docs-header/link/template.hbs
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
{{#if href}}
{{#if @href}}

<a href={{href}}
<a href={{@href}}
class="
docs-px-4 docs-py-5 docs-transition docs-uppercase docs-text-xxs docs-font-bold
docs-text-grey-darkest docs-no-underline hover:docs-text-brand
{{if push "docs-ml-auto"}}
{{if this.push "docs-ml-auto"}}
"
data-test-id={{data-test-id}}>
data-test-id={{this.data-test-id}}>
{{yield}}
</a>

{{else if on-click}}
{{else if @on-click}}

<a {{action on-click}}
<a {{action @on-click}}
href="#"
class="
docs-px-4 docs-py-5 docs-transition docs-uppercase docs-text-xxs docs-font-bold
docs-text-grey-darkest docs-no-underline hover:docs-text-brand
{{if push "docs-ml-auto"}}
{{if this.push "docs-ml-auto"}}
"
data-test-id={{data-test-id}}>
data-test-id={{this.data-test-id}}>
{{yield}}
</a>

{{else}}

<LinkTo @route={{route}} class={{concat "docs-px-4 docs-py-5 docs-transition docs-uppercase docs-text-xxs
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}}>
<LinkTo @route={{@route}} class={{concat "docs-px-4 docs-py-5 docs-transition docs-uppercase docs-text-xxs
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}}>
{{yield}}
</LinkTo>

Expand Down
6 changes: 3 additions & 3 deletions addon/components/docs-header/search-box/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
so we stick with the dumb html element. Maybe there's a way to disable them
and get the convenient two-way binding.
--}}
<input oninput={{action on-input value="target.value"}}
value={{query}}
<input oninput={{action @on-input value="target.value"}}
value={{@query}}
type="text"
disabled={{fetchProject.isRunning}}
disabled={{this.fetchProject.isRunning}}
placeholder="SEARCH"
class="docs-w-24 docs-text-xxs docs-p-2 docs-pl-6 docs-rounded focus:docs-bg-grey-lighter outline-none"
data-search-box-input
Expand Down
18 changes: 9 additions & 9 deletions addon/components/docs-header/search-result/template.hbs
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<div {{on "click" this.onClick}} {{on "mouseenter" this.onMouseEnter}}>
{{#link-to
params=linkArgs
params=this.linkArgs
class=(concat
"docs-block docs-py-2 docs-px-3 docs-text-black docs-no-underline hover:docs-bg-grey-lighter "
(if selected "docs-bg-grey-lighter")
(if @selected "docs-bg-grey-lighter")
)
}}
<div class="docs-flex docs-items-center">
{{svg-jar icon height=28 width=28 class="docs-mr-2 docs-flex-no-shrink"}}
{{svg-jar this.icon height=28 width=28 class="docs-mr-2 docs-flex-no-shrink"}}
<span class="docs-truncate">
{{#if titleMatchesQuery}}
{{{highlightedTitle}}}
{{#if this.titleMatchesQuery}}
{{{this.highlightedTitle}}}
{{else}}
{{result.document.title}}
{{this.result.document.title}}
{{/if}}
</span>
</div>
{{#if (not titleMatchesQuery)}}

{{#if (not this.titleMatchesQuery)}}
<small class="docs-text-grey-dark docs-inline-block">
{{{bestMatch}}}
{{{this.bestMatch}}}
</small>
{{/if}}
{{/link-to}}
Expand Down
6 changes: 3 additions & 3 deletions addon/components/docs-header/search-results/template.hbs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{#if (and trimmedQuery search.isIdle)}}
{{#if (and this.trimmedQuery this.search.isIdle)}}
<ModalDialog @tetherTarget="[data-search-box]" @attachment="top left" @clickOutsideToClose={{true}} @onClose={{action "clearSearch"}} @targetAttachment="bottom left" @constraints={{array (hash to="window" attachment="together" pin=true)}}>

<ul class="docs-w-76 docs-bg-white docs-shadow-md" data-test-search-result-list>
{{#each (take 5 searchResults) as |result index|}}
{{#each (take 5 this.searchResults) as |result index|}}
<li>
<DocsHeader::SearchResult @result={{result}} @query={{query}} @selected={{eq index selectedIndex}} @onMouseEnter={{action "selectResult" index}} @onClick={{action "clearSearch"}} />
<DocsHeader::SearchResult @result={{result}} @query={{@query}} @selected={{eq index this.selectedIndex}} @onMouseEnter={{action "selectResult" index}} @onClick={{action "clearSearch"}} />
</li>
{{else}}
<li class="docs-block docs-py-1 docs-px-3 docs-text-grey-dark docs-no-underline">
Expand Down
28 changes: 14 additions & 14 deletions addon/components/docs-header/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

{{#docs-header/link "index"}}
<span class="docs-leading-none docs-font-title docs-text-large-2 docs-font-normal docs-normal-case docs-block docs-mr-6">
{{#if prefix}}
{{#if this.prefix}}
<div class="docs-text-xxs">
{{prefix}}
{{this.prefix}}
</div>
{{/if}}
{{name}}
{{this.name}}
</span>
{{/docs-header/link}}

Expand All @@ -21,27 +21,27 @@
link=(component "docs-header/link")
)}}

<DocsHeader::SearchBox @query={{query}} @on-input={{action (mut query)}} />
<DocsHeader::SearchBox @query={{this.query}} @on-input={{action (mut this.query)}} />

<DocsHeader::Link @on-click={{action (toggle "isShowingVersionSelector" this)}}>
<span data-test-id="current-version" data-version-selector class="docs-flex docs-items-center">

{{#if (eq currentVersion.key latestVersionName)}}
{{#if currentVersion.tag}}
{{currentVersion.tag}}
{{#if (eq this.currentVersion.key this.latestVersionName)}}
{{#if this.currentVersion.tag}}
{{this.currentVersion.tag}}
{{else}}
Latest
{{/if}}
{{else}}
{{currentVersion.name}}
{{this.currentVersion.name}}
{{/if}}

{{svg-jar "caret" height=12 width=12}}
</span>
</DocsHeader::Link>

{{#if projectHref}}
<DocsHeader::Link @href={{projectHref}}>
{{#if this.projectHref}}
<DocsHeader::Link @href={{this.projectHref}}>
<span class="docs-flex">
{{svg-jar "github" width=24 height=24}}
</span>
Expand All @@ -54,10 +54,10 @@
</div>
</header>

{{#if query}}
<DocsHeader::SearchResults @query={{query}} @on-visit={{action "didVisitPage"}} />
{{#if this.query}}
<DocsHeader::SearchResults @query={{this.query}} @on-visit={{action "didVisitPage"}} />
{{/if}}

{{#if isShowingVersionSelector}}
<DocsHeader::VersionSelector @on-close={{action (mut isShowingVersionSelector false)}} />
{{#if this.isShowingVersionSelector}}
<DocsHeader::VersionSelector @on-close={{action (mut this.isShowingVersionSelector false)}} />
{{/if}}
Loading