From 54e32f7ad6cee6122d73538ac51bf4fb4715c40d Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Tue, 31 Mar 2020 11:59:48 -0500 Subject: [PATCH 1/6] Leave emoji packs disabled in master branch for now. This ensures a build doesn't get accidentally produced with it enabled. --- config/prod.env.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/prod.env.js b/config/prod.env.js index 7acb93a2..e4c40c43 100644 --- a/config/prod.env.js +++ b/config/prod.env.js @@ -2,6 +2,6 @@ module.exports = { NODE_ENV: '"production"', ENV_CONFIG: '"prod"', BASE_API: '"https://api-prod"', - DISABLED_FEATURES: '[""]', + DISABLED_FEATURES: '["emoji-packs"]', ASSETS_PUBLIC_PATH: '/pleroma/admin/' } From 95729814860200fdf4f0e792a4ba9f02a4800402 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Wed, 18 Mar 2020 21:13:39 +0000 Subject: [PATCH 2/6] Merge branch 'fix/emails-with-symbols' into 'develop' Fix parsing emails with symbols See merge request pleroma/admin-fe!105 (cherry picked from commit d021c77a3e08909b016d2e8d1fa08726d0ea1ec6) 88b5abc6 Fix parsing emails with symbols --- src/api/invites.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/api/invites.js b/src/api/invites.js index 1d8371db..a303ac17 100644 --- a/src/api/invites.js +++ b/src/api/invites.js @@ -13,14 +13,13 @@ export async function generateInviteToken(max_use, expires_at, authHost, token) } export async function inviteViaEmail(email, name, authHost, token) { - const url = name.length > 0 - ? `/api/pleroma/admin/users/email_invite?email=${email}&name=${name}` - : `/api/pleroma/admin/users/email_invite?email=${email}` + const data = name.length > 0 ? { email, name } : { email } return await request({ baseURL: baseName(authHost), - url, + url: '/api/pleroma/admin/users/email_invite', method: 'post', - headers: authHeaders(token) + headers: authHeaders(token), + data }) } From 46658b8fd0b24ad79a83737261f7a2ac6bdb6241 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Tue, 24 Mar 2020 20:59:12 +0000 Subject: [PATCH 3/6] Merge branch 'user-edit' into 'develop' Add the ability to set user password and email Closes #69 See merge request pleroma/admin-fe!92 (cherry picked from commit 747dc65e9bf81895266696579584a614ae6bf4d0) 9395cc78 Add the Security Settings modal for setting the user's email and password --- src/api/users.js | 19 +++ src/lang/en.js | 17 +- src/store/modules/userProfile.js | 14 +- .../components/SecuritySettingsModal.vue | 155 ++++++++++++++++++ src/views/users/show.vue | 21 ++- 5 files changed, 222 insertions(+), 4 deletions(-) create mode 100644 src/views/users/components/SecuritySettingsModal.vue diff --git a/src/api/users.js b/src/api/users.js index 8298eeca..642dd1a7 100644 --- a/src/api/users.js +++ b/src/api/users.js @@ -71,6 +71,25 @@ export async function fetchUser(id, authHost, token) { }) } +export async function fetchUserCredentials(nickname, authHost, token) { + return await request({ + baseURL: baseName(authHost), + url: `/api/pleroma/admin/users/${nickname}/credentials`, + method: 'get', + headers: authHeaders(token) + }) +} + +export async function updateUserCredentials(nickname, credentials, authHost, token) { + return await request({ + baseURL: baseName(authHost), + url: `/api/pleroma/admin/users/${nickname}/credentials`, + method: 'patch', + headers: authHeaders(token), + data: credentials + }) +} + export async function fetchUsers(filters, authHost, token, page = 1) { return await request({ baseURL: baseName(authHost), diff --git a/src/lang/en.js b/src/lang/en.js index 8b8e9ff7..5e98a3cb 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -261,7 +261,22 @@ export default { activeUppercase: 'Active', active: 'active', deactivated: 'deactivated', - noStatuses: 'No statuses to show' + noStatuses: 'No statuses to show', + securitySettings: { + email: 'Email', + password: 'Password', + securitySettings: 'Security settings', + passwordChangeWarning1: 'Setting a new password will cause the user to be signed out from any client they have used before.', + passwordChangeWarning2: 'When the user signs in with this password, they will be asked to set a new one.', + passwordLengthNotice: 'Make sure it\'s at least {minLength} characters long.', + inputNewEmail: 'Input new email', + inputNewPassword: 'Input new password', + passwordUpdated: 'The password has been updated', + emailUpdated: 'The email has been updated', + success: 'Success', + submit: 'Submit', + close: 'Close' + } }, usersFilter: { inputPlaceholder: 'Select filter', diff --git a/src/store/modules/userProfile.js b/src/store/modules/userProfile.js index 5a7e4394..af54072c 100644 --- a/src/store/modules/userProfile.js +++ b/src/store/modules/userProfile.js @@ -1,10 +1,11 @@ -import { fetchUser, fetchUserStatuses } from '@/api/users' +import { fetchUser, fetchUserStatuses, fetchUserCredentials, updateUserCredentials } from '@/api/users' const userProfile = { state: { statuses: [], statusesLoading: true, user: {}, + userCredentials: {}, userProfileLoading: true }, mutations: { @@ -19,6 +20,9 @@ const userProfile = { }, SET_USER_PROFILE_LOADING: (state, status) => { state.userProfileLoading = status + }, + SET_USER_CREDENTIALS: (state, userCredentials) => { + state.userCredentials = userCredentials } }, actions: { @@ -38,6 +42,14 @@ const userProfile = { commit('SET_STATUSES', statuses.data) commit('SET_STATUSES_LOADING', false) + }, + async FetchUserCredentials({ commit, getters }, { nickname }) { + const userResponse = await fetchUserCredentials(nickname, getters.authHost, getters.token) + commit('SET_USER_CREDENTIALS', userResponse.data) + }, + async UpdateUserCredentials({ dispatch, getters }, { nickname, credentials }) { + await updateUserCredentials(nickname, credentials, getters.authHost, getters.token) + dispatch('FetchUserCredentials', { nickname }) } } } diff --git a/src/views/users/components/SecuritySettingsModal.vue b/src/views/users/components/SecuritySettingsModal.vue new file mode 100644 index 00000000..58c757b1 --- /dev/null +++ b/src/views/users/components/SecuritySettingsModal.vue @@ -0,0 +1,155 @@ + + + + + diff --git a/src/views/users/show.vue b/src/views/users/show.vue index fd24486d..84cfef32 100644 --- a/src/views/users/show.vue +++ b/src/views/users/show.vue @@ -73,6 +73,18 @@ {{ $t('userProfile.deactivated') }} + + + + {{ $t('userProfile.securitySettings.securitySettings') }} + + + + + @@ -96,14 +108,16 @@