+
:
-
+
@@ -120,9 +128,10 @@
-
-
diff --git a/src/views/settings/components/inputComponents/ImageUploadInput.vue b/src/views/settings/components/inputComponents/ImageUploadInput.vue
new file mode 100644
index 00000000..f54b4190
--- /dev/null
+++ b/src/views/settings/components/inputComponents/ImageUploadInput.vue
@@ -0,0 +1,204 @@
+
+
+
+
+
+ {{ $t('settings.uploadImage') }}
+
+
+
+ {{ $t('settings.remove') }}
+
+
+
+
+
+
+
+
diff --git a/src/views/settings/components/inputComponents/LinkFormatterInput.vue b/src/views/settings/components/inputComponents/LinkFormatterInput.vue
new file mode 100644
index 00000000..38ec2e50
--- /dev/null
+++ b/src/views/settings/components/inputComponents/LinkFormatterInput.vue
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ :
+
+
+
+
+
+
+
+
diff --git a/src/views/settings/components/inputComponents/SelectInputWithReducedLabels.vue b/src/views/settings/components/inputComponents/SelectInputWithReducedLabels.vue
index 8e7b9129..9b6b6140 100644
--- a/src/views/settings/components/inputComponents/SelectInputWithReducedLabels.vue
+++ b/src/views/settings/components/inputComponents/SelectInputWithReducedLabels.vue
@@ -56,7 +56,7 @@ export default {
inputValue() {
if (this.setting.key === 'Pleroma.Web.Auth.Authenticator') {
return this.data.value
- } else if (this.setting.key === ':rewrite_policy') {
+ } else if (this.setting.key === ':policies') {
return typeof this.data[this.setting.key] === 'string'
? [this.data[this.setting.key]]
: this.data[this.setting.key]
@@ -71,7 +71,7 @@ export default {
methods: {
options(suggestions) {
const prefixes = {
- ':rewrite_policy': 'Pleroma.Web.ActivityPub.MRF.',
+ ':policies': 'Pleroma.Web.ActivityPub.MRF.',
'Pleroma.Web.Auth.Authenticator': 'Pleroma.Web.Auth.',
':method': 'Pleroma.Captcha.',
':adapter': 'Swoosh.Adapters.',
@@ -100,14 +100,6 @@ export default {
this.setting.key === ':args'
)
},
- rewritePolicyOptions(suggestions) {
- return suggestions.map(element => {
- const label = element.split('Pleroma.Web.ActivityPub.MRF.')[1]
- ? element.split('Pleroma.Web.ActivityPub.MRF.')[1]
- : element
- return { value: element, label }
- })
- },
updateSetting(value, group, key, input, type) {
const updatedValue = getBooleanValue(value)
this.$store.dispatch('UpdateSettings', { group, key, input, value: updatedValue, type })
diff --git a/src/views/settings/components/inputComponents/index.js b/src/views/settings/components/inputComponents/index.js
index d95ebd05..0ef58841 100644
--- a/src/views/settings/components/inputComponents/index.js
+++ b/src/views/settings/components/inputComponents/index.js
@@ -1,6 +1,7 @@
-export { default as AutoLinkerInput } from './AutoLinkerInput'
export { default as EditableKeywordInput } from './EditableKeywordInput'
export { default as IconsInput } from './IconsInput'
+export { default as ImageUploadInput } from './ImageUploadInput'
+export { default as LinkFormatterInput } from './LinkFormatterInput'
export { default as MascotsInput } from './MascotsInput'
export { default as ProxyUrlInput } from './ProxyUrlInput'
export { default as PruneInput } from './PruneInput'
diff --git a/src/views/settings/components/tabs.js b/src/views/settings/components/tabs.js
index 68b01093..394f0670 100644
--- a/src/views/settings/components/tabs.js
+++ b/src/views/settings/components/tabs.js
@@ -1,4 +1,3 @@
-
export const tabs = description => {
return {
'activity-pub': {
diff --git a/src/views/settings/index.vue b/src/views/settings/index.vue
index 7d47c67b..08f0cb64 100644
--- a/src/views/settings/index.vue
+++ b/src/views/settings/index.vue
@@ -69,7 +69,7 @@
-
+
@@ -97,7 +97,6 @@ import { tabs } from './components/tabs'
import {
ActivityPub,
Authentication,
- AutoLinker,
Captcha,
Esshd,
Frontend,
@@ -105,6 +104,7 @@ import {
Http,
Instance,
JobQueue,
+ LinkFormatter,
Logger,
Mailer,
MediaProxy,
@@ -122,7 +122,6 @@ export default {
components: {
ActivityPub,
Authentication,
- AutoLinker,
Captcha,
Esshd,
Frontend,
@@ -130,6 +129,7 @@ export default {
Http,
Instance,
JobQueue,
+ LinkFormatter,
Logger,
Mailer,
MediaProxy,
@@ -147,7 +147,7 @@ export default {
options: [
{ value: 'activityPub', label: i18n.t('settings.activityPub') },
{ value: 'auth', label: i18n.t('settings.auth') },
- { value: 'autoLinker', label: i18n.t('settings.autoLinker') },
+ { value: 'linkFormatter', label: i18n.t('settings.linkFormatter') },
{ value: 'esshd', label: i18n.t('settings.esshd') },
{ value: 'captcha', label: i18n.t('settings.captcha') },
{ value: 'frontend', label: i18n.t('settings.frontend') },
@@ -222,9 +222,7 @@ export default {
querySearch(queryString, cb) {
const results = this.searchData.filter(searchObj => searchObj.search.find(el => el.includes(queryString.toLowerCase())))
.map(searchObj => {
- return searchObj.groupKey === ':opts'
- ? { value: `${searchObj.label} in Auto Linker`, group: searchObj.groupKey, key: searchObj.key }
- : { value: `${searchObj.label} in ${searchObj.groupLabel}`, group: searchObj.groupKey, key: searchObj.key }
+ return { value: `${searchObj.label} in ${searchObj.groupLabel}`, group: searchObj.groupKey, key: searchObj.key }
})
cb(results)
},
diff --git a/src/views/users/components/ModerationDropdown.vue b/src/views/users/components/ModerationDropdown.vue
index 3a145290..6f9a5651 100644
--- a/src/views/users/components/ModerationDropdown.vue
+++ b/src/views/users/components/ModerationDropdown.vue
@@ -143,7 +143,20 @@ export default {
this.$store.dispatch('ResendConfirmationEmail', [user])
},
handleDeletion(user) {
- this.$store.dispatch('DeleteUsers', { users: [user], _userId: user.id })
+ this.$confirm(
+ this.$t('users.deleteUsersConfirmation'),
+ {
+ confirmButtonText: 'Delete',
+ cancelButtonText: 'Cancel',
+ type: 'warning'
+ }).then(() => {
+ this.$store.dispatch('DeleteUsers', { users: [user], _userId: user.id })
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: 'Delete canceled'
+ })
+ })
},
handleEmailConfirmation(user) {
this.$store.dispatch('ConfirmUsersEmail', { users: [user], _userId: user.id, _statusId: this.statusId })
diff --git a/test/modules/normalizers/checkPartialUpdate.test.js b/test/modules/normalizers/checkPartialUpdate.test.js
deleted file mode 100644
index 87e6f104..00000000
--- a/test/modules/normalizers/checkPartialUpdate.test.js
+++ /dev/null
@@ -1,48 +0,0 @@
-import { checkPartialUpdate } from '@/store/modules/normalizers'
-import _ from 'lodash'
-
-describe('Partial update', () => {
- it('partial update for settings that do not allow partial update', () => {
- const settings = { ':auto_linker': { ':opts':
- { ':strip_prefix': true, ':new_window': false, ':rel': 'ugc', ':truncate': 3 }
- }}
- const updatedSettings = { ':auto_linker': { ':opts': { ':new_window': false }}}
- const description = [{
- children: [
- { key: ':strip_prefix', type: 'boolean' },
- { key: ':truncate', type: ['integer', false] },
- { key: ':new_window', type: 'boolean' }],
- description: 'Configuration for the auto_linker library',
- group: ':auto_linker',
- key: ':opts',
- label: 'Opts',
- type: 'group'
- }]
-
- const expectedData = { ':auto_linker': { ':opts': {
- ':strip_prefix': ['boolean', true],
- ':new_window': ['boolean', false],
- ':rel': ['', 'ugc'],
- ':truncate': [['integer', false], 3]
- }}}
- const updatedData = checkPartialUpdate(settings, updatedSettings, description)
- expect(_.isEqual(updatedData, expectedData)).toBeTruthy()
- })
-
- it('partial update for settings that allow partial update', () => {
- const settings = { ':pleroma': { 'Pleroma.Captcha': { ':enabled': true, ':seconds_valid': 70, ':method': 'Pleroma.Captcha.Kocaptcha' }}}
- const updatedSettings = { ':pleroma': { 'Pleroma.Captcha': { ':seconds_valid': ['integer', 70] }}}
- const description = [{
- children: [],
- description: 'Captcha-related settings',
- group: ':pleroma',
- key: 'Pleroma.Captcha',
- label: 'Pleroma.Captcha',
- type: 'group'
- }]
-
- const expectedData = { ':pleroma': { 'Pleroma.Captcha': { ':seconds_valid': ['integer', 70] }}}
- const updatedData = checkPartialUpdate(settings, updatedSettings, description)
- expect(_.isEqual(updatedData, expectedData)).toBeTruthy()
- })
-})
diff --git a/test/views/reports/reportsFilter.test.js b/test/views/reports/reportsFilter.test.js
index 0701262c..853cb1c3 100644
--- a/test/views/reports/reportsFilter.test.js
+++ b/test/views/reports/reportsFilter.test.js
@@ -26,7 +26,7 @@ describe('Reports filter', () => {
it('shows open reports when "Open" filter is applied', async (done) => {
expect(store.state.reports.fetchedReports.length).toEqual(7)
- store.dispatch('SetFilter', 'open')
+ store.dispatch('SetReportsFilter', 'open')
store.dispatch('ClearFetchedReports')
store.dispatch('FetchReports', 1)
await flushPromises()
@@ -38,7 +38,7 @@ describe('Reports filter', () => {
it('shows resolved reports when "Resolved" filter is applied', async (done) => {
expect(store.state.reports.fetchedReports.length).toEqual(7)
- store.dispatch('SetFilter', 'resolved')
+ store.dispatch('SetReportsFilter', 'resolved')
store.dispatch('ClearFetchedReports')
store.dispatch('FetchReports')
await flushPromises()
@@ -50,7 +50,7 @@ describe('Reports filter', () => {
it('shows closed reports when "Closed" filter is applied', async (done) => {
expect(store.state.reports.fetchedReports.length).toEqual(7)
- store.dispatch('SetFilter', 'closed')
+ store.dispatch('SetReportsFilter', 'closed')
store.dispatch('ClearFetchedReports')
store.dispatch('FetchReports')
await flushPromises()
@@ -62,13 +62,13 @@ describe('Reports filter', () => {
it('shows all users after removing filters', async (done) => {
expect(store.state.reports.fetchedReports.length).toEqual(7)
- store.dispatch('SetFilter', 'open')
+ store.dispatch('SetReportsFilter', 'open')
store.dispatch('ClearFetchedReports')
store.dispatch('FetchReports')
await flushPromises()
expect(store.state.reports.fetchedReports.length).toEqual(2)
- store.dispatch('SetFilter', '')
+ store.dispatch('SetReportsFilter', '')
store.dispatch('ClearFetchedReports')
store.dispatch('FetchReports')
await flushPromises()
diff --git a/test/views/settings/index.test.js b/test/views/settings/index.test.js
index 9455dbb7..4cacf881 100644
--- a/test/views/settings/index.test.js
+++ b/test/views/settings/index.test.js
@@ -58,8 +58,6 @@ describe('Settings search', () => {
wrapper.vm.handleSearchSelect({ group: ':media_proxy', key: ':ssl_options' })
expect(store.state.settings.activeTab).toBe('media-proxy')
- wrapper.vm.handleSearchSelect({ group: ':opts', key: ':opts' })
- expect(store.state.settings.activeTab).toBe('auto-linker')
done()
})
})
diff --git a/test/views/users/index.test.js b/test/views/users/index.test.js
index 57cefad1..847de253 100644
--- a/test/views/users/index.test.js
+++ b/test/views/users/index.test.js
@@ -156,11 +156,13 @@ describe('Users actions', () => {
stubs: ['router-link']
})
await flushPromises()
- expect(store.state.users.fetchedUsers.length).toEqual(3)
+ expect(store.state.users.fetchedUsers[1].deactivated).toBe(false)
wrapper.find(htmlElement(2, 2)).trigger('click')
+ store.dispatch('DeleteUsers', { users: [{ active: true, deactivated: false, id: '10', nickname: 'bob', local: false, external: true, roles: { admin: false, moderator: false }, tags: ['sandbox'] }] })
+
await flushPromises()
- expect(store.state.users.fetchedUsers.length).toEqual(2)
+ expect(store.state.users.fetchedUsers[1].deactivated).toBe(true)
done()
})
diff --git a/test/views/users/multipleUsersMenu.test.js b/test/views/users/multipleUsersMenu.test.js
index aea1a9aa..c956bed4 100644
--- a/test/views/users/multipleUsersMenu.test.js
+++ b/test/views/users/multipleUsersMenu.test.js
@@ -225,11 +225,11 @@ describe('Apply users actions to multiple users', () => {
expect(wrapper.vm.deleteMultipleUsers).toHaveBeenCalled()
const remove = wrapper.vm.mappers().remove
- expect(store.state.users.fetchedUsers.length).toEqual(3)
+ expect(store.state.users.fetchedUsers.filter(user => user.deactivated).length).toEqual(1)
remove()
await flushPromises()
- expect(store.state.users.fetchedUsers.length).toEqual(0)
+ expect(store.state.users.fetchedUsers.length).toEqual(3)
done()
})