Skip to content

Commit

Permalink
#3160 update search static content, and fix search evn banner touch d…
Browse files Browse the repository at this point in the history
…evice responsiveness
  • Loading branch information
athu-tran committed Oct 14, 2024
1 parent a96cbec commit f254276
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 37 deletions.
4 changes: 3 additions & 1 deletion src/assets/data/faqs.json
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,9 @@
"questionId": "search_cve",
"questionText": "How do I search the CVE List",
"questionResponseParagraphs": [
"<strong>Keyword(s) Search of All CVE Records</strong>",
"<b><i>Search Tips<i></b>",
"<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.</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>",
"<strong>2. Other CVE List search options</strong>",
"<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>"
]
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/PrimaryNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
<div class="navbar-item cve-secondary-navbar-item cve-keyword-search">
<span class="icon-text mr-2" style="font-size: 14px">
<router-link to="/ResourcesSupport/FAQs#pc_cve_list_basicssearch_cve" class="cve-dark-blue-text">
The legacy CVE List search is available on cve.mitre.org.
Access Search Tips
</router-link>
</span>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/cveRecordSearchModule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
aria-labelledby="alertIcon" aria-hidden="false" />
<p class="cve-help-text">
{{ errorMessage }}
<router-link to="/About/Process#request"> Learn more</router-link>
<router-link to="/ResourcesSupport/FAQs#pc_cve_list_basicssearch_cve" class="cve-dark-blue-text">Access Search Tips.</router-link>
</p>
</div>
</div>
Expand Down Expand Up @@ -128,7 +128,7 @@ function validateQueryString() {
const cveIdPattern = new RegExp(/^CVE-\d{4}-\d{4,7}$/, 'i').test(cveId);
if (cveId.length > 0 && !cveIdPattern) {
cveListSearchStore.isSeachButtonDisabled = true;
errorMessage.value = 'Only CVE IDs (CVE-YYYY-NNNN) are allowed.';
errorMessage.value = 'Required CVE ID format: CVE-YYYY-NNNN';
cveListSearchStore.showHelpText = true;
} else if (cveId.length === 0) {
cveListSearchStore.isSeachButtonDisabled = true;
Expand Down
17 changes: 10 additions & 7 deletions src/views/CVERecord/CVERecord.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@
<p id="alertIconCveRecordsRequestErrored" class="is-hidden">alert</p>
<font-awesome-icon style="flex: 0 0 40px;" size="1x" icon="triangle-exclamation" role="img"
aria-labelledby="alertIconCveRecordsRequestErrored" aria-hidden="false" />
<p>You are viewing <span class="has-text-weight-bold">{{ usingProd }}</span> data from&nbsp;</p>
<a :href="resultUrl" target="_blank"> {{ resultUrl }}
<span class="icon cve-icon-xxs">
<p id="externalLinkIcon" class="is-hidden">external website</p>
<font-awesome-icon icon="up-right-from-square"
aria-labelledby="externalLinkIcon" aria-hidden="false"/>
<p>You are accessing <span class="has-text-weight-bold">{{ usingProd }}</span> data from
<span class="icon-text">
<a :href="resultUrl" target="_blank"> {{ resultUrl }}
<span class="icon cve-icon-xxs">
<p id="externalLinkIcon" class="is-hidden">external website</p>
<font-awesome-icon icon="up-right-from-square"
aria-labelledby="externalLinkIcon" aria-hidden="false"/>
</span>
</a>
</span>
</a>
</p>
</div>
</div>
<PublishedRecord v-if="usecveRecordStore.isPublished"/>
Expand Down
50 changes: 28 additions & 22 deletions src/views/CVERecord/SearchResults.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,29 @@
<ServiceUnavailable></ServiceUnavailable>
</div>
<div v-else>
<div v-if="Object.keys(cveListSearchStore.recordData).length > 0">
<h2 class="title">CVE Record Lookup</h2>
<div class="notification is-warning is-light" role="alert">
<div v-if="websiteEnv !== 'prd'" class="is-flex is-justify-content-center">
<p id="alertIconCveRecordsRequestErrored" class="is-hidden">alert</p>
<font-awesome-icon style="flex: 0 0 40px;" size="1x" icon="triangle-exclamation" role="alert"
aria-labelledby="alertIconCveRecordsRequestErrored" aria-hidden="false" />
<p>
You are accessing <span class="has-text-weight-bold">Production</span> data from
<span class="icon-text">
<a :href="resultUrl" target="_blank">{{ resultUrl }}
<span class="icon cve-icon-xxs">
<p id="externalLinkIcon" class="is-hidden">external website</p>
<font-awesome-icon icon="up-right-from-square"
aria-labelledby="externalLinkIcon" aria-hidden="false"/>
</span>
</a>
</span>
</p>
</div>
</div>
<div class="mb-3" v-if="Object.keys(cveListSearchStore.recordData).length > 0">
<h2 class="title">CVE Record Found</h2>
<p class="cve-help-text">
Find the information on the specific CVE Record below.
If you're searching for that CVE Record, use the Search Results section below.
See the CVE Record below. If you are searching for this CVE ID in other CVE Records, view the Search Results section below.
</p>
<div class="columns cve-columns is-variable is-1-desktop is-0-mobile mt-5 mr-2 mb-0 ml-2">
<div class="column cve-column">
Expand Down Expand Up @@ -63,23 +81,11 @@
</div>
</div>
<div id="cve-search-results-container" v-if="cveListSearchStore.totalSearchResultCount > 0">
<div class="notification is-warning is-light" role="alert">
<div v-if="websiteEnv !== 'prd'" class="is-flex" style="justify-content: center;">
<p id="alertIconCveRecordsRequestErrored" class="is-hidden">alert</p>
<font-awesome-icon style="flex: 0 0 40px;" size="1x" icon="triangle-exclamation" role="img"
aria-labelledby="alertIconCveRecordsRequestErrored" aria-hidden="false" />
<p>You are viewing <span class="has-text-weight-bold">Production</span> data from&nbsp;</p>
<a :href="resultUrl" target="_blank"> {{ resultUrl }}
<span class="icon cve-icon-xxs">
<p id="externalLinkIcon" class="is-hidden">external website</p>
<font-awesome-icon icon="up-right-from-square"
aria-labelledby="externalLinkIcon" aria-hidden="false"/>
</span>
</a>
</div>
</div>
<h2 class="title">Search Results</h2>
<div class="mt-2 mb-2">
<p class="cve-help-text" v-if="Object.keys(cveListSearchStore.recordData).length > 0">
Includes all record(s) that reference this CVE ID.
</p>
<div class="mt-4 mb-2">
<p>
<span>Showing </span>
<span>
Expand Down Expand Up @@ -224,8 +230,8 @@
</div>
<div v-else>
<p class="has-text-weight-bold">No search results found for: <span class="is-italic">{{ cveListSearchStore.query }}</span></p>
<p>Please try your search again using the following
<router-link to="/ResourcesSupport/FAQs#pc_cve_list_basicssearch_cve_list_tips">search tips and ticks</router-link> on the FAQs page.
<p>Please try your search again using different keyword(s) or access the
<router-link to="/ResourcesSupport/FAQs#pc_cve_list_basicssearch_cve_list_tips">search tips</router-link>.
</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/views/Downloads.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
{{cvenavs['Downloads']['submenu']['Downloads']['submenu']['Legacy Format']['label']}}
</h2>
<div role="alert" class="notification is-warning is-light">
<div class="is-flex" style="justify-content: center;">
<div class="is-flex is-justify-content-center">
<p id="alertIconVariousFormts" class="is-hidden">alert</p>
<font-awesome-icon style="flex: 0 0 40px;" size="1x" icon="exclamation-triangle" role="alert"
aria-labelledby="alertIconVariousFormts" aria-hidden="false" />
Expand Down
5 changes: 2 additions & 3 deletions src/views/ResourcesSupport/FAQs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
:class="{'is-hidden': accordion[item.sectionId + qAndA.questionId]}">
<div v-if="qAndA.questionId == 'search_cve'" class="pb-3">
<p>The following methods are available:</p>
<strong>On this site</strong>
<span class="has-text-weight-bold">1. On this site</span>
<ul>
<li>Search the CVE List by keywords using the
<router-link :to="{ hash: '#cve-secondary-navbar' }">search box</router-link> at the top of this page.
Expand Down Expand Up @@ -137,11 +137,10 @@ export default {
</script>

<style lang="scss">
@import '../../assets/style/globals.scss';
@import '@/assets/style/globals.scss';
</style>

<style scoped lang="scss">
@import '@/assets/style/routerLink.scss';
.message {
background-color: unset;
}
Expand Down

0 comments on commit f254276

Please sign in to comment.