Skip to content

Commit

Permalink
JS prettier changes and localization updates
Browse files Browse the repository at this point in the history
Signed-off-by: Nicholas Castelli <[email protected]>
  • Loading branch information
Nicholas Castelli committed Sep 24, 2024
1 parent 1137033 commit 0cb60b4
Show file tree
Hide file tree
Showing 14 changed files with 64 additions and 34 deletions.
4 changes: 3 additions & 1 deletion src/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,9 @@
"weakness": "Schwäche",
"will_not_fix": "Wird nicht repariert",
"workaround_available": "Problemumgehung verfügbar",
"x_trust_boundary": "Vertrauensgrenzen überschreiten"
"x_trust_boundary": "Vertrauensgrenzen überschreiten",
"download_component": "Komponenten herunterladen",
"csv_filetype": "CSV"
},
"operator": {
"contains_all": "enthält alle",
Expand Down
4 changes: 2 additions & 2 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@
"create_vulnerability": "Create Vulnerability",
"created": "Created",
"credits": "Credits",
"csv_filetype": "CSV",
"csv_filetype": "CSV ",
"custom_license": "Custom License",
"custom_license_deleted": "Custom License Deleted",
"cvss": "CVSS",
Expand Down Expand Up @@ -476,7 +476,7 @@
"direct_only": "Direct only",
"direction": "Direction",
"download_bom": "Download BOM",
"download_component":"Download Components",
"download_component": "Download Components",
"email": "Email",
"empty_selection": "No items selected",
"endpoints": "Endpoints",
Expand Down
4 changes: 3 additions & 1 deletion src/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,9 @@
"weakness": "Debilidad",
"will_not_fix": "No se reparara",
"workaround_available": "Solución alternativa disponible",
"x_trust_boundary": "Cruzar el límite de confianza"
"x_trust_boundary": "Cruzar el límite de confianza",
"download_component": "Descargar componentes",
"csv_filetype": "CSV"
},
"operator": {
"contains_all": "contiene todo",
Expand Down
4 changes: 3 additions & 1 deletion src/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,9 @@
"weakness": "Faiblesse",
"will_not_fix": "Ne sera pas corrigée",
"workaround_available": "Solution de contournement disponible",
"x_trust_boundary": "Limte de confiance mutuelle"
"x_trust_boundary": "Limte de confiance mutuelle",
"download_component": "Télécharger les composants",
"csv_filetype": "CSV"
},
"operator": {
"contains_all": "contient tous",
Expand Down
4 changes: 3 additions & 1 deletion src/i18n/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,9 @@
"weakness": "कमजोरी",
"will_not_fix": "ठीक नहीं होगा",
"workaround_available": "वैकल्पिक उपाय उपलब्ध है",
"x_trust_boundary": "क्रॉस ट्रस्ट सीमा"
"x_trust_boundary": "क्रॉस ट्रस्ट सीमा",
"download_component": "घटक डाउनलोड करें",
"csv_filetype": "CSV"
},
"operator": {
"contains_all": "इसमें सभी शामिल हैं",
Expand Down
4 changes: 3 additions & 1 deletion src/i18n/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,9 @@
"weakness": "Debolezza",
"will_not_fix": "Non risolverà",
"workaround_available": "Soluzione disponibile",
"x_trust_boundary": "Confine di fiducia incrociata"
"x_trust_boundary": "Confine di fiducia incrociata",
"download_component": "Scarica Componenti",
"csv_filetype": "CSV"
},
"operator": {
"contains_all": "contiene tutto",
Expand Down
4 changes: 3 additions & 1 deletion src/i18n/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,9 @@
"weakness": "弱点",
"will_not_fix": "修正しない",
"workaround_available": "回避策あり",
"x_trust_boundary": "信頼境界を越える"
"x_trust_boundary": "信頼境界を越える",
"download_component": "コンポーネントをダウンロードする",
"csv_filetype": "CSV"
},
"operator": {
"contains_all": "すべてを含む",
Expand Down
4 changes: 3 additions & 1 deletion src/i18n/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,9 @@
"weakness": "Słabość",
"will_not_fix": "Nie naprawi",
"workaround_available": "Dostępne obejście",
"x_trust_boundary": "Granica zaufania krzyżowego"
"x_trust_boundary": "Granica zaufania krzyżowego",
"download_component": "Pobierz komponenty",
"csv_filetype": "CSV"
},
"operator": {
"contains_all": "zawiera wszystko",
Expand Down
4 changes: 3 additions & 1 deletion src/i18n/locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,9 @@
"weakness": "Fraqueza",
"will_not_fix": "Não irá corrigir",
"workaround_available": "Solução alternativa disponível",
"x_trust_boundary": "Limite de confiança cruzada"
"x_trust_boundary": "Limite de confiança cruzada",
"download_component": "Baixar componentes",
"csv_filetype": "CSV"
},
"operator": {
"contains_all": "contém tudo",
Expand Down
4 changes: 3 additions & 1 deletion src/i18n/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,9 @@
"weakness": "Fraqueza",
"will_not_fix": "Não irá corrigir",
"workaround_available": "Solução alternativa disponível",
"x_trust_boundary": "Limite de confiança cruzada"
"x_trust_boundary": "Limite de confiança cruzada",
"download_component": "Baixar componentes",
"csv_filetype": "CSV"
},
"operator": {
"contains_all": "contém tudo",
Expand Down
4 changes: 3 additions & 1 deletion src/i18n/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,9 @@
"weakness": "Слабость",
"will_not_fix": "Не будет исправлено",
"workaround_available": "Доступное решение",
"x_trust_boundary": "Пересечение границы доверия"
"x_trust_boundary": "Пересечение границы доверия",
"download_component": "Загрузить компоненты",
"csv_filetype": "CSV"
},
"operator": {
"contains_all": "содержит все",
Expand Down
4 changes: 3 additions & 1 deletion src/i18n/locales/uk-UA.json
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,9 @@
"weakness": "Слабкість",
"will_not_fix": "Не виправить",
"workaround_available": "Доступний обхідний шлях",
"x_trust_boundary": "Перетнути кордон довіри"
"x_trust_boundary": "Перетнути кордон довіри",
"download_component": "Завантажити компоненти",
"csv_filetype": "CSV"
},
"operator": {
"contains_all": "містить усе",
Expand Down
4 changes: 3 additions & 1 deletion src/i18n/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,9 @@
"weakness": "弱点",
"will_not_fix": "不会修复",
"workaround_available": "有解决方法",
"x_trust_boundary": "跨越信任边界"
"x_trust_boundary": "跨越信任边界",
"download_component": "下载组件",
"csv_filetype": "CSV"
},
"operator": {
"contains_all": "包含全部",
Expand Down
46 changes: 26 additions & 20 deletions src/views/portfolio/projects/ProjectComponents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -422,38 +422,44 @@ export default {
link.click();
});
},
buildTableFile: function (json, fileType) {
if(fileType == "csv") {
buildTableFile: function (json, fileType) {
if (fileType == 'csv') {
const items = json.data;
const header = ['name', 'version', 'group', 'internal', 'resolvedLicense.licenseId', 'lastInheritedRiskScore', 'metrics.vulnerabilities'];//Object.keys(items[0])//as long as the structure of the json doesnt change these can be static
const header = [
'name',
'version',
'group',
'internal',
'resolvedLicense.licenseId',
'lastInheritedRiskScore',
'metrics.vulnerabilities',
]; //Object.keys(items[0])//as long as the structure of the json doesnt change these can be static
const csv = [
header.join(','),
...items.map(row =>
header.map(header => get(row, header)).join(','),
),
].join('\r\n')
const url = window.URL.createObjectURL(new Blob([csv]));
const link = document.createElement('a');
link.href = url;
let filename = 'componentTable.csv';
link.setAttribute('download', filename);
document.body.appendChild(link);
link.click();
}
...items.map((row) =>
header.map((header) => get(row, header)).join(','),
),
].join('\r\n');
const url = window.URL.createObjectURL(new Blob([csv]));
const link = document.createElement('a');
link.href = url;
let filename = 'componentTable.csv';
link.setAttribute('download', filename);
document.body.appendChild(link);
link.click();
}
},
downloadTable: async function (fileType) {
const result = await this.downloadTableJson();
this.buildTableFile(result, fileType)
this.buildTableFile(result, fileType);
},
downloadTableJson: async function () {
let url = `${this.$api.BASE_URL}/${this.$api.URL_COMPONENT}/project/${this.uuid}?limit=1000000&offset=0`;
let url = `${this.$api.BASE_URL}/${this.$api.URL_COMPONENT}/project/${this.uuid}?limit=1000000&offset=0`;
try {
let response = await this.axios.get(url);
return response;
}
catch (e) {
} catch (e) {
console.log(e);
return e;
}
Expand Down

0 comments on commit 0cb60b4

Please sign in to comment.