Skip to content

Commit

Permalink
Merge pull request #1017 from rkg-mm/4148-introduce-isLatest-project-…
Browse files Browse the repository at this point in the history
…flag
  • Loading branch information
nscuro authored Sep 29, 2024
2 parents d2172f2 + 40f1afa commit 8a4e179
Show file tree
Hide file tree
Showing 20 changed files with 272 additions and 89 deletions.
92 changes: 92 additions & 0 deletions src/forms/BInputGroupFormSwitch.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<template>
<div>
<label class="d-block" v-if="showPlaceholderLabel">&nbsp;</label>
<b-form-group
:id="id"
:label="currentLabel"
:label-for="`${id}-input`"
content-cols="auto"
>
<b-input-group :class="inputGroupSize">
<c-switch
:id="`${id}-input`"
color="primary"
v-model="innerValue"
label
v-bind="labelIcon"
:readonly="readonly"
:disabled="disabled"
v-b-tooltip.hover
:title="tooltip"
v-on="inputListeners"
/>
</b-input-group>
</b-form-group>
</div>
</template>

<script>
import common from '../shared/common';
import { Switch as cSwitch } from '@coreui/vue';
export default {
components: {
cSwitch,
},
props: {
id: String,
label: String, // fallback label if labelOn or labelOff not set
labelOn: String, // if set will be used for "on" state
labelOff: String, // if set will be used for "off" state
value: Boolean,
inputGroupSize: String,
readonly: Boolean,
disabled: Boolean,
showPlaceholderLabel: Boolean, // can be used to show an empty label on top, useful to put on same row as other inputs
tooltip: String,
},
data() {
return {
labelIcon: {
dataOn: '\u2713',
dataOff: '\u2715',
},
currentLabel: (this.value ? this.labelOn : this.labelOff) || this.label,
};
},
computed: {
innerValue: {
get: function () {
return common.toBoolean(this.value);
},
set: function (newValue) {
this.currentLabel =
(newValue ? this.labelOn : this.labelOff) || this.label;
return common.toBoolean(newValue);
},
},
inputListeners: function () {
const vm = this;
return Object.assign({}, this.$listeners, {
change: function (event) {
vm.$emit('input', event); // model doesn't update otherwise?
vm.$emit('change', event);
},
});
},
},
methods: {},
};
</script>
<style scoped>
.switch {
margin-right: 0;
margin-top: 0.25rem;
}
.form-group {
flex-direction: row-reverse;
}
.form-group >>> label.col-form-label {
padding-left: 0 !important;
}
</style>
3 changes: 3 additions & 0 deletions src/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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.",
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@
"last_bom_import": "अंतिम BOM आयात",
"last_measurement": "अंतिम माप",
"last_seen": "आखिरी बार देखा",
"latest": "नवीनतम",
"latest_version": "नवीनतम संस्करण",
"legal": "कानूनी",
"license": "लाइसेंस",
Expand Down Expand Up @@ -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": "नीति उल्लंघन ऑडिट",
Expand All @@ -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": "आपूर्तिकर्ता द्वारा प्रदान किया गया परियोजना या घटक का नाम",
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@
"last_bom_import": "最後のBOMインポート",
"last_measurement": "最終測定",
"last_seen": "最終確認",
"latest": "最新",
"latest_version": "最新バージョン",
"legal": "法律上の",
"license": "ライセンス",
Expand Down Expand Up @@ -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": "ポリシー違反の監査",
Expand All @@ -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": "サプライヤーから提供されたプロジェクトまたはコンポーネントの名前",
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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ę",
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@
"last_bom_import": "Последний импорт спецификации",
"last_measurement": "Последнее измерение",
"last_seen": "Последний раз видели",
"latest": "Последний",
"latest_version": "Последняя версия",
"legal": "Юридический",
"license": "Лицензия",
Expand Down Expand Up @@ -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": "Аудит нарушений политики",
Expand All @@ -713,6 +715,7 @@
"project_delete_title": "Подтвердить удаление проекта",
"project_deleted": "Проект удален",
"project_details": "Детали проекта",
"project_is_latest": "Последняя версия",
"project_metadata_supplier_name_desc": "Организация, предоставившая спецификацию",
"project_name": "название проекта",
"project_name_desc": "Название проекта или компонента, предоставленное поставщиком.",
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/locales/uk-UA.json
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@
"last_bom_import": "Останній імпорт специфікації",
"last_measurement": "Останнє вимірювання",
"last_seen": "Останнє побачення в",
"latest": "Останній",
"latest_version": "Остання версія",
"legal": "юридичний",
"license": "Ліцензія",
Expand Down Expand Up @@ -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": "Аудит порушень політики",
Expand All @@ -713,6 +715,7 @@
"project_delete_title": "Підтвердити видалення проекту",
"project_deleted": "Проект видалено",
"project_details": "Деталі проекту",
"project_is_latest": "Остання версія",
"project_metadata_supplier_name_desc": "Організація, яка надала специфікацію",
"project_name": "Назва проекту",
"project_name_desc": "Назва проекту або компонента, надана постачальником",
Expand Down
Loading

0 comments on commit 8a4e179

Please sign in to comment.