From d5e8315e83327c7b8dda71eca5dd1c9d7d0a23dc Mon Sep 17 00:00:00 2001 From: jared Date: Tue, 16 Apr 2019 10:13:26 -0400 Subject: #482 - add subscribe button --- src/components/user_card/user_card.js | 4 +- src/components/user_card/user_card.vue | 365 +++++++++++---------------------- 2 files changed, 123 insertions(+), 246 deletions(-) (limited to 'src/components/user_card') diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js index 92cd0e54..bab1a654 100644 --- a/src/components/user_card/user_card.js +++ b/src/components/user_card/user_card.js @@ -1,5 +1,6 @@ import UserAvatar from '../user_avatar/user_avatar.vue' import RemoteFollow from '../remote_follow/remote_follow.vue' +import SubscribeButton from '../subscribe_button/subscribe_button.vue' import ModerationTools from '../moderation_tools/moderation_tools.vue' import { hex2rgb } from '../../services/color_convert/color_convert.js' import { requestFollow, requestUnfollow } from '../../services/follow_manipulate/follow_manipulate' @@ -104,7 +105,8 @@ export default { components: { UserAvatar, RemoteFollow, - ModerationTools + ModerationTools, + SubscribeButton }, methods: { followUser () { diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index 5a5a4881..18ec6e94 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -1,260 +1,135 @@ -- cgit v1.2.3-70-g09d2 From 4cf402ff21c26fa9b82d2ea956ceb7ce8533146a Mon Sep 17 00:00:00 2001 From: taehoon Date: Thu, 25 Apr 2019 04:19:22 -0400 Subject: migrate SubscribeButton to the existing common component --- .../subscribe_button/subscribe_button.js | 26 ---------------------- .../subscribe_button/subscribe_button.vue | 22 ------------------ src/components/user_card/user_card.js | 10 +++++++-- src/components/user_card/user_card.vue | 9 +++++++- 4 files changed, 16 insertions(+), 51 deletions(-) delete mode 100644 src/components/subscribe_button/subscribe_button.js delete mode 100644 src/components/subscribe_button/subscribe_button.vue (limited to 'src/components/user_card') diff --git a/src/components/subscribe_button/subscribe_button.js b/src/components/subscribe_button/subscribe_button.js deleted file mode 100644 index e3a2842c..00000000 --- a/src/components/subscribe_button/subscribe_button.js +++ /dev/null @@ -1,26 +0,0 @@ -export default { - props: [ 'user' ], - data () { - return { - inProgress: false - } - }, - methods: { - subscribe () { - this.inProgress = true - this.$store.state.api.backendInteractor.subscribeUser(this.user.id) - .then((updated) => { - console.log(updated) - this.inProgress = false - }) - }, - unsubscribe () { - this.inProgress = true - this.$store.state.api.backendInteractor.unsubscribeUser(this.user.id) - .then((updated) => { - console.log(updated) - this.inProgress = false - }) - } - } -} diff --git a/src/components/subscribe_button/subscribe_button.vue b/src/components/subscribe_button/subscribe_button.vue deleted file mode 100644 index f7dd8c61..00000000 --- a/src/components/subscribe_button/subscribe_button.vue +++ /dev/null @@ -1,22 +0,0 @@ - - - diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js index bab1a654..d7fe71d0 100644 --- a/src/components/user_card/user_card.js +++ b/src/components/user_card/user_card.js @@ -1,6 +1,6 @@ import UserAvatar from '../user_avatar/user_avatar.vue' import RemoteFollow from '../remote_follow/remote_follow.vue' -import SubscribeButton from '../subscribe_button/subscribe_button.vue' +import ProgressButton from '../progress_button/progress_button.vue' import ModerationTools from '../moderation_tools/moderation_tools.vue' import { hex2rgb } from '../../services/color_convert/color_convert.js' import { requestFollow, requestUnfollow } from '../../services/follow_manipulate/follow_manipulate' @@ -106,7 +106,7 @@ export default { UserAvatar, RemoteFollow, ModerationTools, - SubscribeButton + ProgressButton }, methods: { followUser () { @@ -137,6 +137,12 @@ export default { unmuteUser () { this.$store.dispatch('unmuteUser', this.user.id) }, + subscribeUser () { + return this.$store.state.api.backendInteractor.subscribeUser(this.user.id) + }, + unsubscribeUser () { + return this.$store.state.api.backendInteractor.unsubscribeUser(this.user.id) + }, setProfileView (v) { if (this.switcher) { const store = this.$store diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index 18ec6e94..e1d3f48f 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -72,7 +72,14 @@ - +
+ + Subscribe + + + Subscribing! + +
-
+
Subscribe -- cgit v1.2.3-70-g09d2 From ace3b399ffe21459b1fbd7a3b0023f2c58c12b03 Mon Sep 17 00:00:00 2001 From: taehoon Date: Thu, 25 Apr 2019 04:40:37 -0400 Subject: support i18n --- src/components/user_card/user_card.vue | 4 ++-- src/i18n/en.json | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/components/user_card') diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index f185b8b9..cbf32db4 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -74,10 +74,10 @@
- Subscribe + {{ $t('user_card.subscribe') }} - Subscribing! + {{ $t('user_card.subscribing') }}
diff --git a/src/i18n/en.json b/src/i18n/en.json index dd34a95d..5a85bf9b 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -529,6 +529,8 @@ "remote_follow": "Remote follow", "report": "Report", "statuses": "Statuses", + "subscribe": "Subscribe", + "subscribing": "Subscribing!", "unblock": "Unblock", "unblock_progress": "Unblocking...", "block_progress": "Blocking...", -- cgit v1.2.3-70-g09d2 From 0c52d69a525aa200f03650e52f21d7b52a3918ca Mon Sep 17 00:00:00 2001 From: taehoon Date: Thu, 25 Apr 2019 12:32:26 -0400 Subject: update copy --- src/components/user_card/user_card.vue | 2 +- src/i18n/en.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/components/user_card') diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index cbf32db4..720415f0 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -77,7 +77,7 @@ {{ $t('user_card.subscribe') }} - {{ $t('user_card.subscribing') }} + {{ $t('user_card.subscribed') }}
diff --git a/src/i18n/en.json b/src/i18n/en.json index 5a85bf9b..03455cce 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -530,7 +530,7 @@ "report": "Report", "statuses": "Statuses", "subscribe": "Subscribe", - "subscribing": "Subscribing!", + "subscribed": "Subscribed", "unblock": "Unblock", "unblock_progress": "Unblocking...", "block_progress": "Blocking...", -- cgit v1.2.3-70-g09d2 From 670cbfdd1c262ddd34717b88f879d5fb80280b60 Mon Sep 17 00:00:00 2001 From: taehoon Date: Thu, 25 Apr 2019 12:33:50 -0400 Subject: change subscribing to subscribed --- src/components/user_card/user_card.vue | 2 +- src/modules/users.js | 2 +- src/services/entity_normalizer/entity_normalizer.service.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/components/user_card') diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index 720415f0..5d23bf1e 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -73,7 +73,7 @@
- + {{ $t('user_card.subscribe') }} diff --git a/src/modules/users.js b/src/modules/users.js index c7ebbc85..57d3a3e3 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -135,7 +135,7 @@ export const mutations = { user.following = relationship.following user.muted = relationship.muting user.statusnet_blocking = relationship.blocking - user.subscribing = relationship.subscribing + user.subscribed = relationship.subscribing } }) }, diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index 60c6285a..de6664d1 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -68,7 +68,7 @@ export const parseUser = (data) => { output.following = relationship.following output.statusnet_blocking = relationship.blocking output.muted = relationship.muting - output.subscribing = relationship.subscribing + output.subscribed = relationship.subscribing } output.hide_follows = data.pleroma.hide_follows -- cgit v1.2.3-70-g09d2 From dbe2decc59d9e61a630b242edebe36c0669732c1 Mon Sep 17 00:00:00 2001 From: taehoon Date: Thu, 25 Apr 2019 23:32:56 -0400 Subject: clean up UserCard template --- src/components/user_card/user_card.vue | 63 ++++++++++++++++------------------ 1 file changed, 29 insertions(+), 34 deletions(-) (limited to 'src/components/user_card') diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index 5d23bf1e..89b20e77 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -45,34 +45,29 @@
-
-
-
+
-
- -
{{ $t('user_card.subscribe') }} @@ -78,19 +75,19 @@
- -
- -
@@ -365,21 +362,15 @@ flex: 1 0 0; margin: 0 .75em .6em 0; white-space: nowrap; - - > button { - margin: 0; - width: 100%; - } } - .remote-button { - height: 28px; + button { margin: 0; - } - button.pressed { - border-bottom-color: rgba(255, 255, 255, 0.2); - border-top-color: rgba(0, 0, 0, 0.2); + &.pressed { + border-bottom-color: rgba(255, 255, 255, 0.2); + border-top-color: rgba(0, 0, 0, 0.2); + } } } } -- cgit v1.2.3-70-g09d2 From 38ba5fe028e09a4a64ef7f4f5d4366b0781b13f8 Mon Sep 17 00:00:00 2001 From: taehoon Date: Fri, 26 Apr 2019 03:43:21 -0400 Subject: change subscribe button to icon button --- src/components/user_card/user_card.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/components/user_card') diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index 2d3cf28f..013b142d 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -66,11 +66,11 @@ {{ $t('user_card.follow') }} - - {{ $t('user_card.subscribe') }} + + - - {{ $t('user_card.subscribed') }} + +
-- cgit v1.2.3-70-g09d2 From 0f4cccd115f514df07725d1d2bfabfe589befff6 Mon Sep 17 00:00:00 2001 From: taehoon Date: Sat, 4 May 2019 13:23:57 -0400 Subject: improve ui --- src/components/user_card/user_card.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/components/user_card') diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index 013b142d..03c79b49 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -93,7 +93,7 @@
-
-- cgit v1.2.3-70-g09d2 From 4f26299bd54efd64ee1e7a8e4f0ccbf364df491c Mon Sep 17 00:00:00 2001 From: taehoon Date: Sun, 19 May 2019 09:21:48 -0400 Subject: update copy --- src/components/user_card/user_card.vue | 2 +- src/i18n/en.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/components/user_card') diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index 03c79b49..d73ae716 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -69,7 +69,7 @@ - +
diff --git a/src/i18n/en.json b/src/i18n/en.json index 03455cce..49989f78 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -530,7 +530,7 @@ "report": "Report", "statuses": "Statuses", "subscribe": "Subscribe", - "subscribed": "Subscribed", + "unsubscribe": "Unsubscribe", "unblock": "Unblock", "unblock_progress": "Unblocking...", "block_progress": "Blocking...", -- cgit v1.2.3-70-g09d2 From 1237d0d2b879f4e6859e4ba3d9426c26dd0e5648 Mon Sep 17 00:00:00 2001 From: taehoon Date: Sun, 19 May 2019 14:33:25 -0400 Subject: use normal bell for unsubscribed state --- src/components/user_card/user_card.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/components/user_card') diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index d73ae716..9fac0186 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -67,7 +67,7 @@ - + -- cgit v1.2.3-70-g09d2 From 9712e324e5d6dd4bae5b61a76a28d902545f029f Mon Sep 17 00:00:00 2001 From: taehoon Date: Mon, 20 May 2019 11:36:44 -0400 Subject: hide subscribe button unless following --- src/components/user_card/user_card.vue | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src/components/user_card') diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index 9fac0186..70d5a30d 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -46,16 +46,8 @@
-
- - +
+
+ +
+
+ -- cgit v1.2.3-70-g09d2 From b2dbf01a728592758b72966550410171ea9ac74e Mon Sep 17 00:00:00 2001 From: taehoon Date: Wed, 10 Jul 2019 20:59:10 -0400 Subject: eslint —fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../moderation_tools/moderation_tools.vue | 235 ++++++++----- src/components/progress_button/progress_button.vue | 5 +- src/components/user_card/user_card.vue | 376 ++++++++++++++------- 3 files changed, 424 insertions(+), 192 deletions(-) (limited to 'src/components/user_card') diff --git a/src/components/moderation_tools/moderation_tools.vue b/src/components/moderation_tools/moderation_tools.vue index 80f6858e..f1ab67a6 100644 --- a/src/components/moderation_tools/moderation_tools.vue +++ b/src/components/moderation_tools/moderation_tools.vue @@ -1,85 +1,166 @@ diff --git a/src/components/progress_button/progress_button.vue b/src/components/progress_button/progress_button.vue index 53481b0d..283a51af 100644 --- a/src/components/progress_button/progress_button.vue +++ b/src/components/progress_button/progress_button.vue @@ -1,5 +1,8 @@