diff options
author | Christopher Ng <chrng8@gmail.com> | 2022-03-11 02:11:28 +0000 |
---|---|---|
committer | Christopher Ng <chrng8@gmail.com> | 2022-03-18 02:55:12 +0000 |
commit | 1fc0b4320c8921ad59bf4d41a88bf9936e1f653d (patch) | |
tree | 8d630f864f4a2760f72307e68553cc2ee0c516d4 /apps/settings/src/main-personal-info.js | |
parent | d364edcf6a18fa237dc53f6b95614851ed5fdc9a (diff) | |
download | nextcloud-server-1fc0b4320c8921ad59bf4d41a88bf9936e1f653d.tar.gz nextcloud-server-1fc0b4320c8921ad59bf4d41a88bf9936e1f653d.zip |
Add global profile toggle config
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Diffstat (limited to 'apps/settings/src/main-personal-info.js')
-rw-r--r-- | apps/settings/src/main-personal-info.js | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/apps/settings/src/main-personal-info.js b/apps/settings/src/main-personal-info.js index 398518984a0..7694fa4ff6d 100644 --- a/apps/settings/src/main-personal-info.js +++ b/apps/settings/src/main-personal-info.js @@ -22,6 +22,7 @@ import Vue from 'vue' import { getRequestToken } from '@nextcloud/auth' +import { loadState } from '@nextcloud/initial-state' import { translate as t } from '@nextcloud/l10n' import '@nextcloud/dialogs/styles/toast.scss' @@ -39,6 +40,8 @@ import ProfileVisibilitySection from './components/PersonalInfo/ProfileVisibilit __webpack_nonce__ = btoa(getRequestToken()) +const profileEnabledGlobally = loadState('settings', 'profileEnabledGlobally', true) + Vue.mixin({ props: { logger, @@ -51,19 +54,23 @@ Vue.mixin({ const DisplayNameView = Vue.extend(DisplayNameSection) const EmailView = Vue.extend(EmailSection) const LanguageView = Vue.extend(LanguageSection) -const ProfileView = Vue.extend(ProfileSection) -const OrganisationView = Vue.extend(OrganisationSection) -const RoleView = Vue.extend(RoleSection) -const HeadlineView = Vue.extend(HeadlineSection) -const BiographyView = Vue.extend(BiographySection) -const ProfileVisibilityView = Vue.extend(ProfileVisibilitySection) new DisplayNameView().$mount('#vue-displayname-section') new EmailView().$mount('#vue-email-section') new LanguageView().$mount('#vue-language-section') -new ProfileView().$mount('#vue-profile-section') -new OrganisationView().$mount('#vue-organisation-section') -new RoleView().$mount('#vue-role-section') -new HeadlineView().$mount('#vue-headline-section') -new BiographyView().$mount('#vue-biography-section') -new ProfileVisibilityView().$mount('#vue-profile-visibility-section') + +if (profileEnabledGlobally) { + const ProfileView = Vue.extend(ProfileSection) + const OrganisationView = Vue.extend(OrganisationSection) + const RoleView = Vue.extend(RoleSection) + const HeadlineView = Vue.extend(HeadlineSection) + const BiographyView = Vue.extend(BiographySection) + const ProfileVisibilityView = Vue.extend(ProfileVisibilitySection) + + new ProfileView().$mount('#vue-profile-section') + new OrganisationView().$mount('#vue-organisation-section') + new RoleView().$mount('#vue-role-section') + new HeadlineView().$mount('#vue-headline-section') + new BiographyView().$mount('#vue-biography-section') + new ProfileVisibilityView().$mount('#vue-profile-visibility-section') +} |