Skip to content

Commit be0ef19

Browse files
DanaKirshjenweber
authored andcommitted
Create Ember Data landing page (#638)
1 parent 69d4c38 commit be0ef19

File tree

3 files changed

+60
-13
lines changed

3 files changed

+60
-13
lines changed

app/routes/project-version.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,11 @@ export default Route.extend({
5050
// if there is no class, module, or namespace specified...
5151
let latestVersion = getLastVersion(model.get('project.content').hasMany('projectVersions').ids());
5252
let isLatestVersion = transitionVersion === latestVersion || transitionVersion === 'release';
53+
let isEmberProject = model.get('project.id') === 'ember';
5354
let shouldConvertPackages = semverCompare(model.get('version'), '2.16') < 0;
54-
if (!shouldConvertPackages || isLatestVersion) {
55-
// ... and the transition version is the latest release,
56-
// display the landing page at
55+
if ((!shouldConvertPackages || isLatestVersion) && isEmberProject) {
56+
// ... and the transition version is the latest release, and the selected docs are
57+
// ember (not Ember Data), then display the landing page at
5758
return this.transitionTo('project-version.index');
5859
} else {
5960
// else go to the version specified

app/templates/ember-data.hbs

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<article class="chapter">
2+
<h1>
3+
Ember Data API Documentation
4+
</h1>
5+
<p>
6+
Ember Data is a library for robustly managing data in applications built with Ember.js.
7+
</p>
8+
<h2>
9+
Commonly searched-for documentation
10+
</h2>
11+
<ul class="spec-method-list">
12+
<li>
13+
{{#link-to "project-version.classes.class" "Model"}}
14+
Model
15+
{{/link-to}}
16+
- an object that represents the underlying data that your application presents to the user.
17+
</li>
18+
<li>
19+
{{#link-to "project-version.classes.class" "Store"}}
20+
Store
21+
{{/link-to}}
22+
- a service that contains all of the data for records loaded from the server.
23+
</li>
24+
<li>
25+
{{#link-to "project-version.classes.class" "Adapter"}}
26+
Adapter
27+
{{/link-to}}
28+
- determines how data is persisted to a backend data store.
29+
</li>
30+
<li>
31+
{{#link-to "project-version.classes.class" "Serializer"}}
32+
Serializer
33+
{{/link-to}}
34+
- format the data sent to and received from the backend store.
35+
</li>
36+
</ul>
37+
<h2>
38+
Useful links
39+
</h2>
40+
<ul>
41+
<li>
42+
<h5>
43+
<a href="https://github.com/ember-learn/ember-api-docs">
44+
API Documentation Github Repository
45+
</a>
46+
</h5>
47+
</li>
48+
<li>
49+
<h5>
50+
<a href="https://guides.emberjs.com/release/models/">
51+
Introduction to Ember Data
52+
</a>
53+
</h5>
54+
</li>
55+
</ul>
56+
</article>

tests/acceptance/redirects-test.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,6 @@ module('Acceptance | redirects', function(hooks) {
1515
assert.dom('h1').hasText('Ember API Documentation');
1616
});
1717

18-
test('visiting /ember-data', async function (assert) {
19-
await visit('/ember-data');
20-
assert.equal(
21-
currentURL(),
22-
`/ember-data/release`,
23-
'routes to the landing page'
24-
);
25-
assert.dom('h1').hasText('Ember API Documentation');
26-
});
27-
2818
test('visiting pre-2.16 version', async function(assert) {
2919
await visit('/ember/1.0');
3020

0 commit comments

Comments
 (0)