Skip to content

Commit 1c50311

Browse files
authored
Merge pull request #953 from ember-learn/layout-rebased
`layout` branch rebased
2 parents a6cad9a + f6ba4c9 commit 1c50311

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+3971
-5187
lines changed

app/adapters/application.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { inject as service } from '@ember/service';
22
import JSONAPIAdapter from '@ember-data/adapter/json-api';
3-
import fetch from 'fetch';
43
import { pluralize } from 'ember-inflector';
54
import { isBlank } from '@ember/utils';
65

app/components/class-field-description.hbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{! template-lint-disable no-invalid-interactive }}
22
<section class='{{@type}}'>
3-
<h3 data-anchor='{{@field.name}}'>
3+
<h3 id='{{@field.name}}'>
44
<span class='{{@type}}-name'>{{@field.name}}</span>
55
{{#if @field.params}}
66
<span class='args'>
@@ -17,7 +17,7 @@
1717
<span class='access'>deprecated</span>
1818
{{/if}}
1919
{{!-- TODO: Fix this link for a11y --}}
20-
<a class='class-field-description--link' data-test-anchor="{{@field.name}}" {{on 'click' (fn this.updateAnchor @field.name)}} {{!-- template-lint-disable link-href-attributes --}}>
20+
<a class='class-field-description--link' href="#{{@field.name}}">
2121
{{svg-jar 'link' width='20px' height='20px'}}
2222
</a>
2323
</h3>
@@ -78,4 +78,4 @@
7878
{{/if}}
7979
</dl>
8080
<MarkdownToHtml @markdown={{@field.description}} />
81-
</section>
81+
</section>
Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { inject as service } from '@ember/service';
22
import Component from '@glimmer/component';
3-
import { action } from '@ember/object';
43

54
export default class ClassFieldDescription extends Component {
65
@service
@@ -12,15 +11,4 @@ export default class ClassFieldDescription extends Component {
1211
this.args.field.class
1312
);
1413
}
15-
16-
/**
17-
* Callback for updating the anchor with the field name that was clicked by a user.
18-
*
19-
* @method updateAnchor
20-
* @method fieldName String The name representing the field that was clicked.
21-
*/
22-
@action
23-
updateAnchor(fieldName) {
24-
this.args.updateAnchor?.(fieldName);
25-
}
2614
}

app/components/ember-anchor.js

Lines changed: 0 additions & 29 deletions
This file was deleted.

app/components/ember-landing-page.hbs

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,27 @@
1818
<li><LinkTo @route='project-version.classes.class' @model='ComputedProperty'>Computed Properties</LinkTo> - declare functions as properties</li>
1919
{{! template-lint-disable no-potential-path-strings }}
2020
<li><LinkTo @route='project-version.classes.class' @model='@ember/object/computed'>Computed Macros</LinkTo> - shorter ways of expressing certain types of computed properties</li>
21-
<li><LinkTo @route='project-version.classes.class' @model='EmberArray'>EmberArray</LinkTo> - contains methods like <LinkTo @route='project-version.classes.class.methods.method' @models={{array 'EmberArray' 'forEach'}} @query={{hash anchor='forEach'}}>forEach</LinkTo> and <LinkTo @route='project-version.classes.class.methods.method' @models={{array 'EmberArray' 'mapBy'}} @query={{hash anchor='mapBy'}}>mapBy</LinkTo> that help you iterate over Ember Objects</li>
22-
<li><LinkTo @route='project-version.classes.class' @model='EmberObject'>EmberObject</LinkTo> - the main base class for all Ember objects, including the <LinkTo @route='project-version.classes.class.methods.method' @models={{array 'EmberObject' 'get'}} @query={{hash anchor='get'}}>get</LinkTo> and <LinkTo @route='project-version.classes.class.methods.method' @models={{array 'EmberObject' 'set'}} @query={{hash anchor='set'}}>set</LinkTo> methods</li>
23-
<li><LinkTo @route='project-version.classes.class' @model='Ember.Templates.helpers'>Ember.Templates.helpers</LinkTo> - built-in functions that can be used in templates, such as the <LinkTo @route='project-version.classes.class.methods.method' @models={{array 'Ember.Templates.helpers' 'each'}} @query={{hash anchor='each'}}>each</LinkTo>, <LinkTo @route='project-version.classes.class.methods.method' @models={{array 'Ember.Templates.helpers' 'on'}} @query={{hash anchor='on'}}>on</LinkTo> and <LinkTo @route='project-version.classes.class.methods.method' @models={{array 'Ember.Templates.helpers' 'fn'}} @query={{hash anchor='fn'}}>fn</LinkTo> helpers</li>
21+
<li>
22+
<LinkTo @route='project-version.classes.class' @model='EmberArray'>EmberArray</LinkTo> - contains methods like
23+
<a href="/ember/{{@version}}/classes/EmberArray#forEach">forEach</a> and
24+
<a href="/ember/{{@version}}/classes/EmberArray#mapBy">mapBy</a>
25+
that help you iterate over Ember Objects
26+
</li>
27+
<li>
28+
<LinkTo @route='project-version.classes.class' @model='EmberObject'>EmberObject</LinkTo> - the main base class for all Ember objects, including the
29+
<a href="/ember/{{@version}}/classes/EmberObject#get">get</a> and
30+
<a href="/ember/{{@version}}/classes/EmberObject#set">set</a> methods
31+
</li>
32+
<li>
33+
<LinkTo @route='project-version.classes.class' @model='Ember.Templates.helpers'>Ember.Templates.helpers</LinkTo> - built-in functions that can be used in templates, such as the
34+
<a href="/ember/{{@version}}/classes/Ember.Templates.helpers#each">each</a> and
35+
<a href="/ember/{{@version}}/classes/Ember.Templates.helpers#on">on</a> helpers
36+
</li>
2437
<li><LinkTo @route='project-version.classes.class' @model='Helper'>Helpers</LinkTo> - a way to define custom display functions that are used in templates</li>
25-
<li><LinkTo @route='project-version.classes.class' @model='Route'>Route</LinkTo> - used to define individual routes, including the <LinkTo @route='project-version.classes.class.methods.method' @models={{array 'Route' 'model'}} @query={{hash anchor='model'}}>model</LinkTo> hook for loading data</li>
38+
<li>
39+
<LinkTo @route='project-version.classes.class' @model='Route'>Route</LinkTo> - used to define individual routes, including the
40+
<a href="/ember/{{@version}}/classes/Route#model">model</a> hook for loading data
41+
</li>
2642
<li><LinkTo @route='project-version.classes.class' @model='Service'>Service</LinkTo> - an Ember object that lives for the duration of the application, and can be made available in different parts of your application</li>
2743
</ul>
2844
<h2>Useful links</h2>

app/templates/events.hbs renamed to app/components/events.hbs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<EmberAnchor @a={{this.anchor}} />
2-
<ApiIndexFilter @model={{this.model}} @filterData={{this.filterData}} as |filteredModel|>
1+
<ApiIndexFilter @model={{@model}} @filterData={{@filterData}} as |filteredModel|>
32
{{#each filteredModel.events as |event|}}
43
<ClassFieldDescription @type="event" @field={{event}} @model={{this.model}} />
54
{{/each}}

app/components/methods.hbs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<ApiIndexFilter @model={{@model}} @filterData={{@filterData}} as |filteredModel|>
2+
{{#each filteredModel.methods as |method|}}
3+
<ClassFieldDescription @type="method" @field={{method}} @model={{this.model}} />
4+
{{/each}}
5+
</ApiIndexFilter>

app/components/properties.hbs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<ApiIndexFilter @model={{@model}} @filterData={{@filterData}} as |filteredModel|>
2+
{{#each filteredModel.properties as |property|}}
3+
<ClassFieldDescription @type="property" @field={{property}} @model={{this.model}} />
4+
{{/each}}
5+
</ApiIndexFilter>

app/components/search-input.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { inject as service } from '@ember/service';
22
import Component from '@glimmer/component';
33
import { get } from '@ember/object';
44
import { isPresent } from '@ember/utils';
5-
import { task, timeout } from 'ember-concurrency';
5+
import { restartableTask, task, timeout } from 'ember-concurrency';
66
import { action } from '@ember/object';
77
import { tracked } from '@glimmer/tracking';
88

@@ -32,8 +32,8 @@ export default class SearchInput extends Component {
3232
return isPresent(this.query);
3333
}
3434

35-
@task({ restartable: true }) *search(query) {
36-
yield timeout(SEARCH_DEBOUNCE_PERIOD);
35+
search = restartableTask(async (query) => {
36+
await timeout(SEARCH_DEBOUNCE_PERIOD);
3737

3838
this.query = query;
3939

@@ -46,14 +46,14 @@ export default class SearchInput extends Component {
4646
// ensure search results are visible if the menu was previously closed above
4747
this._focused = true;
4848

49-
yield get(this, 'searchService.search').perform(query);
50-
}
49+
await get(this, 'searchService.search').perform(query);
50+
});
5151

52-
@task *closeMenu() {
53-
yield timeout(SEARCH_CLOSE_PERIOD);
52+
closeMenu = task(async () => {
53+
await timeout(SEARCH_CLOSE_PERIOD);
5454

5555
this._focused = false;
56-
}
56+
});
5757

5858
@action onfocus() {
5959
if (this.query.length > 0 && this.searchService.hasStaleResults()) {

app/components/table-of-contents.hbs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<label class='toc-private-toggle'>
2+
<input type='checkbox' checked={{@showPrivateClasses}} onchange={{@togglePrivateClasses}} class='private-deprecated-toggle' />
3+
Show Private / Deprecated packages
4+
</label>
15
<ul class='table-of-contents '>
26
<li class='toc-item toc-group' data-test-toc-title="packages">
37
Packages
@@ -38,7 +42,3 @@
3842
</ul>
3943
</li>
4044
</ul>
41-
<label class='toc-private-toggle'>
42-
<input type='checkbox' checked={{@showPrivateClasses}} onchange={{@togglePrivateClasses}} class='private-deprecated-toggle' />
43-
Show Private / Deprecated
44-
</label>

0 commit comments

Comments
 (0)