Skip to content

Commit

Permalink
fix: search for destination and display name[WTEL-4985/4776]
Browse files Browse the repository at this point in the history
  • Loading branch information
Lera24 committed Sep 16, 2024
1 parent 0c6173a commit 6cc39a7
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 64 deletions.
88 changes: 44 additions & 44 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@vuelidate/core": "^2.0.3",
"@vuelidate/validators": "^2.0.4",
"@vueuse/core": "^11.0.3",
"@webitel/ui-sdk": "^24.10.5",
"@webitel/ui-sdk": "^24.10.8",
"axios": "^1.7.7",
"deep-equal": "^2.2.1",
"dompurify": "^3.1.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('OpenedContactGeneral', () => {
it('renders a component', () => {
const wrapper = shallowMount(OpenedContactGeneral, {
props: {
commonName: 'jest',
name: 'jest',
},
global: {
provide: {
Expand Down
14 changes: 5 additions & 9 deletions src/modules/contacts/components/contact-popup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
<template #main>
<form class="contact-popup-form">
<wt-input
:value="draft.name.commonName"
:value="draft.name"
:label="t('reusable.name')"
:v="v$.draft.name.commonName"
:v="v$.draft.name"
required
prevent-trim
@input="draft.name.commonName = $event"
@input="draft.name = $event"
/>
<wt-select
:value="draft.timezones[0]?.timezone"
Expand Down Expand Up @@ -94,9 +94,7 @@ const store = useStore();
const userinfo = computed(() => store.state.userinfo);
const generateNewDraft = () => ({
name: {
commonName: '',
},
name: '',
timezones: [],
managers: [],
labels: [],
Expand All @@ -108,9 +106,7 @@ const draft = ref(generateNewDraft());
const v$ = useVuelidate(computed(() => ({
draft: {
name: {
commonName: { required },
},
name: { required },
},
})), { draft }, { $autoDirty: true });
Expand Down
8 changes: 4 additions & 4 deletions src/modules/contacts/components/opened-contact-general.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@

<wt-avatar
size="3xl"
:username="commonName"
:username="name"
/>

<p class="opened-contact-general-name">
{{ commonName }}
{{ name }}
</p>

<wt-divider />
Expand Down Expand Up @@ -103,9 +103,9 @@ import { useI18n } from 'vue-i18n';
const access = inject('access');
const props = defineProps({
commonName: {
name: {
type: String,
required: true,
default: ''
},
timezones: {
type: Array,
Expand Down
4 changes: 2 additions & 2 deletions src/modules/contacts/components/opened-contact.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/>
<div class="opened-contact-content">
<opened-contact-general
:common-name="itemInstance.name ? itemInstance.name.commonName : ''"
:name="itemInstance.name"
:timezones="itemInstance.timezones ? itemInstance.timezones : []"
:managers="itemInstance.managers ? itemInstance.managers : []"
:about="itemInstance.about"
Expand Down Expand Up @@ -108,7 +108,7 @@ const path = computed(() => {
{ name: t('crm') },
{ name: t('contacts.contact', 2), route: baseUrl },
{
name: itemInstance.value?.name?.commonName || 'Contact',
name: itemInstance.value?.name || 'Contact',
route: `/contacts/${id.value}`,
},
];
Expand Down
4 changes: 1 addition & 3 deletions src/modules/contacts/store/contacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ import variables from '../modules/variables/store/variables';

const cardState = {
itemInstance: {
name: {
commonName: '',
},
name: '',
timezones: [],
managers: [],
labels: [],
Expand Down

0 comments on commit 6cc39a7

Please sign in to comment.