From d7821f8474be0146b9ac67d130f497bcb776ed9e Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Thu, 21 Jul 2022 20:00:59 +0000 Subject: Remake phone number property saving with Vue Signed-off-by: Christopher Ng --- apps/settings/js/federationsettingsview.js | 3 +- .../lib/Settings/Personal/PersonalInfo.php | 3 +- .../src/components/PersonalInfo/PhoneSection.vue | 59 ++++++++++++++++++++++ apps/settings/src/main-personal-info.js | 3 ++ .../templates/settings/personal/personal.info.php | 15 +----- 5 files changed, 66 insertions(+), 17 deletions(-) create mode 100644 apps/settings/src/components/PersonalInfo/PhoneSection.vue (limited to 'apps') diff --git a/apps/settings/js/federationsettingsview.js b/apps/settings/js/federationsettingsview.js index 98659ac8f5c..a4a1a31223e 100644 --- a/apps/settings/js/federationsettingsview.js +++ b/apps/settings/js/federationsettingsview.js @@ -133,7 +133,8 @@ field === 'displayname' || field === 'twitter' || field === 'address' || - field === 'website' + field === 'website' || + field === 'phone' ) { return; } diff --git a/apps/settings/lib/Settings/Personal/PersonalInfo.php b/apps/settings/lib/Settings/Personal/PersonalInfo.php index 4484433bacf..11d3f8b1e09 100644 --- a/apps/settings/lib/Settings/Personal/PersonalInfo.php +++ b/apps/settings/lib/Settings/Personal/PersonalInfo.php @@ -147,8 +147,6 @@ class PersonalInfo implements ISettings { 'federationEnabled' => $federationEnabled, 'lookupServerUploadEnabled' => $lookupServerUploadEnabled, 'avatarScope' => $account->getProperty(IAccountManager::PROPERTY_AVATAR)->getScope(), - 'phone' => $account->getProperty(IAccountManager::PROPERTY_PHONE)->getValue(), - 'phoneScope' => $account->getProperty(IAccountManager::PROPERTY_PHONE)->getScope(), 'groups' => $this->getGroups($user), 'isFairUseOfFreePushService' => $this->isFairUseOfFreePushService(), 'profileEnabledGlobally' => $this->profileManager->isProfileEnabled(), @@ -158,6 +156,7 @@ class PersonalInfo implements ISettings { 'userId' => $uid, 'displayName' => $this->getProperty($account, IAccountManager::PROPERTY_DISPLAYNAME), 'emailMap' => $this->getEmailMap($account), + 'phone' => $this->getProperty($account, IAccountManager::PROPERTY_PHONE), 'location' => $this->getProperty($account, IAccountManager::PROPERTY_ADDRESS), 'website' => $this->getProperty($account, IAccountManager::PROPERTY_WEBSITE), 'twitter' => $this->getProperty($account, IAccountManager::PROPERTY_TWITTER), diff --git a/apps/settings/src/components/PersonalInfo/PhoneSection.vue b/apps/settings/src/components/PersonalInfo/PhoneSection.vue new file mode 100644 index 00000000000..45641cd8e14 --- /dev/null +++ b/apps/settings/src/components/PersonalInfo/PhoneSection.vue @@ -0,0 +1,59 @@ + + + + + diff --git a/apps/settings/src/main-personal-info.js b/apps/settings/src/main-personal-info.js index 1b6d56a262a..32d8bfc8b45 100644 --- a/apps/settings/src/main-personal-info.js +++ b/apps/settings/src/main-personal-info.js @@ -28,6 +28,7 @@ import '@nextcloud/dialogs/styles/toast.scss' import DisplayNameSection from './components/PersonalInfo/DisplayNameSection.vue' import EmailSection from './components/PersonalInfo/EmailSection/EmailSection.vue' +import PhoneSection from './components/PersonalInfo/PhoneSection.vue' import LocationSection from './components/PersonalInfo/LocationSection.vue' import WebsiteSection from './components/PersonalInfo/WebsiteSection.vue' import TwitterSection from './components/PersonalInfo/TwitterSection.vue' @@ -51,6 +52,7 @@ Vue.mixin({ const DisplayNameView = Vue.extend(DisplayNameSection) const EmailView = Vue.extend(EmailSection) +const PhoneView = Vue.extend(PhoneSection) const LocationView = Vue.extend(LocationSection) const WebsiteView = Vue.extend(WebsiteSection) const TwitterView = Vue.extend(TwitterSection) @@ -58,6 +60,7 @@ const LanguageView = Vue.extend(LanguageSection) new DisplayNameView().$mount('#vue-displayname-section') new EmailView().$mount('#vue-email-section') +new PhoneView().$mount('#vue-phone-section') new LocationView().$mount('#vue-location-section') new WebsiteView().$mount('#vue-website-section') new TwitterView().$mount('#vue-twitter-section') diff --git a/apps/settings/templates/settings/personal/personal.info.php b/apps/settings/templates/settings/personal/personal.info.php index b379400c14b..9c18ec71d4a 100644 --- a/apps/settings/templates/settings/personal/personal.info.php +++ b/apps/settings/templates/settings/personal/personal.info.php @@ -120,20 +120,7 @@ script('settings', [
-
-

- - - - - - -

- - - - -
+
-- cgit v1.2.3