File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
src/views/portfolio/projects Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 11<template >
2- <b-modal id =" componentDetailsModal" size =" lg" 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')" @show = " initializeSelectedLicense " >
33 <b-tabs class =" body-bg-color" style =" border :0 ;padding :0 " >
44 <b-tab class =" body-bg-color" style =" border :0 ;padding :0 " active >
55 <template v-slot :title ><i class =" fa fa-cube" ></i > {{ $t('message.identity') }}</template >
253253 this .axios .get (url).then ((response ) => {
254254 for (let i = 0 ; i < response .data .length ; i++ ) {
255255 let license = response .data [i];
256- this .selectableLicenses .push ({value: license .licenseId , text: license .name });
257- if (this .component .resolvedLicense && this .component .resolvedLicense .uuid === license .uuid ) {
258- this .selectedLicense = license .licenseId ;
259- }
256+ this .selectableLicenses .push ({value: license .licenseId , text: license .name , uuid: license .uuid });
260257 }
261258 }).catch ((error ) => {
262259 this .$toastr .w (this .$t (' condition.unsuccessful_action' ));
263260 });
261+ },
262+ initializeSelectedLicense : function () {
263+ const resolvedLicense = this .component .resolvedLicense ;
264+ if (! resolvedLicense) {
265+ this .selectedLicense = null ;
266+ return ;
267+ }
268+ this .selectedLicense = this .selectableLicenses
269+ .filter (license => license .uuid == resolvedLicense .uuid )
270+ .map (license => license .value )
271+ .find (() => true ) || null ;
264272 }
265273 }
266274 }
You can’t perform that action at this time.
0 commit comments