|
1 | 1 | <template> |
2 | | - <b-modal id="componentDetailsModal" size="md" hide-header-close no-stacking :title="$t('message.component_details')"> |
| 2 | + <b-modal id="componentDetailsModal" size="lg" hide-header-close no-stacking :title="$t('message.component_details')"> |
3 | 3 | <b-tabs class="body-bg-color" style="border:0;padding:0"> |
4 | 4 | <b-tab class="body-bg-color" style="border:0;padding:0" active> |
5 | 5 | <template v-slot:title><i class="fa fa-cube"></i> {{ $t('message.identity') }}</template> |
|
94 | 94 | :readonly="this.isNotPermitted(PERMISSIONS.PORTFOLIO_MANAGEMENT)" /> |
95 | 95 | </b-card> |
96 | 96 | </b-tab> |
| 97 | + <b-tab> |
| 98 | + <template v-slot:title><i class="fa fa-external-link"></i> {{ $t('message.external_references') }}</template> |
| 99 | + <b-card> |
| 100 | + <bootstrap-table |
| 101 | + ref="referencesTable" |
| 102 | + :columns="referencesTableColumns" |
| 103 | + :data="component.externalReferences" |
| 104 | + :options="referencesTableOptions"> |
| 105 | + </bootstrap-table> |
| 106 | + </b-card> |
| 107 | + </b-tab> |
97 | 108 | <b-tab> |
98 | 109 | <template v-slot:title><i class="fa fa-file-text-o"></i> {{ $t('message.notes') }}</template> |
99 | 110 | <b-card> |
|
119 | 130 | import BInputGroupFormInput from "../../../forms/BInputGroupFormInput"; |
120 | 131 | import BInputGroupFormSelect from "../../../forms/BInputGroupFormSelect"; |
121 | 132 | import permissionsMixin from "../../../mixins/permissionsMixin"; |
| 133 | + import xssFilters from "xss-filters"; |
| 134 | + import common from "@/shared/common"; |
122 | 135 |
|
123 | 136 | export default { |
124 | 137 | name: "ComponentDetailsModal", |
|
143 | 156 | { value: 'FILE', text: 'File' } |
144 | 157 | ], |
145 | 158 | selectableLicenses: [], |
146 | | - selectedLicense: '' |
| 159 | + selectedLicense: '', |
| 160 | + referencesTableColumns: [ |
| 161 | + { |
| 162 | + title: this.$t('message.url'), |
| 163 | + field: "url", |
| 164 | + sortable: false, |
| 165 | + formatter(value, row, index) { |
| 166 | + let url = xssFilters.uriInUnQuotedAttr(common.valueWithDefault(value, "")); |
| 167 | + return `<a href="${url}">${xssFilters.inHTMLData(common.valueWithDefault(value, ""))}</a>`; |
| 168 | + } |
| 169 | + }, |
| 170 | + { |
| 171 | + title: this.$t('message.type'), |
| 172 | + field: "type", |
| 173 | + sortable: false, |
| 174 | + formatter(value, row, index) { |
| 175 | + return xssFilters.inHTMLData(common.valueWithDefault(value, "")); |
| 176 | + } |
| 177 | + } |
| 178 | + ], |
| 179 | + referencesTableOptions: { |
| 180 | + search: false, |
| 181 | + showColumns: false, |
| 182 | + showRefresh: false, |
| 183 | + pagination: true, |
| 184 | + silentSort: false, |
| 185 | + sidePagination: 'client', |
| 186 | + queryParamsType: 'pageSize', |
| 187 | + pageList: '[5, 10, 25]', |
| 188 | + pageSize: 5, |
| 189 | + icons: { |
| 190 | + refresh: 'fa-refresh' |
| 191 | + }, |
| 192 | + responseHandler: function (res, xhr) { |
| 193 | + res.total = xhr.getResponseHeader("X-Total-Count"); |
| 194 | + return res; |
| 195 | + } |
| 196 | + } |
147 | 197 | } |
148 | 198 | }, |
149 | 199 | beforeMount() { |
|
0 commit comments