Skip to content

Commit

Permalink
fix: add hint and fix validation for password input[WTEL-4344]
Browse files Browse the repository at this point in the history
  • Loading branch information
Lera24 committed May 1, 2024
1 parent 40039ca commit b93885a
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 6 deletions.
5 changes: 4 additions & 1 deletion src/app/components/utils/generate-password-input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<wt-input
:disabled="disabled"
:label="$t('objects.password')"
:label-props="{ hint: $t('objects.directory.passwordInfo'), hintPosition: 'right' }"
:label-props="{ hint: (hint || $t('objects.directory.passwordInfo')), hintPosition: 'right' }"
:placeholder="$t('objects.password')"
:required="required"
:v="v"
Expand Down Expand Up @@ -55,6 +55,9 @@ export default {
type: Boolean,
default: false,
},
hint: {
type: String,
},
},
data() {
return {
Expand Down
1 change: 1 addition & 0 deletions src/app/locale/en/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,7 @@ export default {
listen: 'Listen',
authType: 'Auth type',
authenticatedAs: 'Authenticated as',
passwordInfo: 'The empty value will leave the password unchanged',
},
singleSignOn: {
allTypes: 'All types',
Expand Down
1 change: 1 addition & 0 deletions src/app/locale/ru/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,7 @@ export default {
listen: 'Прослушивать ',
authType: 'Тип аутентификации',
authenticatedAs: 'Аутентифицировано как',
passwordInfo: 'Пустое значение оставит пароль тем же',
},

singleSignOn: {
Expand Down
1 change: 1 addition & 0 deletions src/app/locale/ua/ua.js
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,7 @@ export default {
listen: 'Прослуховувати',
authType: 'Тип аутентифікації',
authenticatedAs: 'Аутентифіковано як',
passwordInfo: 'Порожнє значення залишить пароль незмінним',
},
singleSignOn: {
allTypes: 'Всі типи',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
:label="$t('objects.key')"
:v="v.itemInstance.properties.key"
:value="itemInstance.properties.key"
:label-props="{ hint: $t('objects.integrations.emailProfiles.passwordInfo'), hintPosition: 'right' }"
required
@input="setItemProp({ path: 'properties.key', value: $event })"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<wt-input
:disabled="disableUserInput"
:label="$t('objects.key')"
:label-props="{ hint: $t('objects.integrations.emailProfiles.passwordInfo'), hintPosition: 'right' }"
:v="v.itemInstance.properties.key"
:value="itemInstance.properties.key"
required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default {
return deepmerge(defaults, {
itemInstance: {
properties: {
key: { required },
key: { required: requiredUnless(() => !!this.id) },
region: { required },
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
v-if="isPlainAuthType"
:value="itemInstance.password"
:disabled="disableUserInput"
:hint="$t('objects.integrations.emailProfiles.passwordInfo')"
@input="setItemProp({ prop: 'password', value: $event })"
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<wt-input
:disabled="disableUserInput"
:label="$t('objects.integrations.storage.s3Access')"
:label-props="{ hint: $t('objects.integrations.emailProfiles.passwordInfo'), hintPosition: 'right' }"
:v="v.itemInstance.properties.accessKey"
:value="itemInstance.properties.accessKey"
required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

<script>
import { useVuelidate } from '@vuelidate/core';
import { minValue, required } from '@vuelidate/validators';
import { minValue, required, requiredUnless } from '@vuelidate/validators';
import openedObjectMixin from '../../../../../app/mixins/objectPagesMixins/openedObjectMixin/openedObjectMixin';
import storageMixin from '../mixins/storageMixin';
import Storage from '../store/_internals/enums/Storage.enum';
Expand Down Expand Up @@ -84,7 +84,7 @@ export default {
itemInstance: {
properties: {
keyId: { required },
accessKey: { required },
accessKey: { required: requiredUnless(() => !!this.id) },
bucketName: { required },
region: { required },
endpoint: { required },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<wt-select
:disabled="disableUserInput"
:label="$t('objects.routing.schema')"
:hint="$t('objects.integrations.emailProfiles.passwordInfo')"
:search-method="loadDropdownOptionsList"
:value="itemInstance.schema"
@input="setItemProp({ prop: 'schema', value: $event })"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<script>
import { useVuelidate } from '@vuelidate/core';
import { helpers, maxValue, minValue, numeric, required } from '@vuelidate/validators';
import { helpers, maxValue, minValue, numeric, required, requiredUnless } from '@vuelidate/validators';
import { mapActions } from 'vuex';
import openedObjectMixin from '../../../../../app/mixins/objectPagesMixins/openedObjectMixin/openedObjectMixin';
import { gatewayHostValidator, ipValidator, sipAccountValidator } from '../../../../../app/utils/validators';
Expand Down Expand Up @@ -67,7 +67,7 @@ export default {
itemInstance: {
account: { sipAccountValidator, required },
proxy: { gatewayHostValidator, required },
password: { required },
password: { required: requiredUnless(() => !!this.id) },
expires: {
numeric,
minValue: minValue(32),
Expand Down

0 comments on commit b93885a

Please sign in to comment.