Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frontend/src/components/Modals/TaskModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</div>
<div class="flex flex-wrap items-center gap-2">
<Dropdown :options="taskStatusOptions(updateTaskStatus)">
<Button :label="_task.status" class="justify-between w-full">
<Button :label="_task.status">
<template #prefix>
<TaskStatusIcon :status="_task.status" />
</template>
Expand Down Expand Up @@ -88,7 +88,7 @@
/>
</div>
<Dropdown :options="taskPriorityOptions(updateTaskPriority)">
<Button :label="_task.priority" class="justify-between w-full">
<Button :label="_task.priority">
<template #prefix>
<TaskPriorityIcon :priority="_task.priority" />
</template>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Notes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@
onClick: () => deleteNote(note.name),
},
]"
@click.stop
>
<Button
icon="more-horizontal"
variant="ghosted"
class="hover:bg-surface-white"
@click.stop
/>
</Dropdown>
</div>
Expand Down
42 changes: 28 additions & 14 deletions frontend/src/pages/Organization.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
:image="organization.doc.organization_logo"
/>
<component
:is="organization.doc.image ? Dropdown : 'div'"
:is="organization.doc.organization_logo ? Dropdown : 'div'"
v-bind="
organization.doc.image
organization.doc.organization_logo
? {
options: [
{
icon: 'upload',
label: organization.doc.image
label: organization.doc.organization_logo
? __('Change image')
: __('Upload image'),
onClick: openFileSelector,
Expand Down Expand Up @@ -105,6 +105,7 @@
doctype="CRM Organization"
:docname="organization.doc.name"
@reload="sections.reload"
@beforeFieldChange="beforeFieldChange"
/>
</div>
</Resizer>
Expand Down Expand Up @@ -180,6 +181,7 @@ import WebsiteIcon from '@/components/Icons/WebsiteIcon.vue'
import CameraIcon from '@/components/Icons/CameraIcon.vue'
import DealsIcon from '@/components/Icons/DealsIcon.vue'
import ContactsIcon from '@/components/Icons/ContactsIcon.vue'
import DeleteLinkedDocModal from '@/components/DeleteLinkedDocModal.vue'
import { showAddressModal, addressProps } from '@/composables/modals'
import { useDocument } from '@/data/document'
import { getSettings } from '@/stores/settings'
Expand All @@ -189,21 +191,19 @@ import { statusesStore } from '@/stores/statuses'
import { getView } from '@/utils/view'
import { formatDate, timeAgo, validateIsImageFile } from '@/utils'
import {
Tooltip,
Breadcrumbs,
Avatar,
FileUploader,
Dropdown,
Tabs,
call,
createListResource,
usePageMeta,
createResource,
toast,
call,
} from 'frappe-ui'
import { h, computed, ref } from 'vue'
import { useRoute } from 'vue-router'
import DeleteLinkedDocModal from '@/components/DeleteLinkedDocModal.vue'
import { useRoute, useRouter } from 'vue-router'

const props = defineProps({
organizationId: {
Expand All @@ -218,6 +218,7 @@ const { getDealStatus } = statusesStore()
const { doctypeMeta } = getMeta('CRM Organization')

const route = useRoute()
const router = useRouter()

const errorTitle = ref('')
const errorMessage = ref('')
Expand Down Expand Up @@ -277,14 +278,27 @@ async function deleteOrganization() {
showDeleteLinkedDocModal.value = true
}

async function changeOrganizationImage(file) {
await call('frappe.client.set_value', {
doctype: 'CRM Organization',
name: props.organizationId,
fieldname: 'organization_logo',
value: file?.file_url || '',
function changeOrganizationImage(file) {
organization.setValue.submit({
organization_logo: file?.file_url || null,
})
organization.reload()
}

function beforeFieldChange(data) {
if (data?.hasOwnProperty('organization_name')) {
call('frappe.client.rename_doc', {
doctype: 'CRM Organization',
old_name: props.organizationId,
new_name: data.organization_name,
}).then(() => {
router.push({
name: 'Organization',
params: { organizationId: data.organization_name },
})
})
} else {
organization.save.submit()
}
}

function website(url) {
Expand Down
1 change: 1 addition & 0 deletions frontend/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export default defineConfig({
'prosemirror-state',
'prosemirror-view',
'lowlight',
'interactjs'
],
},
})