mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 04:01:10 -04:00
Make SMTP username & password optional in mail configuration
Fixes #438
This commit is contained in:
@ -37,14 +37,6 @@ class MailEnvironmentRequest extends FormRequest
|
|||||||
'mail_port' => [
|
'mail_port' => [
|
||||||
'required'
|
'required'
|
||||||
],
|
],
|
||||||
'mail_username' => [
|
|
||||||
'required',
|
|
||||||
'string'
|
|
||||||
],
|
|
||||||
'mail_password' => [
|
|
||||||
'required',
|
|
||||||
'string'
|
|
||||||
],
|
|
||||||
'mail_encryption' => [
|
'mail_encryption' => [
|
||||||
'required',
|
'required',
|
||||||
'string'
|
'string'
|
||||||
|
|||||||
@ -33,33 +33,21 @@
|
|||||||
/>
|
/>
|
||||||
</sw-input-group>
|
</sw-input-group>
|
||||||
|
|
||||||
<sw-input-group
|
<sw-input-group :label="$t('settings.mail.username')">
|
||||||
:label="$t('settings.mail.username')"
|
|
||||||
:error="usernameError"
|
|
||||||
required
|
|
||||||
>
|
|
||||||
<sw-input
|
<sw-input
|
||||||
:invalid="$v.mailConfigData.mail_username.$error"
|
|
||||||
v-model.trim="mailConfigData.mail_username"
|
v-model.trim="mailConfigData.mail_username"
|
||||||
type="text"
|
type="text"
|
||||||
name="db_name"
|
name="db_name"
|
||||||
class="mt-2"
|
class="mt-2"
|
||||||
@input="$v.mailConfigData.mail_username.$touch()"
|
|
||||||
/>
|
/>
|
||||||
</sw-input-group>
|
</sw-input-group>
|
||||||
|
|
||||||
<sw-input-group
|
<sw-input-group :label="$t('settings.mail.password')">
|
||||||
:label="$t('settings.mail.password')"
|
|
||||||
:error="passwordError"
|
|
||||||
required
|
|
||||||
>
|
|
||||||
<sw-input
|
<sw-input
|
||||||
:invalid="$v.mailConfigData.mail_password.$error"
|
|
||||||
v-model.trim="mailConfigData.mail_password"
|
v-model.trim="mailConfigData.mail_password"
|
||||||
:type="getInputType"
|
:type="getInputType"
|
||||||
name="password"
|
name="password"
|
||||||
class="mt-2"
|
class="mt-2"
|
||||||
@input="$v.mailConfigData.mail_password.$touch()"
|
|
||||||
>
|
>
|
||||||
<template v-slot:rightIcon>
|
<template v-slot:rightIcon>
|
||||||
<eye-off-icon
|
<eye-off-icon
|
||||||
@ -158,6 +146,10 @@ const { required, email, numeric } = require('vuelidate/lib/validators')
|
|||||||
import { EyeIcon, EyeOffIcon } from '@vue-hero-icons/outline'
|
import { EyeIcon, EyeOffIcon } from '@vue-hero-icons/outline'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
EyeIcon,
|
||||||
|
EyeOffIcon,
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
configData: {
|
configData: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@ -175,10 +167,6 @@ export default {
|
|||||||
default: Array,
|
default: Array,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
components: {
|
|
||||||
EyeIcon,
|
|
||||||
EyeOffIcon,
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
mailConfigData: {
|
mailConfigData: {
|
||||||
@ -207,12 +195,6 @@ export default {
|
|||||||
required,
|
required,
|
||||||
numeric,
|
numeric,
|
||||||
},
|
},
|
||||||
mail_username: {
|
|
||||||
required,
|
|
||||||
},
|
|
||||||
mail_password: {
|
|
||||||
required,
|
|
||||||
},
|
|
||||||
mail_encryption: {
|
mail_encryption: {
|
||||||
required,
|
required,
|
||||||
},
|
},
|
||||||
@ -244,24 +226,6 @@ export default {
|
|||||||
return this.$tc('validation.required')
|
return this.$tc('validation.required')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
usernameError() {
|
|
||||||
if (!this.$v.mailConfigData.mail_username.$error) {
|
|
||||||
return ''
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.$v.mailConfigData.mail_username.required) {
|
|
||||||
return this.$tc('validation.required')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
passwordError() {
|
|
||||||
if (!this.$v.mailConfigData.mail_password.$error) {
|
|
||||||
return ''
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.$v.mailConfigData.mail_password.required) {
|
|
||||||
return this.$tc('validation.required')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
portError() {
|
portError() {
|
||||||
if (!this.$v.mailConfigData.mail_port.$error) {
|
if (!this.$v.mailConfigData.mail_port.$error) {
|
||||||
return ''
|
return ''
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
/>
|
/>
|
||||||
<sw-wizard
|
<sw-wizard
|
||||||
:steps="7"
|
:steps="7"
|
||||||
:currentStep.sync="step"
|
:current-step.sync="step"
|
||||||
:allow-navigation-redirect="false"
|
:allow-navigation-redirect="false"
|
||||||
>
|
>
|
||||||
<component :is="tab" @next="setTab" />
|
<component :is="tab" @next="setTab" />
|
||||||
|
|||||||
@ -33,31 +33,19 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="grid grid-cols-1 gap-4 mb-4 md:grid-cols-2 md:mb-6">
|
<div class="grid grid-cols-1 gap-4 mb-4 md:grid-cols-2 md:mb-6">
|
||||||
<sw-input-group
|
<sw-input-group :label="$t('wizard.mail.username')">
|
||||||
:label="$t('wizard.mail.username')"
|
|
||||||
:error="usernameError"
|
|
||||||
required
|
|
||||||
>
|
|
||||||
<sw-input
|
<sw-input
|
||||||
:invalid="$v.mailConfigData.mail_username.$error"
|
|
||||||
v-model.trim="mailConfigData.mail_username"
|
v-model.trim="mailConfigData.mail_username"
|
||||||
type="text"
|
type="text"
|
||||||
name="db_name"
|
name="db_name"
|
||||||
@input="$v.mailConfigData.mail_username.$touch()"
|
|
||||||
/>
|
/>
|
||||||
</sw-input-group>
|
</sw-input-group>
|
||||||
|
|
||||||
<sw-input-group
|
<sw-input-group :label="$t('wizard.mail.password')">
|
||||||
:label="$t('wizard.mail.password')"
|
|
||||||
:error="passwordError"
|
|
||||||
required
|
|
||||||
>
|
|
||||||
<sw-input
|
<sw-input
|
||||||
:invalid="$v.mailConfigData.mail_password.$error"
|
|
||||||
v-model.trim="mailConfigData.mail_password"
|
v-model.trim="mailConfigData.mail_password"
|
||||||
:type="getInputType"
|
:type="getInputType"
|
||||||
name="password"
|
name="password"
|
||||||
@input="$v.mailConfigData.mail_password.$touch()"
|
|
||||||
>
|
>
|
||||||
<template v-slot:rightIcon>
|
<template v-slot:rightIcon>
|
||||||
<eye-off-icon
|
<eye-off-icon
|
||||||
@ -154,6 +142,10 @@ const { required, email, numeric } = require('vuelidate/lib/validators')
|
|||||||
import { EyeIcon, EyeOffIcon } from '@vue-hero-icons/outline'
|
import { EyeIcon, EyeOffIcon } from '@vue-hero-icons/outline'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
EyeIcon,
|
||||||
|
EyeOffIcon,
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
configData: {
|
configData: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@ -171,10 +163,6 @@ export default {
|
|||||||
default: Array,
|
default: Array,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
components: {
|
|
||||||
EyeIcon,
|
|
||||||
EyeOffIcon,
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isShowPassword: false,
|
isShowPassword: false,
|
||||||
@ -203,12 +191,6 @@ export default {
|
|||||||
required,
|
required,
|
||||||
numeric,
|
numeric,
|
||||||
},
|
},
|
||||||
mail_username: {
|
|
||||||
required,
|
|
||||||
},
|
|
||||||
mail_password: {
|
|
||||||
required,
|
|
||||||
},
|
|
||||||
mail_encryption: {
|
mail_encryption: {
|
||||||
required,
|
required,
|
||||||
},
|
},
|
||||||
@ -239,24 +221,6 @@ export default {
|
|||||||
return this.$tc('validation.required')
|
return this.$tc('validation.required')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
usernameError() {
|
|
||||||
if (!this.$v.mailConfigData.mail_username.$error) {
|
|
||||||
return ''
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.$v.mailConfigData.mail_username.required) {
|
|
||||||
return this.$tc('validation.required')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
passwordError() {
|
|
||||||
if (!this.$v.mailConfigData.mail_password.$error) {
|
|
||||||
return ''
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.$v.mailConfigData.mail_password.required) {
|
|
||||||
return this.$tc('validation.required')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
portError() {
|
portError() {
|
||||||
if (!this.$v.mailConfigData.mail_port.$error) {
|
if (!this.$v.mailConfigData.mail_port.$error) {
|
||||||
return ''
|
return ''
|
||||||
|
|||||||
Reference in New Issue
Block a user