truncate name

This commit is contained in:
Mutasem 2022-03-28 13:36:11 +02:00
parent 4c3231e156
commit 6d49f99d16
2 changed files with 8 additions and 2 deletions

View file

@ -15,7 +15,7 @@
</div>
</div>
<span :class="$style.title" slot="reference">
{{value}}
<WorkflowNameShort :name="value" :limit="40" />
<font-awesome-icon :class="$style.editIcon" icon="pencil-alt" />
</span>
</el-popover>
@ -24,8 +24,10 @@
<script lang="ts">
import Vue from 'vue';
import WorkflowNameShort from './WorkflowNameShort.vue';
export default Vue.extend({
components: { WorkflowNameShort },
name: 'NodeTitle',
props: {
value: {

View file

@ -1,6 +1,7 @@
<template>
<span :title="name">
<slot :shortenedName="shortenedName"></slot>
<slot v-if="hasDefaultSlot" :shortenedName="shortenedName"></slot>
{{ shortenedName }}
</span>
</template>
@ -14,6 +15,9 @@ export default Vue.extend({
name: "WorkflowNameShort",
props: ["name", "limit"],
computed: {
hasDefaultSlot(): boolean {
return !!this.$slots.default;
},
shortenedName(): string {
const name = this.$props.name;