|
31 | 31 | <h4 class="title">Find the CVE Numbering Authority (CNA)</h4> |
32 | 32 | <p> |
33 | 33 | Find the CNA partner whose scope includes the product affected by the vulnerability on the |
34 | | - <router-link to="/PartnerInformation/ListofPartners">List of Partners</router-link> |
35 | | - page or in the search box below. |
| 34 | + <router-link to="/PartnerInformation/ListofPartners">List of Partners</router-link> page or in the search box below. |
36 | 35 | </p> |
37 | 36 | <b-field> |
38 | 37 | <b-autocomplete |
@@ -189,34 +188,17 @@ export default { |
189 | 188 | }, |
190 | 189 | computed: { |
191 | 190 | filteredDataObj() { |
192 | | - const normalizedName = this.name.toLowerCase(); |
193 | | - if (!normalizedName.length) |
194 | | - return; |
| 191 | + const results = this.data.filter((option) => ( |
| 192 | + option.organizationName |
| 193 | + .toString() |
| 194 | + .toLowerCase() |
| 195 | + .indexOf(this.name.toLowerCase()) >= 0 |
| 196 | + )); |
195 | 197 |
|
196 | | - let results = this.data.filter((option) => ( |
197 | | - option.organizationName.toLowerCase() |
198 | | - .indexOf(normalizedName) >= 0)); |
199 | | -
|
200 | | - function cmp(cna1, cna2) { |
201 | | - // Sorts the list of organization names based on the characters |
202 | | - // entered by the user in the search box. For example, if the user |
203 | | - // has entered "br", then "Brocade Communications" is listed before |
204 | | - // "Jetbrains" because "br" is closest to the beginning of the |
205 | | - // string in "Brocade Communications". |
206 | | -
|
207 | | - const cna1NormalName = cna1.organizationName.toLowerCase(); |
208 | | - const cna2NormalName = cna2.organizationName.toLowerCase() |
209 | | - const cna1Index = cna1NormalName.indexOf(normalizedName); |
210 | | - const cna2Index = cna2NormalName.indexOf(normalizedName); |
211 | | -
|
212 | | - return cna1Index < cna2Index ? -1 : cna1Index > cna2Index ? 1 : |
213 | | - cna1NormalName.localeCompare(cna2NormalName); |
| 198 | + if (results.length > 10) { |
| 199 | + return results.splice(0, 10); |
214 | 200 | } |
215 | | -
|
216 | | - // Limit the choices presented to the user to the first 10 organizations |
217 | | - // in the list. |
218 | | -
|
219 | | - return results.sort(cmp).slice(0, 10); |
| 201 | + return results; |
220 | 202 | }, |
221 | 203 | }, |
222 | 204 | methods: { |
|
0 commit comments