Compare commits

...
2 changed files with 32 additions and 16 deletions
@@ -193,6 +193,7 @@ export default {
.map(view => ({ .map(view => ({
id: view.id, id: view.id,
label: view.name, label: view.name,
count: view.count,
truncateLabel: true, truncateLabel: true,
toState: frontendURL( toState: frontendURL(
`accounts/${this.accountId}/custom_view/${view.id}` `accounts/${this.accountId}/custom_view/${view.id}`
@@ -211,6 +212,7 @@ export default {
.map(view => ({ .map(view => ({
id: view.id, id: view.id,
label: view.name, label: view.name,
count: view.count,
truncateLabel: true, truncateLabel: true,
toState: frontendURL( toState: frontendURL(
`accounts/${this.accountId}/contacts/custom_view/${view.id}` `accounts/${this.accountId}/contacts/custom_view/${view.id}`
@@ -20,19 +20,22 @@
class="badge--label" class="badge--label"
:style="{ backgroundColor: labelColor }" :style="{ backgroundColor: labelColor }"
/> />
<span <div class="menu-label--wrapper">
:title="menuTitle" <span
class="menu-label button__content" :title="menuTitle"
:class="{ 'text-truncate': shouldTruncate }" class="menu-label button__content"
> :class="{ 'text-truncate': shouldTruncate }"
{{ label }} >
<span v-if="showChildCount" class="count-view"> {{ label }}
</span>
<span
v-if="showChildCount"
class="count-view"
:class="isCountZero ? 'text-muted' : 'text-color'"
>
{{ childItemCount }} {{ childItemCount }}
</span> </span>
</span> </div>
<span v-if="count" class="badge" :class="{ secondary: !isActive }">
{{ count }}
</span>
<span v-if="warningIcon" class="badge--icon"> <span v-if="warningIcon" class="badge--icon">
<fluent-icon <fluent-icon
v-tooltip.top-end="$t('SIDEBAR.FACEBOOK_REAUTHORIZE')" v-tooltip.top-end="$t('SIDEBAR.FACEBOOK_REAUTHORIZE')"
@@ -72,10 +75,6 @@ export default {
type: String, type: String,
default: '', default: '',
}, },
count: {
type: String,
default: '',
},
showChildCount: { showChildCount: {
type: Boolean, type: Boolean,
default: false, default: false,
@@ -89,6 +88,9 @@ export default {
showIcon() { showIcon() {
return { 'text-truncate': this.shouldTruncate }; return { 'text-truncate': this.shouldTruncate };
}, },
isCountZero() {
return this.childItemCount === 0;
},
menuTitle() { menuTitle() {
return this.shouldTruncate ? this.label : ''; return this.shouldTruncate ? this.label : '';
}, },
@@ -134,6 +136,15 @@ $label-badge-size: var(--space-slab);
} }
} }
.menu-label--wrapper {
align-items: center;
display: flex;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 100%;
}
.menu-label { .menu-label {
flex-grow: 1; flex-grow: 1;
} }
@@ -174,11 +185,14 @@ $label-badge-size: var(--space-slab);
.count-view { .count-view {
background: var(--s-50); background: var(--s-50);
border-radius: var(--border-radius-normal); border-radius: var(--border-radius-normal);
color: var(--s-600);
font-size: var(--font-size-micro); font-size: var(--font-size-micro);
font-weight: var(--font-weight-bold); font-weight: var(--font-weight-bold);
margin-left: var(--space-smaller); margin-left: var(--space-smaller);
padding: var(--space-zero) var(--space-smaller); padding: var(--space-zero) var(--space-smaller);
line-height: var(--font-size-small); line-height: var(--font-size-small);
&.text-color {
color: var(--s-600);
}
} }
</style> </style>