Skip to content

Commit

Permalink
Merge pull request #452 from hborchardt/spdx-expressions
Browse files Browse the repository at this point in the history
Add SPDX expression field to component dialog and list
  • Loading branch information
nscuro authored Aug 19, 2023
2 parents 7279daa + 3716763 commit 5e69238
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@
"template": "Template",
"source_header": "Source Header",
"license_name": "License Name",
"license_expression": "SPDX Expression",
"license_url": "License URL",
"required_license_name": "The license name is required",
"license_name_desc": "The name of the license as provided by the supplier",
Expand Down Expand Up @@ -309,6 +310,7 @@
"component_swid_tagid_desc": "The ISO/IEC 19770-2:2015 (SWID) tag ID provided by the software vendor",
"component_classifier_desc": "Specifies the type of component: Assets (applications, operating systems, and hardware) and non-assets (libraries, frameworks, and files)",
"component_spdx_license_desc": "Specifies the SPDX license ID of the component",
"component_license_expression_desc": "Specifies license information for the component in the form of an SPDX expression",
"component_license_url_desc": "Specifies the URL to the license of the component",
"component_filename_desc": "Specifies the observed filename of the component",
"component_hash_desc": "Specifies the observed hash value of the component using the preceding algorithm",
Expand Down
3 changes: 3 additions & 0 deletions src/views/portfolio/projects/ComponentDetailsModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@
v-model="selectedLicense" :options="selectableLicenses"
:label="$t('message.license')" :tooltip="$t('message.component_spdx_license_desc')"
:disabled="this.isNotPermitted(PERMISSIONS.PORTFOLIO_MANAGEMENT)" />
<b-input-group-form-input id="component-license-expression" input-group-size="mb-3" type="text" v-model="component.licenseExpression"
required="false" :label="$t('message.license_expression')" :tooltip="$t('message.component_license_expression_desc')"
:readonly="this.isNotPermitted(PERMISSIONS.PORTFOLIO_MANAGEMENT)" />
<b-input-group-form-input id="component-license-url-input" input-group-size="mb-3" type="text" v-model="component.licenseUrl"
required="false" :label="$t('message.license_url')" :tooltip="$t('message.component_license_url_desc')"
:readonly="this.isNotPermitted(PERMISSIONS.PORTFOLIO_MANAGEMENT)" />
Expand Down
6 changes: 5 additions & 1 deletion src/views/portfolio/projects/ProjectComponents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,12 @@ import SeverityProgressBar from "../../components/SeverityProgressBar";
if (Object.prototype.hasOwnProperty.call(row, "resolvedLicense")) {
let licenseurl = "../../../licenses/" + row.resolvedLicense.licenseId;
return "<a href=\"" + licenseurl + "\">" + xssFilters.inHTMLData(row.resolvedLicense.licenseId) + "</a>";
} else {
} else if (value) {
return xssFilters.inHTMLData(common.valueWithDefault(value, ""));
} else if (row.licenseExpression) {
return xssFilters.inHTMLData(common.valueWithDefault(row.licenseExpression, ""));
} else {
return "";
}
}
},
Expand Down

0 comments on commit 5e69238

Please sign in to comment.