Skip to content

fix broken ember data index page #635 #637

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 2 commits into from
Sep 16, 2019
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
7 changes: 3 additions & 4 deletions app/routes/project-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ export default Route.extend({
// if there is no class, module, or namespace specified...
let latestVersion = getLastVersion(model.get('project.projectVersions'));
let isLatestVersion = transitionVersion === latestVersion || transitionVersion === 'release';
let isEmberProject = model.get('project.id') === 'ember';
let shouldConvertPackages = semverCompare(model.get('version'), '2.16') < 0;
if ((!shouldConvertPackages || isLatestVersion) && isEmberProject) {
// ... and the transition version is the latest release, and the selected docs are
// ember (not Ember Data), then show the landing page
if (!shouldConvertPackages || isLatestVersion) {
// ... and the transition version is the latest release,
// display the landing page at
return this.transitionTo('project-version.index');
} else {
// else go to the version specified
Expand Down
2 changes: 1 addition & 1 deletion app/templates/project-version/index.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<article class="chapter">
<h1>Ember.js API Documentation</h1>
<h1>Ember API Documentation</h1>
<p>
To get started, choose a project (Ember or Ember Data) and a version
from the dropdown menu. Ember has core methods used in any app, while Ember Data has
Expand Down
8 changes: 4 additions & 4 deletions tests/acceptance/redirects-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ module('Acceptance | redirects', function(hooks) {
`/ember/release`,
'routes to the latest version of the project'
);
assert.dom('h1').hasText('Ember.js API Documentation');
assert.dom('h1').hasText('Ember API Documentation');
});

test('visiting /ember-data', async function (assert) {
await visit('/ember-data');
assert.equal(
currentURL(),
`/ember-data/release/modules/ember-data`,
'routes to the first page of ember data'
`/ember-data/release`,
'routes to the landing page'
);
assert.dom('h1').hasText('Package ember-data');
assert.dom('h1').hasText('Ember API Documentation');
});

test('visiting pre-2.16 version', async function(assert) {
Expand Down