Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@
"include_tags": "Tags einschließen",
"inherited_risk_score": "Vererbter Risiko-Score",
"internal": "Intern",
"internal_status": "Component classified as internal",
"inventory": "Inventar",
"inventory_with_vulnerabilities": "Inventarisierung mit Schwachstellen",
"justification": "Begründung",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@
"include_tags": "Include tags",
"inherited_risk_score": "Inherited Risk Score",
"internal": "Internal",
"internal_status": "Component classified as internal",
"inventory": "Inventory",
"inventory_with_vulnerabilities": "Inventory with Vulnerabilities",
"justification": "Justification",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@
"include_tags": "Incluir etiquetas",
"inherited_risk_score": "Puntuación de riesgo heredada",
"internal": "Interno",
"internal_status": "Component classified as internal",
"inventory": "Inventario",
"inventory_with_vulnerabilities": "Inventario con vulnerabilidades",
"justification": "Justificación",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@
"include_tags": "Inclure des balises",
"inherited_risk_score": "Score de risque hérité",
"internal": "Interne",
"internal_status": "Component classified as internal",
"inventory": "Inventaire",
"inventory_with_vulnerabilities": "Inventaire avec vulnérabilités",
"justification": "Justification",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@
"include_tags": "टैग शामिल करें",
"inherited_risk_score": "वंशानुगत जोखिम स्कोर",
"internal": "आंतरिक",
"internal_status": "Component classified as internal",
"inventory": "भंडार",
"inventory_with_vulnerabilities": "कमज़ोरियों वाली सूची",
"justification": "औचित्य",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@
"include_tags": "Includi tag",
"inherited_risk_score": "Punteggio di rischio ereditario",
"internal": "Interno",
"internal_status": "Component classified as internal",
"inventory": "Inventario",
"inventory_with_vulnerabilities": "Inventario con vulnerabilità",
"justification": "Giustificazione",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@
"include_tags": "タグを含める",
"inherited_risk_score": "継承リスクスコア",
"internal": "内部",
"internal_status": "Component classified as internal",
"inventory": "インベントリ",
"inventory_with_vulnerabilities": "脆弱性のあるインベントリ",
"justification": "正当化",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@
"include_tags": "Dołącz tagi",
"inherited_risk_score": "Odziedziczona ocena ryzyka",
"internal": "Wewnętrzny",
"internal_status": "Component classified as internal",
"inventory": "Spis",
"inventory_with_vulnerabilities": "Inwentarz z lukami w zabezpieczeniach",
"justification": "Uzasadnienie",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@
"include_tags": "Incluir tags",
"inherited_risk_score": "Pontuação de risco herdada",
"internal": "interno",
"internal_status": "Component classified as internal",
"inventory": "Inventário",
"inventory_with_vulnerabilities": "Inventário com vulnerabilidades",
"justification": "Justificação",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@
"include_tags": "Incluir tags",
"inherited_risk_score": "Pontuação de risco herdada",
"internal": "interno",
"internal_status": "Component classified as internal",
"inventory": "Inventário",
"inventory_with_vulnerabilities": "Inventário com vulnerabilidades",
"justification": "Justificação",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@
"include_tags": "Включить теги",
"inherited_risk_score": "Унаследованный рейтинг риска",
"internal": "Внутренний",
"internal_status": "Component classified as internal",
"inventory": "Инвентарь",
"inventory_with_vulnerabilities": "Инвентарь с уязвимостями",
"justification": "Обоснование",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/uk-UA.json
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@
"include_tags": "Включити теги",
"inherited_risk_score": "Успадкований бал ризику",
"internal": "Внутрішній",
"internal_status": "Component classified as internal",
"inventory": "Інвентаризація",
"inventory_with_vulnerabilities": "Інвентаризація з уразливостями",
"justification": "Обґрунтування",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@
"include_tags": "包含标签",
"inherited_risk_score": "遗传风险评分",
"internal": "内部的",
"internal_status": "Component classified as internal",
"inventory": "存货",
"inventory_with_vulnerabilities": "存在漏洞的清单",
"justification": "理由",
Expand Down
77 changes: 72 additions & 5 deletions src/views/policy/PolicyCondition.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
:delete-icon="true"
v-on:actionClicked="removeCondition()"
>
<b-row>
<b-row v-if="subject !== 'IS_INTERNAL'">
<b-col md="4" lg="3">
<b-input-group-form-select
id="input-subject"
Expand Down Expand Up @@ -148,10 +148,32 @@
</b-col>
<b-col md="0" lg="2"> </b-col>
</b-row>
<b-row v-else>
<b-col md="4" lg="3">
<b-input-group-form-select
id="input-subject"
required="true"
v-on:change="subjectChanged"
v-model="subject"
:options="subjects"
/>
</b-col>

