fix: Truncate long label names in the sidebar (#1309)
Co-authored-by: Pranav Raj S <pranav@thoughtwoot.com>
This commit is contained in:
parent
3bb2d27646
commit
7d409321e9
2 changed files with 17 additions and 4 deletions
|
@ -275,6 +275,7 @@ export default {
|
||||||
id: label.id,
|
id: label.id,
|
||||||
label: label.title,
|
label: label.title,
|
||||||
color: label.color,
|
color: label.color,
|
||||||
|
truncateLabel: true,
|
||||||
toState: frontendURL(
|
toState: frontendURL(
|
||||||
`accounts/${this.accountId}/label/${label.title}`
|
`accounts/${this.accountId}/label/${label.title}`
|
||||||
),
|
),
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
tag="li"
|
tag="li"
|
||||||
:to="child.toState"
|
:to="child.toState"
|
||||||
>
|
>
|
||||||
<a href="#">
|
<a href="#" :class="computedChildClass(child)">
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
<i
|
<i
|
||||||
v-if="computedInboxClass(child)"
|
v-if="computedInboxClass(child)"
|
||||||
|
@ -42,9 +42,13 @@
|
||||||
class="label-color--display"
|
class="label-color--display"
|
||||||
:style="{ backgroundColor: child.color }"
|
:style="{ backgroundColor: child.color }"
|
||||||
/>
|
/>
|
||||||
|
<div
|
||||||
|
:title="computedChildTitle(child)"
|
||||||
|
:class="computedChildClass(child)"
|
||||||
|
>
|
||||||
{{ child.label }}
|
{{ child.label }}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</router-link>
|
</router-link>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -52,7 +56,6 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
/* eslint no-console: 0 */
|
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
|
|
||||||
import router from '../../routes';
|
import router from '../../routes';
|
||||||
|
@ -125,6 +128,14 @@ export default {
|
||||||
const classByType = getInboxClassByType(type, phoneNumber);
|
const classByType = getInboxClassByType(type, phoneNumber);
|
||||||
return classByType;
|
return classByType;
|
||||||
},
|
},
|
||||||
|
computedChildClass(child) {
|
||||||
|
if (!child.truncateLabel) return '';
|
||||||
|
return 'text-truncate';
|
||||||
|
},
|
||||||
|
computedChildTitle(child) {
|
||||||
|
if (!child.truncateLabel) return false;
|
||||||
|
return child.label;
|
||||||
|
},
|
||||||
newLinkClick() {
|
newLinkClick() {
|
||||||
router.push({ name: 'settings_inbox_new', params: { page: 'new' } });
|
router.push({ name: 'settings_inbox_new', params: { page: 'new' } });
|
||||||
},
|
},
|
||||||
|
@ -151,6 +162,7 @@ export default {
|
||||||
border-radius: $space-smaller;
|
border-radius: $space-smaller;
|
||||||
height: $space-normal;
|
height: $space-normal;
|
||||||
margin-right: $space-small;
|
margin-right: $space-small;
|
||||||
|
min-width: $space-normal;
|
||||||
width: $space-normal;
|
width: $space-normal;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue