From 44763576b1180c84b645fcd7017eceaeeeedb094 Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Tue, 29 Jun 2021 18:46:37 +0000 Subject: [PATCH] Make emails Vuetiful Signed-off-by: Christopher Ng --- apps/settings/js/federationsettingsview.js | 5 +- .../PersonalInfo/EmailSection/AddButton.vue | 78 +++++ .../PersonalInfo/EmailSection/Email.vue | 323 ++++++++++++++++++ .../EmailSection/EmailSection.vue | 117 +++++++ .../EmailSection/FederationControl.vue | 160 +++++++++ .../PersonalInfo/EmailSection/HeaderBar.vue | 94 +++++ apps/settings/src/main-personal-info.js | 38 +++ .../settings/personal/personal.info.php | 52 +-- apps/settings/webpack.js | 14 + 9 files changed, 832 insertions(+), 49 deletions(-) create mode 100644 apps/settings/src/components/PersonalInfo/EmailSection/AddButton.vue create mode 100644 apps/settings/src/components/PersonalInfo/EmailSection/Email.vue create mode 100644 apps/settings/src/components/PersonalInfo/EmailSection/EmailSection.vue create mode 100644 apps/settings/src/components/PersonalInfo/EmailSection/FederationControl.vue create mode 100644 apps/settings/src/components/PersonalInfo/EmailSection/HeaderBar.vue create mode 100644 apps/settings/src/main-personal-info.js diff --git a/apps/settings/js/federationsettingsview.js b/apps/settings/js/federationsettingsview.js index cf2865be1b0..602acab5c8d 100644 --- a/apps/settings/js/federationsettingsview.js +++ b/apps/settings/js/federationsettingsview.js @@ -119,7 +119,10 @@ _registerEvents: function() { var self = this; _.each(this._inputFields, function(field) { - if (field === 'avatar') { + if ( + field === 'avatar' || + field === 'email' + ) { return; } self.$('#' + field).keyUpDelayedOrEnter(_.bind(self._onInputChanged, self), true); diff --git a/apps/settings/src/components/PersonalInfo/EmailSection/AddButton.vue b/apps/settings/src/components/PersonalInfo/EmailSection/AddButton.vue new file mode 100644 index 00000000000..83a293ed234 --- /dev/null +++ b/apps/settings/src/components/PersonalInfo/EmailSection/AddButton.vue @@ -0,0 +1,78 @@ + + + + + + + diff --git a/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue b/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue new file mode 100644 index 00000000000..7ae01908013 --- /dev/null +++ b/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue @@ -0,0 +1,323 @@ + + + + + + + diff --git a/apps/settings/src/components/PersonalInfo/EmailSection/EmailSection.vue b/apps/settings/src/components/PersonalInfo/EmailSection/EmailSection.vue new file mode 100644 index 00000000000..700036872b4 --- /dev/null +++ b/apps/settings/src/components/PersonalInfo/EmailSection/EmailSection.vue @@ -0,0 +1,117 @@ + + + + + + + diff --git a/apps/settings/src/components/PersonalInfo/EmailSection/FederationControl.vue b/apps/settings/src/components/PersonalInfo/EmailSection/FederationControl.vue new file mode 100644 index 00000000000..87496a81160 --- /dev/null +++ b/apps/settings/src/components/PersonalInfo/EmailSection/FederationControl.vue @@ -0,0 +1,160 @@ + + + + + + + diff --git a/apps/settings/src/components/PersonalInfo/EmailSection/HeaderBar.vue b/apps/settings/src/components/PersonalInfo/EmailSection/HeaderBar.vue new file mode 100644 index 00000000000..7d2b1ab76b6 --- /dev/null +++ b/apps/settings/src/components/PersonalInfo/EmailSection/HeaderBar.vue @@ -0,0 +1,94 @@ + + + + + + + diff --git a/apps/settings/src/main-personal-info.js b/apps/settings/src/main-personal-info.js new file mode 100644 index 00000000000..8edbd29669f --- /dev/null +++ b/apps/settings/src/main-personal-info.js @@ -0,0 +1,38 @@ +/** + * @copyright 2021, Christopher Ng + * + * @author Christopher Ng + * + * @license GNU AGPL version 3 or any later version + * + * 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 . + * + */ + +import Vue from 'vue' + +import logger from './logger' + +import EmailSection from './components/PersonalInfo/EmailSection/EmailSection' + +// eslint-disable-next-line camelcase +__webpack_nonce__ = btoa(OC.requestToken) + +Vue.prototype.t = t +Vue.prototype.logger = logger + +const View = Vue.extend(EmailSection) +export default new View({ + el: '#vue-emailsection', +}) diff --git a/apps/settings/templates/settings/personal/personal.info.php b/apps/settings/templates/settings/personal/personal.info.php index 6f8516e6437..d3c666d8385 100644 --- a/apps/settings/templates/settings/personal/personal.info.php +++ b/apps/settings/templates/settings/personal/personal.info.php @@ -31,6 +31,7 @@ script('settings', [ 'federationsettingsview', 'federationscopemenu', 'settings/personalInfo', + 'vue-settings-personal-info', ]); ?> @@ -126,52 +127,7 @@ script('settings', [
-
-

- - - - - - -

-
- -
- - placeholder="t('Your email address')); ?>" - autocomplete="on" autocapitalize="none" autocorrect="off" /> - - - - t('No email address set')); - }?> - - - t('For password reset and notifications')); ?> - - -
+
@@ -223,8 +179,8 @@ script('settings', [
+ p('hidden'); + } ?>">