From a463959a365a5d618a79c96a26f6506e700d6ea3 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 1 Oct 2020 01:43:07 +0300 Subject: Initial work on highlighting changed settings. Some refactoring to simplify addition of new settings --- src/modules/config.js | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src/modules/config.js') diff --git a/src/modules/config.js b/src/modules/config.js index 409d77a4..2c1e881f 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -74,18 +74,24 @@ export const instanceDefaultProperties = Object.entries(defaultState) .map(([key, value]) => key) const config = { - state: defaultState, + state: { ...defaultState }, getters: { - mergedConfig (state, getters, rootState, rootGetters) { + defaultConfig (state, getters, rootState, rootGetters) { const { instance } = rootState + console.log('DC', instance.minimalScopesMode) + return { + ...defaultState, + ...Object.fromEntries( + instanceDefaultProperties.map(key => [key, instance[key]]) + ) + } + }, + mergedConfig (state, getters, rootState, rootGetters) { + const { defaultConfig } = rootGetters + console.log('DC2', defaultConfig.hideISP) return { - ...state, - ...instanceDefaultProperties - .map(key => [key, state[key] === undefined - ? instance[key] - : state[key] - ]) - .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {}) + ...defaultConfig, + ...state } } }, -- cgit v1.2.3-70-g09d2 From 66f3e72b545a7f92d2569baa0fd52275a29d629a Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 1 Feb 2021 20:08:36 +0200 Subject: update branch with recent develop changes (FA, added settings) --- .../settings_modal/helpers/boolean_setting.vue | 6 +-- .../settings_modal/helpers/modified_icon.vue | 46 ------------------- .../settings_modal/helpers/modified_indicator.vue | 51 ++++++++++++++++++++++ .../helpers/shared_computed_object.js | 1 - src/components/settings_modal/tabs/general_tab.vue | 8 ++-- src/modules/config.js | 2 - 6 files changed, 58 insertions(+), 56 deletions(-) delete mode 100644 src/components/settings_modal/helpers/modified_icon.vue create mode 100644 src/components/settings_modal/helpers/modified_indicator.vue (limited to 'src/modules/config.js') diff --git a/src/components/settings_modal/helpers/boolean_setting.vue b/src/components/settings_modal/helpers/boolean_setting.vue index f7c392cd..b600b63b 100644 --- a/src/components/settings_modal/helpers/boolean_setting.vue +++ b/src/components/settings_modal/helpers/boolean_setting.vue @@ -13,7 +13,7 @@ > - + @@ -21,7 +21,7 @@ - - diff --git a/src/components/settings_modal/helpers/modified_indicator.vue b/src/components/settings_modal/helpers/modified_indicator.vue new file mode 100644 index 00000000..b75a2811 --- /dev/null +++ b/src/components/settings_modal/helpers/modified_indicator.vue @@ -0,0 +1,51 @@ + + + + + diff --git a/src/components/settings_modal/helpers/shared_computed_object.js b/src/components/settings_modal/helpers/shared_computed_object.js index 3cbcd288..2c833c0c 100644 --- a/src/components/settings_modal/helpers/shared_computed_object.js +++ b/src/components/settings_modal/helpers/shared_computed_object.js @@ -9,7 +9,6 @@ const SharedComputedObject = () => ({ .map(key => [ key + 'DefaultValue', function () { - console.log(this.$store.getters.defaultConfig) return this.$store.getters.defaultConfig[key] } ]) diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue index 92cd2069..f93f4ea0 100644 --- a/src/components/settings_modal/tabs/general_tab.vue +++ b/src/components/settings_modal/tabs/general_tab.vue @@ -12,9 +12,9 @@
  • - + {{ $t('settings.hide_wallpaper') }} - +
  • @@ -64,9 +64,9 @@
  • - + {{ $t('settings.virtual_scrolling') }} - +
  • diff --git a/src/modules/config.js b/src/modules/config.js index 444808cf..f992519e 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -80,7 +80,6 @@ const config = { getters: { defaultConfig (state, getters, rootState, rootGetters) { const { instance } = rootState - console.log('DC', instance.minimalScopesMode) return { ...defaultState, ...Object.fromEntries( @@ -90,7 +89,6 @@ const config = { }, mergedConfig (state, getters, rootState, rootGetters) { const { defaultConfig } = rootGetters - console.log('DC2', defaultConfig.hideISP) return { ...defaultConfig, ...state -- cgit v1.2.3-70-g09d2 From 3f23aecd10e570f78b4142687a9a3fa349c13018 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Tue, 23 Feb 2021 10:00:23 +0200 Subject: add sensitive by default option --- src/components/post_status_form/post_status_form.js | 4 ++-- src/components/settings_modal/tabs/general_tab.vue | 7 ++++++- src/i18n/en.json | 1 + src/modules/config.js | 3 ++- src/modules/instance.js | 1 + 5 files changed, 12 insertions(+), 4 deletions(-) (limited to 'src/modules/config.js') diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 4148381c..e540654b 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -115,7 +115,7 @@ const PostStatusForm = { ? this.copyMessageScope : this.$store.state.users.currentUser.default_scope - const { postContentType: contentType } = this.$store.getters.mergedConfig + const { postContentType: contentType, sensitiveByDefault } = this.$store.getters.mergedConfig return { dropFiles: [], @@ -126,7 +126,7 @@ const PostStatusForm = { newStatus: { spoilerText: this.subject || '', status: statusText, - nsfw: false, + nsfw: !!sensitiveByDefault, files: [], poll: {}, mediaDescriptions: {}, diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue index f93f4ea0..9228c78e 100644 --- a/src/components/settings_modal/tabs/general_tab.vue +++ b/src/components/settings_modal/tabs/general_tab.vue @@ -144,7 +144,12 @@
  • - {{ $t('settings.minimal_scopes_mode') }} {{ minimalScopesModeDefaultValue }} + {{ $t('settings.minimal_scopes_mode') }} + +
  • +
  • + + {{ $t('settings.sensitive_by_default') }}
  • diff --git a/src/i18n/en.json b/src/i18n/en.json index 0e069785..e6acda9c 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -429,6 +429,7 @@ "subject_line_mastodon": "Like mastodon: copy as is", "subject_line_noop": "Do not copy", "post_status_content_type": "Post status content type", + "sensitive_by_default": "Mark posts as sensitive by default", "stop_gifs": "Play-on-hover GIFs", "streaming": "Enable automatic streaming of new posts when scrolled to the top", "user_mutes": "Users", diff --git a/src/modules/config.js b/src/modules/config.js index f992519e..b08903d1 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -67,7 +67,8 @@ export const defaultState = { greentext: undefined, // instance default hidePostStats: undefined, // instance default hideUserStats: undefined, // instance default - virtualScrolling: undefined // instance default + virtualScrolling: undefined, // instance default + sensitiveByDefault: undefined } // caching the instance default properties diff --git a/src/modules/instance.js b/src/modules/instance.js index 411b1caa..96de73ca 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -43,6 +43,7 @@ const defaultState = { subjectLineBehavior: 'email', theme: 'pleroma-dark', virtualScrolling: true, + sensitiveByDefault: false, // Nasty stuff customEmoji: [], -- cgit v1.2.3-70-g09d2 From ecb211606cddeeec809c8a6bc39f9c96a0af95f5 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Tue, 23 Feb 2021 10:06:45 +0200 Subject: change config comment to be consistent --- src/modules/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/modules/config.js') diff --git a/src/modules/config.js b/src/modules/config.js index b08903d1..eca58c12 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -68,7 +68,7 @@ export const defaultState = { hidePostStats: undefined, // instance default hideUserStats: undefined, // instance default virtualScrolling: undefined, // instance default - sensitiveByDefault: undefined + sensitiveByDefault: undefined // instance default } // caching the instance default properties -- cgit v1.2.3-70-g09d2 From f6af4c43f656d1990da00bc773c15ebbbc57e71d Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Mon, 1 Mar 2021 16:21:35 +0200 Subject: add quick filters for notifications2 --- .../notifications/notification_filters.vue | 121 +++++++++++++++++++++ src/components/notifications/notifications.js | 8 +- src/components/notifications/notifications.vue | 1 + src/components/timeline/timeline_quick_settings.js | 4 +- .../timeline/timeline_quick_settings.vue | 8 +- src/modules/config.js | 2 +- 6 files changed, 130 insertions(+), 14 deletions(-) create mode 100644 src/components/notifications/notification_filters.vue (limited to 'src/modules/config.js') diff --git a/src/components/notifications/notification_filters.vue b/src/components/notifications/notification_filters.vue new file mode 100644 index 00000000..95b2513b --- /dev/null +++ b/src/components/notifications/notification_filters.vue @@ -0,0 +1,121 @@ + + + + + diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js index 49258563..a9bf2931 100644 --- a/src/components/notifications/notifications.js +++ b/src/components/notifications/notifications.js @@ -1,5 +1,6 @@ import { mapGetters } from 'vuex' import Notification from '../notification/notification.vue' +import NotificationFilters from './notification_filters.vue' import notificationsFetcher from '../../services/notifications_fetcher/notifications_fetcher.service.js' import { notificationsFromStore, @@ -17,6 +18,10 @@ library.add( const DEFAULT_SEEN_TO_DISPLAY_COUNT = 30 const Notifications = { + components: { + Notification, + NotificationFilters + }, props: { // Disables display of panel header noHeading: Boolean, @@ -70,9 +75,6 @@ const Notifications = { }, ...mapGetters(['unreadChatCount']) }, - components: { - Notification - }, watch: { unseenCountTitle (count) { if (count > 0) { diff --git a/src/components/notifications/notifications.vue b/src/components/notifications/notifications.vue index 725d1ad4..12097b85 100644 --- a/src/components/notifications/notifications.vue +++ b/src/components/notifications/notifications.vue @@ -22,6 +22,7 @@ > {{ $t('notifications.read') }} +
    diff --git a/src/i18n/en.json b/src/i18n/en.json index 2aefebc9..049d3d11 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -357,6 +357,7 @@ "interface": "Interface", "interfaceLanguage": "Interface language", "invalid_theme_imported": "The selected file is not a supported Pleroma theme. No changes to your theme were made.", + "invalid_settings_imported": "The selected file is not a supported Pleroma settings backup. No changes were made.", "limited_availability": "Unavailable in your browser", "links": "Links", "lock_account_description": "Restrict your account to approved followers only", @@ -364,6 +365,10 @@ "loop_video_silent_only": "Loop only videos without sound (i.e. Mastodon's \"gifs\")", "mutes_tab": "Mutes", "play_videos_in_modal": "Play videos in a popup frame", + "backup_restore": "Settings backup", + "backup_settings": "Backup settings to file", + "backup_settings_theme": "Backup settings and theme to file", + "restore_settings": "Restore settings from file", "profile_fields": { "label": "Profile metadata", "add_field": "Add Field", diff --git a/src/modules/config.js b/src/modules/config.js index eca58c12..ec3b4c43 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -110,6 +110,11 @@ const config = { } }, actions: { + loadSettings ({ dispatch }, data) { + Object.keys(this.state.config).forEach( + name => dispatch('setOption', { name, value: data[name] }) + ) + }, setHighlight ({ commit, dispatch }, { user, color, type }) { commit('setHighlight', { user, color, type }) }, -- cgit v1.2.3-70-g09d2 From fada49768dcd12faae4f7a188bdd36ea60f8b0a8 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 8 Mar 2021 21:14:03 +0200 Subject: extra protection to not write what we don't know --- src/modules/config.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/modules/config.js') diff --git a/src/modules/config.js b/src/modules/config.js index ec3b4c43..352adf20 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -111,7 +111,16 @@ const config = { }, actions: { loadSettings ({ dispatch }, data) { - Object.keys(this.state.config).forEach( + const knownKeys = new Set(Object.keys(this.state.config)) + const presentKeys = new Set(Object.keys(data)) + const intersection = new Set() + for (let elem of presentKeys) { + if (knownKeys.has(elem)) { + intersection.add(elem) + } + } + + Object.keys(intersection).forEach( name => dispatch('setOption', { name, value: data[name] }) ) }, -- cgit v1.2.3-70-g09d2 From 3d95ea6acbd47cabee519b2450647512ac2d5b46 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 8 Mar 2021 21:56:20 +0200 Subject: cleanup + fix --- src/components/settings_modal/settings_modal.js | 1 - src/modules/config.js | 4 ++-- src/services/export_import/export_import.js | 2 -- 3 files changed, 2 insertions(+), 5 deletions(-) (limited to 'src/modules/config.js') diff --git a/src/components/settings_modal/settings_modal.js b/src/components/settings_modal/settings_modal.js index 7010e4aa..04043483 100644 --- a/src/components/settings_modal/settings_modal.js +++ b/src/components/settings_modal/settings_modal.js @@ -116,7 +116,6 @@ const SettingsModal = { if (data) { this.$store.dispatch('loadSettings', data) } }, restore () { - console.log(this.dataImporter) this.dataImporter.importData() }, backup () { diff --git a/src/modules/config.js b/src/modules/config.js index 352adf20..b0fc98f5 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -111,7 +111,7 @@ const config = { }, actions: { loadSettings ({ dispatch }, data) { - const knownKeys = new Set(Object.keys(this.state.config)) + const knownKeys = new Set(Object.keys(defaultState)) const presentKeys = new Set(Object.keys(data)) const intersection = new Set() for (let elem of presentKeys) { @@ -120,7 +120,7 @@ const config = { } } - Object.keys(intersection).forEach( + intersection.forEach( name => dispatch('setOption', { name, value: data[name] }) ) }, diff --git a/src/services/export_import/export_import.js b/src/services/export_import/export_import.js index 0bf9eadc..ac67cf9c 100644 --- a/src/services/export_import/export_import.js +++ b/src/services/export_import/export_import.js @@ -26,7 +26,6 @@ export const newImporter = ({ const filePicker = document.createElement('input') filePicker.setAttribute('type', 'file') filePicker.setAttribute('accept', '.json') - console.log(1) filePicker.addEventListener('change', event => { if (event.target.files[0]) { @@ -45,7 +44,6 @@ export const newImporter = ({ onImportFailure({ error }) } } - console.log(2) reader.readAsText(event.target.files[0]) } }) -- cgit v1.2.3-70-g09d2 From 7341b8a5516621985a76456e1eefc58cd23ff2e2 Mon Sep 17 00:00:00 2001 From: eris Date: Wed, 26 May 2021 22:22:55 +0000 Subject: Implement right sidebar option as user option --- CHANGELOG.md | 1 + src/App.js | 2 +- src/components/settings_modal/tabs/general_tab.vue | 5 +++++ src/i18n/en.json | 1 + src/modules/config.js | 1 + 5 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src/modules/config.js') diff --git a/CHANGELOG.md b/CHANGELOG.md index cef6d401..905d9f65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Added a quick settings to timeline header for easier access - Added option to mark posts as sensitive by default - Added quick filters for notifications +- Implemented user option to change sidebar position to the right side ## [2.3.0] - 2021-03-01 diff --git a/src/App.js b/src/App.js index 1ca029b6..231c6ae1 100644 --- a/src/App.js +++ b/src/App.js @@ -77,7 +77,7 @@ export default { privateMode () { return this.$store.state.instance.private }, sidebarAlign () { return { - 'order': this.$store.state.instance.sidebarRight ? 99 : 0 + 'order': this.$store.getters.mergedConfig.sidebarRight ? 99 : 0 } }, ...mapGetters(['mergedConfig']) diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue index 9228c78e..7bae4a32 100644 --- a/src/components/settings_modal/tabs/general_tab.vue +++ b/src/components/settings_modal/tabs/general_tab.vue @@ -11,6 +11,11 @@ {{ $t('settings.hide_isp') }}
  • +
  • + + {{ $t('settings.right_sidebar') }} + +
  • {{ $t('settings.hide_wallpaper') }} diff --git a/src/i18n/en.json b/src/i18n/en.json index d6138482..1b38e29a 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -345,6 +345,7 @@ "hide_all_muted_posts": "Hide muted posts", "max_thumbnails": "Maximum amount of thumbnails per post", "hide_isp": "Hide instance-specific panel", + "right_sidebar": "Show sidebar on the right side", "hide_wallpaper": "Hide instance wallpaper", "preload_images": "Preload images", "use_one_click_nsfw": "Open NSFW attachments with just one click", diff --git a/src/modules/config.js b/src/modules/config.js index 629588a8..0f596750 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -54,6 +54,7 @@ export const defaultState = { interfaceLanguage: browserLocale, hideScopeNotice: false, useStreamingApi: false, + sidebarRight: undefined, // instance default scopeCopy: undefined, // instance default subjectLineBehavior: undefined, // instance default alwaysShowSubjectInput: undefined, // instance default -- cgit v1.2.3-70-g09d2 From b87a9d6675cf7cd8d37d45e62013fab27cbc46e6 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 8 Jun 2021 16:14:01 +0300 Subject: Rearranged settings, moved more stuff to filtering where apllicable. Changed how filering works. --- src/components/notification/notification.scss | 6 + src/components/notification/notification.vue | 1 + src/components/notifications/notifications.scss | 5 - .../settings_modal/tabs/filtering_tab.vue | 195 ++++++++++++++------- src/components/settings_modal/tabs/general_tab.vue | 154 ++++++---------- src/components/status/status.js | 44 +++-- src/components/timeline/timeline_quick_settings.js | 3 +- src/i18n/en.json | 14 +- src/modules/config.js | 2 + src/modules/instance.js | 3 + 10 files changed, 242 insertions(+), 185 deletions(-) (limited to 'src/modules/config.js') diff --git a/src/components/notification/notification.scss b/src/components/notification/notification.scss index f5905560..e075747b 100644 --- a/src/components/notification/notification.scss +++ b/src/components/notification/notification.scss @@ -2,6 +2,12 @@ // TODO Copypaste from Status, should unify it somehow .Notification { + border-bottom: 1px solid; + border-color: $fallback--border; + border-color: var(--border, $fallback--border); + word-wrap: break-word; + word-break: break-word; + &.-muted { padding: 0.25em 0.6em; height: 1.2em; diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue index 0081dee4..fb324cec 100644 --- a/src/components/notification/notification.vue +++ b/src/components/notification/notification.vue @@ -1,6 +1,7 @@