Skip to content

Commit

Permalink
Added buttons to add/delete/edit the affected
Browse files Browse the repository at this point in the history
Components.

Signed-off-by: Thomas Schauer-Köckeis <[email protected]>
  • Loading branch information
Gepardgame committed Oct 11, 2024
1 parent 380fe5a commit f5b779a
Show file tree
Hide file tree
Showing 15 changed files with 205 additions and 50 deletions.
2 changes: 2 additions & 0 deletions src/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@
"direction": "Richtung",
"download_bom": "BOM herunterladen",
"download_component": "Komponenten herunterladen",
"edit": "Bearbeiten",
"edit_affected_component": "Bearbeiten Sie die betroffene Komponente",
"email": "E-Mail",
"empty_selection": "Keine Elemente ausgewählt",
"endpoints": "Endpunkte",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@
"direction": "Direction",
"download_bom": "Download BOM",
"download_component": "Download Components",
"edit": "Edit",
"edit_affected_component": "Edit Affected Component",
"email": "Email",
"empty_selection": "No items selected",
"endpoints": "Endpoints",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@
"direction": "Dirección",
"download_bom": "Descargar lista de materiales",
"download_component": "Descargar componentes",
"edit": "Editar",
"edit_affected_component": "Editar componente afectado",
"email": "Correo electrónico",
"empty_selection": "No hay elementos seleccionados",
"endpoints": "Puntos finales",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@
"direction": "Direction",
"download_bom": "Télécharger la nomenclature",
"download_component": "Télécharger les composants",
"edit": "Modifier",
"edit_affected_component": "Modifier le composant concerné",
"email": "Courriel",
"empty_selection": "Aucun élément sélectionné",
"endpoints": "Points de terminaison",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@
"direction": "दिशा",
"download_bom": "BOM डाउनलोड करें",
"download_component": "घटक डाउनलोड करें",
"edit": "संपादन करना",
"edit_affected_component": "प्रभावित घटक संपादित करें",
"email": "ईमेल",
"empty_selection": "कोई आइटम चयनित नहीं",
"endpoints": "अंतिमबिंदुओं",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@
"direction": "Direzione",
"download_bom": "Scarica distinta base",
"download_component": "Scarica Componenti",
"edit": "Modificare",
"edit_affected_component": "Modifica componente interessato",
"email": "E-mail",
"empty_selection": "Nessun elemento selezionato",
"endpoints": "Endpoint",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@
"direction": "方向",
"download_bom": "BOMをダウンロード",
"download_component": "コンポーネントをダウンロードする",
"edit": "編集",
"edit_affected_component": "影響を受けるコンポーネントの編集",
"email": "Eメール",
"empty_selection": "項目が選択されていません",
"endpoints": "エンドポイント",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@
"direction": "Kierunek",
"download_bom": "Pobierz BOM",
"download_component": "Pobierz komponenty",
"edit": "Redagować",
"edit_affected_component": "Edytuj komponent, którego dotyczy problem",
"email": "E-mail",
"empty_selection": "Nie wybrano żadnych elementów",
"endpoints": "Punkty końcowe",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@
"direction": "Direção",
"download_bom": "Baixe a lista técnica",
"download_component": "Baixar componentes",
"edit": "Editar",
"edit_affected_component": "Editar componente afetado",
"email": "E-mail",
"empty_selection": "Nenhum item selecionado",
"endpoints": "Pontos finais",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@
"direction": "Direção",
"download_bom": "Baixe a lista técnica",
"download_component": "Baixar componentes",
"edit": "Editar",
"edit_affected_component": "Editar componente afetado",
"email": "E-mail",
"empty_selection": "Nenhum item selecionado",
"endpoints": "Pontos finais",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@
"direction": "Направление",
"download_bom": "Скачать спецификацию",
"download_component": "Загрузить компоненты",
"edit": "Редактировать",
"edit_affected_component": "Редактировать затронутый компонент",
"email": "Электронная почта",
"empty_selection": "Элементы не выбраны",
"endpoints": "Конечные точки",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/uk-UA.json
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@
"direction": "Напрямок",
"download_bom": "Завантажити BOM",
"download_component": "Завантажити компоненти",
"edit": "Редагувати",
"edit_affected_component": "Редагувати пошкоджений компонент",
"email": "Електронна пошта",
"empty_selection": "Елементи не вибрано",
"endpoints": "Кінцеві точки",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@
"direction": "方向",
"download_bom": "下载 BOM",
"download_component": "下载组件",
"edit": "编辑",
"edit_affected_component": "编辑受影响的组件",
"email": "电子邮件",
"empty_selection": "没有选择任何项目",
"endpoints": "终结点",
Expand Down
22 changes: 20 additions & 2 deletions src/views/portfolio/vulnerabilities/AddAffectedComponentModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@hide="resetValues()"
size="lg"
hide-header-close
:title="$t('message.add_affected_component')"
:title="title"
>
<b-row>
<b-col md="3">
Expand Down Expand Up @@ -82,7 +82,7 @@
$t('message.cancel')
}}</b-button>
<b-button size="md" variant="primary" @click="composeObject()">{{
$t('message.add')
okButton
}}</b-button>
</template>
</b-modal>
Expand All @@ -103,6 +103,8 @@ export default {
},
data() {
return {
okButton: this.$t('message.add'),
title: this.$t('message.add_affected_component'),
affectedComponent: {
identityType: 'PURL',
identity: null,
Expand Down Expand Up @@ -135,6 +137,13 @@ export default {
],
};
},
created() {
this.$root.$on('object-event', (data) => {
this.affectedComponent = data;
this.okButton = this.$t('message.edit');
this.title = this.$t('message.edit_affected_component');
});
},
methods: {
composeObject: function () {
if (this.affectedComponent.versionType === 'RANGE') {
Expand Down Expand Up @@ -194,6 +203,15 @@ export default {
this.tempVersionEndRange = null;
this.rangeBeginSyntax = null;
this.rangeEndSyntax = null;
this.okButton = this.$t('message.add');
this.title = this.$t('message.add_affected_component');
},
cancelEdit(cancel) {
this.resetValues();
cancel();
},
beforeDestroy() {
this.$root.$off('object-event');
},
},
};
Expand Down
Loading

0 comments on commit f5b779a

Please sign in to comment.