feat(editor): Migrate copyPaste mixin to composables (no-changelog) (#8179)

This commit is contained in:
Alex Grozav
2023-12-29 12:13:24 +02:00
committed by GitHub
parent 216ec079c9
commit f5a4bfe40c
27 changed files with 212 additions and 332 deletions

View File

@@ -4,14 +4,14 @@ import { computed, nextTick, onMounted, ref, watch } from 'vue';
import type { EnvironmentVariable, Rule, RuleGroup } from '@/Interface';
import { useI18n } from '@/composables/useI18n';
import { useToast } from '@/composables/useToast';
import { useCopyToClipboard } from '@/composables/useCopyToClipboard';
import { useClipboard } from '@/composables/useClipboard';
import { EnterpriseEditionFeature } from '@/constants';
import { useSettingsStore } from '@/stores/settings.store';
import { useUsersStore } from '@/stores/users.store';
import { getVariablesPermissions } from '@/permissions';
const i18n = useI18n();
const copyToClipboard = useCopyToClipboard();
const clipboard = useClipboard();
const { showMessage } = useToast();
const settingsStore = useSettingsStore();
const usersStore = useUsersStore();
@@ -120,7 +120,7 @@ function onValidate(key: string, value: boolean) {
}
function onUsageClick() {
copyToClipboard(usage.value);
void clipboard.copy(usage.value);
showMessage({
title: i18n.baseText('variables.row.usage.copiedToClipboard'),
type: 'success',