diff options
author | Christopher Ng <chrng8@gmail.com> | 2022-07-15 04:21:11 +0000 |
---|---|---|
committer | Christopher Ng <chrng8@gmail.com> | 2022-08-25 18:19:10 +0000 |
commit | 09f6eb5e58b4e0e3880d5e454331eb53e6d43eab (patch) | |
tree | f49f331175d7487f1e33faa972350b1ec459e249 /apps/settings/src | |
parent | c5c70daa663cab80eb362b0312099fc2e71312e9 (diff) | |
download | nextcloud-server-09f6eb5e58b4e0e3880d5e454331eb53e6d43eab.tar.gz nextcloud-server-09f6eb5e58b4e0e3880d5e454331eb53e6d43eab.zip |
Remake Twitter handle saving with Vue
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Diffstat (limited to 'apps/settings/src')
-rw-r--r-- | apps/settings/src/components/PersonalInfo/TwitterSection.vue | 50 | ||||
-rw-r--r-- | apps/settings/src/main-personal-info.js | 3 |
2 files changed, 53 insertions, 0 deletions
diff --git a/apps/settings/src/components/PersonalInfo/TwitterSection.vue b/apps/settings/src/components/PersonalInfo/TwitterSection.vue new file mode 100644 index 00000000000..78a772973fb --- /dev/null +++ b/apps/settings/src/components/PersonalInfo/TwitterSection.vue @@ -0,0 +1,50 @@ +<!-- + - @copyright 2022 Christopher Ng <chrng8@gmail.com> + - + - @author Christopher Ng <chrng8@gmail.com> + - + - @license AGPL-3.0-or-later + - + - This program is free software: you can redistribute it and/or modify + - it under the terms of the GNU Affero General Public License as + - published by the Free Software Foundation, either version 3 of the + - License, or (at your option) any later version. + - + - This program is distributed in the hope that it will be useful, + - but WITHOUT ANY WARRANTY; without even the implied warranty of + - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + - GNU Affero General Public License for more details. + - + - You should have received a copy of the GNU Affero General Public License + - along with this program. If not, see <http://www.gnu.org/licenses/>. + - +--> + +<template> + <AccountPropertySection v-bind.sync="twitter" + :placeholder="t('settings', 'Your Twitter handle')" /> +</template> + +<script> +import { loadState } from '@nextcloud/initial-state' + +import AccountPropertySection from './shared/AccountPropertySection.vue' + +import { NAME_READABLE_ENUM } from '../../constants/AccountPropertyConstants.js' + +const { twitter } = loadState('settings', 'personalInfoParameters', {}) + +export default { + name: 'TwitterSection', + + components: { + AccountPropertySection, + }, + + data() { + return { + twitter: { ...twitter, readable: NAME_READABLE_ENUM[twitter.name] }, + } + }, +} +</script> diff --git a/apps/settings/src/main-personal-info.js b/apps/settings/src/main-personal-info.js index b133604a6ac..1ebaae0fc8e 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 TwitterSection from './components/PersonalInfo/TwitterSection.vue' import LanguageSection from './components/PersonalInfo/LanguageSection/LanguageSection.vue' import ProfileSection from './components/PersonalInfo/ProfileSection/ProfileSection.vue' import OrganisationSection from './components/PersonalInfo/OrganisationSection.vue' @@ -48,10 +49,12 @@ Vue.mixin({ const DisplayNameView = Vue.extend(DisplayNameSection) const EmailView = Vue.extend(EmailSection) +const TwitterView = Vue.extend(TwitterSection) const LanguageView = Vue.extend(LanguageSection) new DisplayNameView().$mount('#vue-displayname-section') new EmailView().$mount('#vue-email-section') +new TwitterView().$mount('#vue-twitter-section') new LanguageView().$mount('#vue-language-section') if (profileEnabledGlobally) { |