chore: renamed Fields to FieldLayout and QuickEntryLayoutBuilder to FieldLayoutEditor
This commit is contained in:
parent
941c166af5
commit
851449bbc3
@ -2,7 +2,7 @@
|
||||
<div
|
||||
class="my-3 flex items-center justify-between text-lg font-medium sm:mb-4 sm:mt-8"
|
||||
>
|
||||
<div class="flex h-8 items-center text-xl font-semibold text-ink-gray-8 ">
|
||||
<div class="flex h-8 items-center text-xl font-semibold text-ink-gray-8">
|
||||
{{ __('Data') }}
|
||||
<Badge
|
||||
v-if="data.isDirty"
|
||||
@ -35,7 +35,7 @@
|
||||
v-else
|
||||
class="flex flex-col gap-3 border border-outline-gray-1 rounded-lg"
|
||||
>
|
||||
<Fields
|
||||
<FieldLayout
|
||||
v-if="sections.data"
|
||||
:sections="sections.data"
|
||||
:data="data.doc"
|
||||
@ -52,7 +52,7 @@
|
||||
<script setup>
|
||||
import EditIcon from '@/components/Icons/EditIcon.vue'
|
||||
import DataFieldsModal from '@/components/Modals/DataFieldsModal.vue'
|
||||
import Fields from '@/components/Fields.vue'
|
||||
import FieldLayout from '@/components/FieldLayout.vue'
|
||||
import { Badge, createResource, createDocumentResource } from 'frappe-ui'
|
||||
import LoadingIndicator from '@/components/Icons/LoadingIndicator.vue'
|
||||
import { createToast } from '@/utils'
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="sections.data">
|
||||
<Fields :sections="sections.data" :data="_address" />
|
||||
<FieldLayout :sections="sections.data" :data="_address" />
|
||||
<ErrorMessage class="mt-2" :message="error" />
|
||||
</div>
|
||||
</div>
|
||||
@ -50,7 +50,7 @@
|
||||
|
||||
<script setup>
|
||||
import QuickEntryModal from '@/components/Modals/QuickEntryModal.vue'
|
||||
import Fields from '@/components/Fields.vue'
|
||||
import FieldLayout from '@/components/FieldLayout.vue'
|
||||
import EditIcon from '@/components/Icons/EditIcon.vue'
|
||||
import { usersStore } from '@/stores/users'
|
||||
import { capture } from '@/telemetry'
|
||||
@ -108,7 +108,7 @@ const dialogOptions = computed(() => {
|
||||
|
||||
const sections = createResource({
|
||||
url: 'crm.fcrm.doctype.crm_fields_layout.crm_fields_layout.get_fields_layout',
|
||||
cache: ['quickEntryFields', 'Address'],
|
||||
cache: ['QuickEntry', 'Address'],
|
||||
params: { doctype: 'Address', type: 'Quick Entry' },
|
||||
auto: true,
|
||||
})
|
||||
|
||||
@ -57,8 +57,8 @@
|
||||
<div v-else>{{ field.value }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<Fields
|
||||
v-else-if="filteredSections"
|
||||
<FieldLayout
|
||||
v-else-if="filteredSections.length"
|
||||
:sections="filteredSections"
|
||||
:data="_contact"
|
||||
/>
|
||||
@ -82,7 +82,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import Fields from '@/components/Fields.vue'
|
||||
import FieldLayout from '@/components/FieldLayout.vue'
|
||||
import AddressModal from '@/components/Modals/AddressModal.vue'
|
||||
import ContactIcon from '@/components/Icons/ContactIcon.vue'
|
||||
import GenderIcon from '@/components/Icons/GenderIcon.vue'
|
||||
@ -247,7 +247,7 @@ const detailFields = computed(() => {
|
||||
|
||||
const sections = createResource({
|
||||
url: 'crm.fcrm.doctype.crm_fields_layout.crm_fields_layout.get_fields_layout',
|
||||
cache: ['quickEntryFields', 'Contact'],
|
||||
cache: ['QuickEntry', 'Contact'],
|
||||
params: { doctype: 'Contact', type: 'Quick Entry' },
|
||||
auto: true,
|
||||
})
|
||||
|
||||
@ -30,12 +30,12 @@
|
||||
/>
|
||||
</div>
|
||||
<div v-if="sections?.data">
|
||||
<QuickEntryLayoutBuilder
|
||||
<FieldLayoutEditor
|
||||
v-if="!preview"
|
||||
:sections="sections.data"
|
||||
:doctype="_doctype"
|
||||
/>
|
||||
<Fields v-else :sections="sections.data" :data="{}" />
|
||||
<FieldLayout v-else :sections="sections.data" :data="{}" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -53,8 +53,8 @@
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup>
|
||||
import Fields from '@/components/Fields.vue'
|
||||
import QuickEntryLayoutBuilder from '@/components/QuickEntryLayoutBuilder.vue'
|
||||
import FieldLayout from '@/components/FieldLayout.vue'
|
||||
import FieldLayoutEditor from '@/components/FieldLayoutEditor.vue'
|
||||
import { useDebounceFn } from '@vueuse/core'
|
||||
import { capture } from '@/telemetry'
|
||||
import { Dialog, Badge, Switch, call, createResource } from 'frappe-ui'
|
||||
@ -79,7 +79,7 @@ function getParams() {
|
||||
|
||||
const sections = createResource({
|
||||
url: 'crm.fcrm.doctype.crm_fields_layout.crm_fields_layout.get_fields_layout',
|
||||
cache: ['dataFieldsSections', _doctype.value],
|
||||
cache: ['DataFieldsModal', _doctype.value],
|
||||
params: getParams(),
|
||||
onSuccess(data) {
|
||||
sections.originalData = JSON.parse(JSON.stringify(data))
|
||||
|
||||
@ -33,9 +33,9 @@
|
||||
<Switch v-model="chooseExistingContact" />
|
||||
</div>
|
||||
</div>
|
||||
<Fields
|
||||
v-if="filteredSections"
|
||||
class="border-t pt-4"
|
||||
<div class="h-px w-full border-t my-5" />
|
||||
<FieldLayout
|
||||
v-if="filteredSections.length"
|
||||
:sections="filteredSections"
|
||||
:data="deal"
|
||||
/>
|
||||
@ -58,7 +58,7 @@
|
||||
|
||||
<script setup>
|
||||
import EditIcon from '@/components/Icons/EditIcon.vue'
|
||||
import Fields from '@/components/Fields.vue'
|
||||
import FieldLayout from '@/components/FieldLayout.vue'
|
||||
import { usersStore } from '@/stores/users'
|
||||
import { statusesStore } from '@/stores/statuses'
|
||||
import { capture } from '@/telemetry'
|
||||
@ -102,7 +102,7 @@ const chooseExistingOrganization = ref(false)
|
||||
|
||||
const sections = createResource({
|
||||
url: 'crm.fcrm.doctype.crm_fields_layout.crm_fields_layout.get_fields_layout',
|
||||
cache: ['quickEntryFields', 'CRM Deal'],
|
||||
cache: ['QuickEntry', 'CRM Deal'],
|
||||
params: { doctype: 'CRM Deal', type: 'Quick Entry' },
|
||||
auto: true,
|
||||
transform: (data) => {
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<Fields v-if="sections.data" :sections="sections.data" :data="lead" />
|
||||
<FieldLayout v-if="sections.data" :sections="sections.data" :data="lead" />
|
||||
<ErrorMessage class="mt-4" v-if="error" :message="__(error)" />
|
||||
</div>
|
||||
</div>
|
||||
@ -43,7 +43,7 @@
|
||||
|
||||
<script setup>
|
||||
import EditIcon from '@/components/Icons/EditIcon.vue'
|
||||
import Fields from '@/components/Fields.vue'
|
||||
import FieldLayout from '@/components/FieldLayout.vue'
|
||||
import { usersStore } from '@/stores/users'
|
||||
import { statusesStore } from '@/stores/statuses'
|
||||
import { capture } from '@/telemetry'
|
||||
@ -65,7 +65,7 @@ const isLeadCreating = ref(false)
|
||||
|
||||
const sections = createResource({
|
||||
url: 'crm.fcrm.doctype.crm_fields_layout.crm_fields_layout.get_fields_layout',
|
||||
cache: ['quickEntryFields', 'CRM Lead'],
|
||||
cache: ['QuickEntry', 'CRM Lead'],
|
||||
params: { doctype: 'CRM Lead', type: 'Quick Entry' },
|
||||
auto: true,
|
||||
transform: (data) => {
|
||||
|
||||
@ -35,8 +35,8 @@
|
||||
<div>{{ field.value }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<Fields
|
||||
v-else-if="filteredSections"
|
||||
<FieldLayout
|
||||
v-else-if="filteredSections.length"
|
||||
:sections="filteredSections"
|
||||
:data="_organization"
|
||||
/>
|
||||
@ -60,7 +60,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import Fields from '@/components/Fields.vue'
|
||||
import FieldLayout from '@/components/FieldLayout.vue'
|
||||
import AddressModal from '@/components/Modals/AddressModal.vue'
|
||||
import EditIcon from '@/components/Icons/EditIcon.vue'
|
||||
import MoneyIcon from '@/components/Icons/MoneyIcon.vue'
|
||||
@ -243,7 +243,7 @@ const fields = computed(() => {
|
||||
|
||||
const sections = createResource({
|
||||
url: 'crm.fcrm.doctype.crm_fields_layout.crm_fields_layout.get_fields_layout',
|
||||
cache: ['quickEntryFields', 'CRM Organization'],
|
||||
cache: ['QuickEntry', 'CRM Organization'],
|
||||
params: { doctype: 'CRM Organization', type: 'Quick Entry' },
|
||||
auto: true,
|
||||
})
|
||||
|
||||
@ -36,12 +36,12 @@
|
||||
/>
|
||||
</div>
|
||||
<div v-if="sections?.data">
|
||||
<QuickEntryLayoutBuilder
|
||||
<FieldLayoutEditor
|
||||
v-if="!preview"
|
||||
:sections="sections.data"
|
||||
:doctype="_doctype"
|
||||
/>
|
||||
<Fields v-else :sections="sections.data" :data="{}" />
|
||||
<FieldLayout v-else :sections="sections.data" :data="{}" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -59,8 +59,8 @@
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup>
|
||||
import Fields from '@/components/Fields.vue'
|
||||
import QuickEntryLayoutBuilder from '@/components/QuickEntryLayoutBuilder.vue'
|
||||
import FieldLayout from '@/components/FieldLayout.vue'
|
||||
import FieldLayoutEditor from '@/components/FieldLayoutEditor.vue'
|
||||
import { useDebounceFn } from '@vueuse/core'
|
||||
import { capture } from '@/telemetry'
|
||||
import { Dialog, Badge, Switch, call, createResource } from 'frappe-ui'
|
||||
@ -85,7 +85,7 @@ function getParams() {
|
||||
|
||||
const sections = createResource({
|
||||
url: 'crm.fcrm.doctype.crm_fields_layout.crm_fields_layout.get_fields_layout',
|
||||
cache: ['quick-entry-sections', _doctype.value],
|
||||
cache: ['QuickEntryModal', _doctype.value],
|
||||
params: getParams(),
|
||||
onSuccess(data) {
|
||||
sections.originalData = JSON.parse(JSON.stringify(data))
|
||||
|
||||
@ -108,7 +108,7 @@ function getParams() {
|
||||
|
||||
const sections = createResource({
|
||||
url: 'crm.fcrm.doctype.crm_fields_layout.crm_fields_layout.get_fields_layout',
|
||||
cache: ['sidebar-sections', _doctype.value],
|
||||
cache: ['SidePanel', _doctype.value],
|
||||
params: getParams(),
|
||||
onSuccess(data) {
|
||||
sections.originalData = JSON.parse(JSON.stringify(data))
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
<template>
|
||||
<div class="flex h-full flex-col gap-8">
|
||||
<h2 class="flex gap-2 text-xl font-semibold leading-none h-5 text-ink-gray-9">
|
||||
<h2
|
||||
class="flex gap-2 text-xl font-semibold leading-none h-5 text-ink-gray-9"
|
||||
>
|
||||
<div>{{ title || __(doctype) }}</div>
|
||||
<Badge
|
||||
v-if="data.isDirty"
|
||||
@ -10,7 +12,7 @@
|
||||
/>
|
||||
</h2>
|
||||
<div v-if="!data.get.loading" class="flex-1 overflow-y-auto">
|
||||
<Fields
|
||||
<FieldLayout
|
||||
v-if="data?.doc && sections"
|
||||
:sections="sections"
|
||||
:data="data.doc"
|
||||
@ -31,7 +33,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import Fields from '@/components/Fields.vue'
|
||||
import FieldLayout from '@/components/FieldLayout.vue'
|
||||
import {
|
||||
createDocumentResource,
|
||||
createResource,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user