From 7cc3cd1526782db93214dbb677ebadb32ed5f21c Mon Sep 17 00:00:00 2001 From: Nils Date: Tue, 5 Nov 2024 13:50:28 +0100 Subject: [PATCH 1/6] migrate mt-field-copyable to custom i18n --- .../mt-field-copyable/mt-field-copyable.vue | 116 +++++++----------- 1 file changed, 42 insertions(+), 74 deletions(-) diff --git a/packages/component-library/src/components/form/_internal/mt-field-copyable/mt-field-copyable.vue b/packages/component-library/src/components/form/_internal/mt-field-copyable/mt-field-copyable.vue index 5257180b9..dab861180 100644 --- a/packages/component-library/src/components/form/_internal/mt-field-copyable/mt-field-copyable.vue +++ b/packages/component-library/src/components/form/_internal/mt-field-copyable/mt-field-copyable.vue @@ -12,48 +12,21 @@ name="regular-copy" size="18" @click="copyToClipboard" - @mouseleave="resetTooltipText" + @mouseleave="wasCopied = false" /> From b6087af855b41b150614f32d2f99c0cc25a2a675 Mon Sep 17 00:00:00 2001 From: Nils Date: Tue, 5 Nov 2024 13:51:58 +0100 Subject: [PATCH 2/6] migrate mt-field-copyable to plain css --- .../form/_internal/mt-field-copyable/mt-field-copyable.vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/component-library/src/components/form/_internal/mt-field-copyable/mt-field-copyable.vue b/packages/component-library/src/components/form/_internal/mt-field-copyable/mt-field-copyable.vue index dab861180..9e09abb9a 100644 --- a/packages/component-library/src/components/form/_internal/mt-field-copyable/mt-field-copyable.vue +++ b/packages/component-library/src/components/form/_internal/mt-field-copyable/mt-field-copyable.vue @@ -100,10 +100,8 @@ export default defineComponent({ }); - From a0fb1b73bcc8276a6f8162600c5ece4bd66d2b50 Mon Sep 17 00:00:00 2001 From: Nils Date: Tue, 5 Nov 2024 14:06:38 +0100 Subject: [PATCH 3/6] migrate mt-inheritance-switch to custom i18n --- .../mt-inheritance-switch.vue | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/packages/component-library/src/components/form/_internal/mt-inheritance-switch/mt-inheritance-switch.vue b/packages/component-library/src/components/form/_internal/mt-inheritance-switch/mt-inheritance-switch.vue index 1318a7b73..fa10f9074 100644 --- a/packages/component-library/src/components/form/_internal/mt-inheritance-switch/mt-inheritance-switch.vue +++ b/packages/component-library/src/components/form/_internal/mt-inheritance-switch/mt-inheritance-switch.vue @@ -11,7 +11,7 @@ v-if="isInherited" key="inherit-icon" v-tooltip="{ - message: $tc('mt-inheritance-switch.tooltipRemoveInheritance'), + message: t('tooltipRemoveInheritance'), disabled: disabled, }" data-testid="mt-inheritance-switch-icon" @@ -24,7 +24,7 @@ v-else key="uninherit-icon" v-tooltip="{ - message: $tc('mt-inheritance-switch.tooltipRestoreInheritance'), + message: t('tooltipRestoreInheritance'), disabled: disabled, }" :class="unInheritClasses" @@ -40,27 +40,11 @@ import { defineComponent } from "vue"; import MtTooltipDirective from "../../../../directives/tooltip.directive"; import MtIcon from "../../../icons-media/mt-icon/mt-icon.vue"; +import { useI18n } from "@/composables/useI18n"; export default defineComponent({ name: "MtInheritanceSwitch", - i18n: { - messages: { - en: { - "mt-inheritance-switch": { - tooltipRemoveInheritance: "Remove inheritance", - tooltipRestoreInheritance: "Restore inheritance", - }, - }, - de: { - "mt-inheritance-switch": { - tooltipRemoveInheritance: "Vererbung entfernen", - tooltipRestoreInheritance: "Vererbung wiederherstellen", - }, - }, - }, - }, - components: { "mt-icon": MtIcon, }, @@ -104,6 +88,23 @@ export default defineComponent({ this.$emit("inheritance-remove"); }, }, + + setup() { + const { t } = useI18n({ + messages: { + en: { + tooltipRemoveInheritance: "Remove inheritance", + tooltipRestoreInheritance: "Restore inheritance", + }, + de: { + tooltipRemoveInheritance: "Vererbung entfernen", + tooltipRestoreInheritance: "Vererbung wiederherstellen", + }, + }, + }); + + return { t }; + }, }); From ad42e43be7e1cdc8e938226221c82bc92d028a90 Mon Sep 17 00:00:00 2001 From: Nils Date: Tue, 5 Nov 2024 14:13:12 +0100 Subject: [PATCH 4/6] migrate mt-inheritance-switch to custom i18n --- .../mt-inheritance-switch.vue | 57 +++++++++---------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/packages/component-library/src/components/form/_internal/mt-inheritance-switch/mt-inheritance-switch.vue b/packages/component-library/src/components/form/_internal/mt-inheritance-switch/mt-inheritance-switch.vue index fa10f9074..57f440031 100644 --- a/packages/component-library/src/components/form/_internal/mt-inheritance-switch/mt-inheritance-switch.vue +++ b/packages/component-library/src/components/form/_internal/mt-inheritance-switch/mt-inheritance-switch.vue @@ -1,11 +1,13 @@ +