Merge pull request #25970 from barredterra/email-account-form
fix(Email Account): form layout, OAuth button
This commit is contained in:
commit
8ff2516de4
2 changed files with 35 additions and 30 deletions
|
|
@ -128,10 +128,6 @@ frappe.ui.form.on("Email Account", {
|
|||
frm.trigger("warn_autoreply_on_incoming");
|
||||
},
|
||||
|
||||
notify_if_unreplied: function (frm) {
|
||||
frm.set_df_property("send_notification_to", "reqd", frm.doc.notify_if_unreplied);
|
||||
},
|
||||
|
||||
onload: function (frm) {
|
||||
frm.set_df_property("append_to", "only_select", true);
|
||||
frm.set_query(
|
||||
|
|
@ -153,7 +149,6 @@ frappe.ui.form.on("Email Account", {
|
|||
|
||||
refresh: function (frm) {
|
||||
frm.events.enable_incoming(frm);
|
||||
frm.events.notify_if_unreplied(frm);
|
||||
|
||||
if (frappe.route_flags.delete_user_from_locals && frappe.route_flags.linked_user) {
|
||||
delete frappe.route_flags.delete_user_from_locals;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@
|
|||
"account_section",
|
||||
"email_id",
|
||||
"email_account_name",
|
||||
"enable_incoming",
|
||||
"enable_outgoing",
|
||||
"column_break_3",
|
||||
"domain",
|
||||
"service",
|
||||
|
|
@ -24,8 +26,8 @@
|
|||
"connected_user",
|
||||
"login_id_is_different",
|
||||
"login_id",
|
||||
"incoming_popimap_tab",
|
||||
"mailbox_settings",
|
||||
"enable_incoming",
|
||||
"default_incoming",
|
||||
"use_imap",
|
||||
"use_ssl",
|
||||
|
|
@ -48,8 +50,9 @@
|
|||
"notify_if_unreplied",
|
||||
"unreplied_for_mins",
|
||||
"send_notification_to",
|
||||
"outgoing_smtp_tab",
|
||||
"outgoing_mail_settings",
|
||||
"enable_outgoing",
|
||||
"column_break_bidn",
|
||||
"use_tls",
|
||||
"use_ssl_for_outgoing",
|
||||
"smtp_server",
|
||||
|
|
@ -175,7 +178,6 @@
|
|||
},
|
||||
{
|
||||
"default": "0",
|
||||
"depends_on": "eval: !doc.domain && doc.enable_incoming",
|
||||
"fetch_from": "domain.use_imap",
|
||||
"fieldname": "use_imap",
|
||||
"fieldtype": "Check",
|
||||
|
|
@ -184,7 +186,6 @@
|
|||
"label": "Use IMAP"
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:!doc.domain && doc.enable_incoming",
|
||||
"description": "e.g. pop.gmail.com / imap.gmail.com",
|
||||
"fetch_from": "domain.email_server",
|
||||
"fieldname": "email_server",
|
||||
|
|
@ -195,7 +196,6 @@
|
|||
},
|
||||
{
|
||||
"default": "0",
|
||||
"depends_on": "eval:!doc.domain && doc.enable_incoming",
|
||||
"fetch_from": "domain.use_ssl",
|
||||
"fieldname": "use_ssl",
|
||||
"fieldtype": "Check",
|
||||
|
|
@ -204,7 +204,6 @@
|
|||
"label": "Use SSL"
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:!doc.domain && doc.enable_incoming",
|
||||
"description": "Ignore attachments over this size",
|
||||
"fetch_from": "domain.attachment_limit",
|
||||
"fieldname": "attachment_limit",
|
||||
|
|
@ -214,7 +213,7 @@
|
|||
"label": "Attachment Limit (MB)"
|
||||
},
|
||||
{
|
||||
"depends_on": "eval: doc.enable_incoming && !doc.use_imap",
|
||||
"depends_on": "eval: !doc.use_imap",
|
||||
"description": "Append as communication against this DocType (must have fields: \"Sender\" and \"Subject\"). These fields can be defined in the email settings section of the appended doctype.",
|
||||
"fieldname": "append_to",
|
||||
"fieldtype": "Link",
|
||||
|
|
@ -236,7 +235,7 @@
|
|||
},
|
||||
{
|
||||
"default": "UNSEEN",
|
||||
"depends_on": "eval: doc.enable_incoming && doc.use_imap",
|
||||
"depends_on": "use_imap",
|
||||
"fieldname": "email_sync_option",
|
||||
"fieldtype": "Select",
|
||||
"hide_days": 1,
|
||||
|
|
@ -246,7 +245,7 @@
|
|||
},
|
||||
{
|
||||
"default": "250",
|
||||
"depends_on": "eval: doc.enable_incoming && doc.use_imap",
|
||||
"depends_on": "use_imap",
|
||||
"description": "Total number of emails to sync in initial sync process ",
|
||||
"fieldname": "initial_sync_count",
|
||||
"fieldtype": "Select",
|
||||
|
|
@ -281,12 +280,13 @@
|
|||
},
|
||||
{
|
||||
"depends_on": "notify_if_unreplied",
|
||||
"description": "Email Addresses",
|
||||
"description": "List of email addresses, separated by comma or new line.",
|
||||
"fieldname": "send_notification_to",
|
||||
"fieldtype": "Small Text",
|
||||
"hide_days": 1,
|
||||
"hide_seconds": 1,
|
||||
"label": "Send Notification to"
|
||||
"label": "Send Notification to",
|
||||
"mandatory_depends_on": "notify_if_unreplied"
|
||||
},
|
||||
{
|
||||
"fieldname": "outgoing_mail_settings",
|
||||
|
|
@ -297,7 +297,6 @@
|
|||
},
|
||||
{
|
||||
"default": "0",
|
||||
"description": "SMTP Settings for outgoing emails",
|
||||
"fieldname": "enable_outgoing",
|
||||
"fieldtype": "Check",
|
||||
"hide_days": 1,
|
||||
|
|
@ -305,7 +304,6 @@
|
|||
"label": "Enable Outgoing"
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:!doc.domain && doc.enable_outgoing",
|
||||
"description": "e.g. smtp.gmail.com",
|
||||
"fetch_from": "domain.smtp_server",
|
||||
"fieldname": "smtp_server",
|
||||
|
|
@ -316,7 +314,6 @@
|
|||
},
|
||||
{
|
||||
"default": "0",
|
||||
"depends_on": "eval:!doc.domain && doc.enable_outgoing",
|
||||
"fetch_from": "domain.use_tls",
|
||||
"fieldname": "use_tls",
|
||||
"fieldtype": "Check",
|
||||
|
|
@ -325,7 +322,6 @@
|
|||
"label": "Use TLS"
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:!doc.domain && doc.enable_outgoing",
|
||||
"description": "If non standard port (e.g. 587). If on Google Cloud, try port 2525.",
|
||||
"fetch_from": "domain.smtp_port",
|
||||
"fieldname": "smtp_port",
|
||||
|
|
@ -336,7 +332,6 @@
|
|||
},
|
||||
{
|
||||
"default": "0",
|
||||
"depends_on": "enable_outgoing",
|
||||
"description": "Notifications and bulk mails will be sent from this outgoing server.",
|
||||
"fieldname": "default_outgoing",
|
||||
"fieldtype": "Check",
|
||||
|
|
@ -346,7 +341,6 @@
|
|||
},
|
||||
{
|
||||
"default": "0",
|
||||
"depends_on": "enable_outgoing",
|
||||
"fieldname": "always_use_account_email_id_as_sender",
|
||||
"fieldtype": "Check",
|
||||
"hide_days": 1,
|
||||
|
|
@ -355,7 +349,6 @@
|
|||
},
|
||||
{
|
||||
"default": "0",
|
||||
"depends_on": "enable_outgoing",
|
||||
"fieldname": "always_use_account_name_as_sender_name",
|
||||
"fieldtype": "Check",
|
||||
"hide_days": 1,
|
||||
|
|
@ -415,6 +408,7 @@
|
|||
{
|
||||
"collapsible": 1,
|
||||
"collapsible_depends_on": "enable_auto_reply",
|
||||
"depends_on": "enable_incoming",
|
||||
"fieldname": "auto_reply",
|
||||
"fieldtype": "Section Break",
|
||||
"hide_days": 1,
|
||||
|
|
@ -499,8 +493,8 @@
|
|||
"label": "Enable Automatic Linking in Documents"
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:!doc.domain && doc.enable_incoming",
|
||||
"description": "If non-standard port (e.g. POP3: 995/110, IMAP: 993/143)",
|
||||
"fetch_from": "domain.incoming_port",
|
||||
"fieldname": "incoming_port",
|
||||
"fieldtype": "Data",
|
||||
"hide_days": 1,
|
||||
|
|
@ -518,7 +512,7 @@
|
|||
},
|
||||
{
|
||||
"default": "0",
|
||||
"depends_on": "eval:!doc.domain && doc.enable_outgoing",
|
||||
"fetch_from": "domain.use_ssl_for_outgoing",
|
||||
"fieldname": "use_ssl_for_outgoing",
|
||||
"fieldtype": "Check",
|
||||
"hide_days": 1,
|
||||
|
|
@ -565,7 +559,7 @@
|
|||
"label": "Account"
|
||||
},
|
||||
{
|
||||
"depends_on": "eval: doc.use_imap && doc.enable_incoming",
|
||||
"depends_on": "use_imap",
|
||||
"fieldname": "imap_folder",
|
||||
"fieldtype": "Table",
|
||||
"label": "IMAP Folder",
|
||||
|
|
@ -577,7 +571,7 @@
|
|||
"label": "IMAP Details"
|
||||
},
|
||||
{
|
||||
"depends_on": "eval: doc.auth_method === \"OAuth\" && !doc.__islocal && !doc.__unsaved",
|
||||
"depends_on": "eval: doc.auth_method === \"OAuth\" && doc.connected_app && doc.connected_user",
|
||||
"fieldname": "authorize_api_access",
|
||||
"fieldtype": "Button",
|
||||
"label": "Authorize API Access"
|
||||
|
|
@ -591,7 +585,7 @@
|
|||
},
|
||||
{
|
||||
"default": "0",
|
||||
"depends_on": "eval:!doc.domain && doc.enable_incoming && doc.use_imap && !doc.use_ssl",
|
||||
"depends_on": "eval: doc.use_imap && !doc.use_ssl",
|
||||
"fetch_from": "domain.use_starttls",
|
||||
"fieldname": "use_starttls",
|
||||
"fieldtype": "Check",
|
||||
|
|
@ -615,19 +609,35 @@
|
|||
},
|
||||
{
|
||||
"default": "1",
|
||||
"depends_on": "eval:!doc.domain && doc.enable_incoming && doc.use_ssl",
|
||||
"depends_on": "use_ssl",
|
||||
"fetch_from": "domain.use_ssl",
|
||||
"fieldname": "validate_ssl_certificate",
|
||||
"fieldtype": "Check",
|
||||
"hide_days": 1,
|
||||
"hide_seconds": 1,
|
||||
"label": "Validate SSL Certificate"
|
||||
},
|
||||
{
|
||||
"depends_on": "enable_incoming",
|
||||
"fieldname": "incoming_popimap_tab",
|
||||
"fieldtype": "Tab Break",
|
||||
"label": "Incoming (POP/IMAP)"
|
||||
},
|
||||
{
|
||||
"depends_on": "enable_outgoing",
|
||||
"fieldname": "outgoing_smtp_tab",
|
||||
"fieldtype": "Tab Break",
|
||||
"label": "Outgoing (SMTP)"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_bidn",
|
||||
"fieldtype": "Column Break"
|
||||
}
|
||||
],
|
||||
"icon": "fa fa-inbox",
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2024-03-23 16:03:23.581556",
|
||||
"modified": "2024-04-17 14:46:38.836631",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Email",
|
||||
"name": "Email Account",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue