* Enhancement: Updates sidebar to a new design (#2733) * feat: Changes primary navbar to new design (#2598) * feat: updates design for secondary navbar (#2612) * Changes primary nvbar to new design * Updates design for contexual sidebar * Fixes issues with JSON * Remove duplication of notificatons in Navigation * Fixes broken tests * Fixes broken tests * Update app/javascript/dashboard/components/layout/AvailabilityStatus.vue * Update app/javascript/dashboard/components/layout/AvailabilityStatus.vue * Update app/javascript/dashboard/components/layout/SidebarItem.vue Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> * Update app/javascript/dashboard/components/layout/SidebarItem.vue Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> * Update app/javascript/dashboard/modules/sidebar/components/Secondary.vue Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> * Chore: Update design changes to features * Fixes menu transitions and refactors code * Refactors sidebar routeing logic * lint error fixes * Fixes dropdown menu styles * Fixes secondary new item links * Fixes lint scss issues * fixes linter issues * Fixes broken test cases * Update AvailabilityStatus.spec.js * Review feedbacks * Fixes add modal for label * Add tooltip for primary menu item * Tooltip for notifications * Adds tooltip for primary menu items * Review fixes * Review fixes * Fix merge issues * fixes logo size for login pages * fixes Merge breaks with styles * fix: Changes thumbnail colors to new color scheme Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
145 lines
3.6 KiB
Vue
145 lines
3.6 KiB
Vue
<template>
|
|
<div class="conversation--details">
|
|
<contact-details-item
|
|
v-if="initiatedAt"
|
|
:title="$t('CONTACT_PANEL.INITIATED_AT')"
|
|
:value="initiatedAt.timestamp"
|
|
class="conversation--attribute"
|
|
/>
|
|
<contact-details-item
|
|
v-if="referer"
|
|
:title="$t('CONTACT_PANEL.INITIATED_FROM')"
|
|
:value="referer"
|
|
class="conversation--attribute"
|
|
>
|
|
<a :href="referer" rel="noopener noreferrer nofollow" target="_blank">
|
|
{{ referer }}
|
|
</a>
|
|
</contact-details-item>
|
|
<contact-details-item
|
|
v-if="browserName"
|
|
:title="$t('CONTACT_PANEL.BROWSER')"
|
|
:value="browserName"
|
|
class="conversation--attribute"
|
|
/>
|
|
<contact-details-item
|
|
v-if="platformName"
|
|
:title="$t('CONTACT_PANEL.OS')"
|
|
:value="platformName"
|
|
class="conversation--attribute"
|
|
/>
|
|
<contact-details-item
|
|
v-if="ipAddress"
|
|
:title="$t('CONTACT_PANEL.IP_ADDRESS')"
|
|
:value="ipAddress"
|
|
class="conversation--attribute"
|
|
/>
|
|
<custom-attributes
|
|
attribute-type="conversation_attribute"
|
|
attribute-class="conversation--attribute"
|
|
:class="customAttributeRowClass"
|
|
/>
|
|
<custom-attribute-selector attribute-type="conversation_attribute" />
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import ContactDetailsItem from './ContactDetailsItem.vue';
|
|
import CustomAttributes from './customAttributes/CustomAttributes.vue';
|
|
import CustomAttributeSelector from './customAttributes/CustomAttributeSelector.vue';
|
|
|
|
export default {
|
|
components: {
|
|
ContactDetailsItem,
|
|
CustomAttributes,
|
|
CustomAttributeSelector,
|
|
},
|
|
props: {
|
|
conversationAttributes: {
|
|
type: Object,
|
|
default: () => ({}),
|
|
},
|
|
contactAttributes: {
|
|
type: Object,
|
|
default: () => ({}),
|
|
},
|
|
},
|
|
STATIC_ATTRIBUTES: [
|
|
{
|
|
name: 'initiated_at',
|
|
label: 'CONTACT_PANEL.INITIATED_AT',
|
|
},
|
|
{
|
|
name: 'referer',
|
|
label: 'CONTACT_PANEL.BROWSER',
|
|
},
|
|
{
|
|
name: 'browserName',
|
|
label: 'CONTACT_PANEL.BROWSER',
|
|
},
|
|
{
|
|
name: 'platformName',
|
|
label: 'CONTACT_PANEL.OS',
|
|
},
|
|
{
|
|
name: 'ipAddress',
|
|
label: 'CONTACT_PANEL.IP_ADDRESS',
|
|
},
|
|
],
|
|
computed: {
|
|
referer() {
|
|
return this.conversationAttributes.referer;
|
|
},
|
|
initiatedAt() {
|
|
return this.conversationAttributes.initiated_at;
|
|
},
|
|
browserName() {
|
|
if (!this.conversationAttributes.browser) {
|
|
return '';
|
|
}
|
|
const {
|
|
browser_name: browserName = '',
|
|
browser_version: browserVersion = '',
|
|
} = this.conversationAttributes.browser;
|
|
return `${browserName} ${browserVersion}`;
|
|
},
|
|
platformName() {
|
|
if (!this.conversationAttributes.browser) {
|
|
return '';
|
|
}
|
|
const {
|
|
platform_name: platformName,
|
|
platform_version: platformVersion,
|
|
} = this.conversationAttributes.browser;
|
|
return `${platformName || ''} ${platformVersion || ''}`;
|
|
},
|
|
ipAddress() {
|
|
const { created_at_ip: createdAtIp } = this.contactAttributes;
|
|
return createdAtIp;
|
|
},
|
|
customAttributeRowClass() {
|
|
const attributes = [
|
|
'initiatedAt',
|
|
'referer',
|
|
'browserName',
|
|
'platformName',
|
|
'ipAddress',
|
|
];
|
|
const availableAttributes = attributes.filter(
|
|
attribute => !!this[attribute]
|
|
);
|
|
return availableAttributes.length % 2 === 0 ? 'even' : 'odd';
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
<style scoped lang="scss">
|
|
.conversation--attribute {
|
|
border-bottom: 1px solid var(--color-border-light);
|
|
|
|
&:nth-child(2n) {
|
|
background: var(--s-25);
|
|
}
|
|
}
|
|
</style>
|