Fix default phone region validation

Signed-off-by: Christopher Ng <chrng8@gmail.com>
pull/36005/head
Christopher Ng 3 years ago
parent 74a0ac8854
commit 4c111845e8
  1. 1
      apps/settings/lib/Settings/Personal/PersonalInfo.php
  2. 8
      apps/settings/src/components/PersonalInfo/PhoneSection.vue
  3. 4
      dist/settings-vue-settings-personal-info.js
  4. 2
      dist/settings-vue-settings-personal-info.js.map

@ -154,6 +154,7 @@ class PersonalInfo implements ISettings {
'displayName' => $this->getProperty($account, IAccountManager::PROPERTY_DISPLAYNAME),
'emailMap' => $this->getEmailMap($account),
'phone' => $this->getProperty($account, IAccountManager::PROPERTY_PHONE),
'defaultPhoneRegion' => $this->config->getSystemValueString('default_phone_region'),
'location' => $this->getProperty($account, IAccountManager::PROPERTY_ADDRESS),
'website' => $this->getProperty($account, IAccountManager::PROPERTY_WEBSITE),
'twitter' => $this->getProperty($account, IAccountManager::PROPERTY_TWITTER),

@ -35,7 +35,10 @@ import AccountPropertySection from './shared/AccountPropertySection.vue'
import { NAME_READABLE_ENUM } from '../../constants/AccountPropertyConstants.js'
const { phone } = loadState('settings', 'personalInfoParameters', {})
const {
defaultPhoneRegion,
phone,
} = loadState('settings', 'personalInfoParameters', {})
export default {
name: 'PhoneSection',
@ -52,6 +55,9 @@ export default {
methods: {
onValidate(value) {
if (defaultPhoneRegion) {
return isValidPhoneNumber(value, defaultPhoneRegion)
}
return isValidPhoneNumber(value)
},
},

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save