aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/App.scss3
-rw-r--r--src/components/chat_panel/chat_panel.vue2
-rw-r--r--src/components/emoji_picker/emoji_picker.js5
-rw-r--r--src/components/settings_modal/tabs/data_import_export_tab.js28
-rw-r--r--src/components/settings_modal/tabs/data_import_export_tab.vue17
-rw-r--r--src/components/side_drawer/side_drawer.vue2
-rw-r--r--src/components/user_profile/user_profile.vue3
-rw-r--r--src/i18n/en.json7
-rw-r--r--src/services/api/api.service.js13
9 files changed, 67 insertions, 13 deletions
diff --git a/src/App.scss b/src/App.scss
index e2e2d079..88e5df86 100644
--- a/src/App.scss
+++ b/src/App.scss
@@ -941,6 +941,9 @@ nav {
min-height: 1.3rem;
max-height: 1.3rem;
line-height: 1.3rem;
+ max-width: 10em;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
.chat-layout {
diff --git a/src/components/chat_panel/chat_panel.vue b/src/components/chat_panel/chat_panel.vue
index ca529b5a..570435e7 100644
--- a/src/components/chat_panel/chat_panel.vue
+++ b/src/components/chat_panel/chat_panel.vue
@@ -63,7 +63,7 @@
@click.stop.prevent="togglePanel"
>
<div class="title">
- <i class="icon-comment-empty" />
+ <i class="icon-megaphone" />
{{ $t('shoutbox.title') }}
</div>
</div>
diff --git a/src/components/emoji_picker/emoji_picker.js b/src/components/emoji_picker/emoji_picker.js
index 0f397b59..5c09f6ca 100644
--- a/src/components/emoji_picker/emoji_picker.js
+++ b/src/components/emoji_picker/emoji_picker.js
@@ -8,7 +8,10 @@ const LOAD_EMOJI_BY = 60
const LOAD_EMOJI_MARGIN = 64
const filterByKeyword = (list, keyword = '') => {
- return list.filter(x => x.displayText.includes(keyword))
+ const keywordLowercase = keyword.toLowerCase()
+ return list.filter(emoji =>
+ emoji.displayText.toLowerCase().includes(keywordLowercase)
+ )
}
const EmojiPicker = {
diff --git a/src/components/settings_modal/tabs/data_import_export_tab.js b/src/components/settings_modal/tabs/data_import_export_tab.js
index 168f89e1..f4b736d2 100644
--- a/src/components/settings_modal/tabs/data_import_export_tab.js
+++ b/src/components/settings_modal/tabs/data_import_export_tab.js
@@ -1,6 +1,7 @@
import Importer from 'src/components/importer/importer.vue'
import Exporter from 'src/components/exporter/exporter.vue'
import Checkbox from 'src/components/checkbox/checkbox.vue'
+import { mapState } from 'vuex'
const DataImportExportTab = {
data () {
@@ -18,21 +19,26 @@ const DataImportExportTab = {
Checkbox
},
computed: {
- user () {
- return this.$store.state.users.currentUser
- }
+ ...mapState({
+ backendInteractor: (state) => state.api.backendInteractor,
+ user: (state) => state.users.currentUser
+ })
},
methods: {
getFollowsContent () {
- return this.$store.state.api.backendInteractor.exportFriends({ id: this.$store.state.users.currentUser.id })
+ return this.backendInteractor.exportFriends({ id: this.user.id })
.then(this.generateExportableUsersContent)
},
getBlocksContent () {
- return this.$store.state.api.backendInteractor.fetchBlocks()
+ return this.backendInteractor.fetchBlocks()
+ .then(this.generateExportableUsersContent)
+ },
+ getMutesContent () {
+ return this.backendInteractor.fetchMutes()
.then(this.generateExportableUsersContent)
},
importFollows (file) {
- return this.$store.state.api.backendInteractor.importFollows({ file })
+ return this.backendInteractor.importFollows({ file })
.then((status) => {
if (!status) {
throw new Error('failed')
@@ -40,7 +46,15 @@ const DataImportExportTab = {
})
},
importBlocks (file) {
- return this.$store.state.api.backendInteractor.importBlocks({ file })
+ return this.backendInteractor.importBlocks({ file })
+ .then((status) => {
+ if (!status) {
+ throw new Error('failed')
+ }
+ })
+ },
+ importMutes (file) {
+ return this.backendInteractor.importMutes({ file })
.then((status) => {
if (!status) {
throw new Error('failed')
diff --git a/src/components/settings_modal/tabs/data_import_export_tab.vue b/src/components/settings_modal/tabs/data_import_export_tab.vue
index b5d0f5ed..a406077d 100644
--- a/src/components/settings_modal/tabs/data_import_export_tab.vue
+++ b/src/components/settings_modal/tabs/data_import_export_tab.vue
@@ -36,6 +36,23 @@
:export-button-label="$t('settings.block_export_button')"
/>
</div>
+ <div class="setting-item">
+ <h2>{{ $t('settings.mute_import') }}</h2>
+ <p>{{ $t('settings.import_mutes_from_a_csv_file') }}</p>
+ <Importer
+ :submit-handler="importMutes"
+ :success-message="$t('settings.mutes_imported')"
+ :error-message="$t('settings.mute_import_error')"
+ />
+ </div>
+ <div class="setting-item">
+ <h2>{{ $t('settings.mute_export') }}</h2>
+ <Exporter
+ :get-content="getMutesContent"
+ filename="mutes.csv"
+ :export-button-label="$t('settings.mute_export_button')"
+ />
+ </div>
</div>
</template>
diff --git a/src/components/side_drawer/side_drawer.vue b/src/components/side_drawer/side_drawer.vue
index 0587ee02..eda5a68c 100644
--- a/src/components/side_drawer/side_drawer.vue
+++ b/src/components/side_drawer/side_drawer.vue
@@ -90,7 +90,7 @@
@click="toggleDrawer"
>
<router-link :to="{ name: 'chat' }">
- <i class="button-icon icon-chat" /> {{ $t("nav.chat") }}
+ <i class="button-icon icon-megaphone" /> {{ $t("shoutbox.title") }}
</router-link>
</li>
</ul>
diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue
index c7c67c0a..b26499b4 100644
--- a/src/components/user_profile/user_profile.vue
+++ b/src/components/user_profile/user_profile.vue
@@ -156,8 +156,7 @@
.user-profile-field {
display: flex;
- margin: 0.25em auto;
- max-width: 32em;
+ margin: 0.25em;
border: 1px solid var(--border, $fallback--border);
border-radius: $fallback--inputRadius;
border-radius: var(--inputRadius, $fallback--inputRadius);
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 8d831e3d..01f89503 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -113,7 +113,6 @@
"about": "About",
"administration": "Administration",
"back": "Back",
- "chat": "Local Chat",
"friend_requests": "Follow Requests",
"mentions": "Mentions",
"interactions": "Interactions",
@@ -276,6 +275,12 @@
"block_import": "Block import",
"block_import_error": "Error importing blocks",
"blocks_imported": "Blocks imported! Processing them will take a while.",
+ "mute_export": "Mute export",
+ "mute_export_button": "Export your mutes to a csv file",
+ "mute_import": "Mute import",
+ "mute_import_error": "Error importing mutes",
+ "mutes_imported": "Mutes imported! Processing them will take a while.",
+ "import_mutes_from_a_csv_file": "Import mutes from a csv file",
"blocks_tab": "Blocks",
"bot": "This is a bot account",
"btnRadius": "Buttons",
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js
index d1842e17..1a3495d4 100644
--- a/src/services/api/api.service.js
+++ b/src/services/api/api.service.js
@@ -3,6 +3,7 @@ import { parseStatus, parseUser, parseNotification, parseAttachment, parseChat,
import { RegistrationError, StatusCodeError } from '../errors/errors'
/* eslint-env browser */
+const MUTES_IMPORT_URL = '/api/pleroma/mutes_import'
const BLOCKS_IMPORT_URL = '/api/pleroma/blocks_import'
const FOLLOW_IMPORT_URL = '/api/pleroma/follow_import'
const DELETE_ACCOUNT_URL = '/api/pleroma/delete_account'
@@ -712,6 +713,17 @@ const setMediaDescription = ({ id, description, credentials }) => {
}).then((data) => parseAttachment(data))
}
+const importMutes = ({ file, credentials }) => {
+ const formData = new FormData()
+ formData.append('list', file)
+ return fetch(MUTES_IMPORT_URL, {
+ body: formData,
+ method: 'POST',
+ headers: authHeaders(credentials)
+ })
+ .then((response) => response.ok)
+}
+
const importBlocks = ({ file, credentials }) => {
const formData = new FormData()
formData.append('list', file)
@@ -1282,6 +1294,7 @@ const apiService = {
getCaptcha,
updateProfileImages,
updateProfile,
+ importMutes,
importBlocks,
importFollows,
deleteAccount,