File tree Expand file tree Collapse file tree 3 files changed +64
-19
lines changed
app/components/dependency-list Expand file tree Collapse file tree 3 files changed +64
-19
lines changed Original file line number Diff line number Diff line change 28
28
{{ @dependency.crate_id }}
29
29
</LinkTo >
30
30
31
- < span local-class = " metadata " data-test-metadata>
32
- {{ #if @dependency. optional}}
31
+ {{ #if @dependency.optional }}
32
+ < span local-class = " optional-label " data-test-optional>
33
33
optional
34
- {{ /if }}
35
- </span >
36
- </div >
34
+ </span >
35
+ {{ /if }}
37
36
38
- {{ #if (or (not @dependency.default_features ) @dependency.features )}}
39
- <div local-class =" features" data-test-features>
40
- {{ #if (not @dependency.default_features )}}
41
- default-features=false
42
- {{ /if }}
43
- {{ #if @dependency.features }}
44
- features={{ @dependency.features }}
45
- {{ /if }}
46
- </div >
47
- {{ /if }}
37
+ {{ #if this.featuresDescription }}
38
+ <span local-class =" features-label" data-test-features>
39
+ {{! extra <span> for better tooltip alignment }}
40
+ <span >
41
+ {{ this.featuresDescription }}
42
+
43
+ <EmberTooltip >
44
+ <ul local-class =" feature-list" >
45
+ <li >
46
+ {{ svg-jar (if @dependency.default_features " checkbox" " checkbox-empty" )}} default features
47
+ </li >
48
+ {{ #each @dependency.features as |feature |}}
49
+ <li >
50
+ {{ svg-jar " checkbox" }} {{ feature }}
51
+ </li >
52
+ {{ /each }}
53
+ </ul >
54
+ </EmberTooltip >
55
+ </span >
56
+ </span >
57
+ {{ /if }}
58
+ </div >
48
59
49
60
{{ #if (or this.description this.loadCrateTask.isRunning )}}
50
61
<div local-class =" description" data-test-description>
Original file line number Diff line number Diff line change @@ -26,6 +26,19 @@ export default class VersionRow extends Component {
26
26
return this . loadCrateTask . lastSuccessful ?. value ?. description ;
27
27
}
28
28
29
+ get featuresDescription ( ) {
30
+ let { default_features : defaultFeatures , features } = this . args . dependency ;
31
+ let numFeatures = features . length ;
32
+
33
+ if ( numFeatures !== 0 ) {
34
+ return defaultFeatures
35
+ ? `${ numFeatures } extra feature${ numFeatures > 1 ? 's' : '' } `
36
+ : `only ${ numFeatures } feature${ numFeatures > 1 ? 's' : '' } ` ;
37
+ } else if ( ! defaultFeatures ) {
38
+ return 'no default features' ;
39
+ }
40
+ }
41
+
29
42
@task * loadCrateTask ( ) {
30
43
let { dependency } = this . args ;
31
44
return yield this . store . findRecord ( 'crate' , dependency . crate_id ) ;
Original file line number Diff line number Diff line change 94
94
text-transform : uppercase;
95
95
letter-spacing : .7px ;
96
96
font-size : 13px ;
97
+ margin-right : 15px ;
97
98
98
99
a {
99
100
position : relative;
115
116
text-transform : none;
116
117
letter-spacing : normal;
117
118
}
119
+
120
+ @media only screen and (max-width : 550px ) {
121
+ display : block;
122
+ margin-top : 10px ;
123
+ }
118
124
}
119
125
120
- .features {
121
- margin-top : 10px ;
122
- color : var (--crate-color );
123
- font-size : 80% ;
126
+ .optional-label {
127
+ composes : metadata;
128
+ }
129
+
130
+ .features-label {
131
+ composes : metadata;
132
+ }
133
+
134
+ .feature-list {
135
+ padding : 0 ;
136
+ margin : 10px 5px ;
137
+ list-style : none;
138
+
139
+ svg {
140
+ height : 1em ;
141
+ width : auto;
142
+ margin-right : 2px ;
143
+ margin-bottom : -.1em ;
144
+ }
124
145
}
125
146
126
147
.description {
You can’t perform that action at this time.
0 commit comments