From 0d663a0579b2b1212cb39006eb4fa3125af866ff Mon Sep 17 00:00:00 2001 From: wenyann <64353056+wenyann@users.noreply.github.com> Date: Wed, 4 Nov 2020 17:49:48 +0800 Subject: [PATCH 01/12] =?UTF-8?q?fix(=E6=B6=88=E6=81=AF=E8=AE=BE=E7=BD=AE)?= =?UTF-8?q?:=E4=BF=AE=E5=A4=8D=E7=82=B9=E5=87=BB=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=9C=A8=E9=A1=B5=E9=9D=A2=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/components/DefectTaskNotification.vue | 6 +++++- .../organization/components/JenkinsNotification.vue | 7 ++++++- .../organization/components/ScheduleTaskNotification.vue | 6 +++++- .../organization/components/TestPlanTaskNotification.vue | 6 +++++- .../organization/components/TestReviewNotification.vue | 6 +++++- 5 files changed, 26 insertions(+), 5 deletions(-) diff --git a/frontend/src/business/components/settings/organization/components/DefectTaskNotification.vue b/frontend/src/business/components/settings/organization/components/DefectTaskNotification.vue index c91267ef82..3fe1c2939d 100644 --- a/frontend/src/business/components/settings/organization/components/DefectTaskNotification.vue +++ b/frontend/src/business/components/settings/organization/components/DefectTaskNotification.vue @@ -204,7 +204,11 @@ export default { }) }, removeRowTask(index, data) { //移除 - data.splice(index, 1) + if (!data[index].identification) { + data.splice(index, 1) + } else { + data[index].isSet = false + } }, deleteRowTask(index, data) { //删除 this.result = this.$get("/notice/delete/message/" + data.identification, response => { diff --git a/frontend/src/business/components/settings/organization/components/JenkinsNotification.vue b/frontend/src/business/components/settings/organization/components/JenkinsNotification.vue index 1617ebab7b..6393408753 100644 --- a/frontend/src/business/components/settings/organization/components/JenkinsNotification.vue +++ b/frontend/src/business/components/settings/organization/components/JenkinsNotification.vue @@ -205,7 +205,12 @@ export default { }) }, removeRowTask(index, data) { //移除 - data.splice(index, 1) + if (!data[index].identification) { + data.splice(index, 1) + } else { + data[index].isSet = false + } + }, deleteRowTask(index, data) { //删除 this.result = this.$get("/notice/delete/message/" + data.identification, response => { diff --git a/frontend/src/business/components/settings/organization/components/ScheduleTaskNotification.vue b/frontend/src/business/components/settings/organization/components/ScheduleTaskNotification.vue index 1ce351b175..b0358ac2b7 100644 --- a/frontend/src/business/components/settings/organization/components/ScheduleTaskNotification.vue +++ b/frontend/src/business/components/settings/organization/components/ScheduleTaskNotification.vue @@ -196,7 +196,11 @@ export default { }) }, removeRowTask(index, data) { //移除 - data.splice(index, 1) + if (!data[index].identification) { + data.splice(index, 1) + } else { + data[index].isSet = false + } }, deleteRowTask(index, data) { //删除 this.result = this.$get("/notice/delete/message/" + data.identification, response => { diff --git a/frontend/src/business/components/settings/organization/components/TestPlanTaskNotification.vue b/frontend/src/business/components/settings/organization/components/TestPlanTaskNotification.vue index e44215182b..80706d170a 100644 --- a/frontend/src/business/components/settings/organization/components/TestPlanTaskNotification.vue +++ b/frontend/src/business/components/settings/organization/components/TestPlanTaskNotification.vue @@ -210,7 +210,11 @@ export default { }) }, removeRowTask(index, data) { //移除 - data.splice(index, 1) + if (!data[index].identification) { + data.splice(index, 1) + } else { + data[index].isSet = false + } }, deleteRowTask(index, data) { //删除 this.result = this.$get("/notice/delete/message/" + data.identification, response => { diff --git a/frontend/src/business/components/settings/organization/components/TestReviewNotification.vue b/frontend/src/business/components/settings/organization/components/TestReviewNotification.vue index 7e75db5d77..53e50ea5af 100644 --- a/frontend/src/business/components/settings/organization/components/TestReviewNotification.vue +++ b/frontend/src/business/components/settings/organization/components/TestReviewNotification.vue @@ -211,7 +211,11 @@ export default { }) }, removeRowTask(index, data) { //移除 - data.splice(index, 1) + if (!data[index].identification) { + data.splice(index, 1) + } else { + data[index].isSet = false + } }, deleteRowTask(index, data) { //删除 this.result = this.$get("/notice/delete/message/" + data.identification, response => { From c1f4c8cba3fcfb5b78d5f70d282c4a6ff28b8746 Mon Sep 17 00:00:00 2001 From: wenyann <64353056+wenyann@users.noreply.github.com> Date: Wed, 4 Nov 2020 18:09:11 +0800 Subject: [PATCH 02/12] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E8=AF=84=E5=AE=A1=E8=AF=84=E8=AE=BA=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/metersphere/notice/service/MailService.java | 2 +- .../track/request/testreview/SaveCommentRequest.java | 1 + backend/src/main/resources/mail/ReviewComments.html | 2 +- .../business/components/track/review/commom/ReviewComment.vue | 4 +++- .../track/review/view/components/TestReviewTestCaseEdit.vue | 2 +- .../track/review/view/components/TestReviewTestCaseList.vue | 1 + 6 files changed, 8 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/metersphere/notice/service/MailService.java b/backend/src/main/java/io/metersphere/notice/service/MailService.java index b39564c1e7..3efeca32ae 100644 --- a/backend/src/main/java/io/metersphere/notice/service/MailService.java +++ b/backend/src/main/java/io/metersphere/notice/service/MailService.java @@ -144,7 +144,7 @@ public class MailService { context.put("testCaseName", testCaseWithBLOBs.getName()); context.put("description", request.getDescription()); context.put("url", baseSystemConfigDTO.getUrl()); - context.put("id", testCaseWithBLOBs.getId()); + context.put("id", request.getReviewId()); try { String commentTemplate = IOUtils.toString(this.getClass().getResource("/mail/ReviewComments.html"), StandardCharsets.UTF_8); sendReviewNotice(addresseeIdList(messageDetail, userIds, eventType), context, commentTemplate); diff --git a/backend/src/main/java/io/metersphere/track/request/testreview/SaveCommentRequest.java b/backend/src/main/java/io/metersphere/track/request/testreview/SaveCommentRequest.java index bf5dbe8388..8e69c209c7 100644 --- a/backend/src/main/java/io/metersphere/track/request/testreview/SaveCommentRequest.java +++ b/backend/src/main/java/io/metersphere/track/request/testreview/SaveCommentRequest.java @@ -7,5 +7,6 @@ import lombok.Setter; @Getter @Setter public class SaveCommentRequest extends TestCaseComment { + private String reviewId; } diff --git a/backend/src/main/resources/mail/ReviewComments.html b/backend/src/main/resources/mail/ReviewComments.html index 04bf929c18..c9f0514a57 100644 --- a/backend/src/main/resources/mail/ReviewComments.html +++ b/backend/src/main/resources/mail/ReviewComments.html @@ -10,7 +10,7 @@ ${testCaseName}
添加评论:${description}
点击下面链接进入用例评审页面

- ${url}/#/track/review/view + ${url}/#/track/review/view/${id} \ No newline at end of file diff --git a/frontend/src/business/components/track/review/commom/ReviewComment.vue b/frontend/src/business/components/track/review/commom/ReviewComment.vue index 62e0b40ad2..c8901d7269 100644 --- a/frontend/src/business/components/track/review/commom/ReviewComment.vue +++ b/frontend/src/business/components/track/review/commom/ReviewComment.vue @@ -40,7 +40,8 @@ export default { components: {ReviewCommentItem}, props: { caseId: String, - comments: Array + comments: Array, + reviewId:String, }, data() { return { @@ -53,6 +54,7 @@ export default { let comment = {}; comment.caseId = this.caseId; comment.description = this.textarea; + comment.reviewId=this.reviewId; if (!this.textarea) { this.$warning(this.$t('test_track.comment.description_is_null')); return; diff --git a/frontend/src/business/components/track/review/view/components/TestReviewTestCaseEdit.vue b/frontend/src/business/components/track/review/view/components/TestReviewTestCaseEdit.vue index 91744b384e..db26dcae91 100644 --- a/frontend/src/business/components/track/review/view/components/TestReviewTestCaseEdit.vue +++ b/frontend/src/business/components/track/review/view/components/TestReviewTestCaseEdit.vue @@ -229,7 +229,7 @@ - + diff --git a/frontend/src/business/components/track/review/view/components/TestReviewTestCaseList.vue b/frontend/src/business/components/track/review/view/components/TestReviewTestCaseList.vue index 122ab4ef4f..03e1d66833 100644 --- a/frontend/src/business/components/track/review/view/components/TestReviewTestCaseList.vue +++ b/frontend/src/business/components/track/review/view/components/TestReviewTestCaseList.vue @@ -300,6 +300,7 @@ export default { return path + "/" + this.currentPage + "/" + this.pageSize; }, handleEdit(testCase, index) { + console.log(testCase) this.isReadOnly = false; if (!checkoutTestManagerOrTestUser()) { this.isReadOnly = true; From e0c0b05ace8d4e65be02b4f8f0de5732bb55502b Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Thu, 5 Nov 2020 09:34:14 +0800 Subject: [PATCH 03/12] =?UTF-8?q?feat(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?):=20=E6=98=BE=E7=A4=BA=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main/java/io/metersphere/xpack | 2 +- frontend/src/business/components/settings/router.js | 4 +++- frontend/src/business/components/xpack | 2 +- frontend/src/i18n/en-US.js | 5 ++++- frontend/src/i18n/zh-CN.js | 5 ++++- frontend/src/i18n/zh-TW.js | 3 +++ 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index ee74568be0..597a1681d1 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit ee74568be0beba46da19616f5832e83f9164c688 +Subproject commit 597a1681d1327a622b2a38bac3f17ae9daf95442 diff --git a/frontend/src/business/components/settings/router.js b/frontend/src/business/components/settings/router.js index 93da75f536..884418855f 100644 --- a/frontend/src/business/components/settings/router.js +++ b/frontend/src/business/components/settings/router.js @@ -32,7 +32,9 @@ export default { component: () => import('@/business/components/settings/system/SystemParameterSetting'), meta: {system: true, title: 'commons.system_parameter_setting'} }, - ...requireContext.keys().map(key => requireContext(key).system),...requireContext.keys().map(key => requireContext(key).license), + ...requireContext.keys().map(key => requireContext(key).system), + ...requireContext.keys().map(key => requireContext(key).license), + ...requireContext.keys().map(key => requireContext(key).display), { path: 'organizationmember', component: () => import('@/business/components/settings/organization/OrganizationMember'), diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index cc38137a69..f6f172c645 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit cc38137a69a0f20fadece9c0f9f50a9468c4ace9 +Subproject commit f6f172c6451d0f9c51f5e3246a66dde9edcd7a5d diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index 1646d9d562..aba963ed85 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -180,6 +180,9 @@ export default { invalid: 'invalid', expired: 'expired', }, + display: { + title: 'Theme' + }, system_config: { base_config: 'Base Config', base: { @@ -228,7 +231,7 @@ export default { mail: 'mail', nail_robot: 'Nail robot', enterprise_wechat_robot: 'Enterprise wechat robot', - notes:'Note: 1. Nail and create a custom robot in the enterprise group, and then copy the webhook address on our platform;\n' + + notes: 'Note: 1. Nail and create a custom robot in the enterprise group, and then copy the webhook address on our platform;\n' + '\n' + '2. Robots are selected as swarm robots, and "custom keyword" is selected for security verification: "task notification";\n' + '\n' + diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 0357884451..ae58f1510c 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -180,6 +180,9 @@ export default { invalid: '无效', expired: '已过期', }, + display: { + title: '显示设置' + }, system_config: { base_config: '基本配置', base: { @@ -229,7 +232,7 @@ export default { mail: '邮件', nail_robot: '钉钉机器人', enterprise_wechat_robot: '企业微信机器人', - notes:'注意:1.钉钉和企业群里新建一个自定义机器人,然后复制 webhook 地址在我们平台上;\n' + + notes: '注意:1.钉钉和企业群里新建一个自定义机器人,然后复制 webhook 地址在我们平台上;\n' + ' 2.机器人选择为群机器人,安全验证选择“自定义关键词” :"任务通知";\n' + ' 3.选择接收人时必须是你所建的群里包含的人,接收人手机号为必填项且为钉钉企业所使用的手机号,', message: '事件,接收人,接收方式为必填项', diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 79149605e7..9427fd6e1d 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -180,6 +180,9 @@ export default { invalid: '無效', expired: '已過期', }, + display: { + title: '顯示設置' + }, system_config: { base_config: '基本配置', base: { From b3682de7a407e0a8910ad0443687af965c19c606 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Thu, 5 Nov 2020 12:31:55 +0800 Subject: [PATCH 04/12] =?UTF-8?q?feat(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?):=20=E6=98=BE=E7=A4=BA=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/config/ShiroConfig.java | 4 +- .../io/metersphere/service/FileService.java | 9 + backend/src/main/java/io/metersphere/xpack | 2 +- frontend/src/business/App.vue | 191 +++++---- frontend/src/business/components/xpack | 2 +- frontend/src/login/Login.vue | 395 +++++++++--------- 6 files changed, 320 insertions(+), 283 deletions(-) diff --git a/backend/src/main/java/io/metersphere/config/ShiroConfig.java b/backend/src/main/java/io/metersphere/config/ShiroConfig.java index 88abf6d940..54505fc49b 100644 --- a/backend/src/main/java/io/metersphere/config/ShiroConfig.java +++ b/backend/src/main/java/io/metersphere/config/ShiroConfig.java @@ -28,7 +28,7 @@ import java.util.Map; import java.util.Objects; @Configuration -@ConditionalOnProperty(prefix="sso",name = "mode", havingValue = "local", matchIfMissing = true) +@ConditionalOnProperty(prefix = "sso", name = "mode", havingValue = "local", matchIfMissing = true) public class ShiroConfig implements EnvironmentAware { private Environment env; @@ -43,6 +43,8 @@ public class ShiroConfig implements EnvironmentAware { shiroFilterFactoryBean.getFilters().put("apikey", new ApiKeyFilter()); Map filterChainDefinitionMap = shiroFilterFactoryBean.getFilterChainDefinitionMap(); ShiroUtils.loadBaseFilterChain(filterChainDefinitionMap); + filterChainDefinitionMap.put("/display/info", "anon"); + filterChainDefinitionMap.put("/display/file/*", "anon"); filterChainDefinitionMap.put("/**", "apikey, authc"); return shiroFilterFactoryBean; } diff --git a/backend/src/main/java/io/metersphere/service/FileService.java b/backend/src/main/java/io/metersphere/service/FileService.java index a74fb7b243..e87980ed7d 100644 --- a/backend/src/main/java/io/metersphere/service/FileService.java +++ b/backend/src/main/java/io/metersphere/service/FileService.java @@ -14,6 +14,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import java.io.IOException; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.UUID; import java.util.stream.Collectors; @@ -141,4 +142,12 @@ public class FileService { example.createCriteria().andIdIn(fileIds); return fileMetadataMapper.selectByExample(example); } + + public void deleteFileById(String fileId) { + deleteFileByIds(Collections.singletonList(fileId)); + } + + public FileMetadata getFileMetadataById(String fileId) { + return fileMetadataMapper.selectByPrimaryKey(fileId); + } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index 597a1681d1..7238c00412 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit 597a1681d1327a622b2a38bac3f17ae9daf95442 +Subproject commit 7238c00412997c529a2a28a47956977ebf83aa13 diff --git a/frontend/src/business/App.vue b/frontend/src/business/App.vue index c226861e51..ff55980514 100644 --- a/frontend/src/business/App.vue +++ b/frontend/src/business/App.vue @@ -7,7 +7,8 @@ -