diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalCaseCommentController.java b/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalCaseCommentController.java index c582459630..ee6c95edcc 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalCaseCommentController.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalCaseCommentController.java @@ -51,7 +51,7 @@ public class FunctionalCaseCommentController { @GetMapping("/get/list/{caseId}") @Operation(summary = "用例管理-功能用例-用例评论-获取用例评论") - @RequiresPermissions(PermissionConstants.FUNCTIONAL_CASE_READ_COMMENT) + @RequiresPermissions(PermissionConstants.FUNCTIONAL_CASE_READ) @CheckOwner(resourceId = "#caseId", resourceType = "functional_case") public List getCommentList(@PathVariable String caseId) { return functionalCaseCommentService.getCommentList(caseId); diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/dto/ReviewFunctionalCaseDTO.java b/backend/services/case-management/src/main/java/io/metersphere/functional/dto/ReviewFunctionalCaseDTO.java index 107f98c9cf..d0433e0320 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/dto/ReviewFunctionalCaseDTO.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/dto/ReviewFunctionalCaseDTO.java @@ -61,4 +61,7 @@ public class ReviewFunctionalCaseDTO implements Serializable { @Schema(description = "只看我的评审状态") private String myStatus; + @Schema(description = "自定义字段集合") + private List customFields; + } diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtCaseReviewFunctionalCaseMapper.xml b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtCaseReviewFunctionalCaseMapper.xml index a16ce0b74f..0fbb754067 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtCaseReviewFunctionalCaseMapper.xml +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtCaseReviewFunctionalCaseMapper.xml @@ -111,6 +111,12 @@ and functional_case.version_id in + + and functional_case.id in ( + select case_id from functional_case_custom_field where `value` in + + ) + and functional_case.id in ( select resource_id from custom_field_test_case where concat('custom_single-',field_id) = diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/CaseReviewFunctionalCaseService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/CaseReviewFunctionalCaseService.java index 7d0c965262..768dd23f76 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/CaseReviewFunctionalCaseService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/CaseReviewFunctionalCaseService.java @@ -26,12 +26,16 @@ import io.metersphere.sdk.exception.MSException; import io.metersphere.sdk.util.BeanUtils; import io.metersphere.sdk.util.LogUtils; import io.metersphere.sdk.util.Translator; +import io.metersphere.system.domain.CustomFieldOption; import io.metersphere.system.domain.UserRoleRelation; import io.metersphere.system.domain.UserRoleRelationExample; import io.metersphere.system.dto.sdk.BaseTreeNode; import io.metersphere.system.dto.sdk.OptionDTO; import io.metersphere.system.mapper.UserRoleRelationMapper; import io.metersphere.system.notice.constants.NoticeConstants; +import io.metersphere.system.service.BaseCustomFieldOptionService; +import io.metersphere.system.service.BaseCustomFieldService; +import io.metersphere.system.service.UserLoginService; import io.metersphere.system.uid.IDGenerator; import io.metersphere.system.utils.ServiceUtils; import jakarta.annotation.Resource; @@ -101,6 +105,14 @@ public class CaseReviewFunctionalCaseService { private PermissionCheckService permissionCheckService; @Resource private CaseReviewMapper caseReviewMapper; + @Resource + private FunctionalCaseCustomFieldService functionalCaseCustomFieldService; + @Resource + private BaseCustomFieldService baseCustomFieldService; + @Resource + private BaseCustomFieldOptionService baseCustomFieldOptionService; + @Resource + private UserLoginService userLoginService; private static final String CASE_MODULE_COUNT_ALL = "all"; @@ -150,12 +162,14 @@ public class CaseReviewFunctionalCaseService { caseStatusMap = new LinkedHashMap<>(); } + Map> collect = getCaseCustomFiledMap(caseIds); + list.forEach(item -> { item.setModuleName(moduleMap.get(item.getModuleId())); item.setVersionName(versionMap.get(item.getVersionId())); item.setReviewers(Collections.singletonList(userIdMap.get(item.getCaseId()))); item.setReviewNames(Collections.singletonList(userNameMap.get(item.getCaseId()))); - + item.setCustomFields(collect.get(item.getCaseId())); if (request.isViewStatusFlag()) { List histories = caseStatusMap.get(item.getCaseId()); if (CollectionUtils.isNotEmpty(histories)) { @@ -170,6 +184,23 @@ public class CaseReviewFunctionalCaseService { return list; } + public Map> getCaseCustomFiledMap(List ids) { + List customFields = functionalCaseCustomFieldService.getCustomFieldsByCaseIds(ids); + customFields.forEach(customField -> { + if (customField.getInternal()) { + customField.setFieldName(baseCustomFieldService.translateInternalField(customField.getFieldName())); + } + }); + List fieldIds = customFields.stream().map(FunctionalCaseCustomFieldDTO::getFieldId).toList(); + List fieldOptions = baseCustomFieldOptionService.getByFieldIds(fieldIds); + Map> customOptions = fieldOptions.stream().collect(Collectors.groupingBy(CustomFieldOption::getFieldId)); + customFields.forEach(customField -> { + customField.setOptions(customOptions.get(customField.getFieldId())); + }); + return customFields.stream().collect(Collectors.groupingBy(FunctionalCaseCustomFieldDTO::getCaseId)); + } + + private String getMyStatus(List histories, String viewStatusUserId) { List list = histories.stream().filter(history -> StringUtils.equalsIgnoreCase(history.getCreateUser(), viewStatusUserId)).toList(); if (CollectionUtils.isNotEmpty(list)) { diff --git a/frontend/src/components/business/ms-comment/comment-item.vue b/frontend/src/components/business/ms-comment/comment-item.vue index f9d20791bb..e134489c70 100644 --- a/frontend/src/components/business/ms-comment/comment-item.vue +++ b/frontend/src/components/business/ms-comment/comment-item.vue @@ -23,6 +23,7 @@ ({{ element.childComments?.length }})
{ - return props.element.createUser === userStore.id; + return ( + props.element.createUser === userStore.id && + hasAnyPermission(['PROJECT_BUG:READ+COMMENT', 'FUNCTIONAL_CASE:READ+COMMENT']) + ); }); const status = defineModel<'normal' | 'edit' | 'reply' | 'delete'>('status', { default: 'normal' }); diff --git a/frontend/src/components/pure/ms-drawer/index.vue b/frontend/src/components/pure/ms-drawer/index.vue index 7e0fd5fd4b..174fab9d3f 100644 --- a/frontend/src/components/pure/ms-drawer/index.vue +++ b/frontend/src/components/pure/ms-drawer/index.vue @@ -318,7 +318,7 @@ .ms-drawer-no-mask { left: auto; .arco-drawer { - box-shadow: -1px 0 4px 0 rgb(2 2 2 / 10%); + box-shadow: 0 4px 10px -1px rgb(100 100 102 / 15%); } } .ms-drawer-no-content-padding { diff --git a/frontend/src/views/api-test/management/components/management/case/caseTable.vue b/frontend/src/views/api-test/management/components/management/case/caseTable.vue index 652eca51e1..71f71a42f5 100644 --- a/frontend/src/views/api-test/management/components/management/case/caseTable.vue +++ b/frontend/src/views/api-test/management/components/management/case/caseTable.vue @@ -952,7 +952,7 @@ versionId: '', refId: '', }); - Message.success(t('common.updateSuccess')); + Message.success(t('case.detail.execute.success')); cancelBatchExecute(); loadCaseListAndResetSelector(); } catch (error) { diff --git a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabBug/tabDefect.vue b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabBug/tabDefect.vue index 83fd3de4a9..c04e70a143 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabBug/tabDefect.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabBug/tabDefect.vue @@ -519,6 +519,9 @@ // ); const total = ref(0); async function initBugList() { + if (!hasAnyPermission(['PROJECT_BUG:READ'])) { + return; + } const res = await getBugList({ current: 1, pageSize: 10, diff --git a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabCase/tabCaseTable.vue b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabCase/tabCaseTable.vue index 8ebe589a53..706a732748 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabCase/tabCaseTable.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabCase/tabCaseTable.vue @@ -32,10 +32,13 @@