Skip to content

Commit e0d46b3

Browse files
authored
Merge pull request #555 from integer32llc/fix-rev-deps
Fix reverse dependencies page that didn't work after ember upgrade
2 parents 51a3f14 + 5f31869 commit e0d46b3

15 files changed

+667
-3
lines changed

app/adapters/dependency.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default ApplicationAdapter.extend({
88
delete query.reverse;
99
var { crate } = query;
1010
delete query.crate;
11-
return this.ajax(`${this.urlPrefix()}/crates/${crate.get('id')}/reverse_dependencies`,
11+
return this.ajax(`/${this.urlPrefix()}/crates/${crate.get('id')}/reverse_dependencies`,
1212
'GET', { data: query });
1313
},
1414
});

mirage/config.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
import summaryFixture from '../mirage/fixtures/summary';
22
import searchFixture from '../mirage/fixtures/search';
33
import categoriesFixture from '../mirage/fixtures/categories';
4+
import crateFixture from '../mirage/fixtures/crate';
5+
import crateVersionsFixture from '../mirage/fixtures/crate_versions';
6+
import crateAuthorsFixture from '../mirage/fixtures/crate_authors';
7+
import crateOwnersFixture from '../mirage/fixtures/crate_owners';
8+
import crateReverseDependenciesFixture from '../mirage/fixtures/crate_reverse_dependencies';
9+
import crateDependenciesFixture from '../mirage/fixtures/crate_dependencies';
10+
import crateDownloadsFixture from '../mirage/fixtures/crate_downloads';
11+
import keywordFixture from '../mirage/fixtures/keyword';
412

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

1826
this.get('/api/v1/categories', () => categoriesFixture);
27+
28+
this.get('/api/v1/crates/nanomsg', () => crateFixture);
29+
this.get('/api/v1/crates/nanomsg/versions', () => crateVersionsFixture);
30+
this.get('/api/v1/crates/nanomsg/:version_num/authors', () => crateAuthorsFixture);
31+
this.get('/api/v1/crates/nanomsg/owners', () => crateOwnersFixture);
32+
this.get('/api/v1/crates/nanomsg/reverse_dependencies', () => crateReverseDependenciesFixture);
33+
this.get('/api/v1/crates/nanomsg/:version_num/dependencies', () => crateDependenciesFixture);
34+
this.get('/api/v1/crates/nanomsg/downloads', () => crateDownloadsFixture);
35+
this.get('/api/v1/keywords/network', () => keywordFixture);
1936
}
2037

