Skip to content

Commit

Permalink
fix: replaced salutation & organization with Link field in contact
Browse files Browse the repository at this point in the history
  • Loading branch information
shariquerik committed Nov 13, 2023
1 parent 21cc553 commit cc1657e
Showing 1 changed file with 15 additions and 25 deletions.
40 changes: 15 additions & 25 deletions frontend/src/pages/Contact.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,13 @@
</Button>
</template>
</Dropdown>
<FormControl
<Link
v-else-if="field.type === 'link'"
type="autocomplete"
class="form-control"
:value="contact[field.name]"
:options="field.options"
@change="(e) => e && field.change(e)"
:doctype="field.doctype"
:placeholder="field.placeholder"
class="form-control"
@change="(e) => e && field.change(e)"
/>
<FormControl
v-else
Expand Down Expand Up @@ -215,6 +214,7 @@
</template>

<script setup>
import Link from '@/components/Controls/Link.vue'
import {
FormControl,
FeatherIcon,
Expand Down Expand Up @@ -256,7 +256,7 @@ import { useRouter } from 'vue-router'
const { getContactByName, contacts } = contactsStore()
const { getUser } = usersStore()
const { getOrganization, getOrganizationOptions } = organizationsStore()
const { getOrganization } = organizationsStore()
const props = defineProps({
contactId: {
Expand Down Expand Up @@ -530,21 +530,11 @@ const details = computed(() => {
label: 'Salutation',
type: 'link',
name: 'salutation',
placeholder: 'Mr./Mrs./Ms.',
options: [
{ label: 'Dr', value: 'Dr' },
{ label: 'Mr', value: 'Mr' },
{ label: 'Mrs', value: 'Mrs' },
{ label: 'Ms', value: 'Ms' },
{ label: 'Mx', value: 'Mx' },
{ label: 'Prof', value: 'Prof' },
{ label: 'Master', value: 'Master' },
{ label: 'Madam', value: 'Madam' },
{ label: 'Miss', value: 'Miss' },
],
change: (data) => {
contact.value.salutation = data.value
updateContact('salutation', data.value)
placeholder: 'Mr./Mrs./Ms...',
doctype: 'Salutation',
change: (value) => {
contact.value.salutation = value
updateContact('salutation', value)
},
},
{
Expand Down Expand Up @@ -626,10 +616,10 @@ const details = computed(() => {
type: 'link',
name: 'company_name',
placeholder: 'Select organization',
options: getOrganizationOptions(),
change: (data) => {
contact.value.company_name = data.value
updateContact('company_name', data.value)
doctype: 'CRM Organization',
change: (value) => {
contact.value.company_name = value
updateContact('company_name', value)
},
link: (data) => {
router.push({
Expand Down

0 comments on commit cc1657e

Please sign in to comment.