Skip to content

Commit

Permalink
fix(性能测试): 创建测试添加编辑权限校验提示
Browse files Browse the repository at this point in the history
--bug=1027188 --user=宋昌昌 【性能测试】项目成员勾选创建性能测试权限,创建测试页面置灰 https://www.tapd.cn/55049933/s/1383671
  • Loading branch information
song-cc-rock authored and liuruibin committed Jun 20, 2023
1 parent 8b2e5e7 commit ee4cab8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ import MsContainer from "../../common/components/MsContainer";
import MsMainContainer from "../../common/components/MsMainContainer";
import MsPerformanceTestStatus from "./PerformanceTestStatus";
import MsTableOperators from "../../common/components/MsTableOperators";
import {getCurrentProjectID, getCurrentWorkspaceId, hasLicense} from "@/common/js/utils";
import {getCurrentProjectID, getCurrentWorkspaceId, hasLicense, hasPermission} from "@/common/js/utils";
import MsTableHeader from "../../common/components/MsTableHeader";
import {TEST_CONFIGS} from "../../common/components/search/search-components";
import {buildBatchParam, getLastTableSortField} from "@/common/js/tableUtils";
Expand Down Expand Up @@ -338,6 +338,10 @@ export default {
this.$warning(this.$t('commons.check_project_tip'));
return;
}
if (!hasPermission('PROJECT_PERFORMANCE_TEST:EDIT')) {
this.$warning(this.$t('performance.edit_performance_test_tips'));
return;
}
this.$router.push('/performance/test/create');
},
getVersionOptions(currentVersion) {
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/i18n/en-US.js
Original file line number Diff line number Diff line change
Expand Up @@ -3659,4 +3659,7 @@ export default {
automation: {
document_validity_msg: 'The file has been modified, please re-upload',
},
performance: {
edit_performance_test_tips: 'Do not have permission to edit performance test, please check it before operation',
}
};
3 changes: 3 additions & 0 deletions frontend/src/i18n/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -3667,4 +3667,7 @@ export default {
automation: {
document_validity_msg: '文件已经被修改,请重新上传',
},
performance: {
edit_performance_test_tips: '没有编辑性能测试的权限,请勾选后再操作',
}
};
3 changes: 3 additions & 0 deletions frontend/src/i18n/zh-TW.js
Original file line number Diff line number Diff line change
Expand Up @@ -3663,4 +3663,7 @@ export default {
automation: {
document_validity_msg: '文件已經被修改,請重新上傳',
},
performance: {
edit_performance_test_tips: '沒有編輯性能測試的權限,請勾選後再操作',
}
};

0 comments on commit ee4cab8

Please sign in to comment.