diff --git a/CHANGELOG.md b/CHANGELOG.md index ddd5235f..be8ddcde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - 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 ### Fixed diff --git a/src/api/users.js b/src/api/users.js index fb168d6c..3755ee7c 100644 --- a/src/api/users.js +++ b/src/api/users.js @@ -136,4 +136,24 @@ export async function fetchUserStatuses(id, authHost, godmode, token) { }) } +export async function confirmUserEmail(nicknames, authHost, token) { + return await request({ + baseURL: baseName(authHost), + url: '/api/pleroma/admin/users/confirm_email', + method: 'patch', + headers: authHeaders(token), + data: { nicknames } + }) +} + +export async function resendConfirmationEmail(nicknames, authHost, token) { + return await request({ + baseURL: baseName(authHost), + url: '/api/pleroma/admin/users/resend_confirmation_email', + method: 'patch', + headers: authHeaders(token), + data: { nicknames } + }) +} + const authHeaders = (token) => token ? { 'Authorization': `Bearer ${getToken()}` } : {} diff --git a/src/views/status/Status.vue b/src/components/Status/index.vue similarity index 100% rename from src/views/status/Status.vue rename to src/components/Status/index.vue diff --git a/src/components/BackToTop/index.vue b/src/components/element-ui/BackToTop/index.vue similarity index 100% rename from src/components/BackToTop/index.vue rename to src/components/element-ui/BackToTop/index.vue diff --git a/src/components/Breadcrumb/index.vue b/src/components/element-ui/Breadcrumb/index.vue similarity index 100% rename from src/components/Breadcrumb/index.vue rename to src/components/element-ui/Breadcrumb/index.vue diff --git a/src/components/Charts/keyboard.vue b/src/components/element-ui/Charts/keyboard.vue similarity index 100% rename from src/components/Charts/keyboard.vue rename to src/components/element-ui/Charts/keyboard.vue diff --git a/src/components/Charts/lineMarker.vue b/src/components/element-ui/Charts/lineMarker.vue similarity index 100% rename from src/components/Charts/lineMarker.vue rename to src/components/element-ui/Charts/lineMarker.vue diff --git a/src/components/Charts/mixChart.vue b/src/components/element-ui/Charts/mixChart.vue similarity index 100% rename from src/components/Charts/mixChart.vue rename to src/components/element-ui/Charts/mixChart.vue diff --git a/src/components/Charts/mixins/resize.js b/src/components/element-ui/Charts/mixins/resize.js similarity index 100% rename from src/components/Charts/mixins/resize.js rename to src/components/element-ui/Charts/mixins/resize.js diff --git a/src/components/DndList/index.vue b/src/components/element-ui/DndList/index.vue similarity index 100% rename from src/components/DndList/index.vue rename to src/components/element-ui/DndList/index.vue diff --git a/src/components/DragSelect/index.vue b/src/components/element-ui/DragSelect/index.vue similarity index 100% rename from src/components/DragSelect/index.vue rename to src/components/element-ui/DragSelect/index.vue diff --git a/src/components/Dropzone/index.vue b/src/components/element-ui/Dropzone/index.vue similarity index 100% rename from src/components/Dropzone/index.vue rename to src/components/element-ui/Dropzone/index.vue diff --git a/src/components/ErrorLog/index.vue b/src/components/element-ui/ErrorLog/index.vue similarity index 100% rename from src/components/ErrorLog/index.vue rename to src/components/element-ui/ErrorLog/index.vue diff --git a/src/components/GithubCorner/index.vue b/src/components/element-ui/GithubCorner/index.vue similarity index 100% rename from src/components/GithubCorner/index.vue rename to src/components/element-ui/GithubCorner/index.vue diff --git a/src/components/Hamburger/index.vue b/src/components/element-ui/Hamburger/index.vue similarity index 100% rename from src/components/Hamburger/index.vue rename to src/components/element-ui/Hamburger/index.vue diff --git a/src/components/HeaderSearch/index.vue b/src/components/element-ui/HeaderSearch/index.vue similarity index 100% rename from src/components/HeaderSearch/index.vue rename to src/components/element-ui/HeaderSearch/index.vue diff --git a/src/components/ImageCropper/index.vue b/src/components/element-ui/ImageCropper/index.vue similarity index 100% rename from src/components/ImageCropper/index.vue rename to src/components/element-ui/ImageCropper/index.vue diff --git a/src/components/ImageCropper/utils/data2blob.js b/src/components/element-ui/ImageCropper/utils/data2blob.js similarity index 100% rename from src/components/ImageCropper/utils/data2blob.js rename to src/components/element-ui/ImageCropper/utils/data2blob.js diff --git a/src/components/ImageCropper/utils/effectRipple.js b/src/components/element-ui/ImageCropper/utils/effectRipple.js similarity index 100% rename from src/components/ImageCropper/utils/effectRipple.js rename to src/components/element-ui/ImageCropper/utils/effectRipple.js diff --git a/src/components/ImageCropper/utils/language.js b/src/components/element-ui/ImageCropper/utils/language.js similarity index 100% rename from src/components/ImageCropper/utils/language.js rename to src/components/element-ui/ImageCropper/utils/language.js diff --git a/src/components/ImageCropper/utils/mimes.js b/src/components/element-ui/ImageCropper/utils/mimes.js similarity index 100% rename from src/components/ImageCropper/utils/mimes.js rename to src/components/element-ui/ImageCropper/utils/mimes.js diff --git a/src/components/JsonEditor/index.vue b/src/components/element-ui/JsonEditor/index.vue similarity index 100% rename from src/components/JsonEditor/index.vue rename to src/components/element-ui/JsonEditor/index.vue diff --git a/src/components/Kanban/index.vue b/src/components/element-ui/Kanban/index.vue similarity index 100% rename from src/components/Kanban/index.vue rename to src/components/element-ui/Kanban/index.vue diff --git a/src/components/MDinput/index.vue b/src/components/element-ui/MDinput/index.vue similarity index 100% rename from src/components/MDinput/index.vue rename to src/components/element-ui/MDinput/index.vue diff --git a/src/components/MarkdownEditor/defaultOptions.js b/src/components/element-ui/MarkdownEditor/defaultOptions.js similarity index 100% rename from src/components/MarkdownEditor/defaultOptions.js rename to src/components/element-ui/MarkdownEditor/defaultOptions.js diff --git a/src/components/MarkdownEditor/index.vue b/src/components/element-ui/MarkdownEditor/index.vue similarity index 100% rename from src/components/MarkdownEditor/index.vue rename to src/components/element-ui/MarkdownEditor/index.vue diff --git a/src/components/Pagination/index.vue b/src/components/element-ui/Pagination/index.vue similarity index 100% rename from src/components/Pagination/index.vue rename to src/components/element-ui/Pagination/index.vue diff --git a/src/components/PanThumb/index.vue b/src/components/element-ui/PanThumb/index.vue similarity index 100% rename from src/components/PanThumb/index.vue rename to src/components/element-ui/PanThumb/index.vue diff --git a/src/components/ScrollPane/index.vue b/src/components/element-ui/ScrollPane/index.vue similarity index 100% rename from src/components/ScrollPane/index.vue rename to src/components/element-ui/ScrollPane/index.vue diff --git a/src/components/Share/dropdownMenu.vue b/src/components/element-ui/Share/dropdownMenu.vue similarity index 100% rename from src/components/Share/dropdownMenu.vue rename to src/components/element-ui/Share/dropdownMenu.vue diff --git a/src/components/SizeSelect/index.vue b/src/components/element-ui/SizeSelect/index.vue similarity index 100% rename from src/components/SizeSelect/index.vue rename to src/components/element-ui/SizeSelect/index.vue diff --git a/src/components/Sticky/index.vue b/src/components/element-ui/Sticky/index.vue similarity index 100% rename from src/components/Sticky/index.vue rename to src/components/element-ui/Sticky/index.vue diff --git a/src/components/SvgIcon/index.vue b/src/components/element-ui/SvgIcon/index.vue similarity index 100% rename from src/components/SvgIcon/index.vue rename to src/components/element-ui/SvgIcon/index.vue diff --git a/src/components/TextHoverEffect/Mallki.vue b/src/components/element-ui/TextHoverEffect/Mallki.vue similarity index 100% rename from src/components/TextHoverEffect/Mallki.vue rename to src/components/element-ui/TextHoverEffect/Mallki.vue diff --git a/src/components/ThemePicker/index.vue b/src/components/element-ui/ThemePicker/index.vue similarity index 100% rename from src/components/ThemePicker/index.vue rename to src/components/element-ui/ThemePicker/index.vue diff --git a/src/components/TreeTable/eval.js b/src/components/element-ui/TreeTable/eval.js similarity index 100% rename from src/components/TreeTable/eval.js rename to src/components/element-ui/TreeTable/eval.js diff --git a/src/components/TreeTable/index.vue b/src/components/element-ui/TreeTable/index.vue similarity index 100% rename from src/components/TreeTable/index.vue rename to src/components/element-ui/TreeTable/index.vue diff --git a/src/components/TreeTable/readme.md b/src/components/element-ui/TreeTable/readme.md similarity index 100% rename from src/components/TreeTable/readme.md rename to src/components/element-ui/TreeTable/readme.md diff --git a/src/components/Upload/singleImage.vue b/src/components/element-ui/Upload/singleImage.vue similarity index 100% rename from src/components/Upload/singleImage.vue rename to src/components/element-ui/Upload/singleImage.vue diff --git a/src/components/Upload/singleImage2.vue b/src/components/element-ui/Upload/singleImage2.vue similarity index 100% rename from src/components/Upload/singleImage2.vue rename to src/components/element-ui/Upload/singleImage2.vue diff --git a/src/components/Upload/singleImage3.vue b/src/components/element-ui/Upload/singleImage3.vue similarity index 100% rename from src/components/Upload/singleImage3.vue rename to src/components/element-ui/Upload/singleImage3.vue diff --git a/src/icons/index.js b/src/icons/index.js index c1c2e792..a58c1f3b 100644 --- a/src/icons/index.js +++ b/src/icons/index.js @@ -1,5 +1,5 @@ import Vue from 'vue' -import SvgIcon from '@/components/SvgIcon'// svg组件 +import SvgIcon from '@/components/element-ui/SvgIcon'// svg组件 // register globally Vue.component('svg-icon', SvgIcon) diff --git a/src/lang/en.js b/src/lang/en.js index 2bedf5a4..dd3326e5 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -104,7 +104,7 @@ export default { }, components: { documentation: 'Documentation', - dropzoneTips: 'Because my business has special needs, and has to upload images to qiniu, so instead of a third party, I chose encapsulate it by myself. It is very simple, you can see the detail code in @/components/Dropzone.', + dropzoneTips: 'Because my business has special needs, and has to upload images to qiniu, so instead of a third party, I chose encapsulate it by myself. It is very simple, you can see the detail code in @/components/element-ui/Dropzone.', stickyTips: 'when the page is scrolled to the preset position will be sticky on the top.', backToTopTips1: 'When the page is scrolled to the specified position, the Back to Top button appears in the lower right corner', backToTopTips2: 'You can customize the style of the button, show / hide, height of appearance, height of the return. If you need a text prompt, you can use element-ui el-tooltip elements externally', @@ -175,6 +175,7 @@ export default { external: 'external', deactivated: 'deactivated', active: 'active', + unconfirmed: 'unconfirmed', actions: 'Actions', activate: 'Activate', deactivate: 'Deactivate', @@ -213,6 +214,8 @@ export default { addTagForMultipleUsersConfirmation: 'Are you sure you want to apply tag to all selected users?', removeTagFromMultipleUsersConfirmation: 'Are you sure you want to remove tag from all selected users?', requirePasswordResetConfirmation: 'Are you sure you want to require password reset for all selected users?', + confirmAccountsConfirmation: 'Are you sure you want to confirm emails for all selected users?', + resendEmailConfirmation: 'Are you sure you want to resend confirmation email for all selected users?', mailerMustBeEnabled: 'To require user\'s password reset you must enable mailer.', ok: 'Okay', completed: 'Completed', @@ -230,7 +233,11 @@ export default { invalidNicknameError: 'Username can include "a-z", "A-Z" and "0-9" characters', getPasswordResetToken: 'Get password reset token', passwordResetTokenCreated: 'Password reset token was created', - accountCreated: 'New account was created!' + accountCreated: 'New account was created!', + unconfirmedEmail: 'User didn\'t confirm the email', + confirmAccount: 'Confirm account', + confirmAccounts: 'Confirm accounts', + resendConfirmation: 'Resend confirmation email' }, statuses: { statuses: 'Statuses', diff --git a/src/lang/es.js b/src/lang/es.js index 17eb4239..25231eca 100755 --- a/src/lang/es.js +++ b/src/lang/es.js @@ -95,7 +95,7 @@ export default { }, components: { documentation: 'Documentación', - dropzoneTips: 'Because my business has special needs, and has to upload images to qiniu, so instead of a third party, I chose encapsulate it by myself. It is very simple, you can see the detail code in @/components/Dropzone.', + dropzoneTips: 'Because my business has special needs, and has to upload images to qiniu, so instead of a third party, I chose encapsulate it by myself. It is very simple, you can see the detail code in @/components/element-ui/Dropzone.', stickyTips: 'when the page is scrolled to the preset position will be sticky on the top.', backToTopTips1: 'When the page is scrolled to the specified position, the Back to Top button appears in the lower right corner', backToTopTips2: 'You can customize the style of the button, show / hide, height of appearance, height of the return. If you need a text prompt, you can use element-ui el-tooltip elements externally', diff --git a/src/lang/oc.js b/src/lang/oc.js index 0edeaed6..088f5acb 100644 --- a/src/lang/oc.js +++ b/src/lang/oc.js @@ -96,7 +96,7 @@ export default { }, components: { documentation: 'Documentacion', - dropzoneTips: 'Because my business has special needs, and has to upload images to qiniu, so instead of a third party, I chose encapsulate it by myself. It is very simple, you can see the detail code in @/components/Dropzone.', + dropzoneTips: 'Because my business has special needs, and has to upload images to qiniu, so instead of a third party, I chose encapsulate it by myself. It is very simple, you can see the detail code in @/components/element-ui/Dropzone.', stickyTips: 'when the page is scrolled to the preset position will be sticky on the top.', backToTopTips1: 'When the page is scrolled to the specified position, the Back to Top button appears in the lower right corner', backToTopTips2: 'You can customize the style of the button, show / hide, height of appearance, height of the return. If you need a text prompt, you can use element-ui el-tooltip elements externally', diff --git a/src/lang/zh.js b/src/lang/zh.js index 08a01496..a28771c5 100644 --- a/src/lang/zh.js +++ b/src/lang/zh.js @@ -95,7 +95,7 @@ export default { }, components: { documentation: '文档', - dropzoneTips: '由于我司业务有特殊需求,而且要传七牛 所以没用第三方,选择了自己封装。代码非常的简单,具体代码你可以在这里看到 @/components/Dropzone', + dropzoneTips: '由于我司业务有特殊需求,而且要传七牛 所以没用第三方,选择了自己封装。代码非常的简单,具体代码你可以在这里看到 @/components/element-ui/Dropzone', stickyTips: '当页面滚动到预设的位置会吸附在顶部', backToTopTips1: '页面滚动到指定位置会在右下角出现返回顶部按钮', backToTopTips2: '可自定义按钮的样式、show/hide、出现的高度、返回的位置 如需文字提示,可在外部使用Element的el-tooltip元素', diff --git a/src/store/modules/users.js b/src/store/modules/users.js index 0290b888..160b4ff2 100644 --- a/src/store/modules/users.js +++ b/src/store/modules/users.js @@ -12,7 +12,9 @@ import { searchUsers, tagUser, untagUser, - requirePasswordReset + requirePasswordReset, + confirmUserEmail, + resendConfirmationEmail } from '@/api/users' const users = { @@ -151,6 +153,31 @@ const users = { } dispatch('SuccessMessage') }, + async ConfirmUsersEmail({ commit, dispatch, getters, state }, users) { + const updatedUsers = users.map(user => { + return { ...user, confirmation_pending: false } + }) + commit('SWAP_USERS', updatedUsers) + + const usersNicknames = users.map(user => user.nickname) + try { + await confirmUserEmail(usersNicknames, getters.authHost, getters.token) + } catch (_e) { + return + } finally { + dispatch('SearchUsers', { query: state.searchQuery, page: state.currentPage }) + } + dispatch('SuccessMessage') + }, + async ResendConfirmationEmail({ dispatch, getters }, users) { + const usersNicknames = users.map(user => user.nickname) + try { + await resendConfirmationEmail(usersNicknames, getters.authHost, getters.token) + } catch (_e) { + return + } + dispatch('SuccessMessage') + }, async DeleteRight({ commit, dispatch, getters, state }, { users, right }) { const updatedUsers = users.map(user => { return user.local ? { ...user, roles: { ...user.roles, [right]: false }} : user diff --git a/src/views/charts/keyboard.vue b/src/views/charts/keyboard.vue index 3ea21397..47952fa1 100644 --- a/src/views/charts/keyboard.vue +++ b/src/views/charts/keyboard.vue @@ -5,7 +5,7 @@