Merge pull request #1235 from frappe/mergify/bp/main-hotfix/pr-1234
fix: Organization is not getting renamed (backport #1234)
This commit is contained in:
commit
7468f19b48
@ -47,7 +47,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex flex-wrap items-center gap-2">
|
<div class="flex flex-wrap items-center gap-2">
|
||||||
<Dropdown :options="taskStatusOptions(updateTaskStatus)">
|
<Dropdown :options="taskStatusOptions(updateTaskStatus)">
|
||||||
<Button :label="_task.status" class="justify-between w-full">
|
<Button :label="_task.status">
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
<TaskStatusIcon :status="_task.status" />
|
<TaskStatusIcon :status="_task.status" />
|
||||||
</template>
|
</template>
|
||||||
@ -88,7 +88,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Dropdown :options="taskPriorityOptions(updateTaskPriority)">
|
<Dropdown :options="taskPriorityOptions(updateTaskPriority)">
|
||||||
<Button :label="_task.priority" class="justify-between w-full">
|
<Button :label="_task.priority">
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
<TaskPriorityIcon :priority="_task.priority" />
|
<TaskPriorityIcon :priority="_task.priority" />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -45,12 +45,12 @@
|
|||||||
onClick: () => deleteNote(note.name),
|
onClick: () => deleteNote(note.name),
|
||||||
},
|
},
|
||||||
]"
|
]"
|
||||||
@click.stop
|
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
icon="more-horizontal"
|
icon="more-horizontal"
|
||||||
variant="ghosted"
|
variant="ghosted"
|
||||||
class="hover:bg-surface-white"
|
class="hover:bg-surface-white"
|
||||||
|
@click.stop
|
||||||
/>
|
/>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -30,14 +30,14 @@
|
|||||||
:image="organization.doc.organization_logo"
|
:image="organization.doc.organization_logo"
|
||||||
/>
|
/>
|
||||||
<component
|
<component
|
||||||
:is="organization.doc.image ? Dropdown : 'div'"
|
:is="organization.doc.organization_logo ? Dropdown : 'div'"
|
||||||
v-bind="
|
v-bind="
|
||||||
organization.doc.image
|
organization.doc.organization_logo
|
||||||
? {
|
? {
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
icon: 'upload',
|
icon: 'upload',
|
||||||
label: organization.doc.image
|
label: organization.doc.organization_logo
|
||||||
? __('Change image')
|
? __('Change image')
|
||||||
: __('Upload image'),
|
: __('Upload image'),
|
||||||
onClick: openFileSelector,
|
onClick: openFileSelector,
|
||||||
@ -105,6 +105,7 @@
|
|||||||
doctype="CRM Organization"
|
doctype="CRM Organization"
|
||||||
:docname="organization.doc.name"
|
:docname="organization.doc.name"
|
||||||
@reload="sections.reload"
|
@reload="sections.reload"
|
||||||
|
@beforeFieldChange="beforeFieldChange"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Resizer>
|
</Resizer>
|
||||||
@ -180,6 +181,7 @@ import WebsiteIcon from '@/components/Icons/WebsiteIcon.vue'
|
|||||||
import CameraIcon from '@/components/Icons/CameraIcon.vue'
|
import CameraIcon from '@/components/Icons/CameraIcon.vue'
|
||||||
import DealsIcon from '@/components/Icons/DealsIcon.vue'
|
import DealsIcon from '@/components/Icons/DealsIcon.vue'
|
||||||
import ContactsIcon from '@/components/Icons/ContactsIcon.vue'
|
import ContactsIcon from '@/components/Icons/ContactsIcon.vue'
|
||||||
|
import DeleteLinkedDocModal from '@/components/DeleteLinkedDocModal.vue'
|
||||||
import { showAddressModal, addressProps } from '@/composables/modals'
|
import { showAddressModal, addressProps } from '@/composables/modals'
|
||||||
import { useDocument } from '@/data/document'
|
import { useDocument } from '@/data/document'
|
||||||
import { getSettings } from '@/stores/settings'
|
import { getSettings } from '@/stores/settings'
|
||||||
@ -189,21 +191,19 @@ import { statusesStore } from '@/stores/statuses'
|
|||||||
import { getView } from '@/utils/view'
|
import { getView } from '@/utils/view'
|
||||||
import { formatDate, timeAgo, validateIsImageFile } from '@/utils'
|
import { formatDate, timeAgo, validateIsImageFile } from '@/utils'
|
||||||
import {
|
import {
|
||||||
Tooltip,
|
|
||||||
Breadcrumbs,
|
Breadcrumbs,
|
||||||
Avatar,
|
Avatar,
|
||||||
FileUploader,
|
FileUploader,
|
||||||
Dropdown,
|
Dropdown,
|
||||||
Tabs,
|
Tabs,
|
||||||
call,
|
|
||||||
createListResource,
|
createListResource,
|
||||||
usePageMeta,
|
usePageMeta,
|
||||||
createResource,
|
createResource,
|
||||||
toast,
|
toast,
|
||||||
|
call,
|
||||||
} from 'frappe-ui'
|
} from 'frappe-ui'
|
||||||
import { h, computed, ref } from 'vue'
|
import { h, computed, ref } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
import DeleteLinkedDocModal from '@/components/DeleteLinkedDocModal.vue'
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
organizationId: {
|
organizationId: {
|
||||||
@ -218,6 +218,7 @@ const { getDealStatus } = statusesStore()
|
|||||||
const { doctypeMeta } = getMeta('CRM Organization')
|
const { doctypeMeta } = getMeta('CRM Organization')
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
const errorTitle = ref('')
|
const errorTitle = ref('')
|
||||||
const errorMessage = ref('')
|
const errorMessage = ref('')
|
||||||
@ -277,14 +278,27 @@ async function deleteOrganization() {
|
|||||||
showDeleteLinkedDocModal.value = true
|
showDeleteLinkedDocModal.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
async function changeOrganizationImage(file) {
|
function changeOrganizationImage(file) {
|
||||||
await call('frappe.client.set_value', {
|
organization.setValue.submit({
|
||||||
doctype: 'CRM Organization',
|
organization_logo: file?.file_url || null,
|
||||||
name: props.organizationId,
|
|
||||||
fieldname: 'organization_logo',
|
|
||||||
value: file?.file_url || '',
|
|
||||||
})
|
})
|
||||||
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) {
|
function website(url) {
|
||||||
|
|||||||
@ -132,6 +132,7 @@ export default defineConfig({
|
|||||||
'prosemirror-state',
|
'prosemirror-state',
|
||||||
'prosemirror-view',
|
'prosemirror-view',
|
||||||
'lowlight',
|
'lowlight',
|
||||||
|
'interactjs'
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user