|
36 | 36 | <section class="cve-accordian"> |
37 | 37 | <div class="message"> |
38 | 38 | <div class="message-header cve-base-light-gray-borders-bg"> |
39 | | - <p style="margin-top: auto !important; margin-bottom: auto !important">{{showRecord ? 'Hide' : 'View'}} full JSON 4.0 record</p> |
40 | | - <button class="button" @click="toggleRecord" :aria-expanded="!true ? 'true' : 'false'" aria-controls="cve-id"> |
| 39 | + <p style="margin-top: auto !important; margin-bottom: auto !important"> |
| 40 | + {{this.$store.state.showJsonRecord ? 'Hide' : 'View'}} full JSON 4.0 record |
| 41 | + </p> |
| 42 | + <button class="button" @click="toggleRecord" |
| 43 | + :aria-expanded="!this.$store.state.showJsonRecord ? 'true' : 'false'" aria-controls="cve-id"> |
41 | 44 | <span class="icon is-small"> |
42 | 45 | <p id="cve-id-alttext" class="is-hidden"> |
43 | 46 | {{true ? 'collapse' : 'expand'}} |
44 | 47 | </p> |
45 | | - <font-awesome-icon :icon="showRecord ? 'minus' : 'plus'" |
| 48 | + <font-awesome-icon :icon="this.$store.state.showJsonRecord ? 'minus' : 'plus'" |
46 | 49 | aria-hidden="false" focusable="true" aria-labelledby="cve-id-alttext"/> |
47 | 50 | </span> |
48 | 51 | </button> |
49 | 52 | </div> |
50 | 53 | <div class="message-body pb-0" :class="{'is-hidden': false}" id="cve-id"> |
51 | | - <div class="block"> |
52 | | - <pre :class="[{'is-hidden': !showRecord}]" v-html="$sanitize(JSON.stringify(this.$store.state.recordData, null, 2))"></pre> |
53 | | - </div> |
| 54 | + <pre :class="[{'is-hidden': !this.$store.state.showJsonRecord}]" |
| 55 | + v-html="$sanitize(JSON.stringify(this.$store.state.recordData, null, 2))"></pre> |
54 | 56 | </div> |
55 | 57 | </div> |
56 | | - <pre :class="[{'is-hidden': !showRecord}]" v-html="$sanitize(JSON.stringify(this.$store.state.recordData, null, 2))"></pre> |
57 | 58 | </section> |
58 | 59 | <div class="cve-scrollx-table-container"> |
59 | 60 | <table class="table is-striped is-hoverable cve-border-dark-blue"> |
|
117 | 118 | <ul v-for="reference in this.$store.state.recordData.reference_data" :key="reference.index"> |
118 | 119 | <li v-if="reference.url !== undefined" class="cve-task-tile-list-item"> |
119 | 120 | <a :href="$sanitize(reference.url)" class="cve-word-wrap" target="_blank"> |
120 | | - {{reference.name === undefined ? $sanitize(reference.url) : $sanitize(reference.name)}} |
| 121 | + {{$sanitize(reference.url)}} |
121 | 122 | </a> |
122 | 123 | </li> |
123 | 124 | </ul> |
|
151 | 152 | <script> |
152 | 153 | export default { |
153 | 154 | name: 'CVERecord', |
154 | | - data() { |
155 | | - return { |
156 | | - showRecord: false, |
157 | | - }; |
158 | | - }, |
159 | 155 | methods: { |
160 | 156 | toggleRecord() { |
161 | | - this.showRecord = !this.showRecord; |
| 157 | + this.$store.commit('updateState', { showJsonRecord: !this.$store.state.showJsonRecord }); |
162 | 158 | }, |
163 | 159 | }, |
164 | 160 | }; |
|
0 commit comments