(cherry picked from commit db577afc568b56b49846773b16b638e0cf1444fa) # Conflicts: # frontend/src/components/Settings/AssignmentRules/AssigneeRules.vue # frontend/src/components/Settings/AssignmentRules/AssignmentRuleView.vue # frontend/src/components/Settings/AssignmentRules/AssignmentRules.vue
66 lines
2.0 KiB
Vue
66 lines
2.0 KiB
Vue
<template>
|
|
<div class="flex h-full flex-col gap-6 p-8 text-ink-gray-8">
|
|
<!-- Header -->
|
|
<div class="flex justify-between">
|
|
<div class="flex gap-1 -ml-4 w-9/12">
|
|
<Button
|
|
variant="ghost"
|
|
icon-left="chevron-left"
|
|
:label="__('Home actions')"
|
|
size="md"
|
|
@click="() => emit('updateStep', 'general-settings')"
|
|
class="cursor-pointer hover:bg-transparent focus:bg-transparent focus:outline-none focus:ring-0 focus:ring-offset-0 focus-visible:none active:bg-transparent active:outline-none active:ring-0 active:ring-offset-0 active:text-ink-gray-5 font-semibold text-xl hover:opacity-70 !pr-0 !max-w-96 !justify-start"
|
|
/>
|
|
</div>
|
|
<div class="flex item-center space-x-2 w-3/12 justify-end">
|
|
<Button
|
|
:label="__('Update')"
|
|
icon-left="plus"
|
|
variant="solid"
|
|
:disabled="!document.isDirty"
|
|
:loading="document.loading"
|
|
@click="updateSettings"
|
|
/>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Fields -->
|
|
<div class="flex flex-1 flex-col gap-4 overflow-y-auto">
|
|
<Grid
|
|
v-model="document.doc.dropdown_items"
|
|
doctype="CRM Dropdown Item"
|
|
parentDoctype="FCRM Settings"
|
|
parentFieldname="dropdown_items"
|
|
/>
|
|
</div>
|
|
<div v-if="errorMessage">
|
|
<ErrorMessage :message="__(errorMessage)" />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
<script setup>
|
|
import Grid from '@/components/Controls/Grid.vue'
|
|
import { ErrorMessage } from 'frappe-ui'
|
|
import { showSettings } from '@/composables/settings'
|
|
import { useDocument } from '@/data/document'
|
|
import { ref, provide } from 'vue'
|
|
|
|
const { document, triggerOnChange } = useDocument(
|
|
'FCRM Settings',
|
|
'FCRM Settings',
|
|
)
|
|
|
|
provide('triggerOnChange', triggerOnChange)
|
|
|
|
const emit = defineEmits(['updateStep'])
|
|
const errorMessage = ref('')
|
|
|
|
function updateSettings() {
|
|
document.save.submit(null, {
|
|
onSuccess: () => {
|
|
showSettings.value = false
|
|
},
|
|
})
|
|
}
|
|
</script>
|