fix: Title cases everywhere possible

This commit is contained in:
Shariq Ansari 2023-11-28 17:49:04 +05:30
parent 59f238ebc7
commit b1584eaa36
18 changed files with 70 additions and 70 deletions

View File

@ -165,10 +165,10 @@ def get_field_obj(field):
"name": field.fieldname, "name": field.fieldname,
} }
obj["placeholder"] = "Add " + field.label.lower() + "..." obj["placeholder"] = "Add " + field.label + "..."
if field.fieldtype == "Link": if field.fieldtype == "Link":
obj["placeholder"] = "Select " + field.label.lower() + "..." obj["placeholder"] = "Select " + field.label + "..."
obj["doctype"] = field.options obj["doctype"] = field.options
elif field.fieldtype == "Select": elif field.fieldtype == "Select":
obj["options"] = [{"label": option, "value": option} for option in field.options.split("\n")] obj["options"] = [{"label": option, "value": option} for option in field.options.split("\n")]

View File

@ -68,7 +68,7 @@ class CRMCallLog(Document):
'width': '9rem', 'width': '9rem',
}, },
{ {
'label': 'Created on', 'label': 'Created On',
'type': 'Datetime', 'type': 'Datetime',
'key': 'creation', 'key': 'creation',
'width': '8rem', 'width': '8rem',

View File

@ -86,20 +86,20 @@ class CRMDeal(Document):
'width': '12rem', 'width': '12rem',
}, },
{ {
'label': 'Mobile no', 'label': 'Mobile No',
'type': 'Data', 'type': 'Data',
'key': 'mobile_no', 'key': 'mobile_no',
'width': '11rem', 'width': '11rem',
}, },
{ {
'label': 'Deal owner', 'label': 'Deal Owner',
'type': 'Link', 'type': 'Link',
'key': 'deal_owner', 'key': 'deal_owner',
'options': 'User', 'options': 'User',
'width': '10rem', 'width': '10rem',
}, },
{ {
'label': 'Last modified', 'label': 'Last Modified',
'type': 'Datetime', 'type': 'Datetime',
'key': 'modified', 'key': 'modified',
'width': '8rem', 'width': '8rem',

View File

@ -165,20 +165,20 @@ class CRMLead(Document):
'width': '12rem', 'width': '12rem',
}, },
{ {
'label': 'Mobile no', 'label': 'Mobile No',
'type': 'Data', 'type': 'Data',
'key': 'mobile_no', 'key': 'mobile_no',
'width': '11rem', 'width': '11rem',
}, },
{ {
'label': 'Lead owner', 'label': 'Lead Owner',
'type': 'Link', 'type': 'Link',
'key': 'lead_owner', 'key': 'lead_owner',
'options': 'User', 'options': 'User',
'width': '10rem', 'width': '10rem',
}, },
{ {
'label': 'Last modified', 'label': 'Last Modified',
'type': 'Datetime', 'type': 'Datetime',
'key': 'modified', 'key': 'modified',
'width': '8rem', 'width': '8rem',

View File

@ -46,7 +46,7 @@ class CRMOrganization(Document):
'width': '14rem', 'width': '14rem',
}, },
{ {
'label': 'Last modified', 'label': 'Last Modified',
'type': 'Datetime', 'type': 'Datetime',
'key': 'modified', 'key': 'modified',
'width': '8rem', 'width': '8rem',

View File

@ -45,7 +45,7 @@ class CustomContact(Contact):
'width': '12rem', 'width': '12rem',
}, },
{ {
'label': 'Last modified', 'label': 'Last Modified',
'type': 'Datetime', 'type': 'Datetime',
'key': 'modified', 'key': 'modified',
'width': '8rem', 'width': '8rem',

View File

@ -11,19 +11,19 @@
<template #prefix> <template #prefix>
<PhoneIcon class="h-4 w-4" /> <PhoneIcon class="h-4 w-4" />
</template> </template>
<span>Make a call</span> <span>Make a Call</span>
</Button> </Button>
<Button v-else-if="title == 'Notes'" variant="solid" @click="showNote()"> <Button v-else-if="title == 'Notes'" variant="solid" @click="showNote()">
<template #prefix> <template #prefix>
<FeatherIcon name="plus" class="h-4 w-4" /> <FeatherIcon name="plus" class="h-4 w-4" />
</template> </template>
<span>New note</span> <span>New Note</span>
</Button> </Button>
<Button v-else-if="title == 'Tasks'" variant="solid" @click="showTask()"> <Button v-else-if="title == 'Tasks'" variant="solid" @click="showTask()">
<template #prefix> <template #prefix>
<FeatherIcon name="plus" class="h-4 w-4" /> <FeatherIcon name="plus" class="h-4 w-4" />
</template> </template>
<span>New task</span> <span>New Task</span>
</Button> </Button>
</div> </div>
<div v-if="activities?.length" class="flex-1 overflow-y-auto"> <div v-if="activities?.length" class="flex-1 overflow-y-auto">
@ -118,7 +118,7 @@
:options="taskStatusOptions(updateTaskStatus, task)" :options="taskStatusOptions(updateTaskStatus, task)"
@click.stop @click.stop
> >
<Tooltip text="Change status"> <Tooltip text="Change Status">
<Button variant="ghosted" class="hover:bg-gray-300"> <Button variant="ghosted" class="hover:bg-gray-300">
<TaskStatusIcon :status="task.status" /> <TaskStatusIcon :status="task.status" />
</Button> </Button>
@ -131,7 +131,7 @@
label: 'Delete', label: 'Delete',
onClick: () => { onClick: () => {
$dialog({ $dialog({
title: 'Delete task', title: 'Delete Task',
message: 'Are you sure you want to delete this task?', message: 'Are you sure you want to delete this task?',
actions: [ actions: [
{ {
@ -187,7 +187,7 @@
> >
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<div> <div>
{{ call.type == 'Incoming' ? 'Inbound' : 'Outbound' }} call {{ call.type == 'Incoming' ? 'Inbound' : 'Outbound' }} Call
</div> </div>
<div> <div>
<Tooltip <Tooltip
@ -213,7 +213,7 @@
<PlayIcon class="h-4 w-4 text-gray-600" /> <PlayIcon class="h-4 w-4 text-gray-600" />
<div class="text-sm text-gray-600"> <div class="text-sm text-gray-600">
{{ {{
call.show_recording ? 'Hide recording' : 'Listen to call' call.show_recording ? 'Hide Recording' : 'Listen to Call'
}} }}
</div> </div>
</div> </div>
@ -226,7 +226,7 @@
class="audio-control" class="audio-control"
controls controls
:src="call.recording_url" :src="call.recording_url"
></audio> />
</div> </div>
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<div class="flex items-center gap-1"> <div class="flex items-center gap-1">
@ -336,7 +336,7 @@
> >
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<div> <div>
{{ activity.type == 'Incoming' ? 'Inbound' : 'Outbound' }} call {{ activity.type == 'Incoming' ? 'Inbound' : 'Outbound' }} Call
</div> </div>
<div> <div>
<Tooltip <Tooltip
@ -362,7 +362,7 @@
<PlayIcon class="h-4 w-4 text-gray-600" /> <PlayIcon class="h-4 w-4 text-gray-600" />
<div class="text-sm text-gray-600"> <div class="text-sm text-gray-600">
{{ {{
activity.show_recording ? 'Hide recording' : 'Listen to call' activity.show_recording ? 'Hide Recording' : 'Listen to Call'
}} }}
</div> </div>
</div> </div>
@ -534,7 +534,7 @@
<div v-if="activity.other_versions"> <div v-if="activity.other_versions">
<Button <Button
:label=" :label="
activity.show_others ? 'Hide all changes' : 'Show all changes' activity.show_others ? 'Hide all Changes' : 'Show all Changes'
" "
variant="outline" variant="outline"
@click="activity.show_others = !activity.show_others" @click="activity.show_others = !activity.show_others"
@ -560,25 +560,25 @@
<Button <Button
v-if="title == 'Calls'" v-if="title == 'Calls'"
variant="solid" variant="solid"
label="Make a call" label="Make a Call"
@click="makeCall(doc.data.mobile_no)" @click="makeCall(doc.data.mobile_no)"
/> />
<Button <Button
v-else-if="title == 'Notes'" v-else-if="title == 'Notes'"
variant="solid" variant="solid"
label="Create note" label="Create Note"
@click="showNote()" @click="showNote()"
/> />
<Button <Button
v-else-if="title == 'Emails'" v-else-if="title == 'Emails'"
variant="solid" variant="solid"
label="Send email" label="Send Email"
@click="$refs.emailBox.show = true" @click="$refs.emailBox.show = true"
/> />
<Button <Button
v-else-if="title == 'Tasks'" v-else-if="title == 'Tasks'"
variant="solid" variant="solid"
label="Create task" label="Create Task"
@click="showTask()" @click="showTask()"
/> />
</div> </div>
@ -825,13 +825,13 @@ function update_activities_details(activity) {
} }
const emptyText = computed(() => { const emptyText = computed(() => {
let text = 'No email communications' let text = 'No Email Communications'
if (props.title == 'Calls') { if (props.title == 'Calls') {
text = 'No call logs' text = 'No Call Logs'
} else if (props.title == 'Notes') { } else if (props.title == 'Notes') {
text = 'No notes' text = 'No Notes'
} else if (props.title == 'Tasks') { } else if (props.title == 'Tasks') {
text = 'No tasks' text = 'No Tasks'
} }
return text return text
}) })

View File

@ -29,7 +29,7 @@
<Button <Button
variant="ghost" variant="ghost"
class="w-full !justify-start" class="w-full !justify-start"
label="Create one" label="Create New"
@click="attrs.onCreate(value, close)" @click="attrs.onCreate(value, close)"
> >
<template #prefix> <template #prefix>

View File

@ -78,7 +78,7 @@
class="!text-gray-600" class="!text-gray-600"
variant="ghost" variant="ghost"
@click="togglePopover()" @click="togglePopover()"
label="Add filter" label="Add Filter"
> >
<template #prefix> <template #prefix>
<FeatherIcon name="plus" class="h-4" /> <FeatherIcon name="plus" class="h-4" />
@ -90,7 +90,7 @@
v-if="storage.size" v-if="storage.size"
class="!text-gray-600" class="!text-gray-600"
variant="ghost" variant="ghost"
label="Clear all filter" label="Clear all Filter"
@click="clearfilter(close)" @click="clearfilter(close)"
/> />
</div> </div>

View File

@ -95,7 +95,7 @@
<Button <Button
variant="ghost" variant="ghost"
class="w-full !justify-start" class="w-full !justify-start"
label="Create one" label="Create New"
@click="field.create()" @click="field.create()"
> >
<template #prefix> <template #prefix>
@ -241,7 +241,7 @@ function handleContactUpdate(doc) {
} }
const dialogOptions = computed(() => { const dialogOptions = computed(() => {
let title = !editMode.value ? 'New contact' : _contact.value.full_name let title = !editMode.value ? 'New Contact' : _contact.value.full_name
let size = detailMode.value ? '' : 'xl' let size = detailMode.value ? '' : 'xl'
let actions = detailMode.value let actions = detailMode.value
@ -323,12 +323,12 @@ const sections = computed(() => {
{ {
fields: [ fields: [
{ {
label: 'First name', label: 'First Name',
type: 'data', type: 'data',
name: 'first_name', name: 'first_name',
}, },
{ {
label: 'Last name', label: 'Last Name',
type: 'data', type: 'data',
name: 'last_name', name: 'last_name',
}, },
@ -353,10 +353,10 @@ const sections = computed(() => {
new_field.value = { new_field.value = {
type: 'email', type: 'email',
value, value,
placeholder: 'Add email address', placeholder: 'Add Email Address',
} }
_dialogOptions.value = { _dialogOptions.value = {
title: 'Add email', title: 'Add Email',
actions: [ actions: [
{ {
label: 'Add', label: 'Add',
@ -373,7 +373,7 @@ const sections = computed(() => {
{ {
fields: [ fields: [
{ {
label: 'Mobile no.', label: 'Mobile No.',
type: 'dropdown', type: 'dropdown',
name: 'mobile_no', name: 'mobile_no',
options: props.contact?.phone_nos?.map((phone) => { options: props.contact?.phone_nos?.map((phone) => {
@ -389,10 +389,10 @@ const sections = computed(() => {
new_field.value = { new_field.value = {
type: 'tel', type: 'tel',
value, value,
placeholder: 'Add mobile no.', placeholder: 'Add Mobile No.',
} }
_dialogOptions.value = { _dialogOptions.value = {
title: 'Add mobile no.', title: 'Add Mobile No.',
actions: [ actions: [
{ {
label: 'Add', label: 'Add',
@ -408,7 +408,7 @@ const sections = computed(() => {
label: 'Gender', label: 'Gender',
type: 'link', type: 'link',
name: 'gender', name: 'gender',
placeholder: 'Select gender', placeholder: 'Select Gender',
doctype: 'Gender', doctype: 'Gender',
change: (value) => { change: (value) => {
_contact.value.gender = value _contact.value.gender = value
@ -422,7 +422,7 @@ const sections = computed(() => {
label: 'Organization', label: 'Organization',
type: 'link', type: 'link',
name: 'company_name', name: 'company_name',
placeholder: 'Select organization', placeholder: 'Select Organization',
doctype: 'CRM Organization', doctype: 'CRM Organization',
change: (value) => { change: (value) => {
_contact.value.company_name = value _contact.value.company_name = value
@ -451,7 +451,7 @@ const sections = computed(() => {
label: 'Address', label: 'Address',
type: 'link', type: 'link',
name: 'address', name: 'address',
placeholder: 'Select address', placeholder: 'Select Address',
doctype: 'Address', doctype: 'Address',
change: (value) => { change: (value) => {
_contact.value.address = value _contact.value.address = value

View File

@ -33,7 +33,7 @@
:bubbleMenu="true" :bubbleMenu="true"
:content="_note.content" :content="_note.content"
@change="(val) => (_note.content = val)" @change="(val) => (_note.content = val)"
placeholder="Type a content" placeholder="Type a Content"
/> />
</div> </div>
</div> </div>

View File

@ -41,10 +41,10 @@
type="text" type="text"
ref="title" ref="title"
size="md" size="md"
label="Organization name" label="Organization Name"
variant="outline" variant="outline"
v-model="_organization.organization_name" v-model="_organization.organization_name"
placeholder="Add organization name" placeholder="Add Organization Name"
/> />
<div class="flex gap-4"> <div class="flex gap-4">
<FormControl <FormControl
@ -54,16 +54,16 @@
label="Website" label="Website"
variant="outline" variant="outline"
v-model="_organization.website" v-model="_organization.website"
placeholder="Add website" placeholder="Add Website"
/> />
<FormControl <FormControl
class="flex-1" class="flex-1"
type="text" type="text"
size="md" size="md"
label="Annual revenue" label="Annual Revenue"
variant="outline" variant="outline"
v-model="_organization.annual_revenue" v-model="_organization.annual_revenue"
placeholder="Add annual revenue" placeholder="Add Annual Revenue"
/> />
</div> </div>
<div class="flex gap-4"> <div class="flex gap-4">
@ -81,7 +81,7 @@
'10001+', '10001+',
]" ]"
size="md" size="md"
label="No. of employees" label="No. of Employees"
variant="outline" variant="outline"
v-model="_organization.no_of_employees" v-model="_organization.no_of_employees"
/> />
@ -92,7 +92,7 @@
variant="outline" variant="outline"
v-model="_organization.industry" v-model="_organization.industry"
doctype="CRM Industry" doctype="CRM Industry"
placeholder="Add industry" placeholder="Add Industry"
/> />
</div> </div>
</div> </div>
@ -224,7 +224,7 @@ function handleOrganizationUpdate(doc) {
const dialogOptions = computed(() => { const dialogOptions = computed(() => {
let title = !editMode.value let title = !editMode.value
? 'New organization' ? 'New Organization'
: _organization.value.organization_name : _organization.value.organization_name
let size = detailMode.value ? '' : 'xl' let size = detailMode.value ? '' : 'xl'
let actions = detailMode.value let actions = detailMode.value

View File

@ -21,7 +21,7 @@
ref="title" ref="title"
variant="outline" variant="outline"
v-model="_task.title" v-model="_task.title"
placeholder="Add title" placeholder="Add Title"
/> />
</div> </div>
<div> <div>
@ -33,7 +33,7 @@
:bubbleMenu="true" :bubbleMenu="true"
:content="_task.description" :content="_task.description"
@change="(val) => (_task.description = val)" @change="(val) => (_task.description = val)"
placeholder="Type a description" placeholder="Type a Description"
/> />
</div> </div>
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
@ -60,7 +60,7 @@
<DatePicker <DatePicker
class="datepicker w-36" class="datepicker w-36"
v-model="_task.due_date" v-model="_task.due_date"
placeholder="Due date" placeholder="Due Date"
input-class="border-none" input-class="border-none"
:formatValue="(val) => val.split('-').reverse().join('-')" :formatValue="(val) => val.split('-').reverse().join('-')"
/> />

View File

@ -144,7 +144,7 @@ const allFields = [
type: 'data', type: 'data',
}, },
{ {
label: 'Mobile no', label: 'Mobile No',
name: 'mobile_no', name: 'mobile_no',
type: 'data', type: 'data',
}, },
@ -173,10 +173,10 @@ const allFields = [
options: statusDropdownOptions(props.newDeal, 'deal'), options: statusDropdownOptions(props.newDeal, 'deal'),
}, },
{ {
label: 'Deal owner', label: 'Deal Owner',
name: 'lead_owner', name: 'lead_owner',
type: 'link', type: 'link',
placeholder: 'Deal owner', placeholder: 'Deal Owner',
}, },
], ],
}, },

View File

@ -144,7 +144,7 @@ const allFields = [
type: 'data', type: 'data',
}, },
{ {
label: 'Mobile no', label: 'Mobile No',
name: 'mobile_no', name: 'mobile_no',
type: 'data', type: 'data',
}, },
@ -173,10 +173,10 @@ const allFields = [
options: statusDropdownOptions(props.newLead), options: statusDropdownOptions(props.newLead),
}, },
{ {
label: 'Lead owner', label: 'Lead Owner',
name: 'lead_owner', name: 'lead_owner',
type: 'user', type: 'user',
placeholder: 'Lead owner', placeholder: 'Lead Owner',
}, },
], ],
}, },

View File

@ -66,7 +66,7 @@
class="!text-gray-600" class="!text-gray-600"
variant="ghost" variant="ghost"
@click="togglePopover()" @click="togglePopover()"
label="Add sort" label="Add Sort"
> >
<template #prefix> <template #prefix>
<FeatherIcon name="plus" class="h-4" /> <FeatherIcon name="plus" class="h-4" />
@ -78,7 +78,7 @@
v-if="sortValues.length" v-if="sortValues.length"
class="!text-gray-600" class="!text-gray-600"
variant="ghost" variant="ghost"
label="Clear sort" label="Clear Sort"
@click="clearSort(close)" @click="clearSort(close)"
/> />
</div> </div>

View File

@ -50,7 +50,7 @@
<div <div
class="flex h-[41px] items-center border-b px-5 py-2.5 text-lg font-semibold" class="flex h-[41px] items-center border-b px-5 py-2.5 text-lg font-semibold"
> >
About this deal About this Deal
</div> </div>
<div class="flex items-center justify-start gap-5 border-b p-5"> <div class="flex items-center justify-start gap-5 border-b p-5">
<Tooltip <Tooltip
@ -122,7 +122,7 @@
<template #target="{ togglePopover }"> <template #target="{ togglePopover }">
<Button <Button
class="h-7 px-3" class="h-7 px-3"
label="Add contact" label="Add Contact"
@click="togglePopover()" @click="togglePopover()"
> >
<template #prefix> <template #prefix>
@ -452,7 +452,7 @@ function contactOptions(contact) {
if (!contact.is_primary) { if (!contact.is_primary) {
options.push({ options.push({
label: 'Set as primary contact', label: 'Set as Primary Contact',
icon: h(SuccessIcon, { class: 'h-4 w-4' }), icon: h(SuccessIcon, { class: 'h-4 w-4' }),
onClick: () => setPrimaryContact(contact.name), onClick: () => setPrimaryContact(contact.name),
}) })

View File

@ -34,7 +34,7 @@
</Button> </Button>
</template> </template>
</Dropdown> </Dropdown>
<Button label="Convert to deal" variant="solid" @click="convertToDeal" /> <Button label="Convert to Deal" variant="solid" @click="convertToDeal" />
</template> </template>
</LayoutHeader> </LayoutHeader>
<div v-if="lead?.data" class="flex h-full overflow-hidden"> <div v-if="lead?.data" class="flex h-full overflow-hidden">
@ -50,7 +50,7 @@
<div <div
class="flex h-[41px] items-center border-b px-5 py-2.5 text-lg font-semibold" class="flex h-[41px] items-center border-b px-5 py-2.5 text-lg font-semibold"
> >
About this lead About this Lead
</div> </div>
<FileUploader <FileUploader
@success="(file) => updateField('image', file.file_url)" @success="(file) => updateField('image', file.file_url)"