fix: name and email address overflow issue in customer side panel (#1348)
* Complete name and email address overflow issue * Changes as per review * Code cleanup
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
"NOT_AVAILABLE": "Not Available",
|
"NOT_AVAILABLE": "Not Available",
|
||||||
"EMAIL_ADDRESS": "Email Address",
|
"EMAIL_ADDRESS": "Email Address",
|
||||||
"PHONE_NUMBER": "Phone number",
|
"PHONE_NUMBER": "Phone number",
|
||||||
|
"COPY_SUCCESSFUL": "Copied to clipboard successfully",
|
||||||
"COMPANY": "Company",
|
"COMPANY": "Company",
|
||||||
"LOCATION": "Location",
|
"LOCATION": "Location",
|
||||||
"CONVERSATION_TITLE": "Conversation Details",
|
"CONVERSATION_TITLE": "Conversation Details",
|
||||||
|
|||||||
@@ -23,7 +23,9 @@
|
|||||||
:value="contact.email"
|
:value="contact.email"
|
||||||
icon="ion-email"
|
icon="ion-email"
|
||||||
:title="$t('CONTACT_PANEL.EMAIL_ADDRESS')"
|
:title="$t('CONTACT_PANEL.EMAIL_ADDRESS')"
|
||||||
|
show-copy
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<contact-info-row
|
<contact-info-row
|
||||||
:href="contact.phone_number ? `tel:${contact.phone_number}` : ''"
|
:href="contact.phone_number ? `tel:${contact.phone_number}` : ''"
|
||||||
:value="contact.phone_number"
|
:value="contact.phone_number"
|
||||||
@@ -120,6 +122,7 @@ export default {
|
|||||||
|
|
||||||
.contact--details {
|
.contact--details {
|
||||||
margin-top: $space-small;
|
margin-top: $space-small;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
p {
|
p {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
@@ -136,7 +139,7 @@ export default {
|
|||||||
.contact--name {
|
.contact--name {
|
||||||
@include text-ellipsis;
|
@include text-ellipsis;
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
|
white-space: normal;
|
||||||
font-weight: $font-weight-bold;
|
font-weight: $font-weight-bold;
|
||||||
font-size: $font-size-default;
|
font-size: $font-size-default;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,21 @@
|
|||||||
<div class="contact-info--row">
|
<div class="contact-info--row">
|
||||||
<a v-if="href" :href="href" class="contact-info--details">
|
<a v-if="href" :href="href" class="contact-info--details">
|
||||||
<i :class="icon" class="contact-info--icon" />
|
<i :class="icon" class="contact-info--icon" />
|
||||||
<span v-if="value" class="text-truncate">{{ value }}</span>
|
<span v-if="value" class="text-truncate" :title="value">{{ value }}</span>
|
||||||
<span v-else class="text-muted">{{
|
<span v-else class="text-muted">{{
|
||||||
$t('CONTACT_PANEL.NOT_AVAILABLE')
|
$t('CONTACT_PANEL.NOT_AVAILABLE')
|
||||||
}}</span>
|
}}</span>
|
||||||
|
|
||||||
|
<button
|
||||||
|
v-if="showCopy"
|
||||||
|
type="submit"
|
||||||
|
class="button nice link hollow grey-btn"
|
||||||
|
@click="onCopy"
|
||||||
|
>
|
||||||
|
<i class="icon copy-icon ion-clipboard"></i>
|
||||||
|
</button>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div v-else class="contact-info--details">
|
<div v-else class="contact-info--details">
|
||||||
<i :class="icon" class="contact-info--icon" />
|
<i :class="icon" class="contact-info--icon" />
|
||||||
<span v-if="value" class="text-truncate">{{ value }}</span>
|
<span v-if="value" class="text-truncate">{{ value }}</span>
|
||||||
@@ -17,7 +27,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import copy from 'copy-text-to-clipboard';
|
||||||
|
import alertMixin from 'shared/mixins/alertMixin';
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [alertMixin],
|
||||||
props: {
|
props: {
|
||||||
href: {
|
href: {
|
||||||
type: String,
|
type: String,
|
||||||
@@ -31,6 +44,17 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
|
showCopy: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onCopy(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
copy(this.value);
|
||||||
|
this.showAlert(this.$t('CONTACT_PANEL.COPY_SUCCESSFUL'));
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -50,6 +74,13 @@ export default {
|
|||||||
margin-bottom: $space-smaller;
|
margin-bottom: $space-smaller;
|
||||||
color: $color-body;
|
color: $color-body;
|
||||||
|
|
||||||
|
.copy-icon {
|
||||||
|
margin-left: $space-one;
|
||||||
|
&:hover {
|
||||||
|
color: $color-woot;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&.a {
|
&.a {
|
||||||
&:hover {
|
&:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
|
|||||||
Reference in New Issue
Block a user