2138
function pageParams(request) {

mirage/fixtures/crate.js

Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
1+
// jscs:disable validateQuoteMarks
2+
export default {
3+
"categories": [],
4+
"crate": {
5+
"badges": [],
6+
"categories": [],
7+
"created_at": "2014-12-08T02:08:06Z",
8+
"description": "A high-level, Rust idiomatic wrapper around nanomsg.",
9+
"documentation": "https://github.com/thehydroimpulse/nanomsg.rs",
10+
"downloads": 3888,
11+
"homepage": "https://github.com/thehydroimpulse/nanomsg.rs",
12+
"id": "nanomsg",
13+
"keywords": [
14+
"network",
15+
],
16+
"license": "MIT",
17+
"links": {
18+
"owners": "/api/v1/crates/nanomsg/owners",
19+
"reverse_dependencies": "/api/v1/crates/nanomsg/reverse_dependencies",
20+
"version_downloads": "/api/v1/crates/nanomsg/downloads",
21+
"versions": null
22+
},
23+
"max_version": "0.6.1",
24+
"name": "nanomsg",
25+
"repository": "https://github.com/thehydroimpulse/nanomsg.rs",
26+
"updated_at": "2016-12-27T08:40:00Z",
27+
"versions": [
28+
40905,
29+
28431,
30+
21273,
31+
18445,
32+
17384,
33+
13574,
34+
9014,
35+
8236,
36+
7190,
37+
4944,
38+
940,
39+
924
40+
]
41+
},
42+
"keywords": [
43+
{
44+
"crates_cnt": 38,
45+
"created_at": "2014-11-23T06:47:40Z",
46+
"id": "network",
47+
"keyword": "network"
48+
}
49+
],
50+
"versions": [
51+
{
52+
"crate": "nanomsg",
53+
"created_at": "2016-12-27T08:40:00Z",
54+
"dl_path": "/api/v1/crates/nanomsg/0.6.1/download",
55+
"downloads": 260,
56+
"features": {
57+
"bundled": [
58+
"nanomsg-sys/bundled"
59+
]
60+
},
61+
"id": 40905,
62+
"links": {
63+
"authors": "/api/v1/crates/nanomsg/0.6.1/authors",
64+
"dependencies": "/api/v1/crates/nanomsg/0.6.1/dependencies",
65+
"version_downloads": "/api/v1/crates/nanomsg/0.6.1/downloads"
66+
},
67+
"num": "0.6.1",
68+
"updated_at": "2016-12-27T08:40:00Z",
69+
"yanked": false
70+
},
71+
{
72+
"crate": "nanomsg",
73+
"created_at": "2016-06-10T20:03:55Z",
74+
"dl_path": "/api/v1/crates/nanomsg/0.6.0/download",
75+
"downloads": 904,
76+
"features": {},
77+
"id": 28431,
78+
"links": {
79+
"authors": "/api/v1/crates/nanomsg/0.6.0/authors",
80+
"dependencies": "/api/v1/crates/nanomsg/0.6.0/dependencies",
81+
"version_downloads": "/api/v1/crates/nanomsg/0.6.0/downloads"
82+
},
83+
"num": "0.6.0",
84+
"updated_at": "2016-06-10T20:03:55Z",
85+
"yanked": false
86+
},
87+
{
88+
"crate": "nanomsg",
89+
"created_at": "2016-01-24T22:07:58Z",
90+
"dl_path": "/api/v1/crates/nanomsg/0.5.0/download",
91+
"downloads": 1217,
92+
"features": {},
93+
"id": 21273,
94+
"links": {
95+
"authors": "/api/v1/crates/nanomsg/0.5.0/authors",
96+
"dependencies": "/api/v1/crates/nanomsg/0.5.0/dependencies",
97+
"version_downloads": "/api/v1/crates/nanomsg/0.5.0/downloads"
98+
},
99+
"num": "0.5.0",
100+
"updated_at": "2016-01-24T22:07:58Z",
101+
"yanked": false
102+
},
103+
{
104+
"crate": "nanomsg",
105+
"created_at": "2015-11-23T12:10:09Z",
106+
"dl_path": "/api/v1/crates/nanomsg/0.4.2/download",
107+
"downloads": 318,
108+
"features": {},
109+
"id": 18445,
110+
"links": {
111+
"authors": "/api/v1/crates/nanomsg/0.4.2/authors",
112+
"dependencies": "/api/v1/crates/nanomsg/0.4.2/dependencies",
113+
"version_downloads": "/api/v1/crates/nanomsg/0.4.2/downloads"
114+
},
115+
"num": "0.4.2",
116+
"updated_at": "2015-12-16T00:01:56Z",
117+
"yanked": false
118+
},
119+
{
120+
"crate": "nanomsg",
121+
"created_at": "2015-10-29T22:13:45Z",
122+
"dl_path": "/api/v1/crates/nanomsg/0.4.1/download",
123+
"downloads": 168,
124+
"features": {},
125+
"id": 17384,
126+
"links": {
127+
"authors": "/api/v1/crates/nanomsg/0.4.1/authors",
128+
"dependencies": "/api/v1/crates/nanomsg/0.4.1/dependencies",
129+
"version_downloads": "/api/v1/crates/nanomsg/0.4.1/downloads"
130+
},
131+
"num": "0.4.1",
132+
"updated_at": "2015-12-11T23:54:29Z",
133+
"yanked": false
134+
},
135+
{
136+
"crate": "nanomsg",
137+
"created_at": "2015-07-23T05:54:44Z",
138+
"dl_path": "/api/v1/crates/nanomsg/0.4.0/download",
139+
"downloads": 311,
140+
"features": {},
141+
"id": 13574,
142+
"links": {
143+
"authors": "/api/v1/crates/nanomsg/0.4.0/authors",
144+
"dependencies": "/api/v1/crates/nanomsg/0.4.0/dependencies",
145+
"version_downloads": "/api/v1/crates/nanomsg/0.4.0/downloads"
146+
},
147+
"num": "0.4.0",
148+
"updated_at": "2015-12-11T23:54:29Z",
149+
"yanked": false
150+
},
151+
{
152+
"crate": "nanomsg",
153+
"created_at": "2015-04-18T20:45:03Z",
154+
"dl_path": "/api/v1/crates/nanomsg/0.3.4/download",
155+
"downloads": 237,
156+
"features": {},
157+
"id": 9014,
158+
"links": {
159+
"authors": "/api/v1/crates/nanomsg/0.3.4/authors",
160+
"dependencies": "/api/v1/crates/nanomsg/0.3.4/dependencies",
161+
"version_downloads": "/api/v1/crates/nanomsg/0.3.4/downloads"
162+
},
163+
"num": "0.3.4",
164+
"updated_at": "2015-12-15T00:03:39Z",
165+
"yanked": false
166+
},
167+
{
168+
"crate": "nanomsg",
169+
"created_at": "2015-04-06T18:57:47Z",
170+
"dl_path": "/api/v1/crates/nanomsg/0.3.3/download",
171+
"downloads": 99,
172+
"features": {},
173+
"id": 8236,
174+
"links": {
175+
"authors": "/api/v1/crates/nanomsg/0.3.3/authors",
176+
"dependencies": "/api/v1/crates/nanomsg/0.3.3/dependencies",
177+
"version_downloads": "/api/v1/crates/nanomsg/0.3.3/downloads"
178+
},
179+
"num": "0.3.3",
180+
"updated_at": "2015-12-11T23:54:29Z",
181+
"yanked": false
182+
},
183+
{
184+
"crate": "nanomsg",
185+
"created_at": "2015-03-26T06:51:10Z",
186+
"dl_path": "/api/v1/crates/nanomsg/0.3.2/download",
187+
"downloads": 98,
188+
"features": {},
189+
"id": 7190,
190+
"links": {
191+
"authors": "/api/v1/crates/nanomsg/0.3.2/authors",
192+
"dependencies": "/api/v1/crates/nanomsg/0.3.2/dependencies",
193+
"version_downloads": "/api/v1/crates/nanomsg/0.3.2/downloads"
194+
},
195+
"num": "0.3.2",
196+
"updated_at": "2015-12-11T23:54:29Z",
197+
"yanked": false
198+
},
199+
{
200+
"crate": "nanomsg",
201+
"created_at": "2015-02-12T20:20:32Z",
202+
"dl_path": "/api/v1/crates/nanomsg/0.3.1/download",
203+
"downloads": 95,
204+
"features": {},
205+
"id": 4944,
206+
"links": {
207+
"authors": "/api/v1/crates/nanomsg/0.3.1/authors",
208+
"dependencies": "/api/v1/crates/nanomsg/0.3.1/dependencies",
209+
"version_downloads": "/api/v1/crates/nanomsg/0.3.1/downloads"
210+
},
211+
"num": "0.3.1",
212+
"updated_at": "2015-12-11T23:54:29Z",
213+
"yanked": false
214+
},
215+
{
216+
"crate": "nanomsg",
217+
"created_at": "2014-12-08T16:21:01Z",
218+
"dl_path": "/api/v1/crates/nanomsg/0.3.0/download",
219+
"downloads": 102,
220+
"features": {},
221+
"id": 940,
222+
"links": {
223+
"authors": "/api/v1/crates/nanomsg/0.3.0/authors",
224+
"dependencies": "/api/v1/crates/nanomsg/0.3.0/dependencies",
225+
"version_downloads": "/api/v1/crates/nanomsg/0.3.0/downloads"
226+
},
227+
"num": "0.3.0",
228+
"updated_at": "2015-12-11T23:54:29Z",
229+
"yanked": false
230+
},
231+
{
232+
"crate": "nanomsg",
233+
"created_at": "2014-12-08T02:08:06Z",
234+
"dl_path": "/api/v1/crates/nanomsg/0.2.0/download",
235+
"downloads": 79,
236+
"features": {},
237+
"id": 924,
238+
"links": {
239+
"authors": "/api/v1/crates/nanomsg/0.2.0/authors",
240+
"dependencies": "/api/v1/crates/nanomsg/0.2.0/dependencies",
241+
"version_downloads": "/api/v1/crates/nanomsg/0.2.0/downloads"
242+
},
243+
"num": "0.2.0",
244+
"updated_at": "2015-12-11T23:54:29Z",
245+
"yanked": false
246+
}
247+
]
248+
};

mirage/fixtures/crate_authors.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// jscs:disable validateQuoteMarks
2+
export default {
3+
"meta": {
4+
"names": [
5+
"Daniel Fagnan <[email protected]>",
6+
"Jason E. Aten",
7+
"David C. Bishop",
8+
"Dennis Lawler",
9+
"Zachary Tong",
10+
"Dan Burkert",
11+
"Benoît Labaere <[email protected]>",
12+
"Chip Collier"
13+
]
14+
},
15+
"users": []
16+
};

mirage/fixtures/crate_dependencies.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// jscs:disable validateQuoteMarks
2+
export default {
3+
"dependencies": [
4+
{
5+
"crate_id": "libc",
6+
"default_features": true,
7+
"features": "",
8+
"id": 146231,
9+
"kind": "normal",
10+
"optional": false,
11+
"req": "^0.2.18",
12+
"target": null,
13+
"version_id": 40905
14+
},
15+
{
16+
"crate_id": "nanomsg-sys",
17+
"default_features": true,
18+
"features": "",
19+
"id": 146232,
20+
"kind": "normal",
21+
"optional": false,
22+
"req": "^0.6.1",
23+
"target": null,
24+
"version_id": 40905
25+
}
26+
]
27+
};

mirage/fixtures/crate_downloads.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// jscs:disable validateQuoteMarks
2+
export default {
3+
"meta": {
4+
"extra_downloads": [
5+
{
6+
"date": "2017-02-02",
7+
"downloads": 41
8+
},
9+
{
10+
"date": "2017-02-07",
11+
"downloads": 14
12+
}
13+
]
14+
},
15+
"version_downloads": [
16+
{
17+
"date": "2017-02-10T00:00:00Z",
18+
"downloads": 2,
19+
"id": 3023900,
20+
"version": 40905
21+
},
22+
{
23+
"date": "2017-02-10T00:00:00Z",
24+
"downloads": 1,
25+
"id": 3024236,
26+
"version": 18445
27+
},
28+
{
29+
"date": "2017-02-11T00:00:00Z",
30+
"downloads": 1,
31+
"id": 3027018,
32+
"version": 40905
33+
}
34+
]
35+
};

mirage/fixtures/crate_owners.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// jscs:disable validateQuoteMarks
2+
export default {
3+
"users": [
4+
{
5+
"avatar": "https://avatars.githubusercontent.com/u/565790?v=3",
6+
"email": "[email protected]",
7+
"id": 2,
8+
"kind": "user",
9+
"login": "thehydroimpulse",
10+
"name": "Daniel Fagnan",
11+
"url": "https://github.com/thehydroimpulse"
12+
},
13+
{
14+
"avatar": "https://avatars.githubusercontent.com/u/9447137?v=3",
15+
"email": null,
16+
"id": 303,
17+
"kind": "user",
18+
"login": "blabaere",
19+
"name": "Benoît Labaere",
20+
"url": "https://github.com/blabaere"
21+
}
22+
]
23+
};

0 commit comments

Comments
 (0)