From 9508c2c1145ee75d6807b800f4758901b48d9ecb Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Sun, 23 Feb 2020 01:25:28 +0300 Subject: [PATCH 01/30] Add new groups of settings: mrfObjectAge, modules, swoosh, uriSchemes, feed, staticFe --- src/views/settings/components/Frontend.vue | 22 ++++++++++++++++------ src/views/settings/components/Inputs.vue | 2 +- src/views/settings/components/Instance.vue | 20 ++++++++++++++++++++ src/views/settings/components/MRF.vue | 20 ++++++++++++++++++++ src/views/settings/components/Mailer.vue | 10 ++++++++++ 5 files changed, 67 insertions(+), 7 deletions(-) diff --git a/src/views/settings/components/Frontend.vue b/src/views/settings/components/Frontend.vue index 48493e01..188a74ca 100644 --- a/src/views/settings/components/Frontend.vue +++ b/src/views/settings/components/Frontend.vue @@ -3,6 +3,10 @@ + + + + {{ $t('settings.assets') }} @@ -70,12 +74,6 @@ export default { frontendData() { return _.get(this.settings.settings, [':pleroma', ':frontend_configurations']) || {} }, - markup() { - return this.settings.description.find(setting => setting.key === ':markup') - }, - markupData() { - return _.get(this.settings.settings, [':pleroma', ':markup']) || {} - }, isMobile() { return this.$store.state.app.device === 'mobile' }, @@ -93,6 +91,18 @@ export default { }, loading() { return this.settings.loading + }, + markup() { + return this.settings.description.find(setting => setting.key === ':markup') + }, + markupData() { + return _.get(this.settings.settings, [':pleroma', ':markup']) || {} + }, + staticFe() { + return this.settings.description.find(setting => setting.key === ':static_fe') + }, + staticFeData() { + return _.get(this.settings.settings, [':pleroma', ':static_fe']) || {} } }, methods: { diff --git a/src/views/settings/components/Inputs.vue b/src/views/settings/components/Inputs.vue index 9b6da5e9..581324d9 100644 --- a/src/views/settings/components/Inputs.vue +++ b/src/views/settings/components/Inputs.vue @@ -187,7 +187,7 @@ export default { return Array.isArray(this.data[':icons']) ? this.data[':icons'] : [] }, inputValue() { - if ([':esshd', ':cors_plug', ':quack', ':http_signatures', ':tesla'].includes(this.settingGroup.group) && + if ([':esshd', ':cors_plug', ':quack', ':http_signatures', ':tesla', ':swoosh'].includes(this.settingGroup.group) && this.data[this.setting.key]) { return this.setting.type === 'atom' && this.data[this.setting.key].value[0] === ':' ? this.data[this.setting.key].value.substr(1) diff --git a/src/views/settings/components/Instance.vue b/src/views/settings/components/Instance.vue index eb8eb34b..f87c7736 100644 --- a/src/views/settings/components/Instance.vue +++ b/src/views/settings/components/Instance.vue @@ -23,6 +23,14 @@ + + + + + + + +
Submit
@@ -50,6 +58,12 @@ export default { adminTokenData() { return _.get(this.settings.settings, [':pleroma', ':admin_token']) || {} }, + feed() { + return this.settings.description.find(setting => setting.key === ':feed') + }, + feedData() { + return _.get(this.settings.settings, [':pleroma', ':feed']) || {} + }, fetchInitialPosts() { return this.settings.description.find(setting => setting.key === ':fetch_initial_posts') }, @@ -97,6 +111,12 @@ export default { }, scheduledActivityData() { return _.get(this.settings.settings, [':pleroma', 'Pleroma.ScheduledActivity']) || {} + }, + uriSchemes() { + return this.settings.description.find(setting => setting.key === ':uri_schemes') + }, + uriSchemesData() { + return _.get(this.settings.settings, [':pleroma', ':uri_schemes']) || {} } }, methods: { diff --git a/src/views/settings/components/MRF.vue b/src/views/settings/components/MRF.vue index a5e05eb1..7528c8b2 100644 --- a/src/views/settings/components/MRF.vue +++ b/src/views/settings/components/MRF.vue @@ -29,6 +29,14 @@ + + + + + + + +
Submit
@@ -66,6 +74,12 @@ export default { loading() { return this.settings.loading }, + modules() { + return this.settings.description.find(setting => setting.key === ':modules') + }, + modulesData() { + return _.get(this.settings.settings, [':pleroma', ':modules']) || {} + }, mrfSimple() { return this.settings.description.find(setting => setting.key === ':mrf_simple') }, @@ -90,6 +104,12 @@ export default { mrfKeywordData() { return _.get(this.settings.settings, [':pleroma', ':mrf_keyword']) || {} }, + mrfObjectAge() { + return this.settings.description.find(setting => setting.key === ':mrf_object_age') + }, + mrfObjectAgeData() { + return _.get(this.settings.settings, [':pleroma', ':mrf_object_age']) || {} + }, mrfSubchain() { return this.settings.description.find(setting => setting.key === ':mrf_subchain') }, diff --git a/src/views/settings/components/Mailer.vue b/src/views/settings/components/Mailer.vue index 2eb4db08..1624eff2 100644 --- a/src/views/settings/components/Mailer.vue +++ b/src/views/settings/components/Mailer.vue @@ -4,6 +4,10 @@
+ + + + @@ -61,6 +65,12 @@ export default { mailerData() { return _.get(this.settings.settings, [':pleroma', 'Pleroma.Emails.Mailer']) || {} }, + swoosh() { + return this.settings.description.find(setting => setting.group === ':swoosh') + }, + swooshData() { + return _.get(this.settings.settings, [':swoosh']) || {} + }, userEmail() { return this.settings.description.find(setting => setting.key === 'Pleroma.Emails.UserEmail') }, From a1aeb9da2c149451efd661aa3d4ee81b3da1d65a Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Tue, 25 Feb 2020 16:50:15 -0600 Subject: [PATCH 02/30] Fix spelling/grammar --- src/lang/en.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lang/en.js b/src/lang/en.js index d0728e07..5130a100 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -193,7 +193,7 @@ export default { deleteAccount: 'Delete Account', deleteAccounts: 'Delete Accounts', forceNsfw: 'Force posts to be NSFW', - stripMedia: 'Force posts not to have media', + stripMedia: 'Force posts to not have media', forceUnlisted: 'Force posts to be unlisted', sandbox: 'Force posts to be followers-only', disableRemoteSubscription: 'Disallow following user from remote instances', @@ -254,7 +254,7 @@ export default { external: 'external', localUppercase: 'Local', nickname: 'Nickname', - recentStatuses: 'Recent Statues', + recentStatuses: 'Recent Statuses', showPrivateStatuses: 'Show private statuses', roles: 'Roles', activeUppercase: 'Active', From d0d421ca5f0359b84011ea41ef34b0a9fdae46f3 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Wed, 26 Feb 2020 17:28:38 +0300 Subject: [PATCH 03/30] Add missing computed properties in emoji section --- src/views/emojiPacks/components/NewEmojiUploader.vue | 3 +++ src/views/emojiPacks/components/SingleEmojiEditor.vue | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/views/emojiPacks/components/NewEmojiUploader.vue b/src/views/emojiPacks/components/NewEmojiUploader.vue index 8bb431a2..f364b49e 100644 --- a/src/views/emojiPacks/components/NewEmojiUploader.vue +++ b/src/views/emojiPacks/components/NewEmojiUploader.vue @@ -44,6 +44,9 @@ export default { isDesktop() { return this.$store.state.app.device === 'desktop' }, + isMobile() { + return this.$store.state.app.device === 'mobile' + }, shortcodePresent() { return this.shortcode.trim() === '' } diff --git a/src/views/emojiPacks/components/SingleEmojiEditor.vue b/src/views/emojiPacks/components/SingleEmojiEditor.vue index d66bd48d..cd0eeb7f 100644 --- a/src/views/emojiPacks/components/SingleEmojiEditor.vue +++ b/src/views/emojiPacks/components/SingleEmojiEditor.vue @@ -95,6 +95,9 @@ export default { isDesktop() { return this.$store.state.app.device === 'desktop' }, + isMobile() { + return this.$store.state.app.device === 'mobile' + }, localPacks() { return this.$store.state.emojiPacks.localPacks }, From 99bcf4cbf5c95a8c60b2172629c19243c9103769 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Wed, 26 Feb 2020 17:32:14 +0300 Subject: [PATCH 04/30] Remove Tesla Adapter from settings --- src/views/settings/components/Http.vue | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/views/settings/components/Http.vue b/src/views/settings/components/Http.vue index a12a1efa..a94000b2 100644 --- a/src/views/settings/components/Http.vue +++ b/src/views/settings/components/Http.vue @@ -3,10 +3,6 @@ - - - - {{ $t('settings.corsPlug') }} @@ -86,12 +82,6 @@ export default { loading() { return this.settings.loading }, - teslaAdapter() { - return this.settings.description.find(setting => setting.group === ':tesla') - }, - teslaAdapterData() { - return _.get(this.settings.settings, [':tesla']) || {} - }, webCacheTtl() { return this.settings.description.find(setting => setting.key === ':web_cache_ttl') }, From 648acc8934ccfbd6898fa874c826e715f5ca3ee0 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Wed, 26 Feb 2020 22:00:49 +0300 Subject: [PATCH 05/30] Fix margins for grouped reports --- src/views/reports/components/GroupedReport.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/views/reports/components/GroupedReport.vue b/src/views/reports/components/GroupedReport.vue index fe4aa6f3..e7ce15e2 100644 --- a/src/views/reports/components/GroupedReport.vue +++ b/src/views/reports/components/GroupedReport.vue @@ -109,6 +109,9 @@ export default { .el-icon-arrow-right { margin-right: 6px; } + .divider { + margin: 15px 0; + } .grouped-report { .header-container { display: flex; From f6683f6d21886651941e70da01b742d9b1c8196c Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Wed, 26 Feb 2020 23:19:33 +0300 Subject: [PATCH 06/30] Add Mobile and Tablet UI to Moderation Log section --- src/views/moderation_log/index.vue | 116 +++++++++++++++++++---------- 1 file changed, 75 insertions(+), 41 deletions(-) diff --git a/src/views/moderation_log/index.vue b/src/views/moderation_log/index.vue index 6dba06f6..2e249b80 100644 --- a/src/views/moderation_log/index.vue +++ b/src/views/moderation_log/index.vue @@ -1,46 +1,40 @@ Date: Thu, 27 Feb 2020 01:13:51 +0300 Subject: [PATCH 08/30] Fix mobile-UI for reports section --- src/components/Status/index.vue | 5 ++--- src/views/reports/components/GroupedReport.vue | 13 ++++++++++--- src/views/reports/components/NoteCard.vue | 5 ++--- src/views/reports/components/Report.vue | 13 +++++++++---- src/views/reports/components/ReportCard.vue | 5 ++--- src/views/reports/components/ReportsFilter.vue | 11 ++++++++--- src/views/reports/index.vue | 8 ++------ src/views/settings/styles/main.scss | 2 +- src/views/statuses/index.vue | 4 +--- src/views/users/components/UsersFilter.vue | 11 ++++++++--- 10 files changed, 45 insertions(+), 32 deletions(-) diff --git a/src/components/Status/index.vue b/src/components/Status/index.vue index f6c63a12..50fbcfb0 100644 --- a/src/components/Status/index.vue +++ b/src/components/Status/index.vue @@ -267,9 +267,8 @@ export default { font-style: italic; } } -@media -only screen and (max-width: 760px), -(min-device-width: 768px) and (max-device-width: 1024px) { + +@media only screen and (max-width:480px) { .el-message { min-width: 80%; } diff --git a/src/views/reports/components/GroupedReport.vue b/src/views/reports/components/GroupedReport.vue index e7ce15e2..54ee5b1a 100644 --- a/src/views/reports/components/GroupedReport.vue +++ b/src/views/reports/components/GroupedReport.vue @@ -140,9 +140,8 @@ export default { .reported-status { margin-top: 15px; } - @media - only screen and (max-width: 760px), - (min-device-width: 768px) and (max-device-width: 1024px) { + + @media only screen and (max-width:480px) { .grouped-report { .header-container { display: flex; @@ -158,5 +157,13 @@ export default { margin-bottom: 7px; } } + .block { + .reports-timeline .el-timeline { + margin: 20px 10px; + .el-timeline-item__wrapper { + padding-left: 20px; + } + } + } } diff --git a/src/views/reports/components/NoteCard.vue b/src/views/reports/components/NoteCard.vue index fdc81d91..379e752b 100644 --- a/src/views/reports/components/NoteCard.vue +++ b/src/views/reports/components/NoteCard.vue @@ -97,9 +97,8 @@ export default { display: flex; justify-content: space-between; } - @media - only screen and (max-width: 760px), - (min-device-width: 768px) and (max-device-width: 1024px) { + + @media only screen and (max-width:480px) { .el-card__header { padding: 10px 17px; } diff --git a/src/views/reports/components/Report.vue b/src/views/reports/components/Report.vue index 9b963679..5911ad7d 100644 --- a/src/views/reports/components/Report.vue +++ b/src/views/reports/components/Report.vue @@ -74,7 +74,7 @@ v-model="notes[report.id]" :placeholder="$t('reports.leaveNote')" type="textarea" - rows="3"/> + rows="2"/>
{{ $t('reports.postNote') }}
@@ -279,9 +279,8 @@ export default { font-style: italic; color: gray; } - @media - only screen and (max-width: 760px), - (min-device-width: 768px) and (max-device-width: 1024px) { + + @media only screen and (max-width:480px) { .report { .header-container { display: flex; @@ -303,5 +302,11 @@ export default { margin-bottom: 7px; } } + .reports-timeline { + margin: 20px 10px; + .el-timeline-item__wrapper { + padding-left: 20px; + } + } } diff --git a/src/views/reports/components/ReportCard.vue b/src/views/reports/components/ReportCard.vue index 6121bb52..430b58bb 100644 --- a/src/views/reports/components/ReportCard.vue +++ b/src/views/reports/components/ReportCard.vue @@ -108,9 +108,8 @@ export default { display: flex; justify-content: space-between; } - @media - only screen and (max-width: 760px), - (min-device-width: 768px) and (max-device-width: 1024px) { + + @media only screen and (max-width:480px) { .el-card__header { padding: 10px 17px; } diff --git a/src/views/reports/components/ReportsFilter.vue b/src/views/reports/components/ReportsFilter.vue index da1fd782..29e15075 100644 --- a/src/views/reports/components/ReportsFilter.vue +++ b/src/views/reports/components/ReportsFilter.vue @@ -54,12 +54,17 @@ export default { .select-field { width: 350px; } -@media -only screen and (max-width: 760px), -(min-device-width: 768px) and (max-device-width: 1024px) { + +@media only screen and (max-width:480px) { .select-field { width: 100%; margin-bottom: 5px; } } + +@media only screen and (max-width:801px) and (min-width: 481px) { + .select-field { + width: 50%; + } +} diff --git a/src/views/reports/index.vue b/src/views/reports/index.vue index 3e67d90e..8c37e6a1 100644 --- a/src/views/reports/index.vue +++ b/src/views/reports/index.vue @@ -92,9 +92,8 @@ export default { font-size: 28px; } } -@media -only screen and (max-width: 760px), -(min-device-width: 768px) and (max-device-width: 1024px) { + +@media only screen and (max-width:480px) { .reports-container { h1 { margin: 7px 10px 15px 10px; @@ -103,8 +102,5 @@ only screen and (max-width: 760px), margin: 0 10px; } } - #app > div > div.main-container > section > div > div.block > ul { - margin: 45px 45px 5px 19px; - } } diff --git a/src/views/settings/styles/main.scss b/src/views/settings/styles/main.scss index a6658b55..5b68e0c6 100644 --- a/src/views/settings/styles/main.scss +++ b/src/views/settings/styles/main.scss @@ -520,8 +520,8 @@ margin-right: 8px } } - @media only screen and (max-width:801px) and (min-width: 481px) { + @media only screen and (max-width:801px) and (min-width: 481px) { .delete-setting-button { margin: 4px 0 0 10px; height: 28px; diff --git a/src/views/statuses/index.vue b/src/views/statuses/index.vue index 828526c8..5dc4834d 100644 --- a/src/views/statuses/index.vue +++ b/src/views/statuses/index.vue @@ -129,9 +129,7 @@ h1 { margin: 22px 0 0 0; } -@media -only screen and (max-width: 760px), -(min-device-width: 768px) and (max-device-width: 1024px) { +@media only screen and (max-width:480px) { .filter-container { display: flex; height: 36px; diff --git a/src/views/users/components/UsersFilter.vue b/src/views/users/components/UsersFilter.vue index edb3d75d..eba859f6 100644 --- a/src/views/users/components/UsersFilter.vue +++ b/src/views/users/components/UsersFilter.vue @@ -61,12 +61,17 @@ export default { .select-field { width: 350px; } -@media -only screen and (max-width: 760px), -(min-device-width: 768px) and (max-device-width: 1024px) { + +@media only screen and (max-width:480px) { .select-field { width: 100%; margin-bottom: 5px; } } + +@media only screen and (max-width:801px) and (min-width: 481px) { + .select-field { + width: 50%; + } +} From 2524581cfdfafe43b83edf1ef1ce1d2bdfb91cd5 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Thu, 27 Feb 2020 01:30:11 +0300 Subject: [PATCH 09/30] Fix mobile-UI for statuses by instance section --- src/views/statuses/index.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/views/statuses/index.vue b/src/views/statuses/index.vue index 5dc4834d..b6fd2019 100644 --- a/src/views/statuses/index.vue +++ b/src/views/statuses/index.vue @@ -134,12 +134,14 @@ h1 { display: flex; height: 36px; flex-direction: column; - margin: 10px 10px + margin: 10px 0; } - .select-field { width: 100%; margin-bottom: 5px; } + .select-instance { + width: 100%; + } } From 1ac453058fdf98ab0f49cf8c1de57d9d5c98820a Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Thu, 27 Feb 2020 02:18:47 +0300 Subject: [PATCH 10/30] Change the way user profile is rendered to using flexbox --- .../users/components/NewAccountDialog.vue | 5 +- src/views/users/index.vue | 5 +- src/views/users/show.vue | 155 ++++++++++-------- 3 files changed, 90 insertions(+), 75 deletions(-) diff --git a/src/views/users/components/NewAccountDialog.vue b/src/views/users/components/NewAccountDialog.vue index 4190f3cc..5b32985d 100644 --- a/src/views/users/components/NewAccountDialog.vue +++ b/src/views/users/components/NewAccountDialog.vue @@ -139,9 +139,8 @@ export default { .create-account-form-item-without-margin { margin-bottom: 0px; } -@media -only screen and (max-width: 760px), -(min-device-width: 768px) and (max-device-width: 1024px) { + +@media only screen and (max-width:480px) { .create-user-dialog { width: 85% } diff --git a/src/views/users/index.vue b/src/views/users/index.vue index 2940f776..780f9b39 100644 --- a/src/views/users/index.vue +++ b/src/views/users/index.vue @@ -269,9 +269,8 @@ export default { font-size: 28px; } } -@media -only screen and (max-width: 760px), -(min-device-width: 768px) and (max-device-width: 1024px) { + +@media only screen and (max-width:480px) { .password-reset-token-dialog { width: 85% } diff --git a/src/views/users/show.vue b/src/views/users/show.vue index 40952aeb..cdc08767 100644 --- a/src/views/users/show.vue +++ b/src/views/users/show.vue @@ -23,81 +23,73 @@

- - - - - - -

{{ $t('userProfile.recentStatuses') }}

-
- - - {{ $t('userProfile.showPrivateStatuses') }} - - -
- + @@ -193,6 +185,11 @@ table { margin-left: 28px; color: #606266; } +.recent-statuses-container { + display: flex; + flex-direction: column; + width: 67%; +} .recent-statuses-header { margin-top: 10px; } @@ -205,6 +202,9 @@ table { line-height: 67px; margin-right: 20px; } +.show-private-statuses { + margin-left: 28px; +} .recent-statuses { margin-left: 28px; } @@ -218,6 +218,11 @@ table { } .user-profile-card { margin: 0 20px; + width: 30%; + height: fit-content; +} +.user-profile-container { + display: flex; } .user-profile-table { margin: 0; @@ -225,4 +230,16 @@ table { .user-profile-tag { margin: 0 4px 4px 0; } + +@media only screen and (max-width:480px) { + .avatar-name-container { + margin-bottom: 10px; + } + .user-page-header { + flex-direction: column; + align-items: flex-start; + padding: 0; + margin: 7px 0 15px 10px; + } +} From a982fcbcb9331806cfa88507bf0018c35c168d0a Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Thu, 27 Feb 2020 02:58:03 +0300 Subject: [PATCH 11/30] Add mobile and tablet UI for user profile --- src/views/users/show.vue | 50 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/views/users/show.vue b/src/views/users/show.vue index cdc08767..ca0ed538 100644 --- a/src/views/users/show.vue +++ b/src/views/users/show.vue @@ -204,6 +204,7 @@ table { } .show-private-statuses { margin-left: 28px; + margin-bottom: 20px; } .recent-statuses { margin-left: 28px; @@ -235,11 +236,60 @@ table { .avatar-name-container { margin-bottom: 10px; } + .recent-statuses { + margin: 20px 10px 15px 10px; + } + .recent-statuses-container { + width: 100%; + margin: 0 10px; + } + .show-private-statuses { + margin: 0 10px 20px 10px; + } .user-page-header { flex-direction: column; align-items: flex-start; padding: 0; margin: 7px 0 15px 10px; } + .user-profile-card { + margin: 0 10px; + width: 95%; + td { + width: 80px; + } + } + .user-profile-container { + flex-direction: column; + } +} + +@media only screen and (max-width:801px) and (min-width: 481px) { + .avatar-name-container { + margin-bottom: 20px; + } + .recent-statuses { + margin: 20px 10px 15px 0; + } + .recent-statuses-container { + width: 97%; + margin: 0 20px; + } + .show-private-statuses { + margin: 0 10px 20px 0; + } + .user-page-header { + flex-direction: column; + align-items: flex-start; + padding: 0; + margin: 7px 0 20px 20px; + } + .user-profile-card { + margin: 0 20px; + width: fit-content; + } + .user-profile-container { + flex-direction: column; + } } From 868eb9dc7159d8efdadf72c4b73ba3c8eaa86fa9 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Thu, 27 Feb 2020 19:29:05 +0300 Subject: [PATCH 12/30] Remove grouped reports from admin-fe --- CHANGELOG.md | 1 - src/api/__mocks__/reports.js | 28 --- src/api/reports.js | 9 - src/lang/en.js | 1 - src/store/modules/reports.js | 27 +-- src/store/modules/status.js | 4 - .../reports/components/GroupedReport.vue | 169 ------------------ src/views/reports/index.vue | 41 +---- test/views/reports/groupedReport.test.js | 47 ----- 9 files changed, 6 insertions(+), 321 deletions(-) delete mode 100644 src/views/reports/components/GroupedReport.vue delete mode 100644 test/views/reports/groupedReport.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 24db7aec..085e4981 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Optimistic update for actions in users module and fetching users after api function finished its execution - Relay management - Ability to fetch all statuses from a given instance -- Grouped reports: now you can view reports, which are grouped by status (pagination is not implemented yet, though) - Ability to confirm users' emails and resend confirmation emails - Report notes - Ability to moderate users on the statuses page diff --git a/src/api/__mocks__/reports.js b/src/api/__mocks__/reports.js index ba4e412e..36fc2008 100644 --- a/src/api/__mocks__/reports.js +++ b/src/api/__mocks__/reports.js @@ -11,40 +11,12 @@ const reports = [ { created_at: '2019-05-18T13:01:33.000Z', account: { acct: 'nick', display_name: 'Nick Keys', tags: [] }, actor: { acct: 'admin' }, state: 'closed', id: '4', content: '', statuses: [] } ] -const groupedReports = [ - { account: { avatar: 'http://localhost:4000/images/avi.png', confirmation_pending: false, deactivated: false, display_name: 'leo', id: '9oG0YghgBi94EATI9I', local: true, nickname: 'leo', roles: { admin: false, moderator: false }, tags: [] }, - actors: [{ acct: 'admin', avatar: 'http://localhost:4000/images/avi.png', deactivated: false, display_name: 'admin', id: '9oFz4pTauG0cnJ581w', local: true, nickname: 'admin', roles: { admin: false, moderator: false }, tags: [], url: 'http://localhost:4000/users/admin', username: 'admin' }], - date: '2019-11-23T12:56:11.969772Z', - reports: [ - { created_at: '2019-05-21T21:35:33.000Z', account: { acct: 'benj', display_name: 'Benjamin Fame', tags: [] }, actor: { acct: 'admin' }, state: 'open', id: '2', content: 'This is a report', statuses: [] }, - { created_at: '2019-05-20T22:45:33.000Z', account: { acct: 'alice', display_name: 'Alice Pool', tags: [] }, actor: { acct: 'admin2' }, state: 'resolved', id: '7', content: 'Please block this user', statuses: [ - { account: { display_name: 'Alice Pool', avatar: '' }, visibility: 'public', sensitive: false, id: '11', content: 'Hey!', url: '', created_at: '2019-05-10T21:35:33.000Z' }, - { account: { display_name: 'Alice Pool', avatar: '' }, visibility: 'unlisted', sensitive: true, id: '10', content: 'Bye!', url: '', created_at: '2019-05-10T21:00:33.000Z' } - ] } - ], - status: { - account: { acct: 'leo' }, - content: 'At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis', - created_at: '2019-11-23T12:55:20.000Z', - id: '9pFoQO69piu7cUDnJg', - url: 'http://localhost:4000/notice/9pFoQO69piu7cUDnJg', - visibility: 'unlisted', - sensitive: true - }, - status_deleted: false - } -] - export async function fetchReports(filter, page, pageSize, authHost, token) { return filter.length > 0 ? Promise.resolve({ data: { reports: reports.filter(report => report.state === filter) }}) : Promise.resolve({ data: { reports }}) } -export async function fetchGroupedReports(authHost, token) { - return Promise.resolve({ data: { reports: groupedReports }}) -} - export async function changeState(reportsData, authHost, token) { return Promise.resolve({ data: '' }) } diff --git a/src/api/reports.js b/src/api/reports.js index 3454da2f..abd371c1 100644 --- a/src/api/reports.js +++ b/src/api/reports.js @@ -24,15 +24,6 @@ export async function fetchReports(filter, page, pageSize, authHost, token) { }) } -export async function fetchGroupedReports(authHost, token) { - return await request({ - baseURL: baseName(authHost), - url: `/api/pleroma/admin/grouped_reports`, - method: 'get', - headers: authHeaders(token) - }) -} - export async function createNote(content, reportID, authHost, token) { return await request({ baseURL: baseName(authHost), diff --git a/src/lang/en.js b/src/lang/en.js index 5130a100..7512ecbf 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -273,7 +273,6 @@ export default { }, reports: { reports: 'Reports', - groupedReports: 'Grouped reports', reply: 'Reply', from: 'From', showNotes: 'Show notes', diff --git a/src/store/modules/reports.js b/src/store/modules/reports.js index c1b07b51..3a836a2f 100644 --- a/src/store/modules/reports.js +++ b/src/store/modules/reports.js @@ -1,13 +1,11 @@ -import { changeState, fetchReports, fetchGroupedReports, createNote, deleteNote } from '@/api/reports' +import { changeState, fetchReports, createNote, deleteNote } from '@/api/reports' const reports = { state: { fetchedReports: [], - fetchedGroupedReports: [], totalReportsCount: 0, currentPage: 1, pageSize: 50, - groupReports: false, stateFilter: '', loading: true }, @@ -24,17 +22,11 @@ const reports = { SET_REPORTS: (state, reports) => { state.fetchedReports = reports }, - SET_GROUPED_REPORTS: (state, reports) => { - state.fetchedGroupedReports = reports - }, SET_REPORTS_COUNT: (state, total) => { state.totalReportsCount = total }, SET_REPORTS_FILTER: (state, filter) => { state.stateFilter = filter - }, - SET_REPORTS_GROUPING: (state) => { - state.groupReports = !state.groupReports } }, actions: { @@ -46,14 +38,7 @@ const reports = { return updatedReportsIds.includes(report.id) ? { ...report, state: reportsData[0].state } : report }) - const updatedGroupedReports = state.fetchedGroupedReports.map(group => { - const updatedReportsIds = reportsData.map(({ id }) => id) - const updatedReports = group.reports.map(report => updatedReportsIds.includes(report.id) ? { ...report, state: reportsData[0].state } : report) - return { ...group, reports: updatedReports } - }) - commit('SET_REPORTS', updatedReports) - commit('SET_GROUPED_REPORTS', updatedGroupedReports) }, ClearFetchedReports({ commit }) { commit('SET_REPORTS', []) @@ -67,19 +52,9 @@ const reports = { commit('SET_PAGE', page) commit('SET_LOADING', false) }, - async FetchGroupedReports({ commit, getters }) { - commit('SET_LOADING', true) - const { data } = await fetchGroupedReports(getters.authHost, getters.token) - - commit('SET_GROUPED_REPORTS', data.reports) - commit('SET_LOADING', false) - }, SetFilter({ commit }, filter) { commit('SET_REPORTS_FILTER', filter) }, - ToggleReportsGrouping({ commit }) { - commit('SET_REPORTS_GROUPING') - }, CreateReportNote({ commit, getters, state, rootState }, { content, reportID }) { createNote(content, reportID, getters.authHost, getters.token) diff --git a/src/store/modules/status.js b/src/store/modules/status.js index 228e03f1..81e86dba 100644 --- a/src/store/modules/status.js +++ b/src/store/modules/status.js @@ -36,8 +36,6 @@ const status = { dispatch('FetchUserStatuses', { userId, godmode }) } else if (fetchStatusesByInstance) { // called from Statuses by Instance dispatch('FetchStatusesByInstance') - } else { // called from GroupedReports - dispatch('FetchGroupedReports') } }, async DeleteStatus({ dispatch, getters }, { statusId, reportCurrentPage, userId, godmode, fetchStatusesByInstance }) { @@ -48,8 +46,6 @@ const status = { dispatch('FetchUserStatuses', { userId, godmode }) } else if (fetchStatusesByInstance) { // called from Statuses by Instance dispatch('FetchStatusesByInstance') - } else { // called from GroupedReports - dispatch('FetchGroupedReports') } }, async FetchStatusesByInstance({ commit, getters, state }) { diff --git a/src/views/reports/components/GroupedReport.vue b/src/views/reports/components/GroupedReport.vue deleted file mode 100644 index 54ee5b1a..00000000 --- a/src/views/reports/components/GroupedReport.vue +++ /dev/null @@ -1,169 +0,0 @@ - - - - - diff --git a/src/views/reports/index.vue b/src/views/reports/index.vue index 8c37e6a1..64993da3 100644 --- a/src/views/reports/index.vue +++ b/src/views/reports/index.vue @@ -1,22 +1,14 @@ @@ -77,9 +49,6 @@ export default { margin: 22px 15px 22px 15px; padding-bottom: 0 } - .group-reports-checkbox { - margin-top: 10px; - } h1 { margin: 22px 0 0 15px; } diff --git a/test/views/reports/groupedReport.test.js b/test/views/reports/groupedReport.test.js deleted file mode 100644 index b24d05e4..00000000 --- a/test/views/reports/groupedReport.test.js +++ /dev/null @@ -1,47 +0,0 @@ -import Vuex from 'vuex' -import { mount, createLocalVue, config } from '@vue/test-utils' -import Element from 'element-ui' -import GroupedReport from '@/views/reports/components/GroupedReport' -import storeConfig from './store.conf' -import { cloneDeep } from 'lodash' -import flushPromises from 'flush-promises' - -config.mocks["$t"] = () => {} - -const localVue = createLocalVue() -localVue.use(Vuex) -localVue.use(Element) - -jest.mock('@/api/reports') - -describe('Grouped report', () => { - let store - - beforeEach(async() => { - store = new Vuex.Store(cloneDeep(storeConfig)) - store.dispatch('FetchGroupedReports') - await flushPromises() - }) - - it('changes state of all reports in a group', async (done) => { - const groupedReports = store.state.reports.fetchedGroupedReports - const wrapper = mount(GroupedReport, { - store, - localVue, - propsData: { - groupedReports - } - }) - - expect(groupedReports[0].reports[0].state).toBe('open') - expect(groupedReports[0].reports[1].state).toBe('resolved') - - const button = wrapper.find(`.grouped-report .el-dropdown-menu__item:nth-child(3)`) - button.trigger('click') - await flushPromises() - - expect(store.state.reports.fetchedGroupedReports[0].reports[0].state).toBe('closed') - expect(store.state.reports.fetchedGroupedReports[0].reports[1].state).toBe('closed') - done() - }) -}) From f4d40cb157ababaaed5d8e5ce68bb415146940c9 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Thu, 27 Feb 2020 19:40:24 +0300 Subject: [PATCH 13/30] Add styles for divider on report tab --- src/views/reports/components/Report.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/views/reports/components/Report.vue b/src/views/reports/components/Report.vue index 5911ad7d..4df72383 100644 --- a/src/views/reports/components/Report.vue +++ b/src/views/reports/components/Report.vue @@ -180,6 +180,9 @@ export default { height: 15px; margin-left: 5px; } + .divider { + margin: 15px 0; + } .el-card__body { padding: 17px; } From a1a90d948efa33e57f47b62bbb978f451aa54493 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Thu, 27 Feb 2020 20:11:09 +0300 Subject: [PATCH 14/30] Update Changelog --- CHANGELOG.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 085e4981..bfd8927e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,20 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## Unreleased - -### Changed - -- **breaking** PleromaFE login feature relies on `admin` scope presence in PleromaFE token (older versions of PleromaFE don't support it) -- Moves emoji pack configuration from the main menu to settings tab, redesigns it and fixes bugs -- `mailerEnabled` must be set to `true` in order to require password reset (password reset currently only works via email) -- Remove fetching initial data for configuring server settings -- Actions in users module (ActivateUsers, AddRight, DeactivateUsers, DeleteRight, DeleteUsers) now accept an array of users instead of one user -- Leave dropdown menu open after clicking an action -- Move current try/catch error handling from view files to module, add it where necessary -- Display checkboxes in status card and fetch statuses only when status card was rendered from Statuses by instance page -- Move statuses by instance state from local state to store state -- Pass user's ID to actions that moderate users when action is called from user's profile page +## [2.0] - 2020-02-27 ### Added @@ -28,8 +15,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Report notes - Ability to moderate users on the statuses page - Ability to moderate user on the user's page +- Ability to remove setting's updated value and set it back to initial value - Ability to restart an application when settings that require instance reboot were changed -- Mobile UI for Settings tab +- Mobile and Tablet UI for all sections + +### Changed + +- **breaking** PleromaFE login feature relies on `admin` scope presence in PleromaFE token (older versions of PleromaFE don't support it) +- `mailerEnabled` must be set to `true` in order to require password reset (password reset currently only works via email) +- Render inputs for configuring settings based on description that comes from the BE +- Remove fetching initial data for configuring server settings +- Actions in users module (ActivateUsers, AddRight, DeactivateUsers, DeleteRight, DeleteUsers) now accept an array of users instead of one user +- Leave dropdown menu open after clicking an action +- Display checkboxes in status card and fetch statuses only when status card was rendered from Statuses by instance page +- Move statuses by instance state from local state to store state ### Fixed @@ -38,6 +37,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Remove duplicated success message - Fix styles for Statuses by instance page - Fix styles for Reports section +- Fix listing remote emoji ## [1.2.0] - 2019-09-27 From d611c7d0e54e653e8b4249b789724a4f88ab1602 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Thu, 27 Feb 2020 22:25:50 +0300 Subject: [PATCH 15/30] Add api function and action to fetch statuses --- CHANGELOG.md | 6 ++++++ src/api/status.js | 9 +++++++++ src/store/getters.js | 4 +--- src/store/modules/status.js | 7 ++++++- src/views/statuses/index.vue | 11 ++++++----- 5 files changed, 28 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bfd8927e..bdefcea9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## Unreleased + +### Added + +- Ability to see local statuses in Statuses by instance section + ## [2.0] - 2020-02-27 ### Added diff --git a/src/api/status.js b/src/api/status.js index 676cd9dc..9feb8754 100644 --- a/src/api/status.js +++ b/src/api/status.js @@ -21,6 +21,15 @@ export async function deleteStatus(id, authHost, token) { }) } +export async function fetchStatuses({ godmode, localOnly, authHost, token }) { + return await request({ + baseURL: baseName(authHost), + url: `/api/pleroma/admin/statuses?godmode=${godmode}&local_only=${localOnly}`, + method: 'get', + headers: authHeaders(token) + }) +} + export async function fetchStatusesByInstance({ instance, authHost, token, pageSize, page }) { return await request({ baseURL: baseName(authHost), diff --git a/src/store/getters.js b/src/store/getters.js index d51dbd28..f58f0c6b 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -17,8 +17,6 @@ const getters = { errorLogs: state => state.errorLog.logs, users: state => state.users.fetchedUsers, authHost: state => state.user.authHost, - settings: state => state.settings, - instances: state => state.peers.fetchedPeers, - statuses: state => state.status.fetchedStatuses + settings: state => state.settings } export default getters diff --git a/src/store/modules/status.js b/src/store/modules/status.js index 81e86dba..7f547d34 100644 --- a/src/store/modules/status.js +++ b/src/store/modules/status.js @@ -1,4 +1,4 @@ -import { changeStatusScope, deleteStatus, fetchStatusesByInstance } from '@/api/status' +import { changeStatusScope, deleteStatus, fetchStatuses, fetchStatusesByInstance } from '@/api/status' const status = { state: { @@ -48,6 +48,11 @@ const status = { dispatch('FetchStatusesByInstance') } }, + async FetchStatuses({ commit, getters }, { godmode, localOnly }) { + commit('SET_LOADING', true) + await fetchStatuses({ godmode, localOnly, authHost: getters.authHost, token: getters.token }) + commit('SET_LOADING', false) + }, async FetchStatusesByInstance({ commit, getters, state }) { commit('SET_LOADING', true) const statuses = state.statusesByInstance.selectedInstance === '' diff --git a/src/views/statuses/index.vue b/src/views/statuses/index.vue index b6fd2019..7ecd649f 100644 --- a/src/views/statuses/index.vue +++ b/src/views/statuses/index.vue @@ -36,7 +36,6 @@ + + diff --git a/src/views/settings/components/inputComponents/EditableKeywordInput.vue b/src/views/settings/components/inputComponents/EditableKeywordInput.vue index a6ecde4d..fe5b9c7b 100644 --- a/src/views/settings/components/inputComponents/EditableKeywordInput.vue +++ b/src/views/settings/components/inputComponents/EditableKeywordInput.vue @@ -8,14 +8,6 @@ -
-
- : - - -
- -
: @@ -109,19 +101,13 @@ export default { this.$store.dispatch('UpdateState', { group, key, input, value }) }, wrapUpdatedSettings(value, input, type) { - if (type === 'map') { - return value.reduce((acc, element) => { + return type === 'map' + ? value.reduce((acc, element) => { return { ...acc, [Object.keys(element)[0]]: Object.values(element)[0].value } }, {}) - } else if (input === ':crontab') { - return value.reduce((acc, element) => { - return { ...acc, [Object.values(element)[0].value]: ['reversed_tuple', Object.keys(element)[0]] } - }, {}) - } else { - return value.reduce((acc, element) => { + : value.reduce((acc, element) => { return { ...acc, [Object.keys(element)[0]]: ['list', Object.values(element)[0].value] } }, {}) - } } } } diff --git a/src/views/settings/components/inputComponents/index.js b/src/views/settings/components/inputComponents/index.js index 389b304e..788d1f99 100644 --- a/src/views/settings/components/inputComponents/index.js +++ b/src/views/settings/components/inputComponents/index.js @@ -1,5 +1,6 @@ export { default as AutoLinkerInput } from './AutoLinkerInput' export { default as EditableKeywordInput } from './EditableKeywordInput' +export { default as CrontabInput } from './CrontabInput' export { default as IconsInput } from './IconsInput' export { default as MascotsInput } from './MascotsInput' export { default as MultipleSelect } from './MultipleSelect' diff --git a/src/views/settings/styles/main.scss b/src/views/settings/styles/main.scss index fd8e69d2..5b68e0c6 100644 --- a/src/views/settings/styles/main.scss +++ b/src/views/settings/styles/main.scss @@ -14,15 +14,6 @@ font-family: monospace; padding: 0 3px 0 3px; } - .crontab-name-input { - width: 30%; - margin-left: 8px; - margin-right: 10px - } - .crontab-value-input { - width: 70%; - margin-right: 8px - } .delete-setting-button { margin-left: 5px; } @@ -334,7 +325,6 @@ margin-right: 10px } - @media only screen and (min-width: 1824px) { .submit-button-container { max-width: 1637px; From 7aae515678cc7be7fc507f5a076e8f6aa547d89b Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Fri, 6 Mar 2020 23:11:49 +0300 Subject: [PATCH 27/30] Add input processor for crontab inputs --- src/store/modules/normalizers.js | 4 +- .../inputComponents/CrontabInput.vue | 41 ++++++++++++++++--- 2 files changed, 38 insertions(+), 7 deletions(-) diff --git a/src/store/modules/normalizers.js b/src/store/modules/normalizers.js index 7e843710..ba4bea81 100644 --- a/src/store/modules/normalizers.js +++ b/src/store/modules/normalizers.js @@ -87,8 +87,8 @@ export const parseTuples = (tuples, key) => { }, []) } else if (item.tuple[0] === ':crontab') { accum[item.tuple[0]] = item.tuple[1].reduce((acc, group) => { - return [...acc, { [group.tuple[1]]: group.tuple[0] }] - }, []) + return { ...acc, [group.tuple[1]]: group.tuple[0] } + }, {}) } else if (item.tuple[0] === ':match_actor') { accum[item.tuple[0]] = Object.keys(item.tuple[1]).reduce((acc, regex) => { return [...acc, { [regex]: { value: item.tuple[1][regex], id: `f${(~~(Math.random() * 1e8)).toString(16)}` }}] diff --git a/src/views/settings/components/inputComponents/CrontabInput.vue b/src/views/settings/components/inputComponents/CrontabInput.vue index a38340ad..9bf3f5ec 100644 --- a/src/views/settings/components/inputComponents/CrontabInput.vue +++ b/src/views/settings/components/inputComponents/CrontabInput.vue @@ -1,11 +1,14 @@ @@ -15,7 +18,7 @@ export default { name: 'CrontabInput', props: { data: { - type: Array, + type: Object, default: function() { return {} } @@ -34,6 +37,22 @@ export default { } }, computed: { + isDesktop() { + return this.$store.state.app.device === 'desktop' + }, + isMobile() { + return this.$store.state.app.device === 'mobile' + }, + isTablet() { + return this.$store.state.app.device === 'tablet' + }, + labelWidth() { + if (this.isMobile) { + return '120px' + } else { + return '380px' + } + }, workers() { return this.setting.suggestions.map(worker => worker[1]) } @@ -41,6 +60,18 @@ export default { methods: { getSuggestion(worker) { return this.setting.suggestions.find(suggestion => suggestion[1] === worker)[0] + }, + update(value, worker) { + const updatedValue = { + ...this.$store.state.settings.settings[this.settingGroup.group][this.settingGroup.key][this.setting.key], + [worker]: value + } + this.$store.dispatch('UpdateSettings', + { group: this.settingGroup.group, key: this.settingGroup.key, input: this.setting.key, value: updatedValue, type: 'reversed_tuple' } + ) + this.$store.dispatch('UpdateState', + { group: this.settingGroup.group, key: this.settingGroup.key, input: this.setting.key, value: updatedValue } + ) } } } From 1ad4cc277cd168975e294feed52f3b1b8534d328 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Sat, 7 Mar 2020 01:08:48 +0300 Subject: [PATCH 28/30] Fix styles for desktop, tablet and mobile versions --- .../components/inputComponents/CrontabInput.vue | 13 +++++-------- src/views/settings/styles/main.scss | 10 ++++++++++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/views/settings/components/inputComponents/CrontabInput.vue b/src/views/settings/components/inputComponents/CrontabInput.vue index 9bf3f5ec..1f6f3af1 100644 --- a/src/views/settings/components/inputComponents/CrontabInput.vue +++ b/src/views/settings/components/inputComponents/CrontabInput.vue @@ -1,16 +1,13 @@