Skip to content

Commit 63209b6

Browse files
authored
VersionList::Row: Limit the length of the features list (#10755)
1 parent 358100b commit 63209b6

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

app/components/version-list/row.hbs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,17 @@
9898

9999
<Tooltip local-class="tooltip">
100100
<ul local-class="feature-list">
101-
{{#each @version.featureList as |feature|}}
101+
{{#each this.features.list as |feature|}}
102102
<li>
103103
{{svg-jar (if feature.isDefault "checkbox" "checkbox-empty")}}
104104
{{feature.name}}
105105
</li>
106106
{{/each}}
107+
{{#if this.features.more}}
108+
<li local-class="other-features">
109+
and {{this.features.more}} other features
110+
</li>
111+
{{/if}}
107112
</ul>
108113
</Tooltip>
109114
</span>

app/components/version-list/row.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ export default class VersionRow extends Component {
4949
return this.args.version.crate.hasOwnerUser(userId);
5050
}
5151

52+
get features() {
53+
let features = this.args.version.featureList;
54+
let list = features.slice(0, 15);
55+
let more = features.length - list.length;
56+
return { list, more };
57+
}
58+
5259
@action setFocused(value) {
5360
this.focused = value;
5461
}

app/components/version-list/row.module.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@
230230
}
231231
}
232232

233+
.other-features {
234+
font-style: italic;
235+
margin-top: var(--space-2xs);
236+
}
237+
233238
.yank-button {
234239
position: relative;
235240
margin-left: var(--space-xs);

0 commit comments

Comments
 (0)