Date: Wed, 20 Mar 2019 12:20:31 -0400
Subject: [PATCH 05/24] add processing state and close modal after api request
is completed
---
.../user_reporting_modal/user_reporting_modal.js | 12 ++++++++++--
.../user_reporting_modal/user_reporting_modal.vue | 2 +-
src/modules/reports.js | 4 ----
3 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/src/components/user_reporting_modal/user_reporting_modal.js b/src/components/user_reporting_modal/user_reporting_modal.js
index ed7e74f0..ac5b5192 100644
--- a/src/components/user_reporting_modal/user_reporting_modal.js
+++ b/src/components/user_reporting_modal/user_reporting_modal.js
@@ -11,7 +11,8 @@ const UserReportingModal = {
return {
comment: '',
forward: false,
- statusIdsToReport: []
+ statusIdsToReport: [],
+ processing: false
}
},
computed: {
@@ -40,6 +41,7 @@ const UserReportingModal = {
this.comment = ''
this.forward = false
this.statusIdsToReport = []
+ this.processing = false
}
},
methods: {
@@ -47,12 +49,18 @@ const UserReportingModal = {
this.$store.dispatch('closeUserReportingModal')
},
reportUser () {
+ this.processing = true
const params = {
+ userId: this.userId,
comment: this.comment,
forward: this.forward,
statusIds: this.statusIdsToReport
}
- this.$store.dispatch('reportUser', params)
+ this.$store.state.api.backendInteractor.reportUser(params)
+ .then(() => {
+ this.processing = false
+ this.closeModal()
+ })
},
isChecked (statusId) {
return this.statusIdsToReport.indexOf(statusId) !== -1
diff --git a/src/components/user_reporting_modal/user_reporting_modal.vue b/src/components/user_reporting_modal/user_reporting_modal.vue
index 49839da3..30d3ab19 100644
--- a/src/components/user_reporting_modal/user_reporting_modal.vue
+++ b/src/components/user_reporting_modal/user_reporting_modal.vue
@@ -19,7 +19,7 @@
Forward to {{remoteInstance}}
-
+
diff --git a/src/modules/reports.js b/src/modules/reports.js
index 0470b3be..904022f1 100644
--- a/src/modules/reports.js
+++ b/src/modules/reports.js
@@ -23,10 +23,6 @@ const reports = {
},
closeUserReportingModal ({ commit }) {
commit('closeUserReportingModal')
- },
- reportUser ({ state, rootState, commit }, params) {
- rootState.api.backendInteractor.reportUser({ userId: state.userId, ...params })
- .then(result => console.log(result))
}
}
}
From dfc56dfee25a178e757f5d0b9d0d111a43083eab Mon Sep 17 00:00:00 2001
From: taehoon
Date: Wed, 20 Mar 2019 12:22:56 -0400
Subject: [PATCH 06/24] reset modal state if api request is completed
---
.../user_reporting_modal/user_reporting_modal.js | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/components/user_reporting_modal/user_reporting_modal.js b/src/components/user_reporting_modal/user_reporting_modal.js
index ac5b5192..6b1177b9 100644
--- a/src/components/user_reporting_modal/user_reporting_modal.js
+++ b/src/components/user_reporting_modal/user_reporting_modal.js
@@ -36,15 +36,16 @@ const UserReportingModal = {
}
},
watch: {
- userId (value) {
+ userId: 'resetState'
+ },
+ methods: {
+ resetState () {
// Reset state
this.comment = ''
this.forward = false
this.statusIdsToReport = []
this.processing = false
- }
- },
- methods: {
+ },
closeModal () {
this.$store.dispatch('closeUserReportingModal')
},
@@ -59,6 +60,7 @@ const UserReportingModal = {
this.$store.state.api.backendInteractor.reportUser(params)
.then(() => {
this.processing = false
+ this.resetState()
this.closeModal()
})
},
From 471085f0f36e91daa74938e34ad738a86849894a Mon Sep 17 00:00:00 2001
From: taehoon
Date: Wed, 20 Mar 2019 12:37:13 -0400
Subject: [PATCH 07/24] add error message
---
.../user_reporting_modal/user_reporting_modal.js | 12 +++++++++++-
.../user_reporting_modal/user_reporting_modal.vue | 7 +++++++
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/src/components/user_reporting_modal/user_reporting_modal.js b/src/components/user_reporting_modal/user_reporting_modal.js
index 6b1177b9..34a87720 100644
--- a/src/components/user_reporting_modal/user_reporting_modal.js
+++ b/src/components/user_reporting_modal/user_reporting_modal.js
@@ -12,7 +12,8 @@ const UserReportingModal = {
comment: '',
forward: false,
statusIdsToReport: [],
- processing: false
+ processing: false,
+ error: false
}
},
computed: {
@@ -45,12 +46,14 @@ const UserReportingModal = {
this.forward = false
this.statusIdsToReport = []
this.processing = false
+ this.error = false
},
closeModal () {
this.$store.dispatch('closeUserReportingModal')
},
reportUser () {
this.processing = true
+ this.error = false
const params = {
userId: this.userId,
comment: this.comment,
@@ -63,6 +66,13 @@ const UserReportingModal = {
this.resetState()
this.closeModal()
})
+ .catch(() => {
+ this.processing = false
+ this.error = true
+ })
+ },
+ clearError () {
+ this.error = false
},
isChecked (statusId) {
return this.statusIdsToReport.indexOf(statusId) !== -1
diff --git a/src/components/user_reporting_modal/user_reporting_modal.vue b/src/components/user_reporting_modal/user_reporting_modal.vue
index 30d3ab19..eae97900 100644
--- a/src/components/user_reporting_modal/user_reporting_modal.vue
+++ b/src/components/user_reporting_modal/user_reporting_modal.vue
@@ -20,6 +20,9 @@
+
+ An error occured processing your request
+
@@ -84,6 +87,10 @@
min-width: 10em;
padding: 0 2em;
}
+
+ .alert {
+ margin: 1em 0 0 0;
+ }
}
&-right {
From d115d98a1b0be846bddd1d24d7bd2c60a7d965ec Mon Sep 17 00:00:00 2001
From: taehoon
Date: Wed, 20 Mar 2019 12:51:43 -0400
Subject: [PATCH 08/24] add translations
---
.../user_reporting_modal/user_reporting_modal.vue | 14 +++++++-------
src/i18n/en.json | 9 +++++++++
2 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/src/components/user_reporting_modal/user_reporting_modal.vue b/src/components/user_reporting_modal/user_reporting_modal.vue
index eae97900..6ad4de17 100644
--- a/src/components/user_reporting_modal/user_reporting_modal.vue
+++ b/src/components/user_reporting_modal/user_reporting_modal.vue
@@ -1,27 +1,27 @@
-
Reporting {{user.screen_name}}
+
{{$t('user_reporting.title', [user.screen_name])}}
-
The report will be sent to your instance moderators. You can provide an explanation of why you are reporting this account below:
+
{{$t('user_reporting.add_comment_description')}}
-
The account is from another server. Send an anonymized copy of the report there as well?
-
Forward to {{remoteInstance}}
+
{{$t('user_reporting.forward_description')}}
+
{{$t('user_reporting.forward_to', [remoteInstance])}}
-
+
- An error occured processing your request
+ {{$t('user_reporting.generic_error')}}
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 8292c921..731c68b4 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -453,6 +453,15 @@
"profile_does_not_exist": "Sorry, this profile does not exist.",
"profile_loading_error": "Sorry, there was an error loading this profile."
},
+ "user_reporting": {
+ "title": "Reporting {0}",
+ "add_comment_description": "The report will be sent to your instance moderators. You can provide an explanation of why you are reporting this account below:",
+ "additional_comments": "Additional comments",
+ "forward_description": "The account is from another server. Send an anonymized copy of the report there as well?",
+ "forward_to": "Forward to {0}",
+ "submit": "Submit",
+ "generic_error": "An error occured processing your request."
+ },
"who_to_follow": {
"more": "More",
"who_to_follow": "Who to follow"
From 5d0bae5569071dbfb6fe038325af620eb83cf865 Mon Sep 17 00:00:00 2001
From: taehoon
Date: Wed, 20 Mar 2019 13:46:53 -0400
Subject: [PATCH 09/24] update generic error message
---
src/components/user_reporting_modal/user_reporting_modal.vue | 1 +
src/i18n/en.json | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/components/user_reporting_modal/user_reporting_modal.vue b/src/components/user_reporting_modal/user_reporting_modal.vue
index 6ad4de17..fd9dd797 100644
--- a/src/components/user_reporting_modal/user_reporting_modal.vue
+++ b/src/components/user_reporting_modal/user_reporting_modal.vue
@@ -90,6 +90,7 @@
.alert {
margin: 1em 0 0 0;
+ line-height: 1.3em;
}
}
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 731c68b4..f7a52c90 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -460,7 +460,7 @@
"forward_description": "The account is from another server. Send an anonymized copy of the report there as well?",
"forward_to": "Forward to {0}",
"submit": "Submit",
- "generic_error": "An error occured processing your request."
+ "generic_error": "An error occurred while processing your request."
},
"who_to_follow": {
"more": "More",
From cf72ebb40720b21736c56289a7bbffa9b67e2d2d Mon Sep 17 00:00:00 2001
From: taehoon
Date: Wed, 20 Mar 2019 16:41:27 -0400
Subject: [PATCH 10/24] update copy
---
src/i18n/en.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/i18n/en.json b/src/i18n/en.json
index f7a52c90..2f48c389 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -457,7 +457,7 @@
"title": "Reporting {0}",
"add_comment_description": "The report will be sent to your instance moderators. You can provide an explanation of why you are reporting this account below:",
"additional_comments": "Additional comments",
- "forward_description": "The account is from another server. Send an anonymized copy of the report there as well?",
+ "forward_description": "The account is from another server. Send a copy of the report there as well?",
"forward_to": "Forward to {0}",
"submit": "Submit",
"generic_error": "An error occurred while processing your request."
From 91502a25a4feaec60891ee5f7b7623fe4e05e0a8 Mon Sep 17 00:00:00 2001
From: taehoon
Date: Fri, 22 Mar 2019 13:49:58 -0400
Subject: [PATCH 11/24] Add a css class to the checkbox indicator
---
src/components/checkbox/checkbox.js | 2 +-
src/components/checkbox/checkbox.scss | 54 +++++++++++++--------------
2 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/src/components/checkbox/checkbox.js b/src/components/checkbox/checkbox.js
index 324a7597..76e7e4f4 100644
--- a/src/components/checkbox/checkbox.js
+++ b/src/components/checkbox/checkbox.js
@@ -36,7 +36,7 @@ export default {
return (
)
diff --git a/src/components/checkbox/checkbox.scss b/src/components/checkbox/checkbox.scss
index 07b3f39e..4dfcfe34 100644
--- a/src/components/checkbox/checkbox.scss
+++ b/src/components/checkbox/checkbox.scss
@@ -5,39 +5,39 @@
display: inline-block;
padding-left: 1.2em;
+ &-indicator::before {
+ position: absolute;
+ left: 0;
+ top: 0;
+ display: block;
+ content: '✔';
+ transition: color 200ms;
+ width: 1.1em;
+ height: 1.1em;
+ border-radius: $fallback--checkboxRadius;
+ border-radius: var(--checkboxRadius, $fallback--checkboxRadius);
+ box-shadow: 0px 0px 2px black inset;
+ box-shadow: var(--inputShadow);
+ background-color: $fallback--fg;
+ background-color: var(--input, $fallback--fg);
+ vertical-align: top;
+ text-align: center;
+ line-height: 1.1em;
+ font-size: 1.1em;
+ color: transparent;
+ overflow: hidden;
+ box-sizing: border-box;
+ }
+
input[type=checkbox] {
display: none;
- & + i::before {
- position: absolute;
- left: 0;
- top: 0;
- display: block;
- content: '✔';
- transition: color 200ms;
- width: 1.1em;
- height: 1.1em;
- border-radius: $fallback--checkboxRadius;
- border-radius: var(--checkboxRadius, $fallback--checkboxRadius);
- box-shadow: 0px 0px 2px black inset;
- box-shadow: var(--inputShadow);
- background-color: $fallback--fg;
- background-color: var(--input, $fallback--fg);
- vertical-align: top;
- text-align: center;
- line-height: 1.1em;
- font-size: 1.1em;
- color: transparent;
- overflow: hidden;
- box-sizing: border-box;
- }
-
- &:checked + i::before {
+ &:checked + .checkbox-indicator::before {
color: $fallback--text;
color: var(--text, $fallback--text);
}
- &:disabled + i::before {
+ &:disabled + .checkbox-indicator::before {
opacity: .5;
}
}
@@ -45,4 +45,4 @@
& > span {
margin-left: .5em;
}
-}
\ No newline at end of file
+}
From f364068e103641e761e2ca2c6d337c3536112546 Mon Sep 17 00:00:00 2001
From: taehoon
Date: Fri, 22 Mar 2019 14:19:50 -0400
Subject: [PATCH 12/24] Improve mobile layout
---
src/App.scss | 1 +
.../user_reporting_modal.vue | 60 +++++++++++++------
2 files changed, 42 insertions(+), 19 deletions(-)
diff --git a/src/App.scss b/src/App.scss
index b1c65ade..07b33f47 100644
--- a/src/App.scss
+++ b/src/App.scss
@@ -379,6 +379,7 @@ main-router {
.panel-heading {
display: flex;
+ flex: none;
border-radius: $fallback--panelRadius $fallback--panelRadius 0 0;
border-radius: var(--panelRadius, $fallback--panelRadius) var(--panelRadius, $fallback--panelRadius) 0 0;
background-size: cover;
diff --git a/src/components/user_reporting_modal/user_reporting_modal.vue b/src/components/user_reporting_modal/user_reporting_modal.vue
index fd9dd797..b2cb6911 100644
--- a/src/components/user_reporting_modal/user_reporting_modal.vue
+++ b/src/components/user_reporting_modal/user_reporting_modal.vue
@@ -26,7 +26,7 @@
-
+
toggleStatus(checked, status.id)" />
@@ -44,26 +44,24 @@
.user-reporting-panel {
width: 90vw;
max-width: 700px;
+ min-height: 20vh;
+ max-height: 80vh;
.panel-body {
display: flex;
+ flex-direction: column-reverse;
border-top: 1px solid;
border-color: $fallback--border;
border-color: var(--border, $fallback--border);
}
&-left {
- width: 50%;
- padding: 1.1em;
- border-right: 1px solid;
- border-color: $fallback--border;
- border-color: var(--border, $fallback--border);
- max-width: 320px;
+ padding: 1.1em 0.7em 0.7em;
line-height: 1.4em;
box-sizing: border-box;
> div {
- margin-bottom: 2em;
+ margin-bottom: 1em;
&:last-child {
margin-bottom: 0;
@@ -95,25 +93,49 @@
}
&-right {
- width: 50%;
- flex: 1 1 auto;
- min-height: 20vh;
- max-height: 80vh;
overflow-y: auto;
overflow-x: hidden;
+ }
- > div {
- display: flex;
- justify-content: space-between;
- border-bottom-width: 1px;
- border-bottom-style: solid;
+ &-sitem {
+ display: flex;
+ justify-content: space-between;
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+ border-color: $fallback--border;
+ border-color: var(--border, $fallback--border);
+
+ > .status-el {
+ flex: 1;
+ }
+
+ > .checkbox {
+ margin: 0.75em;
+ }
+ }
+
+ @media all and (min-width: 801px) {
+ .panel-body {
+ flex-direction: row;
+ }
+
+ &-left {
+ width: 50%;
+ max-width: 320px;
+ border-right: 1px solid;
border-color: $fallback--border;
border-color: var(--border, $fallback--border);
+ padding: 1.1em;
- .checkbox {
- margin: 0.75em;
+ > div {
+ margin-bottom: 2em;
}
}
+
+ &-right {
+ width: 50%;
+ flex: 1 1 auto;
+ }
}
}
From 2e6eab51b8272e3136046544f195253ec6c5841c Mon Sep 17 00:00:00 2001
From: taehoon
Date: Sun, 24 Mar 2019 21:35:34 -0400
Subject: [PATCH 13/24] Update promisedRequest helper to support json payload
---
src/services/api/api.service.js | 37 +++++++++++++++++++++------------
1 file changed, 24 insertions(+), 13 deletions(-)
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js
index a19aff9f..15c4b62a 100644
--- a/src/services/api/api.service.js
+++ b/src/services/api/api.service.js
@@ -67,7 +67,24 @@ let fetch = (url, options) => {
return oldfetch(fullUrl, options)
}
-const promisedRequest = (url, options) => {
+const promisedRequest = ({ method, url, payload, credentials, headers = {} }) => {
+ const options = {
+ method,
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json',
+ ...headers
+ }
+ }
+ if (payload) {
+ options.body = JSON.stringify(payload)
+ }
+ if (credentials) {
+ options.headers = {
+ ...options.headers,
+ ...authHeaders(credentials)
+ }
+ }
return fetch(url, options)
.then((response) => {
return new Promise((resolve, reject) => response.json()
@@ -228,7 +245,7 @@ const denyUser = ({id, credentials}) => {
const fetchUser = ({id, credentials}) => {
let url = `${MASTODON_USER_URL}/${id}`
- return promisedRequest(url, { headers: authHeaders(credentials) })
+ return promisedRequest({ url, credentials })
.then((data) => parseUser(data))
}
@@ -652,26 +669,20 @@ const changePassword = ({credentials, password, newPassword, newPasswordConfirma
}
const fetchMutes = ({credentials}) => {
- return promisedRequest(MASTODON_USER_MUTES_URL, { headers: authHeaders(credentials) })
+ return promisedRequest({ url: MASTODON_USER_MUTES_URL, credentials })
.then((users) => users.map(parseUser))
}
const muteUser = ({id, credentials}) => {
- return promisedRequest(MASTODON_MUTE_USER_URL(id), {
- headers: authHeaders(credentials),
- method: 'POST'
- })
+ return promisedRequest({ url: MASTODON_MUTE_USER_URL(id), credentials, method: 'POST' })
}
const unmuteUser = ({id, credentials}) => {
- return promisedRequest(MASTODON_UNMUTE_USER_URL(id), {
- headers: authHeaders(credentials),
- method: 'POST'
- })
+ return promisedRequest({ url: MASTODON_UNMUTE_USER_URL(id), credentials, method: 'POST' })
}
const fetchBlocks = ({credentials}) => {
- return promisedRequest(MASTODON_USER_BLOCKS_URL, { headers: authHeaders(credentials) })
+ return promisedRequest({ url: MASTODON_USER_BLOCKS_URL, credentials })
.then((users) => users.map(parseUser))
}
@@ -725,7 +736,7 @@ const fetchRebloggedByUsers = ({id}) => {
const reportUser = ({credentials, userId, statusIds, comment, forward}) => {
return promisedRequest({
- uri: MASTODON_REPORT_USER_URL,
+ url: MASTODON_REPORT_USER_URL,
method: 'POST',
payload: {
'account_id': userId,
From 01cc7e448093cf8884610a96c7aeb89fb08c7307 Mon Sep 17 00:00:00 2001
From: taehoon
Date: Thu, 28 Mar 2019 13:48:13 -0400
Subject: [PATCH 14/24] modal style improvements
---
.../user_reporting_modal/user_reporting_modal.vue | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/components/user_reporting_modal/user_reporting_modal.vue b/src/components/user_reporting_modal/user_reporting_modal.vue
index b2cb6911..becf882a 100644
--- a/src/components/user_reporting_modal/user_reporting_modal.vue
+++ b/src/components/user_reporting_modal/user_reporting_modal.vue
@@ -1,7 +1,9 @@
-
{{$t('user_reporting.title', [user.screen_name])}}
+
+
{{$t('user_reporting.title', [user.screen_name])}}
+
@@ -47,12 +49,17 @@
min-height: 20vh;
max-height: 80vh;
+ .panel-heading {
+ text-align: center;
+ }
+
.panel-body {
display: flex;
flex-direction: column-reverse;
border-top: 1px solid;
border-color: $fallback--border;
border-color: var(--border, $fallback--border);
+ overflow: hidden;
}
&-left {
From 6b1e305a181386be11fde996abe66e3be5a35600 Mon Sep 17 00:00:00 2001
From: taehoon
Date: Thu, 28 Mar 2019 14:11:52 -0400
Subject: [PATCH 15/24] use custom scrollbar
---
package.json | 1 +
src/App.scss | 46 ++++++++++++++++++-
.../user_reporting_modal.vue | 11 +++--
src/main.js | 2 +
yarn.lock | 4 ++
5 files changed, 59 insertions(+), 5 deletions(-)
diff --git a/package.json b/package.json
index fcdea2c1..36dfda31 100644
--- a/package.json
+++ b/package.json
@@ -35,6 +35,7 @@
"vue-router": "^3.0.1",
"vue-template-compiler": "^2.3.4",
"vue-timeago": "^3.1.2",
+ "vuebar": "^0.0.20",
"vuelidate": "^0.7.4",
"vuex": "^3.0.1",
"whatwg-fetch": "^2.0.3"
diff --git a/src/App.scss b/src/App.scss
index 07b33f47..6d16c7c9 100644
--- a/src/App.scss
+++ b/src/App.scss
@@ -794,4 +794,48 @@ nav {
background-color: var(--lightBg, $fallback--fg);
}
}
-}
\ No newline at end of file
+}
+
+// Vuebar default style
+.vb > .vb-dragger {
+ z-index: 5;
+ width: 12px;
+ right: 0;
+}
+
+.vb > .vb-dragger > .vb-dragger-styler {
+ backface-visibility: hidden;
+ transform: rotate3d(0,0,0,0);
+ transition:
+ opacity 100ms ease-out,
+ margin 100ms ease-out,
+ height 100ms ease-out;
+
+ background-color: $fallback--text;
+ background-color: var(--text, $fallback--text);
+ opacity: .1;
+ margin: 5px 5px 5px 0;
+ border-radius: 20px;
+ height: calc(100% - 10px);
+ display: block;
+}
+
+.vb.vb-scrolling-phantom > .vb-dragger > .vb-dragger-styler {
+ opacity: .3;
+}
+
+.vb > .vb-dragger:hover > .vb-dragger-styler {
+ opacity: .5;
+ margin: 0px;
+ height: 100%;
+}
+
+.vb.vb-dragging > .vb-dragger > .vb-dragger-styler {
+ opacity: .5;
+ margin: 0px;
+ height: 100%;
+}
+
+.vb.vb-dragging-phantom > .vb-dragger > .vb-dragger-styler {
+ opacity: .5;
+}
diff --git a/src/components/user_reporting_modal/user_reporting_modal.vue b/src/components/user_reporting_modal/user_reporting_modal.vue
index becf882a..acd184cd 100644
--- a/src/components/user_reporting_modal/user_reporting_modal.vue
+++ b/src/components/user_reporting_modal/user_reporting_modal.vue
@@ -27,10 +27,12 @@
-
-
-
-
toggleStatus(checked, status.id)" />
+
+
+
+
+ toggleStatus(checked, status.id)" />
+
@@ -111,6 +113,7 @@
border-bottom-style: solid;
border-color: $fallback--border;
border-color: var(--border, $fallback--border);
+ padding-right: 15px;
> .status-el {
flex: 1;
diff --git a/src/main.js b/src/main.js
index 92f843b1..e01c921c 100644
--- a/src/main.js
+++ b/src/main.js
@@ -16,6 +16,7 @@ import reportsModule from './modules/reports.js'
import VueTimeago from 'vue-timeago'
import VueI18n from 'vue-i18n'
+import Vuebar from 'vuebar'
import createPersistedState from './lib/persisted_state.js'
import pushNotifications from './lib/push_notifications_plugin.js'
@@ -42,6 +43,7 @@ Vue.use(VueTimeago, {
Vue.use(VueI18n)
Vue.use(VueChatScroll)
Vue.use(VueClickOutside)
+Vue.use(Vuebar)
const i18n = new VueI18n({
// By default, use the browser locale, we will update it if neccessary
diff --git a/yarn.lock b/yarn.lock
index 69951563..0dd2173e 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -6491,6 +6491,10 @@ vue@^2.5.13:
version "2.5.21"
resolved "https://registry.yarnpkg.com/vue/-/vue-2.5.21.tgz#3d33dcd03bb813912ce894a8303ab553699c4a85"
+vuebar@^0.0.20:
+ version "0.0.20"
+ resolved "https://registry.yarnpkg.com/vuebar/-/vuebar-0.0.20.tgz#fd6313c2d3a2202c49e42419fe1d9ef126134200"
+
vuelidate@^0.7.4:
version "0.7.4"
resolved "https://registry.yarnpkg.com/vuelidate/-/vuelidate-0.7.4.tgz#5a0e54be09ac0192f1aa3387d74b92e0945bf8aa"
From e97f8a4728bdc224b683242ca446c23a4e4ba5d1 Mon Sep 17 00:00:00 2001
From: taehoon
Date: Thu, 28 Mar 2019 14:33:21 -0400
Subject: [PATCH 16/24] prevent parent scroll
---
src/components/user_reporting_modal/user_reporting_modal.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/components/user_reporting_modal/user_reporting_modal.vue b/src/components/user_reporting_modal/user_reporting_modal.vue
index acd184cd..bf668efc 100644
--- a/src/components/user_reporting_modal/user_reporting_modal.vue
+++ b/src/components/user_reporting_modal/user_reporting_modal.vue
@@ -27,7 +27,7 @@
-
+
From 0bb82478229b19adae998b9a32b05bcaa4ed0a4f Mon Sep 17 00:00:00 2001
From: taehoon
Date: Thu, 28 Mar 2019 15:50:53 -0400
Subject: [PATCH 17/24] fix double scrollbar display bug in mobile
---
src/App.js | 9 ++++++++-
src/App.scss | 11 +++++++++++
src/App.vue | 2 +-
.../user_reporting_modal/user_reporting_modal.vue | 4 ++--
4 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/src/App.js b/src/App.js
index e72c73e3..87f00989 100644
--- a/src/App.js
+++ b/src/App.js
@@ -39,7 +39,14 @@ export default {
window.CSS.supports('-moz-mask-size', 'contain') ||
window.CSS.supports('-ms-mask-size', 'contain') ||
window.CSS.supports('-o-mask-size', 'contain')
- )
+ ),
+ isMobile: navigator.userAgent.match(/Android/i) ||
+ navigator.userAgent.match(/webOS/i) ||
+ navigator.userAgent.match(/iPhone/i) ||
+ navigator.userAgent.match(/iPad/i) ||
+ navigator.userAgent.match(/iPod/i) ||
+ navigator.userAgent.match(/BlackBerry/i) ||
+ navigator.userAgent.match(/Windows Phone/i)
}),
created () {
// Load the locale from the storage
diff --git a/src/App.scss b/src/App.scss
index 6d16c7c9..c72529ac 100644
--- a/src/App.scss
+++ b/src/App.scss
@@ -839,3 +839,14 @@ nav {
.vb.vb-dragging-phantom > .vb-dragger > .vb-dragger-styler {
opacity: .5;
}
+
+// Disable vuebar and use native scrollbar in mobile device
+#app.mobile {
+ .vb-content {
+ width: 100% !important;
+ padding-right: 0 !important;
+ }
+ .vb-dragger {
+ display: none;
+ }
+}
diff --git a/src/App.vue b/src/App.vue
index cb7e8d78..229bf62b 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,5 +1,5 @@
-
+
-
-
-
- toggleStatus(checked, status.id)" />
-
-
+
+
+
+
+ toggleStatus(checked, item.id)" />
+
+
+
@@ -116,10 +118,6 @@
&-sitem {
display: flex;
justify-content: space-between;
- border-bottom-width: 1px;
- border-bottom-style: solid;
- border-color: $fallback--border;
- border-color: var(--border, $fallback--border);
padding-right: 15px;
> .status-el {
From 220a7e89d5087af3989975cb326cd4d8f60cbc6a Mon Sep 17 00:00:00 2001
From: taehoon
Date: Mon, 29 Apr 2019 14:37:08 -0400
Subject: [PATCH 23/24] use native scrollbar
---
package.json | 1 -
src/App.js | 9 +---
src/App.scss | 50 -------------------
src/App.vue | 2 +-
.../user_reporting_modal.vue | 5 +-
src/main.js | 2 -
yarn.lock | 4 --
7 files changed, 5 insertions(+), 68 deletions(-)
diff --git a/package.json b/package.json
index 36dfda31..fcdea2c1 100644
--- a/package.json
+++ b/package.json
@@ -35,7 +35,6 @@
"vue-router": "^3.0.1",
"vue-template-compiler": "^2.3.4",
"vue-timeago": "^3.1.2",
- "vuebar": "^0.0.20",
"vuelidate": "^0.7.4",
"vuex": "^3.0.1",
"whatwg-fetch": "^2.0.3"
diff --git a/src/App.js b/src/App.js
index 87f00989..e72c73e3 100644
--- a/src/App.js
+++ b/src/App.js
@@ -39,14 +39,7 @@ export default {
window.CSS.supports('-moz-mask-size', 'contain') ||
window.CSS.supports('-ms-mask-size', 'contain') ||
window.CSS.supports('-o-mask-size', 'contain')
- ),
- isMobile: navigator.userAgent.match(/Android/i) ||
- navigator.userAgent.match(/webOS/i) ||
- navigator.userAgent.match(/iPhone/i) ||
- navigator.userAgent.match(/iPad/i) ||
- navigator.userAgent.match(/iPod/i) ||
- navigator.userAgent.match(/BlackBerry/i) ||
- navigator.userAgent.match(/Windows Phone/i)
+ )
}),
created () {
// Load the locale from the storage
diff --git a/src/App.scss b/src/App.scss
index adbe949c..921f2c3b 100644
--- a/src/App.scss
+++ b/src/App.scss
@@ -795,53 +795,3 @@ nav {
}
}
}
-
-// Vuebar default style
-.vb > .vb-dragger {
- z-index: 5;
- width: 12px;
- right: 0;
-}
-
-.vb > .vb-dragger > .vb-dragger-styler {
- backface-visibility: hidden;
- transform: rotate3d(0,0,0,0);
- background-color: $fallback--text;
- background-color: var(--text, $fallback--text);
- opacity: .1;
- margin: 5px 5px 5px 0;
- border-radius: 20px;
- height: calc(100% - 10px);
- display: block;
-}
-
-.vb.vb-scrolling-phantom > .vb-dragger > .vb-dragger-styler {
- opacity: .3;
-}
-
-.vb > .vb-dragger:hover > .vb-dragger-styler {
- opacity: .5;
- margin: 0px;
- height: 100%;
-}
-
-.vb.vb-dragging > .vb-dragger > .vb-dragger-styler {
- opacity: .5;
- margin: 0px;
- height: 100%;
-}
-
-.vb.vb-dragging-phantom > .vb-dragger > .vb-dragger-styler {
- opacity: .5;
-}
-
-// Disable vuebar and use native scrollbar in mobile device
-#app.mobile {
- .vb-content {
- width: 100% !important;
- padding-right: 0 !important;
- }
- .vb-dragger {
- display: none;
- }
-}
diff --git a/src/App.vue b/src/App.vue
index 229bf62b..cb7e8d78 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,5 +1,5 @@
-
+
-
+
@@ -113,12 +113,12 @@
&-right {
display: flex;
flex-direction: column;
+ overflow-y: auto;
}
&-sitem {
display: flex;
justify-content: space-between;
- padding-right: 15px;
> .status-el {
flex: 1;
@@ -150,6 +150,7 @@
&-right {
width: 50%;
flex: 1 1 auto;
+ margin-bottom: 12px;
}
}
}
diff --git a/src/main.js b/src/main.js
index e01c921c..92f843b1 100644
--- a/src/main.js
+++ b/src/main.js
@@ -16,7 +16,6 @@ import reportsModule from './modules/reports.js'
import VueTimeago from 'vue-timeago'
import VueI18n from 'vue-i18n'
-import Vuebar from 'vuebar'
import createPersistedState from './lib/persisted_state.js'
import pushNotifications from './lib/push_notifications_plugin.js'
@@ -43,7 +42,6 @@ Vue.use(VueTimeago, {
Vue.use(VueI18n)
Vue.use(VueChatScroll)
Vue.use(VueClickOutside)
-Vue.use(Vuebar)
const i18n = new VueI18n({
// By default, use the browser locale, we will update it if neccessary
diff --git a/yarn.lock b/yarn.lock
index 0dd2173e..69951563 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -6491,10 +6491,6 @@ vue@^2.5.13:
version "2.5.21"
resolved "https://registry.yarnpkg.com/vue/-/vue-2.5.21.tgz#3d33dcd03bb813912ce894a8303ab553699c4a85"
-vuebar@^0.0.20:
- version "0.0.20"
- resolved "https://registry.yarnpkg.com/vuebar/-/vuebar-0.0.20.tgz#fd6313c2d3a2202c49e42419fe1d9ef126134200"
-
vuelidate@^0.7.4:
version "0.7.4"
resolved "https://registry.yarnpkg.com/vuelidate/-/vuelidate-0.7.4.tgz#5a0e54be09ac0192f1aa3387d74b92e0945bf8aa"
From 9787d996722e44e6554d936e0995bf4c346207e2 Mon Sep 17 00:00:00 2001
From: taehoon
Date: Tue, 30 Apr 2019 16:38:34 -0400
Subject: [PATCH 24/24] update api services
---
src/services/api/api.service.js | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js
index 846fab3a..da44fc54 100644
--- a/src/services/api/api.service.js
+++ b/src/services/api/api.service.js
@@ -140,14 +140,11 @@ const updateBanner = ({credentials, banner}) => {
}
const updateProfile = ({credentials, params}) => {
- return promisedRequest(MASTODON_PROFILE_UPDATE_URL, {
- headers: {
- 'Accept': 'application/json',
- 'Content-Type': 'application/json',
- ...authHeaders(credentials)
- },
+ return promisedRequest({
+ url: MASTODON_PROFILE_UPDATE_URL,
method: 'PATCH',
- body: JSON.stringify(params)
+ payload: params,
+ credentials
})
.then((data) => parseUser(data))
}
@@ -727,11 +724,11 @@ const markNotificationsAsSeen = ({id, credentials}) => {
}
const fetchFavoritedByUsers = ({id}) => {
- return promisedRequest(MASTODON_STATUS_FAVORITEDBY_URL(id)).then((users) => users.map(parseUser))
+ return promisedRequest({ url: MASTODON_STATUS_FAVORITEDBY_URL(id) }).then((users) => users.map(parseUser))
}
const fetchRebloggedByUsers = ({id}) => {
- return promisedRequest(MASTODON_STATUS_REBLOGGEDBY_URL(id)).then((users) => users.map(parseUser))
+ return promisedRequest({ url: MASTODON_STATUS_REBLOGGEDBY_URL(id) }).then((users) => users.map(parseUser))
}
const reportUser = ({credentials, userId, statusIds, comment, forward}) => {