mirror of
https://github.com/frappe/books.git
synced 2025-02-04 04:58:30 +00:00
fix: Setup Wizard email error popup
This commit is contained in:
parent
463631d306
commit
189aa70888
@ -26,16 +26,25 @@
|
|||||||
"
|
"
|
||||||
:autofocus="true"
|
:autofocus="true"
|
||||||
/>
|
/>
|
||||||
<FormControl
|
<Popover placement="auto" :show="Boolean(emailError)">
|
||||||
:df="meta.getField('email')"
|
<template slot="target">
|
||||||
:value="doc.email"
|
<FormControl
|
||||||
@change="value => setValue('email', value)"
|
:df="meta.getField('email')"
|
||||||
:input-class="
|
:value="doc.email"
|
||||||
classes => [
|
@change="value => setValue('email', value)"
|
||||||
'text-base bg-transparent text-white placeholder-blue-200 focus:bg-blue-600 focus:outline-none rounded px-3 py-1'
|
:input-class="
|
||||||
]
|
classes => [
|
||||||
"
|
'text-base bg-transparent text-white placeholder-blue-200 focus:bg-blue-600 focus:outline-none rounded px-3 py-1'
|
||||||
/>
|
]
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template slot="content">
|
||||||
|
<div class="ml-2 py-2 text-sm">
|
||||||
|
{{ emailError }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</Popover>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<TwoColumnForm :fields="fields" :doc="doc" />
|
<TwoColumnForm :fields="fields" :doc="doc" />
|
||||||
@ -58,7 +67,13 @@ import TwoColumnForm from '@/components/TwoColumnForm';
|
|||||||
import FormControl from '@/components/Controls/FormControl';
|
import FormControl from '@/components/Controls/FormControl';
|
||||||
import Button from '@/components/Button';
|
import Button from '@/components/Button';
|
||||||
import setupCompany from './setupCompany';
|
import setupCompany from './setupCompany';
|
||||||
import { handleErrorWithDialog, showMessageDialog } from '@/utils';
|
import Popover from '@/components/Popover';
|
||||||
|
|
||||||
|
import {
|
||||||
|
getErrorMessage,
|
||||||
|
handleErrorWithDialog,
|
||||||
|
showMessageDialog
|
||||||
|
} from '@/utils';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SetupWizard',
|
name: 'SetupWizard',
|
||||||
@ -66,7 +81,8 @@ export default {
|
|||||||
return {
|
return {
|
||||||
doc: null,
|
doc: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
valuesFilled: false
|
valuesFilled: false,
|
||||||
|
emailError: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
provide() {
|
provide() {
|
||||||
@ -78,7 +94,8 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
TwoColumnForm,
|
TwoColumnForm,
|
||||||
FormControl,
|
FormControl,
|
||||||
Button
|
Button,
|
||||||
|
Popover
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
this.doc = await frappe.newDoc({ doctype: 'SetupWizard' });
|
this.doc = await frappe.newDoc({ doctype: 'SetupWizard' });
|
||||||
@ -88,9 +105,13 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
setValue(fieldname, value) {
|
setValue(fieldname, value) {
|
||||||
this.doc
|
this.emailError = null;
|
||||||
.set(fieldname, value)
|
this.doc.set(fieldname, value).catch(e => {
|
||||||
.catch(e => handleErrorWithDialog(e, this.doc));
|
// set error
|
||||||
|
if (fieldname === 'email') {
|
||||||
|
this.emailError = getErrorMessage(e, this.doc);
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
allValuesFilled() {
|
allValuesFilled() {
|
||||||
let values = this.meta.quickEditFields.map(
|
let values = this.meta.quickEditFields.map(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user