refactor(editor): Move editor-ui and design-system to frontend dir (no-changelog) (#13564)

This commit is contained in:
Alex Grozav
2025-02-28 14:28:30 +02:00
committed by GitHub
parent 684353436d
commit f5743176e5
1635 changed files with 805 additions and 1079 deletions

View File

@@ -0,0 +1,50 @@
<script lang="ts" setup>
import { useCredentialsStore } from '@/stores/credentials.store';
import { useI18n } from '@/composables/useI18n';
import { computed } from 'vue';
const credentialsStore = useCredentialsStore();
const i18n = useI18n();
const props = defineProps<{
activeCredentialType: string;
scopes: string[];
}>();
const shortCredentialDisplayName = computed((): string => {
const oauth1Api = i18n.baseText('generic.oauth1Api');
const oauth2Api = i18n.baseText('generic.oauth2Api');
return (
credentialsStore
.getCredentialTypeByName(props.activeCredentialType)
?.displayName.replace(new RegExp(`${oauth1Api}|${oauth2Api}`), '')
.trim() || ''
);
});
const scopesShortContent = computed((): string => {
return i18n.baseText('nodeSettings.scopes.notice', {
adjustToNumber: props.scopes.length,
interpolate: {
activeCredential: shortCredentialDisplayName.value,
},
});
});
const scopesFullContent = computed((): string => {
return i18n.baseText('nodeSettings.scopes.expandedNoticeWithScopes', {
adjustToNumber: props.scopes.length,
interpolate: {
activeCredential: shortCredentialDisplayName.value,
scopes: props.scopes
.map((s: string) => (s.includes('/') ? s.split('/').pop() : s))
.join('<br>'),
},
});
});
</script>
<template>
<n8n-notice :content="scopesShortContent" :full-content="scopesFullContent" />
</template>