Skip to content

Commit b3a4531

Browse files
authored
Merge branch 'master' into jw-cm-fix-link
2 parents 711b0c3 + b03cc74 commit b3a4531

File tree

11 files changed

+130
-128
lines changed

11 files changed

+130
-128
lines changed

app/components/import-example.hbs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<div class='highlight javascript'>
2+
<div class='ribbon'></div>
3+
{{#if (is-clipboard-supported)}}
4+
<div class='import-copy'>
5+
{{#if this.showClipboardSuccessIcon}}
6+
{{svg-jar 'success' width='24px' height='24px'}}
7+
{{else}}
8+
<CopyButton @clipboardText={{concat 'import ' @item " from '" @package "';"}} @title='Copy to clipboard' @success={{this.showSuccess}}>
9+
{{svg-jar 'copy' width='24px' height='24px'}}
10+
</CopyButton>
11+
{{/if}}
12+
</div>
13+
{{/if}}
14+
<table class='CodeRay'>
15+
<tbody>
16+
<tr>
17+
<td class='code'><pre><span class='wrapper'><span class='keyword'>import</span> {{@item}} <span class='keyword'>from</span> <span class='string'>'{{@package}}'</span>;</span></pre></td>
18+
</tr>
19+
</tbody>
20+
</table>
21+
</div>

app/components/import-example.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
/* eslint-disable ember/classic-decorator-no-classic-methods */
21
import { action } from '@ember/object';
3-
import Component from '@ember/component';
2+
import Component from '@glimmer/component';
43
import { later } from '@ember/runloop';
4+
import { tracked } from '@glimmer/tracking';
55

66
export default class ImportExample extends Component {
7+
@tracked showClipboardSuccessIcon = false;
8+
79
@action
810
showSuccess() {
9-
this.toggleProperty('showClipboardSuccessIcon');
10-
later(this, () => this.toggleProperty('showClipboardSuccessIcon'), 950);
11+
this.showClipboardSuccessIcon = true;
12+
later(this, () => (this.showClipboardSuccessIcon = false), 950);
1113
}
1214
}

app/components/table-of-contents.hbs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<ol class='toc-level-0'>
2+
<li class='toc-level-0'>
3+
<a {{action 'toggle' 'modules'}} href='#' data-test-toc-title='packages'>Packages</a>
4+
<ol class='toc-level-1 modules selected'>
5+
{{#each @moduleIDs as |moduleID|}}
6+
7+
{{#if (not-eq moduleID '@ember/object/computed')}}
8+
<li class='toc-level-1' data-test-module={{moduleID}}>
9+
<LinkTo @route='project-version.modules.module' @models={{array @version moduleID}}>{{moduleID}}</LinkTo>
10+
</li>
11+
{{/if}}
12+
13+
{{/each}}
14+
</ol>
15+
</li>
16+
17+
{{#if @isShowingNamespaces}}
18+
<li class='toc-level-0'>
19+
<a {{action 'toggle' 'namespaces'}} href='#' data-test-toc-title='namespaces'>Namespaces</a>
20+
<ol class='toc-level-1 namespaces selected'>
21+
{{#each @namespaceIDs as |namespaceID|}}
22+
<li class='toc-level-1' data-test-namespace={{namespaceID}}>
23+
<LinkTo @route='project-version.namespaces.namespace' @models={{array @version namespaceID}}>{{namespaceID}}</LinkTo>
24+
</li>
25+
{{/each}}
26+
</ol>
27+
</li>
28+
{{/if}}
29+
30+
<li class='toc-level-0'>
31+
<a {{action 'toggle' 'classes'}} href='#' data-test-toc-title='classes'>Classes</a>
32+
<ol class='toc-level-1 classes selected'>
33+
{{#each @classesIDs as |classID|}}
34+
<li class='toc-level-1' data-test-class={{classID}}>
35+
<LinkTo @route='project-version.classes.class' @models={{array @version classID}}>{{classID}}</LinkTo>
36+
</li>
37+
{{/each}}
38+
</ol>
39+
</li>
40+
</ol>
41+
<label class='toc-private-toggle'>
42+
<Input @type='checkbox' @checked={{@showPrivateClasses}} class='private-deprecated-toggle' />
43+
Show Private / Deprecated
44+
</label>

app/components/table-of-contents.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { action } from '@ember/object';
2-
import Component from '@ember/component';
2+
import Component from '@glimmer/component';
33

44
export default class TableOfContents extends Component {
55
@action

app/templates/components/import-example.hbs

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

app/templates/components/table-of-contents.hbs

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

app/templates/project-version.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</PowerSelect>
2929
</div>
3030

31-
<TableOfContents @projectId={{this.model.project.id}} @version={{this.urlVersion}} @classesIDs={{this.shownClassesIDs}} @moduleIDs={{this.shownModuleIDs}} @namespaceIDs={{this.shownNamespaceIDs}} @showPrivateClasses={{this.showPrivateClasses}} @isShowingNamespaces={{version-lt this.selectedProjectVersion.compactVersion "2.16"}} />
31+
<TableOfContents @version={{this.urlVersion}} @classesIDs={{this.shownClassesIDs}} @moduleIDs={{this.shownModuleIDs}} @namespaceIDs={{this.shownNamespaceIDs}} @showPrivateClasses={{this.showPrivateClasses}} @isShowingNamespaces={{version-lt this.selectedProjectVersion.compactVersion "2.16"}} />
3232
</aside>
3333
<section class="content">
3434
{{outlet}}

tests/acceptance/convert-legacy-url-to-current-test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,12 @@ module('Acceptance | convert legacy url to current', function (hooks) {
2828
assert.equal(currentURL(), '/ember/release/modules/@ember%2Fapplication');
2929
});
3030

31-
test('should convert url for legacy ember data module to index', async function (assert) {
31+
test('should convert url for legacy ember data module to overview', async function (assert) {
3232
await visit('/data/modules/ember-data.html');
33-
assert.equal(currentURL(), '/ember-data/release');
33+
assert.equal(
34+
currentURL(),
35+
'/ember-data/release/modules/ember-data-overview'
36+
);
3437
});
3538

3639
test('should convert unknown legacy modules url to landing page', async function (assert) {

tests/integration/components/import-example-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ module('Integration | Component | import example', function (hooks) {
88

99
test('it renders a class import example', async function (assert) {
1010
await render(
11-
hbs`{{import-example item='Application' package='@ember/application'}}`
11+
hbs`<ImportExample @item='Application' @package='@ember/application'/>`
1212
);
1313
assert.dom('*').hasText("import Application from '@ember/application';");
1414
});
1515

1616
test('it renders a function import example', async function (assert) {
1717
await render(
18-
hbs`{{import-example item='{ uniqBy }' package='@ember/object/computed'}}`
18+
hbs`<ImportExample @item='{ uniqBy }' @package='@ember/object/computed'/>`
1919
);
2020
assert.dom('*').hasText("import { uniqBy } from '@ember/object/computed';");
2121
});

tests/integration/components/table-of-contents-test.js

Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,16 @@ module('Integration | Component | table of contents', function (hooks) {
1212

1313
test('it renders', async function (assert) {
1414
// Set any properties with this.set('myProperty', 'value');
15-
this.set('projectId', 'Ember');
1615
this.set('emberVersion', '2.4.3');
1716
this.set('classesIDs', CLASSES);
1817

1918
await render(hbs`
20-
{{
21-
table-of-contents showPrivateClasses=true
22-
projectid=projectId
23-
version=emberVersion
24-
classesIDs=classesIDs
25-
isShowingNamespaces=true
26-
}}
19+
<TableOfContents
20+
@showPrivateClasses={{true}}
21+
@version={{this.emberVersion}}
22+
@classesIDs={{this.classesIDs}}
23+
@isShowingNamespaces={{true}}
24+
/>
2725
`);
2826

2927
const contentTitle = document.querySelector(
@@ -41,18 +39,16 @@ module('Integration | Component | table of contents', function (hooks) {
4139

4240
test('Starts with underlying content visible', async function (assert) {
4341
// Set any properties with this.set('myProperty', 'value');
44-
this.set('projectId', 'Ember');
4542
this.set('emberVersion', '2.4.3');
4643
this.set('moduleIDs', MODULES);
4744

4845
await render(hbs`
49-
{{
50-
table-of-contents showPrivateClasses=true
51-
projectid=projectId
52-
version=emberVersion
53-
moduleIDs=moduleIDs
54-
isShowingNamespaces=true
55-
}}
46+
<TableOfContents
47+
@showPrivateClasses={{true}}
48+
@version={{this.emberVersion}}
49+
@moduleIDs={{this.moduleIDs}}
50+
@isShowingNamespaces={{true}}
51+
/>
5652
`);
5753

5854
const contentReference = '.toc-level-1';
@@ -73,18 +69,16 @@ module('Integration | Component | table of contents', function (hooks) {
7369

7470
test('Underlying content hides once clicked', async function (assert) {
7571
// Set any properties with this.set('myProperty', 'value');
76-
this.set('projectId', 'Ember');
7772
this.set('emberVersion', '2.4.3');
7873
this.set('moduleIDs', MODULES);
7974

8075
await render(hbs`
81-
{{
82-
table-of-contents showPrivateClasses=true
83-
projectid=projectId
84-
version=emberVersion
85-
moduleIDs=moduleIDs
86-
isShowingNamespaces=true
87-
}}
76+
<TableOfContents
77+
@showPrivateClasses={{true}}
78+
@version={{this.emberVersion}}
79+
@moduleIDs={{this.moduleIDs}}
80+
@isShowingNamespaces={{true}}
81+
/>
8882
`);
8983

9084
const contentTitle = document.querySelector(
@@ -109,18 +103,16 @@ module('Integration | Component | table of contents', function (hooks) {
109103

110104
test('Underlying content should be visible after 2 clicks', async function (assert) {
111105
// Set any properties with this.set('myProperty', 'value');
112-
this.set('projectId', 'Ember');
113106
this.set('emberVersion', '2.4.3');
114107
this.set('moduleIDs', MODULES);
115108

116109
await render(hbs`
117-
{{
118-
table-of-contents showPrivateClasses=true
119-
projectid=projectId
120-
version=emberVersion
121-
moduleIDs=moduleIDs
122-
isShowingNamespaces=true
123-
}}
110+
<TableOfContents
111+
@showPrivateClasses={{true}}
112+
@version={{this.emberVersion}}
113+
@moduleIDs={{this.moduleIDs}}
114+
@isShowingNamespaces={{true}}
115+
/>
124116
`);
125117

126118
const titleButton = document.querySelector(

0 commit comments

Comments
 (0)