Merge pull request #36010 from nextcloud/backport/36005/stable25

[stable25] Fix default phone region validation
This commit is contained in:
Simon L 2023-01-05 17:33:29 +01:00 committed by GitHub
commit 4797254567
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 4 deletions

View file

@ -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),

View file

@ -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