mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-15 09:04:07 -08:00
9c94050deb
* refactor: replace Vue.extend with defineComponent in editor-ui * fix: change $externalHooks extractions from mixins * fix: refactor externalHooks mixin
28 lines
583 B
Vue
28 lines
583 B
Vue
<template>
|
|
<span :title="name" :data-test-id="testId">
|
|
<slot :shortenedName="shortenedName"></slot>
|
|
</span>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { defineComponent } from 'vue';
|
|
import { shorten } from '@/utils';
|
|
|
|
const DEFAULT_WORKFLOW_NAME_LIMIT = 25;
|
|
const WORKFLOW_NAME_END_COUNT_TO_KEEP = 4;
|
|
|
|
export default defineComponent({
|
|
name: 'ShortenName',
|
|
props: ['name', 'limit', 'testId'],
|
|
computed: {
|
|
shortenedName(): string {
|
|
return shorten(
|
|
this.name,
|
|
this.limit || DEFAULT_WORKFLOW_NAME_LIMIT,
|
|
WORKFLOW_NAME_END_COUNT_TO_KEEP,
|
|
);
|
|
},
|
|
},
|
|
});
|
|
</script>
|