diff --git a/src/forms/BInputGroupFormSwitch.vue b/src/forms/BInputGroupFormSwitch.vue
new file mode 100644
index 000000000..7d5498339
--- /dev/null
+++ b/src/forms/BInputGroupFormSwitch.vue
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/i18n/locales/de.json b/src/i18n/locales/de.json
index b3306a80a..76bd2edec 100644
--- a/src/i18n/locales/de.json
+++ b/src/i18n/locales/de.json
@@ -538,6 +538,7 @@
"last_bom_import": "Letzter BOM-Import",
"last_measurement": "Letzte Messung",
"last_seen": "Zuletzt gesehen bei",
+ "latest": "Aktuellste",
"latest_version": "Letzte Version",
"legal": "Rechtliches",
"license": "Lizenz",
@@ -696,6 +697,7 @@
"policies_tagged_with": "Richtlinien mit dem Tag {tag}",
"policy_created": "Richtlinie erstellt",
"policy_deleted": "Richtlinie gelöscht",
+ "policy_is_only_for_latest_project_version": "Auf als aktuellste gekennzeichnete Projektversionen limitieren",
"policy_management": "Richtlinienverwaltung",
"policy_name": "Versicherungsname",
"policy_violation_audit": "Richtlinienverstoß-Audit",
@@ -713,6 +715,7 @@
"project_delete_title": "Bestätigen Sie die Projektlöschung",
"project_deleted": "Projekt gelöscht",
"project_details": "Projekt Details",
+ "project_is_latest": "Ist aktuellste Version",
"project_metadata_supplier_name_desc": "Die Organisation, die die BOM bereitgestellt hat",
"project_name": "Projektname",
"project_name_desc": "Der vom Lieferanten angegebene Name des Projekts oder der Komponente",
diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json
index 8fda5d01a..432978317 100644
--- a/src/i18n/locales/en.json
+++ b/src/i18n/locales/en.json
@@ -538,6 +538,7 @@
"last_bom_import": "Last BOM Import",
"last_measurement": "Last Measurement",
"last_seen": "Last Seen At",
+ "latest": "Latest",
"latest_version": "Latest Version",
"legal": "Legal",
"license": "License",
@@ -696,6 +697,7 @@
"policies_tagged_with": "Policies tagged with {tag}",
"policy_created": "Policy created",
"policy_deleted": "Policy deleted",
+ "policy_is_only_for_latest_project_version": "Limit to project versions marked as latest",
"policy_management": "Policy Management",
"policy_name": "Policy Name",
"policy_violation_audit": "Policy Violation Audit",
@@ -713,6 +715,7 @@
"project_delete_title": "Confirm Project Deletion",
"project_deleted": "Project deleted",
"project_details": "Project Details",
+ "project_is_latest": "Is latest version",
"project_metadata_supplier_name_desc": "The organization that supplied the BOM",
"project_name": "Project Name",
"project_name_desc": "The name of the project or component as provided by the supplier",
diff --git a/src/i18n/locales/es.json b/src/i18n/locales/es.json
index b65626dec..5a1d00fbb 100644
--- a/src/i18n/locales/es.json
+++ b/src/i18n/locales/es.json
@@ -538,6 +538,7 @@
"last_bom_import": "Importación de la última lista de materiales",
"last_measurement": "Última medición",
"last_seen": "Visto por última vez en",
+ "latest": "El último",
"latest_version": "Ultima versión",
"legal": "Legal",
"license": "Licencia",
@@ -696,6 +697,7 @@
"policies_tagged_with": "Políticas etiquetadas con {tag}",
"policy_created": "Política creada",
"policy_deleted": "Política eliminada",
+ "policy_is_only_for_latest_project_version": "Limitar a las versiones del proyecto marcadas como más recientes",
"policy_management": "Gestión de políticas",
"policy_name": "Nombre de directiva",
"policy_violation_audit": "Auditoría de violaciones de políticas",
@@ -713,6 +715,7 @@
"project_delete_title": "Confirmar la eliminación del proyecto",
"project_deleted": "Proyecto eliminado",
"project_details": "detalles del proyecto",
+ "project_is_latest": "es la ultima version",
"project_metadata_supplier_name_desc": "La organización que suministró el BOM.",
"project_name": "Nombre del proyecto",
"project_name_desc": "El nombre del proyecto o componente proporcionado por el proveedor.",
diff --git a/src/i18n/locales/fr.json b/src/i18n/locales/fr.json
index aaa929eb6..b4f91535b 100644
--- a/src/i18n/locales/fr.json
+++ b/src/i18n/locales/fr.json
@@ -538,6 +538,7 @@
"last_bom_import": "Dernière importation de nomenclature",
"last_measurement": "Dernière mesure",
"last_seen": "Vu la dernière fois à",
+ "latest": "Dernier",
"latest_version": "Dernière version",
"legal": "Légal",
"license": "Licence",
@@ -696,6 +697,7 @@
"policies_tagged_with": "Règles marquées avec {tag}",
"policy_created": "Politique créée",
"policy_deleted": "Politique supprimée",
+ "policy_is_only_for_latest_project_version": "Limité aux versions de projet marquées comme les plus récentes",
"policy_management": "Gestion des politiques",
"policy_name": "Nom de la politique",
"policy_violation_audit": "Audit des violations des politiques",
@@ -713,6 +715,7 @@
"project_delete_title": "Confirmer la suppression du projet",
"project_deleted": "Projet supprimé",
"project_details": "Détails du projet",
+ "project_is_latest": "Est la dernière version",
"project_metadata_supplier_name_desc": "L'organisation qui a fourni la nomenclature",
"project_name": "Nom du projet",
"project_name_desc": "Le nom du projet ou du composant tel que fourni par le fournisseur",
diff --git a/src/i18n/locales/hi.json b/src/i18n/locales/hi.json
index 3cc41e7cd..0a5c26eca 100644
--- a/src/i18n/locales/hi.json
+++ b/src/i18n/locales/hi.json
@@ -538,6 +538,7 @@
"last_bom_import": "अंतिम BOM आयात",
"last_measurement": "अंतिम माप",
"last_seen": "आखिरी बार देखा",
+ "latest": "नवीनतम",
"latest_version": "नवीनतम संस्करण",
"legal": "कानूनी",
"license": "लाइसेंस",
@@ -696,6 +697,7 @@
"policies_tagged_with": "{tag} के साथ टैग की गईं नीतियां",
"policy_created": "नीति बनाई गई",
"policy_deleted": "नीति हटा दी गई",
+ "policy_is_only_for_latest_project_version": "नवीनतम के रूप में चिह्नित प्रोजेक्ट संस्करणों तक सीमित रहें",
"policy_management": "नीति प्रबंधन",
"policy_name": "पालिसी का नाम",
"policy_violation_audit": "नीति उल्लंघन ऑडिट",
@@ -713,6 +715,7 @@
"project_delete_title": "प्रोजेक्ट विलोपन की पुष्टि करें",
"project_deleted": "परियोजना हटा दी गई",
"project_details": "परियोजना विवरण",
+ "project_is_latest": "नवीनतम संस्करण है",
"project_metadata_supplier_name_desc": "वह संगठन जिसने BOM की आपूर्ति की",
"project_name": "परियोजना का नाम",
"project_name_desc": "आपूर्तिकर्ता द्वारा प्रदान किया गया परियोजना या घटक का नाम",
diff --git a/src/i18n/locales/it.json b/src/i18n/locales/it.json
index 2f9767bb9..87ea3081d 100644
--- a/src/i18n/locales/it.json
+++ b/src/i18n/locales/it.json
@@ -538,6 +538,7 @@
"last_bom_import": "Ultima importazione distinta base",
"last_measurement": "Ultima misurazione",
"last_seen": "Visto l'ultima volta a",
+ "latest": "Ultimo",
"latest_version": "Ultima versione",
"legal": "Legale",
"license": "Licenza",
@@ -696,6 +697,7 @@
"policies_tagged_with": "Politiche contrassegnate con {tag}",
"policy_created": "Politica creata",
"policy_deleted": "Politica eliminata",
+ "policy_is_only_for_latest_project_version": "Limita alle versioni del progetto contrassegnate come più recenti",
"policy_management": "Gestione delle politiche",
"policy_name": "Nome della politica",
"policy_violation_audit": "Controllo della violazione delle policy",
@@ -713,6 +715,7 @@
"project_delete_title": "Conferma l'eliminazione del progetto",
"project_deleted": "Progetto eliminato",
"project_details": "Dettagli del progetto",
+ "project_is_latest": "È l'ultima versione",
"project_metadata_supplier_name_desc": "L'organizzazione che ha fornito la distinta base",
"project_name": "Nome del progetto",
"project_name_desc": "Il nome del progetto o del componente fornito dal fornitore",
diff --git a/src/i18n/locales/ja.json b/src/i18n/locales/ja.json
index 24497b515..a463f7fc0 100644
--- a/src/i18n/locales/ja.json
+++ b/src/i18n/locales/ja.json
@@ -538,6 +538,7 @@
"last_bom_import": "最後のBOMインポート",
"last_measurement": "最終測定",
"last_seen": "最終確認",
+ "latest": "最新",
"latest_version": "最新バージョン",
"legal": "法律上の",
"license": "ライセンス",
@@ -696,6 +697,7 @@
"policies_tagged_with": "{tag} でタグ付けされたポリシー",
"policy_created": "ポリシーが作成されました",
"policy_deleted": "ポリシーを削除しました",
+ "policy_is_only_for_latest_project_version": "最新としてマークされたプロジェクト バージョンに制限する",
"policy_management": "ポリシー管理",
"policy_name": "ポリシー名",
"policy_violation_audit": "ポリシー違反の監査",
@@ -713,6 +715,7 @@
"project_delete_title": "プロジェクトの削除の確認",
"project_deleted": "プロジェクトが削除されました",
"project_details": "プロジェクトの詳細",
+ "project_is_latest": "最新バージョンです",
"project_metadata_supplier_name_desc": "BOMを提供した組織",
"project_name": "プロジェクト名",
"project_name_desc": "サプライヤーから提供されたプロジェクトまたはコンポーネントの名前",
diff --git a/src/i18n/locales/pl.json b/src/i18n/locales/pl.json
index a323a37d3..d4e437c42 100644
--- a/src/i18n/locales/pl.json
+++ b/src/i18n/locales/pl.json
@@ -538,6 +538,7 @@
"last_bom_import": "Ostatni import BOM",
"last_measurement": "Ostatni pomiar",
"last_seen": "Ostatnio widziany w",
+ "latest": "Najnowszy",
"latest_version": "Ostatnia wersja",
"legal": "Prawny",
"license": "Licencja",
@@ -696,6 +697,7 @@
"policies_tagged_with": "Zasady oznaczone tagiem {tag}",
"policy_created": "Utworzono politykę",
"policy_deleted": "Polityka została usunięta",
+ "policy_is_only_for_latest_project_version": "Ogranicz do wersji projektu oznaczonych jako najnowsze",
"policy_management": "Zarządzanie polityką",
"policy_name": "Nazwa zasady",
"policy_violation_audit": "Audyt naruszeń zasad",
@@ -713,6 +715,7 @@
"project_delete_title": "Potwierdź usunięcie projektu",
"project_deleted": "Projekt usunięty",
"project_details": "Szczegóły Projektu",
+ "project_is_latest": "Jest najnowszą wersją",
"project_metadata_supplier_name_desc": "Organizacja, która dostarczyła BOM",
"project_name": "Nazwa Projektu",
"project_name_desc": "Nazwa projektu lub komponentu podana przez dostawcę",
diff --git a/src/i18n/locales/pt-BR.json b/src/i18n/locales/pt-BR.json
index 71c872369..637d9f042 100644
--- a/src/i18n/locales/pt-BR.json
+++ b/src/i18n/locales/pt-BR.json
@@ -538,6 +538,7 @@
"last_bom_import": "Última importação de BOM",
"last_measurement": "Última medição",
"last_seen": "Visto por último em",
+ "latest": "Mais recente",
"latest_version": "Última versão",
"legal": "Jurídico",
"license": "Licença",
@@ -696,6 +697,7 @@
"policies_tagged_with": "Políticas marcadas com {tag}",
"policy_created": "Política criada",
"policy_deleted": "Política excluída",
+ "policy_is_only_for_latest_project_version": "Limitar às versões do projeto marcadas como mais recentes",
"policy_management": "Gerenciamento de Políticas",
"policy_name": "Nome da política",
"policy_violation_audit": "Auditoria de violação de política",
@@ -713,6 +715,7 @@
"project_delete_title": "Confirmar exclusão do projeto",
"project_deleted": "Projeto excluído",
"project_details": "Detalhes do Projeto",
+ "project_is_latest": "É a versão mais recente",
"project_metadata_supplier_name_desc": "A organização que forneceu a lista técnica",
"project_name": "Nome do Projeto",
"project_name_desc": "O nome do projeto ou componente fornecido pelo fornecedor",
diff --git a/src/i18n/locales/pt.json b/src/i18n/locales/pt.json
index 58d052840..805755b29 100644
--- a/src/i18n/locales/pt.json
+++ b/src/i18n/locales/pt.json
@@ -538,6 +538,7 @@
"last_bom_import": "Última importação de BOM",
"last_measurement": "Última medição",
"last_seen": "Visto por último em",
+ "latest": "Mais recente",
"latest_version": "Última versão",
"legal": "Jurídico",
"license": "Licença",
@@ -696,6 +697,7 @@
"policies_tagged_with": "Políticas marcadas com {tag}",
"policy_created": "Política criada",
"policy_deleted": "Política excluída",
+ "policy_is_only_for_latest_project_version": "Limitar às versões do projeto marcadas como mais recentes",
"policy_management": "Gerenciamento de Políticas",
"policy_name": "Nome da política",
"policy_violation_audit": "Auditoria de violação de políticas",
@@ -713,6 +715,7 @@
"project_delete_title": "Confirmar exclusão do projeto",
"project_deleted": "Projeto excluído",
"project_details": "Detalhes do Projeto",
+ "project_is_latest": "É a versão mais recente",
"project_metadata_supplier_name_desc": "A organização que forneceu a lista técnica",
"project_name": "Nome do Projeto",
"project_name_desc": "O nome do projeto ou componente fornecido pelo fornecedor",
diff --git a/src/i18n/locales/ru.json b/src/i18n/locales/ru.json
index 7d2fd5123..0ea0cdf10 100644
--- a/src/i18n/locales/ru.json
+++ b/src/i18n/locales/ru.json
@@ -538,6 +538,7 @@
"last_bom_import": "Последний импорт спецификации",
"last_measurement": "Последнее измерение",
"last_seen": "Последний раз видели",
+ "latest": "Последний",
"latest_version": "Последняя версия",
"legal": "Юридический",
"license": "Лицензия",
@@ -696,6 +697,7 @@
"policies_tagged_with": "Политики с тегом {tag}",
"policy_created": "Политика создана",
"policy_deleted": "Политика удалена.",
+ "policy_is_only_for_latest_project_version": "Ограничить версии проекта, помеченные как последние.",
"policy_management": "Управление политиками",
"policy_name": "Имя политики",
"policy_violation_audit": "Аудит нарушений политики",
@@ -713,6 +715,7 @@
"project_delete_title": "Подтвердить удаление проекта",
"project_deleted": "Проект удален",
"project_details": "Детали проекта",
+ "project_is_latest": "Последняя версия",
"project_metadata_supplier_name_desc": "Организация, предоставившая спецификацию",
"project_name": "название проекта",
"project_name_desc": "Название проекта или компонента, предоставленное поставщиком.",
diff --git a/src/i18n/locales/uk-UA.json b/src/i18n/locales/uk-UA.json
index 22da7fbe0..cd48581a8 100644
--- a/src/i18n/locales/uk-UA.json
+++ b/src/i18n/locales/uk-UA.json
@@ -538,6 +538,7 @@
"last_bom_import": "Останній імпорт специфікації",
"last_measurement": "Останнє вимірювання",
"last_seen": "Останнє побачення в",
+ "latest": "Останній",
"latest_version": "Остання версія",
"legal": "юридичний",
"license": "Ліцензія",
@@ -696,6 +697,7 @@
"policies_tagged_with": "Правила з тегом {tag}",
"policy_created": "Політика створена",
"policy_deleted": "Політику видалено",
+ "policy_is_only_for_latest_project_version": "Обмеження версіями проекту, позначеними як останні",
"policy_management": "Управління політикою",
"policy_name": "Назва політики",
"policy_violation_audit": "Аудит порушень політики",
@@ -713,6 +715,7 @@
"project_delete_title": "Підтвердити видалення проекту",
"project_deleted": "Проект видалено",
"project_details": "Деталі проекту",
+ "project_is_latest": "Остання версія",
"project_metadata_supplier_name_desc": "Організація, яка надала специфікацію",
"project_name": "Назва проекту",
"project_name_desc": "Назва проекту або компонента, надана постачальником",
diff --git a/src/i18n/locales/zh.json b/src/i18n/locales/zh.json
index 543546c61..6fe705e49 100644
--- a/src/i18n/locales/zh.json
+++ b/src/i18n/locales/zh.json
@@ -538,6 +538,7 @@
"last_bom_import": "上次 BOM 导入",
"last_measurement": "最后一次评估",
"last_seen": "最后上线时间",
+ "latest": "最新的",
"latest_version": "最新版本",
"legal": "合法的",
"license": "许可证",
@@ -696,6 +697,7 @@
"policies_tagged_with": "带有 {tag} 标记的政策",
"policy_created": "策略已创建",
"policy_deleted": "策略已删除",
+ "policy_is_only_for_latest_project_version": "限制标记为最新的项目版本",
"policy_management": "策略管理",
"policy_name": "策略名称",
"policy_violation_audit": "政策违规审计",
@@ -713,6 +715,7 @@
"project_delete_title": "确认项目删除",
"project_deleted": "项目已删除",
"project_details": "项目细节",
+ "project_is_latest": "是最新版本",
"project_metadata_supplier_name_desc": "提供 BOM 的组织",
"project_name": "项目名",
"project_name_desc": "供应商提供的项目或组件名称",
diff --git a/src/views/policy/PolicyList.vue b/src/views/policy/PolicyList.vue
index eaf57a03f..f08ef9e75 100644
--- a/src/views/policy/PolicyList.vue
+++ b/src/views/policy/PolicyList.vue
@@ -37,11 +37,12 @@ import PolicyCondition from './PolicyCondition';
import BToggleableDisplayButton from '@/views/components/BToggleableDisplayButton';
import SelectProjectModal from '@/views/portfolio/projects/SelectProjectModal';
import SelectTagModal from '@/views/portfolio/tags/SelectTagModal';
-import { Switch as cSwitch } from '@coreui/vue';
+import BInputGroupFormSwitch from '@/forms/BInputGroupFormSwitch.vue';
export default {
mixins: [permissionsMixin, bootstrapTableMixin, routerMixin],
components: {
+ BInputGroupFormSwitch,
CreatePolicyModal,
},
mounted() {
@@ -152,8 +153,22 @@ export default {
-
- {{ $t('admin.include_children') }}
+
+
+
+
+
+
+
+
@@ -183,7 +198,7 @@ export default {
SelectProjectModal,
SelectTagModal,
PolicyCondition,
- cSwitch,
+ BInputGroupFormSwitch,
},
data() {
return {
@@ -205,10 +220,7 @@ export default {
limitToVisible: false,
tags: row.tags,
includeChildren: row.includeChildren,
- labelIcon: {
- dataOn: '\u2713',
- dataOff: '\u2715',
- },
+ onlyLatestProjectVersion: row.onlyLatestProjectVersion,
};
},
methods: {
@@ -243,6 +255,8 @@ export default {
},
updatePolicy: function () {
let url = `${this.$api.BASE_URL}/${this.$api.URL_POLICY}`;
+ let refreshTableRow =
+ this.policy.uuid === null || this.name !== this.policy.name;
this.axios
.post(url, {
uuid: this.policy.uuid,
@@ -250,14 +264,18 @@ export default {
operator: this.operator,
violationState: this.violationState,
includeChildren: this.includeChildren,
+ onlyLatestProjectVersion: this.onlyLatestProjectVersion,
})
.then((response) => {
- this.policy = response.data;
- EventBus.$emit(
- 'policyManagement:policies:rowUpdate',
- index,
- this.policy,
- );
+ // prevent that "limit to" details are hidden after updates where table does not need to refresh
+ if (refreshTableRow) {
+ this.policy = response.data;
+ EventBus.$emit(
+ 'policyManagement:policies:rowUpdate',
+ index,
+ this.policy,
+ );
+ }
this.$toastr.s(this.$t('message.updated'));
})
.catch((error) => {
@@ -286,6 +304,7 @@ export default {
this.violationState = policy.violationState;
this.conditions = policy.policyConditions;
this.includeChildren = policy.includeChildren;
+ this.onlyLatestProjectVersion = policy.onlyLatestProjectVersion;
},
deleteProjectLimiter: function (projectUuid) {
let url = `${this.$api.BASE_URL}/${this.$api.URL_POLICY}/${this.policy.uuid}/project/${projectUuid}`;
@@ -366,23 +385,6 @@ export default {
this.$toastr.s(this.$t('message.updated'));
});
},
- updateIncludeChildren: function () {
- let url = `${this.$api.BASE_URL}/${this.$api.URL_POLICY}`;
- this.axios
- .post(url, {
- uuid: this.policy.uuid,
- name: this.name,
- operator: this.operator,
- violationState: this.violationState,
- includeChildren: this.includeChildren,
- })
- .then((response) => {
- this.$toastr.s(this.$t('message.updated'));
- })
- .catch((error) => {
- this.$toastr.w(this.$t('condition.unsuccessful_action'));
- });
- },
},
watch: {
operator() {
@@ -392,7 +394,10 @@ export default {
this.updatePolicy();
},
includeChildren() {
- this.updateIncludeChildren();
+ this.updatePolicy();
+ },
+ onlyLatestProjectVersion() {
+ this.updatePolicy();
},
},
});
diff --git a/src/views/portfolio/projects/Project.vue b/src/views/portfolio/projects/Project.vue
index cf2ba6a1c..24cbad614 100644
--- a/src/views/portfolio/projects/Project.vue
+++ b/src/views/portfolio/projects/Project.vue
@@ -75,6 +75,9 @@
{{ $t('message.inactive').toUpperCase() }}
+
+ {{ $t('message.latest_version').toUpperCase() }}
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+