bfg-common 1.4.317 → 1.4.318

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,8 +19,7 @@
19
19
  />
20
20
 
21
21
  <p class="change-password__description">
22
- To keep your account secure, please make sure that your new password
23
- is different from any of your previous passwords.
22
+ {{ localization.common.changePasswordDesc }}
24
23
  </p>
25
24
 
26
25
  <div class="change-password__form">
@@ -30,6 +29,7 @@
30
29
  :label="localization.auth.password"
31
30
  :error="passwordErrorText"
32
31
  type="password"
32
+ :autocomplete="'new-password'"
33
33
  ></ui-input>
34
34
 
35
35
  <ui-input
@@ -79,8 +79,14 @@ const initValidationFields = ref<UI_I_InitialValidationFields>({
79
79
  newPassword: false,
80
80
  confirmPassword: false,
81
81
  })
82
- const initValidation = (types: string[]): void => {
82
+ const initValidation = (types: string[]): boolean => {
83
83
  types.forEach((type) => (initValidationFields.value[type] = true))
84
+
85
+ return (
86
+ !!passwordErrorText.value ||
87
+ !!newPasswordErrorText.value ||
88
+ !!confirmPasswordErrorText.value
89
+ )
84
90
  }
85
91
 
86
92
  const passwordErrorText = computed<string>(() => {
@@ -91,7 +97,7 @@ const passwordErrorText = computed<string>(() => {
91
97
  : ''
92
98
  })
93
99
  const newPasswordErrorText = computed<string>(() => {
94
- if (!initValidationFields.value.new_password) return ''
100
+ if (!initValidationFields.value.newPassword) return ''
95
101
 
96
102
  const { new_password, confirm_password } = modelLocal.value
97
103
  return !new_password
@@ -103,7 +109,7 @@ const newPasswordErrorText = computed<string>(() => {
103
109
  )
104
110
  })
105
111
  const confirmPasswordErrorText = computed<string>(() => {
106
- if (!initValidationFields.value.confirm_password) return ''
112
+ if (!initValidationFields.value.confirmPassword) return ''
107
113
  const { new_password, confirm_password } = modelLocal.value
108
114
  return !confirm_password
109
115
  ? localization.value.common.fieldRequired
@@ -117,20 +123,19 @@ const confirmPasswordErrorText = computed<string>(() => {
117
123
  // const isValid = ref<boolean>(false)
118
124
  const errorText = ref<string>('')
119
125
 
120
- // const showValidationErrors = (text: string): void => {
121
- // isValid.value = true
122
- // errorText.value = text
123
- // }
124
-
125
- // const onHideModal = (): void => {
126
- // emits('hide')
127
- // setForm()
128
- // isValid.value = false
129
- // }
130
126
 
131
127
  const onSubmit = (): void => {
132
- initValidation(['currentPassword', 'newPassword', 'confirmPassword'])
128
+ const isFieldValid = initValidation([
129
+ 'currentPassword',
130
+ 'newPassword',
131
+ 'confirmPassword',
132
+ ])
133
133
  // const { } = modelLocal.value
134
+
135
+ if (!isFieldValid) {
136
+ console.log(1111111)
137
+ }
138
+
134
139
  errorText.value = 'asdaldjlkdjkadj'
135
140
 
136
141
  const notReady = true
@@ -139,6 +144,9 @@ const onSubmit = (): void => {
139
144
  }
140
145
  emits('change-password')
141
146
  }
147
+ const onHideModal = (): void => {
148
+ emits('hide')
149
+ }
142
150
  </script>
143
151
 
144
152
  <style lang="scss" scoped>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.317",
4
+ "version": "1.4.318",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",