<b-col md="8" lg="9">
<c-switch
v-model="value"
color="primary"
class="m-0"
label
v-bind="labelIcon"
/>
</b-col>
</b-row>
</actionable-list-group-item>
</template>

<script>
import { Switch as cSwitch } from '@coreui/vue';
import BInputGroupFormInput from '../../forms/BInputGroupFormInput';
import BInputGroupFormSelect from '../../forms/BInputGroupFormSelect';
import common from '../../shared/common';
Expand All @@ -166,19 +188,38 @@ export default {
ActionableListGroupItem,
BInputGroupFormSelect,
BInputGroupFormInput,
cSwitch,
},
watch: {
value(newVal) {
if (!this.ready) return;
if (this.subject === 'IS_INTERNAL') {
this.saveCondition();
}
},
},
created() {
if (this.condition) {
this.uuid = this.condition.uuid;
this.subject = this.condition.subject;
this.subjectChanged();
this.operator = this.condition.operator;
this.value = this.condition.value;

if (this.subject === 'IS_INTERNAL') {
this.value = this.condition.value === 'true';
} else {
this.value = this.condition.value;
}
}

this.$nextTick(() => {
this.ready = true;
});
},
data() {
return {
uuid: null,
ready: false,
subject: null,
operator: null,
value: null,
Expand All @@ -191,6 +232,10 @@ export default {
minor: null,
patch: null,
},
labelIcon: {
dataOn: '\u2713',
dataOff: '\u2715',
},
subjects: [
{ value: 'AGE', text: this.$t('message.age') },
//{value: 'ANALYZER', text: this.$t('message.analyzer')},
Expand All @@ -203,6 +248,7 @@ export default {
{ value: 'CPE', text: this.$t('message.cpe_full') },
{ value: 'SWID_TAGID', text: this.$t('message.swid_tagid') },
{ value: 'VERSION', text: this.$t('message.version') },
{ value: 'IS_INTERNAL', text: this.$t('message.internal_status') },
{ value: 'COMPONENT_HASH', text: this.$t('message.component_hash') },
{ value: 'CWE', text: this.$t('message.cwe_full') },
{ value: 'EPSS', text: this.$t('message.epss_score') },
Expand Down Expand Up @@ -278,6 +324,8 @@ export default {
return false;
case 'VERSION':
return false;
case 'IS_INTERNAL':
return false;
case 'COMPONENT_HASH':
return false;
case 'CWE':
Expand Down Expand Up @@ -347,6 +395,10 @@ export default {
case 'VERSION':
this.operators = this.numericOperators;
break;
case 'IS_INTERNAL':
this.operators = [];
this.operator = 'IS';
return;
case 'COMPONENT_HASH':
this.operators = this.hashAlgorithms;
break;
Expand Down Expand Up @@ -413,6 +465,9 @@ export default {
this.versionDistance = result;
return JSON.stringify(result);
} else {
if (this.subject === 'IS_INTERNAL') {
return this.value ? 'true' : 'false';
}
return this.value;
}
},
Expand All @@ -434,7 +489,11 @@ export default {
this.uuid = response.data.uuid;
this.subject = response.data.subject;
this.operator = response.data.operator;
this.value = response.data.value;
if (this.subject === 'IS_INTERNAL') {
this.value = response.data.value === 'true';
} else {
this.value = response.data.value;
}
this.$toastr.s(this.$t('message.updated'));
})
.catch((error) => {
Expand All @@ -452,7 +511,11 @@ export default {
this.uuid = response.data.uuid;
this.subject = response.data.subject;
this.operator = response.data.operator;
this.value = response.data.value;
if (this.subject === 'IS_INTERNAL') {
this.value = response.data.value === 'true';
} else {
this.value = response.data.value;
}
this.$toastr.s(this.$t('message.updated'));
})
.catch((error) => {
Expand All @@ -469,7 +532,11 @@ export default {
this.uuid = response.data.uuid;
this.subject = response.data.subject;
this.operator = response.data.operator;
this.value = response.data.value;
if (this.subject === 'IS_INTERNAL') {
this.value = response.data.value === 'true';
} else {
this.value = response.data.value;
}
this.$toastr.s(this.$t('message.condition_deleted'));
this.$emit('conditionRemoved');
})
Expand Down
Loading