Skip to content

Commit 9ed5a8c

Browse files
Merge pull request #3074 from CVEProject/jd-3024-loading
Resolves #3024 Added loading spinner and text to container titles
2 parents 83267a9 + b262027 commit 9ed5a8c

1 file changed

Lines changed: 23 additions & 6 deletions

File tree

src/views/CVERecord/PublishedRecord.vue

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,21 @@
6060
<div id="cve-cna-cve-program-containers">
6161
<h2 class="title">Required CVE Record Information</h2>
6262
<AdpVulnerabilityEnrichment v-if="Object.keys(cnaContainer).length > 0" role="cna" :selectedCnaData="cveFieldList"
63-
:containerObject="cnaContainer" :orgId="`cna-${cnaContainer.providerMetadata.orgId}`" :anchorId="cnaContainer.onPageMenu.anchorId"
64-
>
65-
<h3 class="mb-1 has-text-white cve-capitalize-first-letter">{{ cnaContainer.onPageMenu.label }}</h3>
63+
:containerObject="cnaContainer" :orgId="`cna-${cnaContainer.providerMetadata.orgId}`" :anchorId="cnaContainer.onPageMenu.anchorId">
64+
<h3 class="mb-1 has-text-white cve-capitalize-first-letter">
65+
<span v-if="!isLoading">{{ cnaContainer.onPageMenu.label }} </span>
66+
<span v-else>
67+
<span class="icon">
68+
<span class="loader is-loading"/>
69+
</span>
70+
<span class="ml-2">Loading...</span>
71+
</span>
72+
</h3>
6673
</AdpVulnerabilityEnrichment>
6774
<!-- <AdpVulnerabilityEnrichment v-if="!useCveRecordLookupStore.hasHistoricalReferences" role="cna" :containerObject="cnaContainer"></AdpVulnerabilityEnrichment> -->
6875
<AdpVulnerabilityEnrichment v-if="Object.keys(cveProgramContainer).length > 0" role='cveProgram'
6976
:selectedCnaData="{}" :containerObject="cveProgramContainer" :orgId="`cve-program-${cveProgramContainer.providerMetadata.orgId}`"
70-
:anchorId="cveProgramContainer.onPageMenu.anchorId"
71-
>
77+
:anchorId="cveProgramContainer.onPageMenu.anchorId">
7278
<h3 class="mb-1 has-text-white cve-capitalize-first-letter">{{ cveProgramContainer.onPageMenu.label }}</h3>
7379
</AdpVulnerabilityEnrichment>
7480
</div>
@@ -81,7 +87,15 @@
8187
<AdpVulnerabilityEnrichment v-if="adpContainer.providerMetadata.shortName === 'CISA-ADP'" role="adp" :selectedCnaData="{}"
8288
:containerObject="adpContainer" :orgId="`adp-${adpContainer.providerMetadata.orgId}`" :anchorId="adpContainer.onPageMenu.anchorId"
8389
>
84-
<h3 class="mb-1 has-text-white cve-capitalize-first-letter">{{ adpContainer.onPageMenu.label }}</h3>
90+
<h3 class="mb-1 has-text-white cve-capitalize-first-letter">
91+
<span v-if="!isLoading">{{ adpContainer.onPageMenu.label }}</span>
92+
<span v-else>
93+
<span class="icon">
94+
<span class="loader is-loading"/>
95+
</span>
96+
<span class="ml-2">Loading...</span>
97+
</span>
98+
</h3>
8599
</AdpVulnerabilityEnrichment>
86100
<!-- <div v-for="(adpContainer) in cveFieldList.productsStatus.adp" :key="adpContainer.key"
87101
class="mt-5"
@@ -117,6 +131,7 @@ export default {
117131
},
118132
data() {
119133
return {
134+
isLoading: false,
120135
isMessageExpanded: false,
121136
isHelpTestShown: false,
122137
cveRecordFields: ['ID', 'CNA', 'Credits', 'Description', 'References', 'State', 'Tags', 'Title', 'VendorsProductsVersions',
@@ -577,9 +592,11 @@ export default {
577592
},
578593
},
579594
async beforeMount() {
595+
this.isLoading = true
580596
await this.getOrgIdAndLongNameMap().finally(() =>{
581597
this.initializeFields();
582598
this.setupContainersAccordionStateOnPageMenu();
599+
this.isLoading = false;
583600
});
584601
},
585602
created () {

0 commit comments

Comments
 (0)