Skip to content

Fix reverse dependencies page that didn't work after ember upgrade #555

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 5 commits into from
Feb 12, 2017
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
2 changes: 1 addition & 1 deletion app/adapters/dependency.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default ApplicationAdapter.extend({
delete query.reverse;
var { crate } = query;
delete query.crate;
return this.ajax(`${this.urlPrefix()}/crates/${crate.get('id')}/reverse_dependencies`,
return this.ajax(`/${this.urlPrefix()}/crates/${crate.get('id')}/reverse_dependencies`,
'GET', { data: query });
},
});
17 changes: 17 additions & 0 deletions mirage/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import summaryFixture from '../mirage/fixtures/summary';
import searchFixture from '../mirage/fixtures/search';
import categoriesFixture from '../mirage/fixtures/categories';
import crateFixture from '../mirage/fixtures/crate';
import crateVersionsFixture from '../mirage/fixtures/crate_versions';
import crateAuthorsFixture from '../mirage/fixtures/crate_authors';
import crateOwnersFixture from '../mirage/fixtures/crate_owners';
import crateReverseDependenciesFixture from '../mirage/fixtures/crate_reverse_dependencies';
import crateDependenciesFixture from '../mirage/fixtures/crate_dependencies';
import crateDownloadsFixture from '../mirage/fixtures/crate_downloads';
import keywordFixture from '../mirage/fixtures/keyword';

export default function() {
this.get('/summary', () => summaryFixture);
Expand All @@ -16,6 +24,15 @@ export default function() {
});

this.get('/api/v1/categories', () => categoriesFixture);

this.get('/api/v1/crates/nanomsg', () => crateFixture);
this.get('/api/v1/crates/nanomsg/versions', () => crateVersionsFixture);
this.get('/api/v1/crates/nanomsg/:version_num/authors', () => crateAuthorsFixture);
this.get('/api/v1/crates/nanomsg/owners', () => crateOwnersFixture);
this.get('/api/v1/crates/nanomsg/reverse_dependencies', () => crateReverseDependenciesFixture);
this.get('/api/v1/crates/nanomsg/:version_num/dependencies', () => crateDependenciesFixture);
this.get('/api/v1/crates/nanomsg/downloads', () => crateDownloadsFixture);
this.get('/api/v1/keywords/network', () => keywordFixture);
}

