[READ-ONLY] a fast, modern browser for the npm registry
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: remove disabledReason from sort dropdowns to avoid UI issues when not in English (#519)

authored by

Salma Alam-Naylor and committed by
GitHub
485cc9ca f8494ef8

+1 -19
+1 -3
app/components/PackageListToolbar.vue
··· 62 62 return SORT_KEYS.filter(k => !k.searchOnly || k.key === 'relevance').map(k => 63 63 Object.assign({}, k, { 64 64 disabled: k.key !== 'relevance', 65 - disabledReason: k.key !== 'relevance' ? 'Coming soon' : undefined, 66 65 }), 67 66 ) 68 67 } ··· 162 161 :value="keyConfig.key" 163 162 :disabled="keyConfig.disabled" 164 163 > 165 - {{ $t(getSortKeyLabelKey(keyConfig.key)) 166 - }}{{ keyConfig.disabled ? ` (${$t('filters.columns.coming_soon')})` : '' }} 164 + {{ $t(getSortKeyLabelKey(keyConfig.key)) }} 167 165 </option> 168 166 </select> 169 167 <div
-16
shared/types/preferences.ts
··· 29 29 width?: string 30 30 /** Whether the column is disabled (not yet available) */ 31 31 disabled?: boolean 32 - /** Reason for being disabled, shown in UI */ 33 - disabledReason?: string 34 32 } 35 33 36 34 // Default column configuration ··· 55 53 sortable: true, 56 54 width: '100px', 57 55 disabled: true, 58 - disabledReason: 'Coming soon', 59 56 }, 60 57 { 61 58 id: 'popularityScore', ··· 64 61 sortable: true, 65 62 width: '100px', 66 63 disabled: true, 67 - disabledReason: 'Coming soon', 68 64 }, 69 65 { 70 66 id: 'maintenanceScore', ··· 73 69 sortable: true, 74 70 width: '100px', 75 71 disabled: true, 76 - disabledReason: 'Coming soon', 77 72 }, 78 73 { 79 74 id: 'combinedScore', ··· 82 77 sortable: true, 83 78 width: '100px', 84 79 disabled: true, 85 - disabledReason: 'Coming soon', 86 80 }, 87 81 { 88 82 id: 'security', ··· 91 85 sortable: false, 92 86 width: '80px', 93 87 disabled: true, 94 - disabledReason: 'Coming soon', 95 88 }, 96 89 ] 97 90 ··· 143 136 defaultDirection: SortDirection 144 137 /** Whether the sort option is disabled (not yet available) */ 145 138 disabled?: boolean 146 - /** Reason for being disabled, shown in UI */ 147 - disabledReason?: string 148 139 /** Only show this sort option in search context */ 149 140 searchOnly?: boolean 150 141 } ··· 157 148 label: 'Downloads/day', 158 149 defaultDirection: 'desc', 159 150 disabled: true, 160 - disabledReason: 'Coming soon', 161 151 }, 162 152 { 163 153 key: 'downloads-month', 164 154 label: 'Downloads/mo', 165 155 defaultDirection: 'desc', 166 156 disabled: true, 167 - disabledReason: 'Coming soon', 168 157 }, 169 158 { 170 159 key: 'downloads-year', 171 160 label: 'Downloads/yr', 172 161 defaultDirection: 'desc', 173 162 disabled: true, 174 - disabledReason: 'Coming soon', 175 163 }, 176 164 { key: 'updated', label: 'Updated', defaultDirection: 'desc' }, 177 165 { key: 'name', label: 'Name', defaultDirection: 'asc' }, ··· 180 168 label: 'Quality', 181 169 defaultDirection: 'desc', 182 170 disabled: true, 183 - disabledReason: 'Coming soon', 184 171 }, 185 172 { 186 173 key: 'popularity', 187 174 label: 'Popularity', 188 175 defaultDirection: 'desc', 189 176 disabled: true, 190 - disabledReason: 'Coming soon', 191 177 }, 192 178 { 193 179 key: 'maintenance', 194 180 label: 'Maintenance', 195 181 defaultDirection: 'desc', 196 182 disabled: true, 197 - disabledReason: 'Coming soon', 198 183 }, 199 184 { 200 185 key: 'score', 201 186 label: 'Score', 202 187 defaultDirection: 'desc', 203 188 disabled: true, 204 - disabledReason: 'Coming soon', 205 189 }, 206 190 ] 207 191