Skip to content

Commit

Permalink
Revert "Resolves #2922 - create CNA search box for non-CNA reporting/…
Browse files Browse the repository at this point in the history
…requests (dev)" (#3367)
  • Loading branch information
jdaigneau5 authored Dec 17, 2024
1 parent b7aded5 commit dd3ccf3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 49 deletions.
17 changes: 0 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"@fortawesome/free-solid-svg-icons": "^6.5.1",
"@fortawesome/vue-fontawesome": "^3.0.5",
"axios": "^1.6.5",
"buefy": "npm:@ntohq/buefy-next@^0.1.4",
"bulma": "^0.9.4",
"bulma-timeline": "^3.0.5",
"lodash": "^4.17.21",
Expand Down
3 changes: 0 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@

import { createApp } from 'vue';
import Buefy from 'buefy';
import 'buefy/dist/buefy.css';
import { createPinia } from 'pinia';
import VueGtag from 'vue-gtag';
import LoadScript from 'vue-plugin-load-script';
Expand Down Expand Up @@ -33,7 +31,6 @@ library.add(


const app = createApp(App);
app.use(Buefy);
const pinia = createPinia();
pinia.use(({ store }) => {
store.router = router;
Expand Down
38 changes: 10 additions & 28 deletions src/views/ReportRequest/ReportRequestForNonCNAs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
<h4 class="title">Find the CVE Numbering Authority (CNA)</h4>
<p>
Find the CNA partner whose scope includes the product affected by the vulnerability on the
<router-link to="/PartnerInformation/ListofPartners">List of Partners</router-link>
page or in the search box below.
<router-link to="/PartnerInformation/ListofPartners">List of Partners</router-link> page or in the search box below.
</p>
<b-field>
<b-autocomplete
Expand Down Expand Up @@ -189,34 +188,17 @@ export default {
},
computed: {
filteredDataObj() {
const normalizedName = this.name.toLowerCase();
if (!normalizedName.length)
return;
const results = this.data.filter((option) => (
option.organizationName
.toString()
.toLowerCase()
.indexOf(this.name.toLowerCase()) >= 0
));
let results = this.data.filter((option) => (
option.organizationName.toLowerCase()
.indexOf(normalizedName) >= 0));
function cmp(cna1, cna2) {
// Sorts the list of organization names based on the characters
// entered by the user in the search box. For example, if the user
// has entered "br", then "Brocade Communications" is listed before
// "Jetbrains" because "br" is closest to the beginning of the
// string in "Brocade Communications".
const cna1NormalName = cna1.organizationName.toLowerCase();
const cna2NormalName = cna2.organizationName.toLowerCase()
const cna1Index = cna1NormalName.indexOf(normalizedName);
const cna2Index = cna2NormalName.indexOf(normalizedName);
return cna1Index < cna2Index ? -1 : cna1Index > cna2Index ? 1 :
cna1NormalName.localeCompare(cna2NormalName);
if (results.length > 10) {
return results.splice(0, 10);
}
// Limit the choices presented to the user to the first 10 organizations
// in the list.
return results.sort(cmp).slice(0, 10);
return results;
},
},
methods: {
Expand Down

0 comments on commit dd3ccf3

Please sign in to comment.