File tree 4 files changed +72
-7
lines changed
4 files changed +72
-7
lines changed Original file line number Diff line number Diff line change @@ -70,9 +70,19 @@ export default Controller.extend({
70
70
}
71
71
72
72
return PromiseArray . create ( {
73
- promise : deps . then ( deps => {
74
- return deps . filter ( dep => dep . get ( 'kind' ) !== 'dev' ) . uniqBy ( 'crate_id' ) ;
75
- } ) ,
73
+ promise : deps . then ( deps => deps . filterBy ( 'kind' , 'normal' ) . uniqBy ( 'crate_id' ) ) ,
74
+ } ) ;
75
+ } ) ,
76
+
77
+ currentBuildDependencies : computed ( 'currentVersion.dependencies' , function ( ) {
78
+ let deps = this . get ( 'currentVersion.dependencies' ) ;
79
+
80
+ if ( deps === null ) {
81
+ return [ ] ;
82
+ }
83
+
84
+ return PromiseArray . create ( {
85
+ promise : deps . then ( deps => deps . filterBy ( 'kind' , 'build' ) . uniqBy ( 'crate_id' ) ) ,
76
86
} ) ;
77
87
} ) ,
78
88
@@ -82,9 +92,7 @@ export default Controller.extend({
82
92
return [ ] ;
83
93
}
84
94
return PromiseArray . create ( {
85
- promise : deps . then ( deps => {
86
- return deps . filterBy ( 'kind' , 'dev' ) ;
87
- } ) ,
95
+ promise : deps . then ( deps => deps . filterBy ( 'kind' , 'dev' ) . uniqBy ( 'crate_id' ) ) ,
88
96
} ) ;
89
97
} ) ,
90
98
Original file line number Diff line number Diff line change 217
217
</ul >
218
218
</div >
219
219
220
+ {{ #if currentBuildDependencies }}
221
+ <div class =' section' id =' crate-build-dependencies' >
222
+ <h3 >Build-Dependencies</h3 >
223
+ <ul >
224
+ {{ #each currentBuildDependencies as |dep |}}
225
+ {{ link-to-dep tagName =" li" dep =dep }}
226
+ {{ /each }}
227
+ </ul >
228
+ </div >
229
+ {{ /if }}
230
+
220
231
{{ #if currentDevDependencies }}
221
232
<div class =' section' id =' crate-dev-dependencies' >
222
233
<h3 >Dev-Dependencies</h3 >
Original file line number Diff line number Diff line change @@ -26,11 +26,33 @@ export default [
26
26
crate_id : 'nanomsg' ,
27
27
default_features : true ,
28
28
features : '' ,
29
- id : 90880 ,
29
+ id : 146233 ,
30
30
kind : 'normal' ,
31
31
optional : false ,
32
32
req : '^0.5.0' ,
33
33
target : null ,
34
34
version_id : 28674 ,
35
35
} ,
36
+ {
37
+ crate_id : 'mock-build-deps' ,
38
+ default_features : true ,
39
+ features : '' ,
40
+ id : 146234 ,
41
+ kind : 'build' ,
42
+ optional : false ,
43
+ req : '^0.6.1' ,
44
+ target : null ,
45
+ version_id : 40905 ,
46
+ } ,
47
+ {
48
+ crate_id : 'mock-dev-deps' ,
49
+ default_features : true ,
50
+ features : '' ,
51
+ id : 146235 ,
52
+ kind : 'dev' ,
53
+ optional : true ,
54
+ req : '^0.6.1' ,
55
+ target : null ,
56
+ version_id : 40905 ,
57
+ } ,
36
58
] ;
Original file line number Diff line number Diff line change @@ -154,6 +154,30 @@ module('Acceptance | crate page', function(hooks) {
154
154
assert . dom ( '[data-test-heading] [data-test-team-name]' ) . hasText ( 'thehydroimpulseteam' ) ;
155
155
} ) ;
156
156
157
+ test ( 'crates having normal dependencies' , async function ( assert ) {
158
+ this . server . loadFixtures ( ) ;
159
+
160
+ await visit ( 'crates/nanomsg' ) ;
161
+
162
+ assert . dom ( '#crate-dependencies li' ) . exists ( { count : 2 } ) ;
163
+ } ) ;
164
+
165
+ test ( 'crates having build dependencies' , async function ( assert ) {
166
+ this . server . loadFixtures ( ) ;
167
+
168
+ await visit ( 'crates/nanomsg' ) ;
169
+
170
+ assert . dom ( '#crate-build-dependencies li' ) . exists ( { count : 1 } ) ;
171
+ } ) ;
172
+
173
+ test ( 'crates having dev dependencies' , async function ( assert ) {
174
+ this . server . loadFixtures ( ) ;
175
+
176
+ await visit ( 'crates/nanomsg' ) ;
177
+
178
+ assert . dom ( '#crate-dev-dependencies li' ) . exists ( { count : 1 } ) ;
179
+ } ) ;
180
+
157
181
test ( 'crates having user-owners' , async function ( assert ) {
158
182
this . server . loadFixtures ( ) ;
159
183
You can’t perform that action at this time.
0 commit comments