Skip to content

Commit

Permalink
fix: show frappe_mail_site field while creating Frappe Mail Account
Browse files Browse the repository at this point in the history
  • Loading branch information
RitvikSardana committed Nov 13, 2024
1 parent 35a9f01 commit 3e1c5fe
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion desk/src/components/Settings/EmailAdd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ const state: Reactive<EmailAccount> = reactive({
password: "",
api_key: "",
api_secret: "",
frappe_mail_site: "",
enable_incoming: false,
enable_outgoing: false,
default_incoming: false,
Expand Down Expand Up @@ -157,7 +158,7 @@ const addEmailRes = createResource({
},
});
const error = ref("");
const error = ref<string | undefined>();
function createEmailAccount() {
error.value = validateInputs(state, selectedService.value.custom);
if (error.value) return;
Expand Down
6 changes: 4 additions & 2 deletions desk/src/components/Settings/EmailEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ const state = reactive({
api_key: props.accountData?.api_key || null,
api_secret: props.accountData?.api_secret || null,
password: props.accountData?.password || null,
frappe_mail_site: props.accountData?.frappe_mail_site || "",
enable_incoming: props.accountData.enable_incoming || false,
enable_outgoing: props.accountData.enable_outgoing || false,
default_outgoing: props.accountData.default_outgoing || false,
Expand All @@ -135,7 +136,7 @@ const fields = computed(() => {
return popularProviderFields;
});
const error = ref("");
const error = ref<string | undefined>();
const loading = ref(false);
async function updateAccount() {
error.value = validateInputs(state, isCustomService.value);
Expand Down Expand Up @@ -189,7 +190,8 @@ const isDirty = computed(() => {
state.enable_incoming !== props.accountData.enable_incoming ||
state.enable_outgoing !== props.accountData.enable_outgoing ||
state.default_outgoing !== props.accountData.default_outgoing ||
state.default_incoming !== props.accountData.default_incoming
state.default_incoming !== props.accountData.default_incoming ||
state.frappe_mail_site !== props.accountData.frappe_mail_site
);
});
Expand Down
6 changes: 6 additions & 0 deletions desk/src/components/Settings/emailConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ export const popularProviderFields = [

export const customProviderFields = [
...fixedFields,
{
label: "Frappe Mail Site",
name: "frappe_mail_site",
type: "text",
placeholder: "https://frappemail.com",
},
{
label: "API Key",
name: "api_key",
Expand Down
1 change: 1 addition & 0 deletions desk/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export interface EmailAccount {
api_key?: string;
api_secret?: string;
password?: string;
frappe_mail_site?: string;
enable_outgoing?: boolean;
enable_incoming?: boolean;
default_outgoing?: boolean;
Expand Down
1 change: 1 addition & 0 deletions helpdesk/api/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def create_email_account(data):
if service == "Frappe Mail":
email_doc.api_key = data.get("api_key")
email_doc.api_secret = data.get("api_secret")
email_doc.frappe_mail_site = data.get("frappe_mail_site")
else:
email_doc.password = data.get("password")
# validate whether the credentials are correct
Expand Down

0 comments on commit 3e1c5fe

Please sign in to comment.