Skip to content

Commit 74ac0c6

Browse files
authored
Merge pull request #3185 from CVEProject/search-test
update test with search-test
2 parents fcd4a0d + be75e5a commit 74ac0c6

35 files changed

Lines changed: 1417 additions & 708 deletions

.github/workflows/web-issue-triage.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/App.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import PrimaryNavigation from './components/PrimaryNavigation.vue';
1919
import NotificationBannerModule from './components/NotificationBannerModule.vue';
2020
import FoooterModule from './components/FooterModule.vue';
2121
import NotFound from './views/NotFound.vue';
22+
import { usePartnerStore } from '@/stores/partners';
2223
2324
export default {
2425
components: {
@@ -31,6 +32,9 @@ export default {
3132
return {
3233
NavigationItems
3334
}
35+
},
36+
beforeMount() {
37+
usePartnerStore().populatePartnerShortLongNameMap();
3438
}
3539
}
3640
</script>

src/assets/data/faqs.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@
271271
"questionId": "search_cve",
272272
"questionText": "How do I search the CVE List",
273273
"questionResponseParagraphs": [
274-
"<strong>Keyword(s) Search of All CVE Records</strong>",
275-
"<ul><li>Search by keyword(s) across <a href='https://github.com/CVEProject/cvelistV5' target='_blank'>ALL FIELDS of all CVE Records</a> in the cvelistV5 downloads repository using the main search box on GitHub.com.</li><li>Search by keyword(s) in the <a href='https://cve.mitre.org/cve/search_cve_list.html' target='_blank'>Description fields ONLY of all CVE Records</a> using the legacy search page on cve.mitre.org.</li></ul>"
274+
"<b><i>Search Tips<i></b>",
275+
"<ul><li>By CVE ID<ul><li>Must include only one CVE ID per search.</li><li>CVE ID must include all letters, numbers, and hyphens associated with the CVE ID, e.g., CVE-2024-12345678.</li><li>“CVE” may be entered as “cve”, “CVE”, or as a combination of uppercase and lowercase, as casing is ignored during search.</li></ul></li><li>By other keyword(s)<ul><li>Must contain only alphanumeric characters, e.g., letters or numbers.</li><li>May contain one or more keywords, separated by a space.</li><li>Keywords may be entered in lowercase, uppercase, or a combination of both. Casing is ignored during search, e.g., Vulnerabilities, vulnerabilities, VULNERABILITIES.</li></ul></li></ul>"
276276
]
277277
},
278278
{

src/components/AdpVulnerabilityEnrichment.vue

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55
<slot></slot>
66
<button class="button message-header-button"
77
:style="{'background-color': '#162e51 !important', 'color': 'white !important'}"
8-
:aria-expanded="useCveRecordLookupStore.accordionState[organizationId] ? 'true' : 'false'"
8+
:aria-expanded="usecveRecordStore.accordionState[organizationId] ? 'true' : 'false'"
99
:aria-controls="`${organizationId}-panel`"
1010
>
1111
<span class="icon is-small">
1212
<p :id="`expandCollapseAltText-${organizationId}`" class="is-hidden">
13-
{{useCveRecordLookupStore.accordionState[organizationId] ? 'expand' : 'collapse'}}
13+
{{usecveRecordStore.accordionState[organizationId] ? 'expand' : 'collapse'}}
1414
</p>
15-
<font-awesome-icon :icon="useCveRecordLookupStore.accordionState[organizationId] ? 'minus' : 'plus'"
15+
<font-awesome-icon :icon="usecveRecordStore.accordionState[organizationId] ? 'minus' : 'plus'"
1616
aria-hidden="false" focusable="true" :aria-labelledby="`expandCollapseAltText-${organizationId}`"
1717
/>
1818
</span>
1919
</button>
2020
</button>
2121
<!-- Panel content is conditionally determined by role -->
22-
<div :id="`${organizationId}-panel`" v-if="useCveRecordLookupStore.accordionState[organizationId]"
22+
<div :id="`${organizationId}-panel`" v-if="usecveRecordStore.accordionState[organizationId]"
2323
class="pl-3 pr-3 pt-2 pb-5 cve-container-accordion-panel"
2424
>
2525
<div>
@@ -210,7 +210,8 @@
210210
</template>
211211

212212
<script>
213-
import { useCveRecordLookupStore } from '@/stores/cveRecordLookup.ts';
213+
import { usecveRecordStore } from '@/stores/cveRecord.ts';
214+
import { useGenericGlobalsStore } from '@/stores/genericGlobals';
214215
import ProductStatus from '@/components/ProductStatus.vue';
215216
import CveRecordReferences from './CveRecordReferences.vue';
216217
@@ -255,13 +256,13 @@ export default {
255256
//to do
256257
adpShortName: this.containerObject.providerMetadata.shortName,
257258
dateUpdated: '',
258-
cveServicesBaseUrl: import.meta.env.VITE_CVE_SERVICES_BASE_URL,
259-
useCveRecordLookupStore: useCveRecordLookupStore(),
259+
cveServicesBaseUrl: useGenericGlobalsStore().currentServicesUrl,
260+
usecveRecordStore: usecveRecordStore(),
260261
}
261262
},
262263
methods: {
263264
togglePanel(){
264-
useCveRecordLookupStore().accordionState[this.organizationId] = !useCveRecordLookupStore().accordionState[this.organizationId];
265+
usecveRecordStore().accordionState[this.organizationId] = !usecveRecordStore().accordionState[this.organizationId];
265266
},
266267
hasEnrichmentData(){
267268
if (this.cwes.length > 0 || this.cvsss.length > 0 || this.kevs.length > 0 || this.ssvcs.length > 0) {
@@ -406,8 +407,8 @@ export default {
406407
}
407408
},
408409
getCveProgramReferences(){
409-
if (this.containerObject.providerMetadata.shortName.toLowerCase() !== useCveRecordLookupStore().cveProgramShortName) return;
410-
this.cveProgramReferences = useCveRecordLookupStore().getReferences(this.containerObject.references);
410+
if (this.containerObject.providerMetadata.shortName.toLowerCase() !== usecveRecordStore().cveProgramShortName) return;
411+
this.cveProgramReferences = usecveRecordStore().getReferences(this.containerObject.references);
411412
},
412413
getUpdatedDate() {
413414
this.dateUpdated = this.getDate(this.containerObject.providerMetadata.dateUpdated);

src/components/HelloWorld.vue

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/components/PrimaryNavigation.vue

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,16 @@
122122
<div class="navbar-start" style="flex-grow: 1 !important; align-items: center !important; justify-content: center !important;
123123
flex-direction: column !important">
124124
<div class="navbar-item cve-secondary-navbar-item">
125-
<cveRecordLookup/>
125+
<cveRecordSearch/>
126126
</div>
127127
<div class="navbar-item cve-secondary-navbar-item cve-keyword-search">
128-
<span class="icon-text mr-2" style="font-size: 14px">
129-
<router-link to="/ResourcesSupport/FAQs#pc_cve_list_basicssearch_cve" class="cve-dark-blue-text">
130-
Find CVE Records by keyword on cve.mitre.org.
131-
</router-link>
132-
</span>
128+
<div v-if="searchType">
129+
<span class="icon-text mr-2" style="font-size: 14px">
130+
<router-link to="/ResourcesSupport/FAQs#pc_cve_list_basicssearch_cve" class="cve-dark-blue-text">
131+
Access Search Tips
132+
</router-link>
133+
</span>
134+
</div>
133135
</div>
134136
</div>
135137
<div class="navbar-end is-hidden-touch">
@@ -150,16 +152,21 @@
150152
</template>
151153

152154
<script>
153-
import cveRecordLookup from './cveRecordLookupModule.vue';
155+
import cveRecordSearch from '@/components/cveRecordSearchModule.vue';
156+
import { useCveListSearchStore } from '@/stores/cveListSearch';
157+
import { mapState } from 'pinia'
154158
155159
export default {
156-
components: { cveRecordLookup },
160+
components: { cveRecordSearch },
157161
props: {
158162
cvenavs: {
159163
type: Object,
160164
required: true,
161165
},
162166
},
167+
computed: {
168+
...mapState(useCveListSearchStore, ['searchType'])
169+
},
163170
data() {
164171
return {
165172
isOpen: false,
@@ -184,8 +191,6 @@ export default {
184191
} else {
185192
this.selectedTouchScreenMenu.push(menuOption);
186193
}
187-
188-
console.log('this.selectedTouchScreenMenu ', this.selectedTouchScreenMenu)
189194
},
190195
toggleTouchScreenBurgerMenu() {
191196
this.isOpen = !this.isOpen;

src/components/ProductStatus.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<h4 class="title is-size-5 mb-0">Product Status</h4>
44
<router-link to="/CVERecord/UserGuide/#cve-product-status" class="cve-learn-more-link">Learn more</router-link>
55
<div class="mt-4">
6-
<div v-if="useCveRecordLookupStore.emptyProductStatus[role]">
6+
<div v-if="usecveRecordStore.emptyProductStatus[role]">
77
<p class="is-italic cve-help-text">Information not provided</p>
88
</div>
99
<div v-else>
@@ -87,7 +87,7 @@
8787
</template>
8888

8989
<script>
90-
import { useCveRecordLookupStore } from '@/stores/cveRecordLookup.ts';
90+
import { usecveRecordStore } from '@/stores/cveRecord.ts';
9191
9292
export default {
9393
props: {
@@ -102,7 +102,7 @@ export default {
102102
},
103103
data() {
104104
return {
105-
useCveRecordLookupStore: useCveRecordLookupStore()
105+
usecveRecordStore: usecveRecordStore()
106106
107107
}
108108
},
@@ -125,9 +125,9 @@ export default {
125125
}
126126
127127
if (isVendorNa && isProductNa && isVersionNa && isDefaultStausNa) {
128-
useCveRecordLookupStore().emptyProductStatus[this.role] = true;
128+
usecveRecordStore().emptyProductStatus[this.role] = true;
129129
} else {
130-
useCveRecordLookupStore().emptyProductStatus[this.role] = false;
130+
usecveRecordStore().emptyProductStatus[this.role] = false;
131131
}
132132
}
133133
},
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<template>
2+
<div class="cve-service-unavailable-container has-text-centered">
3+
<h1 class="title is-4">Service is currently unavailable.</h1>
4+
<p class="has-text-centered">Please
5+
<span class="icon-text">
6+
<a href="https://cveform.mitre.org/" target="_blank">report the issue
7+
<span class="icon is-size-7 cve-icon-xxs">
8+
<p id="extenalLink1" class="is-hidden">external site</p>
9+
<font-awesome-icon icon="external-link-alt" aria-labelledby="extenalLink1" aria-hidden="false" focusable="false"/>
10+
</span>
11+
</a>
12+
</span>
13+
and try again later.<br/>Or, use
14+
<a :href="legacyCveWebsiteLink" target="_blank">Search CVE List on cve.mitre.org
15+
<span class="icon is-size-7 cve-icon-xxs">
16+
<p id="extenalLink1" class="is-hidden">external site</p>
17+
<font-awesome-icon icon="external-link-alt" aria-labelledby="extenalLink1" aria-hidden="false" focusable="false"/>
18+
</span>
19+
</a>
20+
to search CVE Records. Sorry for the inconvenience.
21+
</p>
22+
</div>
23+
</template>
24+
25+
<script>
26+
import { getCurrentInstance } from 'vue';
27+
28+
export default {
29+
setup() {
30+
const legacyCveWebsiteLink = getCurrentInstance().appContext.config.globalProperties.GenericGlobalsStore.legacyCveWebsiteLink;
31+
32+
return {
33+
legacyCveWebsiteLink
34+
}
35+
}
36+
}
37+
</script>
38+
39+
<style lang="scss">
40+
@import '../assets/style/globals.scss';
41+
</style>
42+
43+
<!-- Add "scoped" attribute to limit CSS to this component only -->
44+
<style scoped lang="scss">
45+
46+
47+
</style>

src/components/StickyOnPageSidebar.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<li v-for="(submenuObj, submenuLabel) in nav.submenu" :key="submenuObj.key">
66
<span class="is-flex" style="justify-content: space-between; width: inherit">
77
<router-link
8-
:to="`${submenuObj.path}?id=${useCveRecordLookupStore.cveId}#${submenuObj.anchorId}`"
8+
:to="`${submenuObj.path}?id=${usecveRecordStore.cveId}#${submenuObj.anchorId}`"
99
:class="isExactPath(`/${submenuObj.path}#${submenuObj.anchorId}`) ? '' : 'cve-not-active-link'"
1010
>
1111
{{ submenuLabel }} here
@@ -28,7 +28,7 @@
2828

2929
<script>
3030
import { useLinkStore } from '@/stores/link';
31-
import { useCveRecordLookupStore } from '@/stores/cveRecordLookup.ts';
31+
import { usecveRecordStore } from '@/stores/cveRecord.ts';
3232
3333
3434
export default {
@@ -46,7 +46,7 @@ export default {
4646
data() {
4747
return {
4848
selectedSubmenu: [this.$route.path],
49-
useCveRecordLookupStore: useCveRecordLookupStore(),
49+
usecveRecordStore: usecveRecordStore(),
5050
};
5151
},
5252
methods: {

0 commit comments

Comments
 (0)