function pageParams(request) {
Expand Down
248 changes: 248 additions & 0 deletions mirage/fixtures/crate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
// jscs:disable validateQuoteMarks
export default {
"categories": [],
"crate": {
"badges": [],
"categories": [],
"created_at": "2014-12-08T02:08:06Z",
"description": "A high-level, Rust idiomatic wrapper around nanomsg.",
"documentation": "https://github.com/thehydroimpulse/nanomsg.rs",
"downloads": 3888,
"homepage": "https://github.com/thehydroimpulse/nanomsg.rs",
"id": "nanomsg",
"keywords": [
"network",
],
"license": "MIT",
"links": {
"owners": "/api/v1/crates/nanomsg/owners",
"reverse_dependencies": "/api/v1/crates/nanomsg/reverse_dependencies",
"version_downloads": "/api/v1/crates/nanomsg/downloads",
"versions": null
},
"max_version": "0.6.1",
"name": "nanomsg",
"repository": "https://github.com/thehydroimpulse/nanomsg.rs",
"updated_at": "2016-12-27T08:40:00Z",
"versions": [
40905,
28431,
21273,
18445,
17384,
13574,
9014,
8236,
7190,
4944,
940,
924
]
},
"keywords": [
{
"crates_cnt": 38,
"created_at": "2014-11-23T06:47:40Z",
"id": "network",
"keyword": "network"
}
],
"versions": [
{
"crate": "nanomsg",
"created_at": "2016-12-27T08:40:00Z",
"dl_path": "/api/v1/crates/nanomsg/0.6.1/download",
"downloads": 260,
"features": {
"bundled": [
"nanomsg-sys/bundled"
]
},
"id": 40905,
"links": {
"authors": "/api/v1/crates/nanomsg/0.6.1/authors",
"dependencies": "/api/v1/crates/nanomsg/0.6.1/dependencies",
"version_downloads": "/api/v1/crates/nanomsg/0.6.1/downloads"
},
"num": "0.6.1",
"updated_at": "2016-12-27T08:40:00Z",
"yanked": false
},
{
"crate": "nanomsg",
"created_at": "2016-06-10T20:03:55Z",
"dl_path": "/api/v1/crates/nanomsg/0.6.0/download",
"downloads": 904,
"features": {},
"id": 28431,
"links": {
"authors": "/api/v1/crates/nanomsg/0.6.0/authors",
"dependencies": "/api/v1/crates/nanomsg/0.6.0/dependencies",
"version_downloads": "/api/v1/crates/nanomsg/0.6.0/downloads"
},
"num": "0.6.0",
"updated_at": "2016-06-10T20:03:55Z",
"yanked": false
},
{
"crate": "nanomsg",
"created_at": "2016-01-24T22:07:58Z",
"dl_path": "/api/v1/crates/nanomsg/0.5.0/download",
"downloads": 1217,
"features": {},
"id": 21273,
"links": {
"authors": "/api/v1/crates/nanomsg/0.5.0/authors",
"dependencies": "/api/v1/crates/nanomsg/0.5.0/dependencies",
"version_downloads": "/api/v1/crates/nanomsg/0.5.0/downloads"
},
"num": "0.5.0",
"updated_at": "2016-01-24T22:07:58Z",
"yanked": false
},
{
"crate": "nanomsg",
"created_at": "2015-11-23T12:10:09Z",
"dl_path": "/api/v1/crates/nanomsg/0.4.2/download",
"downloads": 318,
"features": {},
"id": 18445,
"links": {
"authors": "/api/v1/crates/nanomsg/0.4.2/authors",
"dependencies": "/api/v1/crates/nanomsg/0.4.2/dependencies",
"version_downloads": "/api/v1/crates/nanomsg/0.4.2/downloads"
},
"num": "0.4.2",
"updated_at": "2015-12-16T00:01:56Z",
"yanked": false
},
{
"crate": "nanomsg",
"created_at": "2015-10-29T22:13:45Z",
"dl_path": "/api/v1/crates/nanomsg/0.4.1/download",
"downloads": 168,
"features": {},
"id": 17384,
"links": {
"authors": "/api/v1/crates/nanomsg/0.4.1/authors",
"dependencies": "/api/v1/crates/nanomsg/0.4.1/dependencies",
"version_downloads": "/api/v1/crates/nanomsg/0.4.1/downloads"
},
"num": "0.4.1",
"updated_at": "2015-12-11T23:54:29Z",
"yanked": false
},
{
"crate": "nanomsg",
"created_at": "2015-07-23T05:54:44Z",
"dl_path": "/api/v1/crates/nanomsg/0.4.0/download",
"downloads": 311,
"features": {},
"id": 13574,
"links": {
"authors": "/api/v1/crates/nanomsg/0.4.0/authors",
"dependencies": "/api/v1/crates/nanomsg/0.4.0/dependencies",
"version_downloads": "/api/v1/crates/nanomsg/0.4.0/downloads"
},
"num": "0.4.0",
"updated_at": "2015-12-11T23:54:29Z",
"yanked": false
},
{
"crate": "nanomsg",
"created_at": "2015-04-18T20:45:03Z",
"dl_path": "/api/v1/crates/nanomsg/0.3.4/download",
"downloads": 237,
"features": {},
"id": 9014,
"links": {
"authors": "/api/v1/crates/nanomsg/0.3.4/authors",
"dependencies": "/api/v1/crates/nanomsg/0.3.4/dependencies",
"version_downloads": "/api/v1/crates/nanomsg/0.3.4/downloads"
},
"num": "0.3.4",
"updated_at": "2015-12-15T00:03:39Z",
"yanked": false
},
{
"crate": "nanomsg",
"created_at": "2015-04-06T18:57:47Z",
"dl_path": "/api/v1/crates/nanomsg/0.3.3/download",
"downloads": 99,
"features": {},
"id": 8236,
"links": {
"authors": "/api/v1/crates/nanomsg/0.3.3/authors",
"dependencies": "/api/v1/crates/nanomsg/0.3.3/dependencies",
"version_downloads": "/api/v1/crates/nanomsg/0.3.3/downloads"
},
"num": "0.3.3",
"updated_at": "2015-12-11T23:54:29Z",
"yanked": false
},
{
"crate": "nanomsg",
"created_at": "2015-03-26T06:51:10Z",
"dl_path": "/api/v1/crates/nanomsg/0.3.2/download",
"downloads": 98,
"features": {},
"id": 7190,
"links": {
"authors": "/api/v1/crates/nanomsg/0.3.2/authors",
"dependencies": "/api/v1/crates/nanomsg/0.3.2/dependencies",
"version_downloads": "/api/v1/crates/nanomsg/0.3.2/downloads"
},
"num": "0.3.2",
"updated_at": "2015-12-11T23:54:29Z",
"yanked": false
},
{
"crate": "nanomsg",
"created_at": "2015-02-12T20:20:32Z",
"dl_path": "/api/v1/crates/nanomsg/0.3.1/download",
"downloads": 95,
"features": {},
"id": 4944,
"links": {
"authors": "/api/v1/crates/nanomsg/0.3.1/authors",
"dependencies": "/api/v1/crates/nanomsg/0.3.1/dependencies",
"version_downloads": "/api/v1/crates/nanomsg/0.3.1/downloads"
},
"num": "0.3.1",
"updated_at": "2015-12-11T23:54:29Z",
"yanked": false
},
{
"crate": "nanomsg",
"created_at": "2014-12-08T16:21:01Z",
"dl_path": "/api/v1/crates/nanomsg/0.3.0/download",
"downloads": 102,
"features": {},
"id": 940,
"links": {
"authors": "/api/v1/crates/nanomsg/0.3.0/authors",
"dependencies": "/api/v1/crates/nanomsg/0.3.0/dependencies",
"version_downloads": "/api/v1/crates/nanomsg/0.3.0/downloads"
},
"num": "0.3.0",
"updated_at": "2015-12-11T23:54:29Z",
"yanked": false
},
{
"crate": "nanomsg",
"created_at": "2014-12-08T02:08:06Z",
"dl_path": "/api/v1/crates/nanomsg/0.2.0/download",
"downloads": 79,
"features": {},
"id": 924,
"links": {
"authors": "/api/v1/crates/nanomsg/0.2.0/authors",
"dependencies": "/api/v1/crates/nanomsg/0.2.0/dependencies",
"version_downloads": "/api/v1/crates/nanomsg/0.2.0/downloads"
},
"num": "0.2.0",
"updated_at": "2015-12-11T23:54:29Z",
"yanked": false
}
]
};
16 changes: 16 additions & 0 deletions mirage/fixtures/crate_authors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// jscs:disable validateQuoteMarks
export default {
"meta": {
"names": [
"Daniel Fagnan <[email protected]>",
"Jason E. Aten",
"David C. Bishop",
"Dennis Lawler",
"Zachary Tong",
"Dan Burkert",
"Benoît Labaere <[email protected]>",
"Chip Collier"
]
},
"users": []
};
27 changes: 27 additions & 0 deletions mirage/fixtures/crate_dependencies.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// jscs:disable validateQuoteMarks
export default {
"dependencies": [
{
"crate_id": "libc",
"default_features": true,
"features": "",
"id": 146231,
"kind": "normal",
"optional": false,
"req": "^0.2.18",
"target": null,
"version_id": 40905
},
{
"crate_id": "nanomsg-sys",
"default_features": true,
"features": "",
"id": 146232,
"kind": "normal",
"optional": false,
"req": "^0.6.1",
"target": null,
"version_id": 40905
}
]
};
35 changes: 35 additions & 0 deletions mirage/fixtures/crate_downloads.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// jscs:disable validateQuoteMarks
export default {
"meta": {
"extra_downloads": [
{
"date": "2017-02-02",
"downloads": 41
},
{
"date": "2017-02-07",
"downloads": 14
}
]
},
"version_downloads": [
{
"date": "2017-02-10T00:00:00Z",
"downloads": 2,
"id": 3023900,
"version": 40905
},
{
"date": "2017-02-10T00:00:00Z",
"downloads": 1,
"id": 3024236,
"version": 18445
},
{
"date": "2017-02-11T00:00:00Z",
"downloads": 1,
"id": 3027018,
"version": 40905
}
]
};
23 changes: 23 additions & 0 deletions mirage/fixtures/crate_owners.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// jscs:disable validateQuoteMarks
export default {
"users": [
{
"avatar": "https://avatars.githubusercontent.com/u/565790?v=3",
"email": "[email protected]",
"id": 2,
"kind": "user",
"login": "thehydroimpulse",
"name": "Daniel Fagnan",
"url": "https://github.com/thehydroimpulse"
},
{
"avatar": "https://avatars.githubusercontent.com/u/9447137?v=3",
"email": null,
"id": 303,
"kind": "user",
"login": "blabaere",
"name": "Benoît Labaere",
"url": "https://github.com/blabaere"
}
]
};
Loading