refactor: 消息和模版移动到项目下

This commit is contained in:
CaptainB 2022-03-02 18:10:38 +08:00 committed by 刘瑞斌
parent ae4ccc0e4d
commit 5b104fc009
87 changed files with 1429 additions and 852 deletions

View File

@ -20,17 +20,15 @@ public class CustomField implements Serializable {
private Boolean global; private Boolean global;
private String workspaceId;
private Long createTime; private Long createTime;
private Long updateTime; private Long updateTime;
private String createUser; private String createUser;
private String options; private String projectId;
private String defaultValue; private String options;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }

View File

@ -574,76 +574,6 @@ public class CustomFieldExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andWorkspaceIdIsNull() {
addCriterion("workspace_id is null");
return (Criteria) this;
}
public Criteria andWorkspaceIdIsNotNull() {
addCriterion("workspace_id is not null");
return (Criteria) this;
}
public Criteria andWorkspaceIdEqualTo(String value) {
addCriterion("workspace_id =", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotEqualTo(String value) {
addCriterion("workspace_id <>", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdGreaterThan(String value) {
addCriterion("workspace_id >", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdGreaterThanOrEqualTo(String value) {
addCriterion("workspace_id >=", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdLessThan(String value) {
addCriterion("workspace_id <", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdLessThanOrEqualTo(String value) {
addCriterion("workspace_id <=", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdLike(String value) {
addCriterion("workspace_id like", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotLike(String value) {
addCriterion("workspace_id not like", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdIn(List<String> values) {
addCriterion("workspace_id in", values, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotIn(List<String> values) {
addCriterion("workspace_id not in", values, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdBetween(String value1, String value2) {
addCriterion("workspace_id between", value1, value2, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotBetween(String value1, String value2) {
addCriterion("workspace_id not between", value1, value2, "workspaceId");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() { public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null"); addCriterion("create_time is null");
return (Criteria) this; return (Criteria) this;
@ -833,6 +763,76 @@ public class CustomFieldExample {
addCriterion("create_user not between", value1, value2, "createUser"); addCriterion("create_user not between", value1, value2, "createUser");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andProjectIdIsNull() {
addCriterion("project_id is null");
return (Criteria) this;
}
public Criteria andProjectIdIsNotNull() {
addCriterion("project_id is not null");
return (Criteria) this;
}
public Criteria andProjectIdEqualTo(String value) {
addCriterion("project_id =", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotEqualTo(String value) {
addCriterion("project_id <>", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdGreaterThan(String value) {
addCriterion("project_id >", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdGreaterThanOrEqualTo(String value) {
addCriterion("project_id >=", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLessThan(String value) {
addCriterion("project_id <", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLessThanOrEqualTo(String value) {
addCriterion("project_id <=", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLike(String value) {
addCriterion("project_id like", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotLike(String value) {
addCriterion("project_id not like", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdIn(List<String> values) {
addCriterion("project_id in", values, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotIn(List<String> values) {
addCriterion("project_id not in", values, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdBetween(String value1, String value2) {
addCriterion("project_id between", value1, value2, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotBetween(String value1, String value2) {
addCriterion("project_id not between", value1, value2, "projectId");
return (Criteria) this;
}
} }
public static class Criteria extends GeneratedCriteria { public static class Criteria extends GeneratedCriteria {

View File

@ -20,14 +20,14 @@ public class IssueTemplate implements Serializable {
private Boolean global; private Boolean global;
private String workspaceId;
private Long createTime; private Long createTime;
private Long updateTime; private Long updateTime;
private String createUser; private String createUser;
private String projectId;
private String content; private String content;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -574,76 +574,6 @@ public class IssueTemplateExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andWorkspaceIdIsNull() {
addCriterion("workspace_id is null");
return (Criteria) this;
}
public Criteria andWorkspaceIdIsNotNull() {
addCriterion("workspace_id is not null");
return (Criteria) this;
}
public Criteria andWorkspaceIdEqualTo(String value) {
addCriterion("workspace_id =", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotEqualTo(String value) {
addCriterion("workspace_id <>", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdGreaterThan(String value) {
addCriterion("workspace_id >", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdGreaterThanOrEqualTo(String value) {
addCriterion("workspace_id >=", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdLessThan(String value) {
addCriterion("workspace_id <", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdLessThanOrEqualTo(String value) {
addCriterion("workspace_id <=", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdLike(String value) {
addCriterion("workspace_id like", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotLike(String value) {
addCriterion("workspace_id not like", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdIn(List<String> values) {
addCriterion("workspace_id in", values, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotIn(List<String> values) {
addCriterion("workspace_id not in", values, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdBetween(String value1, String value2) {
addCriterion("workspace_id between", value1, value2, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotBetween(String value1, String value2) {
addCriterion("workspace_id not between", value1, value2, "workspaceId");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() { public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null"); addCriterion("create_time is null");
return (Criteria) this; return (Criteria) this;
@ -833,6 +763,76 @@ public class IssueTemplateExample {
addCriterion("create_user not between", value1, value2, "createUser"); addCriterion("create_user not between", value1, value2, "createUser");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andProjectIdIsNull() {
addCriterion("project_id is null");
return (Criteria) this;
}
public Criteria andProjectIdIsNotNull() {
addCriterion("project_id is not null");
return (Criteria) this;
}
public Criteria andProjectIdEqualTo(String value) {
addCriterion("project_id =", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotEqualTo(String value) {
addCriterion("project_id <>", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdGreaterThan(String value) {
addCriterion("project_id >", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdGreaterThanOrEqualTo(String value) {
addCriterion("project_id >=", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLessThan(String value) {
addCriterion("project_id <", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLessThanOrEqualTo(String value) {
addCriterion("project_id <=", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLike(String value) {
addCriterion("project_id like", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotLike(String value) {
addCriterion("project_id not like", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdIn(List<String> values) {
addCriterion("project_id in", values, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotIn(List<String> values) {
addCriterion("project_id not in", values, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdBetween(String value1, String value2) {
addCriterion("project_id between", value1, value2, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotBetween(String value1, String value2) {
addCriterion("project_id not between", value1, value2, "projectId");
return (Criteria) this;
}
} }
public static class Criteria extends GeneratedCriteria { public static class Criteria extends GeneratedCriteria {

View File

@ -1,8 +1,9 @@
package io.metersphere.base.domain; package io.metersphere.base.domain;
import java.io.Serializable;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
@Data @Data
public class MessageTask implements Serializable { public class MessageTask implements Serializable {
private String id; private String id;
@ -25,7 +26,7 @@ public class MessageTask implements Serializable {
private Long createTime; private Long createTime;
private String workspaceId; private String projectId;
private String template; private String template;

View File

@ -784,73 +784,73 @@ public class MessageTaskExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andWorkspaceIdIsNull() { public Criteria andProjectIdIsNull() {
addCriterion("workspace_id is null"); addCriterion("project_id is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andWorkspaceIdIsNotNull() { public Criteria andProjectIdIsNotNull() {
addCriterion("workspace_id is not null"); addCriterion("project_id is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andWorkspaceIdEqualTo(String value) { public Criteria andProjectIdEqualTo(String value) {
addCriterion("workspace_id =", value, "workspaceId"); addCriterion("project_id =", value, "projectId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andWorkspaceIdNotEqualTo(String value) { public Criteria andProjectIdNotEqualTo(String value) {
addCriterion("workspace_id <>", value, "workspaceId"); addCriterion("project_id <>", value, "projectId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andWorkspaceIdGreaterThan(String value) { public Criteria andProjectIdGreaterThan(String value) {
addCriterion("workspace_id >", value, "workspaceId"); addCriterion("project_id >", value, "projectId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andWorkspaceIdGreaterThanOrEqualTo(String value) { public Criteria andProjectIdGreaterThanOrEqualTo(String value) {
addCriterion("workspace_id >=", value, "workspaceId"); addCriterion("project_id >=", value, "projectId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andWorkspaceIdLessThan(String value) { public Criteria andProjectIdLessThan(String value) {
addCriterion("workspace_id <", value, "workspaceId"); addCriterion("project_id <", value, "projectId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andWorkspaceIdLessThanOrEqualTo(String value) { public Criteria andProjectIdLessThanOrEqualTo(String value) {
addCriterion("workspace_id <=", value, "workspaceId"); addCriterion("project_id <=", value, "projectId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andWorkspaceIdLike(String value) { public Criteria andProjectIdLike(String value) {
addCriterion("workspace_id like", value, "workspaceId"); addCriterion("project_id like", value, "projectId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andWorkspaceIdNotLike(String value) { public Criteria andProjectIdNotLike(String value) {
addCriterion("workspace_id not like", value, "workspaceId"); addCriterion("project_id not like", value, "projectId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andWorkspaceIdIn(List<String> values) { public Criteria andProjectIdIn(List<String> values) {
addCriterion("workspace_id in", values, "workspaceId"); addCriterion("project_id in", values, "projectId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andWorkspaceIdNotIn(List<String> values) { public Criteria andProjectIdNotIn(List<String> values) {
addCriterion("workspace_id not in", values, "workspaceId"); addCriterion("project_id not in", values, "projectId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andWorkspaceIdBetween(String value1, String value2) { public Criteria andProjectIdBetween(String value1, String value2) {
addCriterion("workspace_id between", value1, value2, "workspaceId"); addCriterion("project_id between", value1, value2, "projectId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andWorkspaceIdNotBetween(String value1, String value2) { public Criteria andProjectIdNotBetween(String value1, String value2) {
addCriterion("workspace_id not between", value1, value2, "workspaceId"); addCriterion("project_id not between", value1, value2, "projectId");
return (Criteria) this; return (Criteria) this;
} }
} }

View File

@ -20,8 +20,6 @@ public class TestCaseTemplate implements Serializable {
private Boolean global; private Boolean global;
private String workspaceId;
private String prerequisite; private String prerequisite;
private Long createTime; private Long createTime;
@ -32,5 +30,7 @@ public class TestCaseTemplate implements Serializable {
private String createUser; private String createUser;
private String projectId;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }

View File

@ -574,76 +574,6 @@ public class TestCaseTemplateExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andWorkspaceIdIsNull() {
addCriterion("workspace_id is null");
return (Criteria) this;
}
public Criteria andWorkspaceIdIsNotNull() {
addCriterion("workspace_id is not null");
return (Criteria) this;
}
public Criteria andWorkspaceIdEqualTo(String value) {
addCriterion("workspace_id =", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotEqualTo(String value) {
addCriterion("workspace_id <>", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdGreaterThan(String value) {
addCriterion("workspace_id >", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdGreaterThanOrEqualTo(String value) {
addCriterion("workspace_id >=", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdLessThan(String value) {
addCriterion("workspace_id <", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdLessThanOrEqualTo(String value) {
addCriterion("workspace_id <=", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdLike(String value) {
addCriterion("workspace_id like", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotLike(String value) {
addCriterion("workspace_id not like", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdIn(List<String> values) {
addCriterion("workspace_id in", values, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotIn(List<String> values) {
addCriterion("workspace_id not in", values, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdBetween(String value1, String value2) {
addCriterion("workspace_id between", value1, value2, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotBetween(String value1, String value2) {
addCriterion("workspace_id not between", value1, value2, "workspaceId");
return (Criteria) this;
}
public Criteria andPrerequisiteIsNull() { public Criteria andPrerequisiteIsNull() {
addCriterion("prerequisite is null"); addCriterion("prerequisite is null");
return (Criteria) this; return (Criteria) this;
@ -973,6 +903,76 @@ public class TestCaseTemplateExample {
addCriterion("create_user not between", value1, value2, "createUser"); addCriterion("create_user not between", value1, value2, "createUser");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andProjectIdIsNull() {
addCriterion("project_id is null");
return (Criteria) this;
}
public Criteria andProjectIdIsNotNull() {
addCriterion("project_id is not null");
return (Criteria) this;
}
public Criteria andProjectIdEqualTo(String value) {
addCriterion("project_id =", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotEqualTo(String value) {
addCriterion("project_id <>", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdGreaterThan(String value) {
addCriterion("project_id >", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdGreaterThanOrEqualTo(String value) {
addCriterion("project_id >=", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLessThan(String value) {
addCriterion("project_id <", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLessThanOrEqualTo(String value) {
addCriterion("project_id <=", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLike(String value) {
addCriterion("project_id like", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotLike(String value) {
addCriterion("project_id not like", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdIn(List<String> values) {
addCriterion("project_id in", values, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotIn(List<String> values) {
addCriterion("project_id not in", values, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdBetween(String value1, String value2) {
addCriterion("project_id between", value1, value2, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotBetween(String value1, String value2) {
addCriterion("project_id not between", value1, value2, "projectId");
return (Criteria) this;
}
} }
public static class Criteria extends GeneratedCriteria { public static class Criteria extends GeneratedCriteria {

View File

@ -9,10 +9,10 @@
<result column="remark" jdbcType="VARCHAR" property="remark" /> <result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="system" jdbcType="BIT" property="system" /> <result column="system" jdbcType="BIT" property="system" />
<result column="global" jdbcType="BIT" property="global" /> <result column="global" jdbcType="BIT" property="global" />
<result column="workspace_id" jdbcType="VARCHAR" property="workspaceId" />
<result column="create_time" jdbcType="BIGINT" property="createTime" /> <result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" /> <result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" /> <result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.CustomField"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.CustomField">
<result column="options" jdbcType="LONGVARCHAR" property="options" /> <result column="options" jdbcType="LONGVARCHAR" property="options" />
@ -76,8 +76,8 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, `name`, scene, `type`, remark, `system`, `global`, workspace_id, create_time, id, `name`, scene, `type`, remark, `system`, `global`, create_time, update_time,
update_time, create_user create_user, project_id
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
`options` `options`
@ -131,14 +131,14 @@
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="io.metersphere.base.domain.CustomField"> <insert id="insert" parameterType="io.metersphere.base.domain.CustomField">
insert into custom_field (id, `name`, scene, INSERT INTO custom_field (id, `name`, scene,
`type`, remark, `system`, `global`, `type`, remark, `system`, `global`,
workspace_id, create_time, update_time, create_time, update_time, create_user,
create_user, `options`) project_id, `options`)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{scene,jdbcType=VARCHAR}, VALUES (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{scene,jdbcType=VARCHAR},
#{type,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{system,jdbcType=BIT}, #{global,jdbcType=BIT}, #{type,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{system,jdbcType=BIT}, #{global,jdbcType=BIT},
#{workspaceId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{createUser,jdbcType=VARCHAR},
#{createUser,jdbcType=VARCHAR}, #{options,jdbcType=LONGVARCHAR}) #{projectId,jdbcType=VARCHAR}, #{options,jdbcType=LONGVARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.CustomField"> <insert id="insertSelective" parameterType="io.metersphere.base.domain.CustomField">
insert into custom_field insert into custom_field
@ -164,9 +164,6 @@
<if test="global != null"> <if test="global != null">
`global`, `global`,
</if> </if>
<if test="workspaceId != null">
workspace_id,
</if>
<if test="createTime != null"> <if test="createTime != null">
create_time, create_time,
</if> </if>
@ -176,6 +173,9 @@
<if test="createUser != null"> <if test="createUser != null">
create_user, create_user,
</if> </if>
<if test="projectId != null">
project_id,
</if>
<if test="options != null"> <if test="options != null">
`options`, `options`,
</if> </if>
@ -202,9 +202,6 @@
<if test="global != null"> <if test="global != null">
#{global,jdbcType=BIT}, #{global,jdbcType=BIT},
</if> </if>
<if test="workspaceId != null">
#{workspaceId,jdbcType=VARCHAR},
</if>
<if test="createTime != null"> <if test="createTime != null">
#{createTime,jdbcType=BIGINT}, #{createTime,jdbcType=BIGINT},
</if> </if>
@ -214,6 +211,9 @@
<if test="createUser != null"> <if test="createUser != null">
#{createUser,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR},
</if> </if>
<if test="projectId != null">
#{projectId,jdbcType=VARCHAR},
</if>
<if test="options != null"> <if test="options != null">
#{options,jdbcType=LONGVARCHAR}, #{options,jdbcType=LONGVARCHAR},
</if> </if>
@ -249,9 +249,6 @@
<if test="record.global != null"> <if test="record.global != null">
`global` = #{record.global,jdbcType=BIT}, `global` = #{record.global,jdbcType=BIT},
</if> </if>
<if test="record.workspaceId != null">
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null"> <if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
</if> </if>
@ -261,6 +258,9 @@
<if test="record.createUser != null"> <if test="record.createUser != null">
create_user = #{record.createUser,jdbcType=VARCHAR}, create_user = #{record.createUser,jdbcType=VARCHAR},
</if> </if>
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=VARCHAR},
</if>
<if test="record.options != null"> <if test="record.options != null">
`options` = #{record.options,jdbcType=LONGVARCHAR}, `options` = #{record.options,jdbcType=LONGVARCHAR},
</if> </if>
@ -278,10 +278,10 @@
remark = #{record.remark,jdbcType=VARCHAR}, remark = #{record.remark,jdbcType=VARCHAR},
`system` = #{record.system,jdbcType=BIT}, `system` = #{record.system,jdbcType=BIT},
`global` = #{record.global,jdbcType=BIT}, `global` = #{record.global,jdbcType=BIT},
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT},
create_user = #{record.createUser,jdbcType=VARCHAR}, create_user = #{record.createUser,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
`options` = #{record.options,jdbcType=LONGVARCHAR} `options` = #{record.options,jdbcType=LONGVARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
@ -296,10 +296,10 @@
remark = #{record.remark,jdbcType=VARCHAR}, remark = #{record.remark,jdbcType=VARCHAR},
`system` = #{record.system,jdbcType=BIT}, `system` = #{record.system,jdbcType=BIT},
`global` = #{record.global,jdbcType=BIT}, `global` = #{record.global,jdbcType=BIT},
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT},
create_user = #{record.createUser,jdbcType=VARCHAR} create_user = #{record.createUser,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -325,9 +325,6 @@
<if test="global != null"> <if test="global != null">
`global` = #{global,jdbcType=BIT}, `global` = #{global,jdbcType=BIT},
</if> </if>
<if test="workspaceId != null">
workspace_id = #{workspaceId,jdbcType=VARCHAR},
</if>
<if test="createTime != null"> <if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
</if> </if>
@ -337,6 +334,9 @@
<if test="createUser != null"> <if test="createUser != null">
create_user = #{createUser,jdbcType=VARCHAR}, create_user = #{createUser,jdbcType=VARCHAR},
</if> </if>
<if test="projectId != null">
project_id = #{projectId,jdbcType=VARCHAR},
</if>
<if test="options != null"> <if test="options != null">
`options` = #{options,jdbcType=LONGVARCHAR}, `options` = #{options,jdbcType=LONGVARCHAR},
</if> </if>
@ -351,25 +351,25 @@
remark = #{remark,jdbcType=VARCHAR}, remark = #{remark,jdbcType=VARCHAR},
`system` = #{system,jdbcType=BIT}, `system` = #{system,jdbcType=BIT},
`global` = #{global,jdbcType=BIT}, `global` = #{global,jdbcType=BIT},
workspace_id = #{workspaceId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT},
create_user = #{createUser,jdbcType=VARCHAR}, create_user = #{createUser,jdbcType=VARCHAR},
project_id = #{projectId,jdbcType=VARCHAR},
`options` = #{options,jdbcType=LONGVARCHAR} `options` = #{options,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.CustomField"> <update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.CustomField">
update custom_field UPDATE custom_field
set `name` = #{name,jdbcType=VARCHAR}, SET `name` = #{name,jdbcType=VARCHAR},
scene = #{scene,jdbcType=VARCHAR}, scene = #{scene,jdbcType=VARCHAR},
`type` = #{type,jdbcType=VARCHAR}, `type` = #{type,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR}, remark = #{remark,jdbcType=VARCHAR},
`system` = #{system,jdbcType=BIT}, `system` = #{system,jdbcType=BIT},
`global` = #{global,jdbcType=BIT}, `global` = #{global,jdbcType=BIT},
workspace_id = #{workspaceId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT},
create_user = #{createUser,jdbcType=VARCHAR} create_user = #{createUser,jdbcType=VARCHAR},
where id = #{id,jdbcType=VARCHAR} project_id = #{projectId,jdbcType=VARCHAR}
WHERE id = #{id,jdbcType=VARCHAR}
</update> </update>
</mapper> </mapper>

View File

@ -9,10 +9,10 @@
<result column="title" jdbcType="VARCHAR" property="title" /> <result column="title" jdbcType="VARCHAR" property="title" />
<result column="system" jdbcType="BIT" property="system" /> <result column="system" jdbcType="BIT" property="system" />
<result column="global" jdbcType="BIT" property="global" /> <result column="global" jdbcType="BIT" property="global" />
<result column="workspace_id" jdbcType="VARCHAR" property="workspaceId" />
<result column="create_time" jdbcType="BIGINT" property="createTime" /> <result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" /> <result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" /> <result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.IssueTemplate"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.IssueTemplate">
<result column="content" jdbcType="LONGVARCHAR" property="content" /> <result column="content" jdbcType="LONGVARCHAR" property="content" />
@ -76,8 +76,8 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, `name`, platform, description, title, `system`, `global`, workspace_id, create_time, id, `name`, platform, description, title, `system`, `global`, create_time, update_time,
update_time, create_user create_user, project_id
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
content content
@ -131,15 +131,15 @@
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="io.metersphere.base.domain.IssueTemplate"> <insert id="insert" parameterType="io.metersphere.base.domain.IssueTemplate">
insert into issue_template (id, `name`, platform, INSERT INTO issue_template (id, `name`, platform,
description, title, `system`, description, title, `system`,
`global`, workspace_id, create_time, `global`, create_time, update_time,
update_time, create_user, content create_user, project_id, content
) )
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{platform,jdbcType=VARCHAR}, VALUES (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{platform,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{system,jdbcType=BIT}, #{description,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{system,jdbcType=BIT},
#{global,jdbcType=BIT}, #{workspaceId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{global,jdbcType=BIT}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT}, #{createUser,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR} #{createUser,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR}
) )
</insert> </insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.IssueTemplate"> <insert id="insertSelective" parameterType="io.metersphere.base.domain.IssueTemplate">
@ -166,9 +166,6 @@
<if test="global != null"> <if test="global != null">
`global`, `global`,
</if> </if>
<if test="workspaceId != null">
workspace_id,
</if>
<if test="createTime != null"> <if test="createTime != null">
create_time, create_time,
</if> </if>
@ -178,6 +175,9 @@
<if test="createUser != null"> <if test="createUser != null">
create_user, create_user,
</if> </if>
<if test="projectId != null">
project_id,
</if>
<if test="content != null"> <if test="content != null">
content, content,
</if> </if>
@ -204,9 +204,6 @@
<if test="global != null"> <if test="global != null">
#{global,jdbcType=BIT}, #{global,jdbcType=BIT},
</if> </if>
<if test="workspaceId != null">
#{workspaceId,jdbcType=VARCHAR},
</if>
<if test="createTime != null"> <if test="createTime != null">
#{createTime,jdbcType=BIGINT}, #{createTime,jdbcType=BIGINT},
</if> </if>
@ -216,6 +213,9 @@
<if test="createUser != null"> <if test="createUser != null">
#{createUser,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR},
</if> </if>
<if test="projectId != null">
#{projectId,jdbcType=VARCHAR},
</if>
<if test="content != null"> <if test="content != null">
#{content,jdbcType=LONGVARCHAR}, #{content,jdbcType=LONGVARCHAR},
</if> </if>
@ -251,9 +251,6 @@
<if test="record.global != null"> <if test="record.global != null">
`global` = #{record.global,jdbcType=BIT}, `global` = #{record.global,jdbcType=BIT},
</if> </if>
<if test="record.workspaceId != null">
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null"> <if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
</if> </if>
@ -263,6 +260,9 @@
<if test="record.createUser != null"> <if test="record.createUser != null">
create_user = #{record.createUser,jdbcType=VARCHAR}, create_user = #{record.createUser,jdbcType=VARCHAR},
</if> </if>
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=VARCHAR},
</if>
<if test="record.content != null"> <if test="record.content != null">
content = #{record.content,jdbcType=LONGVARCHAR}, content = #{record.content,jdbcType=LONGVARCHAR},
</if> </if>
@ -280,10 +280,10 @@
title = #{record.title,jdbcType=VARCHAR}, title = #{record.title,jdbcType=VARCHAR},
`system` = #{record.system,jdbcType=BIT}, `system` = #{record.system,jdbcType=BIT},
`global` = #{record.global,jdbcType=BIT}, `global` = #{record.global,jdbcType=BIT},
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT},
create_user = #{record.createUser,jdbcType=VARCHAR}, create_user = #{record.createUser,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
content = #{record.content,jdbcType=LONGVARCHAR} content = #{record.content,jdbcType=LONGVARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
@ -298,10 +298,10 @@
title = #{record.title,jdbcType=VARCHAR}, title = #{record.title,jdbcType=VARCHAR},
`system` = #{record.system,jdbcType=BIT}, `system` = #{record.system,jdbcType=BIT},
`global` = #{record.global,jdbcType=BIT}, `global` = #{record.global,jdbcType=BIT},
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT},
create_user = #{record.createUser,jdbcType=VARCHAR} create_user = #{record.createUser,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -327,9 +327,6 @@
<if test="global != null"> <if test="global != null">
`global` = #{global,jdbcType=BIT}, `global` = #{global,jdbcType=BIT},
</if> </if>
<if test="workspaceId != null">
workspace_id = #{workspaceId,jdbcType=VARCHAR},
</if>
<if test="createTime != null"> <if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
</if> </if>
@ -339,6 +336,9 @@
<if test="createUser != null"> <if test="createUser != null">
create_user = #{createUser,jdbcType=VARCHAR}, create_user = #{createUser,jdbcType=VARCHAR},
</if> </if>
<if test="projectId != null">
project_id = #{projectId,jdbcType=VARCHAR},
</if>
<if test="content != null"> <if test="content != null">
content = #{content,jdbcType=LONGVARCHAR}, content = #{content,jdbcType=LONGVARCHAR},
</if> </if>
@ -353,25 +353,25 @@
title = #{title,jdbcType=VARCHAR}, title = #{title,jdbcType=VARCHAR},
`system` = #{system,jdbcType=BIT}, `system` = #{system,jdbcType=BIT},
`global` = #{global,jdbcType=BIT}, `global` = #{global,jdbcType=BIT},
workspace_id = #{workspaceId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT},
create_user = #{createUser,jdbcType=VARCHAR}, create_user = #{createUser,jdbcType=VARCHAR},
project_id = #{projectId,jdbcType=VARCHAR},
content = #{content,jdbcType=LONGVARCHAR} content = #{content,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.IssueTemplate"> <update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.IssueTemplate">
update issue_template UPDATE issue_template
set `name` = #{name,jdbcType=VARCHAR}, SET `name` = #{name,jdbcType=VARCHAR},
platform = #{platform,jdbcType=VARCHAR}, platform = #{platform,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR}, description = #{description,jdbcType=VARCHAR},
title = #{title,jdbcType=VARCHAR}, title = #{title,jdbcType=VARCHAR},
`system` = #{system,jdbcType=BIT}, `system` = #{system,jdbcType=BIT},
`global` = #{global,jdbcType=BIT}, `global` = #{global,jdbcType=BIT},
workspace_id = #{workspaceId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT},
create_user = #{createUser,jdbcType=VARCHAR} create_user = #{createUser,jdbcType=VARCHAR},
where id = #{id,jdbcType=VARCHAR} project_id = #{projectId,jdbcType=VARCHAR}
WHERE id = #{id,jdbcType=VARCHAR}
</update> </update>
</mapper> </mapper>

View File

@ -12,7 +12,7 @@
<result column="is_set" jdbcType="BIT" property="isSet" /> <result column="is_set" jdbcType="BIT" property="isSet" />
<result column="test_id" jdbcType="VARCHAR" property="testId" /> <result column="test_id" jdbcType="VARCHAR" property="testId" />
<result column="create_time" jdbcType="BIGINT" property="createTime" /> <result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="workspace_id" jdbcType="VARCHAR" property="workspaceId" /> <result column="project_id" jdbcType="VARCHAR" property="projectId" />
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.MessageTask"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.MessageTask">
<result column="template" jdbcType="LONGVARCHAR" property="template" /> <result column="template" jdbcType="LONGVARCHAR" property="template" />
@ -77,7 +77,7 @@
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, `type`, event, user_id, task_type, webhook, identification, is_set, test_id, id, `type`, event, user_id, task_type, webhook, identification, is_set, test_id,
create_time, workspace_id create_time, project_id
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
`template` `template`
@ -131,15 +131,15 @@
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="io.metersphere.base.domain.MessageTask"> <insert id="insert" parameterType="io.metersphere.base.domain.MessageTask">
insert into message_task (id, `type`, event, INSERT INTO message_task (id, `type`, event,
user_id, task_type, webhook, user_id, task_type, webhook,
identification, is_set, test_id, identification, is_set, test_id,
create_time, workspace_id, `template` create_time, project_id, `template`
) )
values (#{id,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{event,jdbcType=VARCHAR}, VALUES (#{id,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{event,jdbcType=VARCHAR},
#{userId,jdbcType=VARCHAR}, #{taskType,jdbcType=VARCHAR}, #{webhook,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{taskType,jdbcType=VARCHAR}, #{webhook,jdbcType=VARCHAR},
#{identification,jdbcType=VARCHAR}, #{isSet,jdbcType=BIT}, #{testId,jdbcType=VARCHAR}, #{identification,jdbcType=VARCHAR}, #{isSet,jdbcType=BIT}, #{testId,jdbcType=VARCHAR},
#{createTime,jdbcType=BIGINT}, #{workspaceId,jdbcType=VARCHAR}, #{template,jdbcType=LONGVARCHAR} #{createTime,jdbcType=BIGINT}, #{projectId,jdbcType=VARCHAR}, #{template,jdbcType=LONGVARCHAR}
) )
</insert> </insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.MessageTask"> <insert id="insertSelective" parameterType="io.metersphere.base.domain.MessageTask">
@ -175,8 +175,8 @@
<if test="createTime != null"> <if test="createTime != null">
create_time, create_time,
</if> </if>
<if test="workspaceId != null"> <if test="projectId != null">
workspace_id, project_id,
</if> </if>
<if test="template != null"> <if test="template != null">
`template`, `template`,
@ -213,8 +213,8 @@
<if test="createTime != null"> <if test="createTime != null">
#{createTime,jdbcType=BIGINT}, #{createTime,jdbcType=BIGINT},
</if> </if>
<if test="workspaceId != null"> <if test="projectId != null">
#{workspaceId,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR},
</if> </if>
<if test="template != null"> <if test="template != null">
#{template,jdbcType=LONGVARCHAR}, #{template,jdbcType=LONGVARCHAR},
@ -260,8 +260,8 @@
<if test="record.createTime != null"> <if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
</if> </if>
<if test="record.workspaceId != null"> <if test="record.projectId != null">
workspace_id = #{record.workspaceId,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR},
</if> </if>
<if test="record.template != null"> <if test="record.template != null">
`template` = #{record.template,jdbcType=LONGVARCHAR}, `template` = #{record.template,jdbcType=LONGVARCHAR},
@ -283,7 +283,7 @@
is_set = #{record.isSet,jdbcType=BIT}, is_set = #{record.isSet,jdbcType=BIT},
test_id = #{record.testId,jdbcType=VARCHAR}, test_id = #{record.testId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
workspace_id = #{record.workspaceId,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR},
`template` = #{record.template,jdbcType=LONGVARCHAR} `template` = #{record.template,jdbcType=LONGVARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
@ -301,7 +301,7 @@
is_set = #{record.isSet,jdbcType=BIT}, is_set = #{record.isSet,jdbcType=BIT},
test_id = #{record.testId,jdbcType=VARCHAR}, test_id = #{record.testId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
workspace_id = #{record.workspaceId,jdbcType=VARCHAR} project_id = #{record.projectId,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -336,8 +336,8 @@
<if test="createTime != null"> <if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
</if> </if>
<if test="workspaceId != null"> <if test="projectId != null">
workspace_id = #{workspaceId,jdbcType=VARCHAR}, project_id = #{projectId,jdbcType=VARCHAR},
</if> </if>
<if test="template != null"> <if test="template != null">
`template` = #{template,jdbcType=LONGVARCHAR}, `template` = #{template,jdbcType=LONGVARCHAR},
@ -356,7 +356,7 @@
is_set = #{isSet,jdbcType=BIT}, is_set = #{isSet,jdbcType=BIT},
test_id = #{testId,jdbcType=VARCHAR}, test_id = #{testId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
workspace_id = #{workspaceId,jdbcType=VARCHAR}, project_id = #{projectId,jdbcType=VARCHAR},
`template` = #{template,jdbcType=LONGVARCHAR} `template` = #{template,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
@ -371,7 +371,7 @@
is_set = #{isSet,jdbcType=BIT}, is_set = #{isSet,jdbcType=BIT},
test_id = #{testId,jdbcType=VARCHAR}, test_id = #{testId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
workspace_id = #{workspaceId,jdbcType=VARCHAR} project_id = #{projectId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
</mapper> </mapper>

View File

@ -9,12 +9,12 @@
<result column="case_name" jdbcType="VARCHAR" property="caseName" /> <result column="case_name" jdbcType="VARCHAR" property="caseName" />
<result column="system" jdbcType="BIT" property="system" /> <result column="system" jdbcType="BIT" property="system" />
<result column="global" jdbcType="BIT" property="global" /> <result column="global" jdbcType="BIT" property="global" />
<result column="workspace_id" jdbcType="VARCHAR" property="workspaceId" />
<result column="prerequisite" jdbcType="VARCHAR" property="prerequisite" /> <result column="prerequisite" jdbcType="VARCHAR" property="prerequisite" />
<result column="create_time" jdbcType="BIGINT" property="createTime" /> <result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" /> <result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="step_model" jdbcType="VARCHAR" property="stepModel" /> <result column="step_model" jdbcType="VARCHAR" property="stepModel" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" /> <result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.TestCaseTemplateWithBLOBs"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.TestCaseTemplateWithBLOBs">
<result column="step_description" jdbcType="LONGVARCHAR" property="stepDescription" /> <result column="step_description" jdbcType="LONGVARCHAR" property="stepDescription" />
@ -81,8 +81,8 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, `name`, `type`, description, case_name, `system`, `global`, workspace_id, prerequisite, id, `name`, `type`, description, case_name, `system`, `global`, prerequisite, create_time,
create_time, update_time, step_model, create_user update_time, step_model, create_user, project_id
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
step_description, expected_result, actual_result, steps step_description, expected_result, actual_result, steps
@ -136,17 +136,17 @@
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="io.metersphere.base.domain.TestCaseTemplateWithBLOBs"> <insert id="insert" parameterType="io.metersphere.base.domain.TestCaseTemplateWithBLOBs">
insert into test_case_template (id, `name`, `type`, INSERT INTO test_case_template (id, `name`, `type`,
description, case_name, `system`, description, case_name, `system`,
`global`, workspace_id, prerequisite, `global`, prerequisite, create_time,
create_time, update_time, step_model, update_time, step_model, create_user,
create_user, step_description, expected_result, project_id, step_description, expected_result,
actual_result, steps) actual_result, steps)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, VALUES (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{caseName,jdbcType=VARCHAR}, #{system,jdbcType=BIT}, #{description,jdbcType=VARCHAR}, #{caseName,jdbcType=VARCHAR}, #{system,jdbcType=BIT},
#{global,jdbcType=BIT}, #{workspaceId,jdbcType=VARCHAR}, #{prerequisite,jdbcType=VARCHAR}, #{global,jdbcType=BIT}, #{prerequisite,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{stepModel,jdbcType=VARCHAR}, #{updateTime,jdbcType=BIGINT}, #{stepModel,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR},
#{createUser,jdbcType=VARCHAR}, #{stepDescription,jdbcType=LONGVARCHAR}, #{expectedResult,jdbcType=LONGVARCHAR}, #{projectId,jdbcType=VARCHAR}, #{stepDescription,jdbcType=LONGVARCHAR}, #{expectedResult,jdbcType=LONGVARCHAR},
#{actualResult,jdbcType=LONGVARCHAR}, #{steps,jdbcType=LONGVARCHAR}) #{actualResult,jdbcType=LONGVARCHAR}, #{steps,jdbcType=LONGVARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestCaseTemplateWithBLOBs"> <insert id="insertSelective" parameterType="io.metersphere.base.domain.TestCaseTemplateWithBLOBs">
@ -173,9 +173,6 @@
<if test="global != null"> <if test="global != null">
`global`, `global`,
</if> </if>
<if test="workspaceId != null">
workspace_id,
</if>
<if test="prerequisite != null"> <if test="prerequisite != null">
prerequisite, prerequisite,
</if> </if>
@ -191,6 +188,9 @@
<if test="createUser != null"> <if test="createUser != null">
create_user, create_user,
</if> </if>
<if test="projectId != null">
project_id,
</if>
<if test="stepDescription != null"> <if test="stepDescription != null">
step_description, step_description,
</if> </if>
@ -226,9 +226,6 @@
<if test="global != null"> <if test="global != null">
#{global,jdbcType=BIT}, #{global,jdbcType=BIT},
</if> </if>
<if test="workspaceId != null">
#{workspaceId,jdbcType=VARCHAR},
</if>
<if test="prerequisite != null"> <if test="prerequisite != null">
#{prerequisite,jdbcType=VARCHAR}, #{prerequisite,jdbcType=VARCHAR},
</if> </if>
@ -244,6 +241,9 @@
<if test="createUser != null"> <if test="createUser != null">
#{createUser,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR},
</if> </if>
<if test="projectId != null">
#{projectId,jdbcType=VARCHAR},
</if>
<if test="stepDescription != null"> <if test="stepDescription != null">
#{stepDescription,jdbcType=LONGVARCHAR}, #{stepDescription,jdbcType=LONGVARCHAR},
</if> </if>
@ -288,9 +288,6 @@
<if test="record.global != null"> <if test="record.global != null">
`global` = #{record.global,jdbcType=BIT}, `global` = #{record.global,jdbcType=BIT},
</if> </if>
<if test="record.workspaceId != null">
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
</if>
<if test="record.prerequisite != null"> <if test="record.prerequisite != null">
prerequisite = #{record.prerequisite,jdbcType=VARCHAR}, prerequisite = #{record.prerequisite,jdbcType=VARCHAR},
</if> </if>
@ -306,6 +303,9 @@
<if test="record.createUser != null"> <if test="record.createUser != null">
create_user = #{record.createUser,jdbcType=VARCHAR}, create_user = #{record.createUser,jdbcType=VARCHAR},
</if> </if>
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=VARCHAR},
</if>
<if test="record.stepDescription != null"> <if test="record.stepDescription != null">
step_description = #{record.stepDescription,jdbcType=LONGVARCHAR}, step_description = #{record.stepDescription,jdbcType=LONGVARCHAR},
</if> </if>
@ -332,12 +332,12 @@
case_name = #{record.caseName,jdbcType=VARCHAR}, case_name = #{record.caseName,jdbcType=VARCHAR},
`system` = #{record.system,jdbcType=BIT}, `system` = #{record.system,jdbcType=BIT},
`global` = #{record.global,jdbcType=BIT}, `global` = #{record.global,jdbcType=BIT},
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
prerequisite = #{record.prerequisite,jdbcType=VARCHAR}, prerequisite = #{record.prerequisite,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT},
step_model = #{record.stepModel,jdbcType=VARCHAR}, step_model = #{record.stepModel,jdbcType=VARCHAR},
create_user = #{record.createUser,jdbcType=VARCHAR}, create_user = #{record.createUser,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
step_description = #{record.stepDescription,jdbcType=LONGVARCHAR}, step_description = #{record.stepDescription,jdbcType=LONGVARCHAR},
expected_result = #{record.expectedResult,jdbcType=LONGVARCHAR}, expected_result = #{record.expectedResult,jdbcType=LONGVARCHAR},
actual_result = #{record.actualResult,jdbcType=LONGVARCHAR}, actual_result = #{record.actualResult,jdbcType=LONGVARCHAR},
@ -355,12 +355,12 @@
case_name = #{record.caseName,jdbcType=VARCHAR}, case_name = #{record.caseName,jdbcType=VARCHAR},
`system` = #{record.system,jdbcType=BIT}, `system` = #{record.system,jdbcType=BIT},
`global` = #{record.global,jdbcType=BIT}, `global` = #{record.global,jdbcType=BIT},
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
prerequisite = #{record.prerequisite,jdbcType=VARCHAR}, prerequisite = #{record.prerequisite,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT},
step_model = #{record.stepModel,jdbcType=VARCHAR}, step_model = #{record.stepModel,jdbcType=VARCHAR},
create_user = #{record.createUser,jdbcType=VARCHAR} create_user = #{record.createUser,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -386,9 +386,6 @@
<if test="global != null"> <if test="global != null">
`global` = #{global,jdbcType=BIT}, `global` = #{global,jdbcType=BIT},
</if> </if>
<if test="workspaceId != null">
workspace_id = #{workspaceId,jdbcType=VARCHAR},
</if>
<if test="prerequisite != null"> <if test="prerequisite != null">
prerequisite = #{prerequisite,jdbcType=VARCHAR}, prerequisite = #{prerequisite,jdbcType=VARCHAR},
</if> </if>
@ -404,6 +401,9 @@
<if test="createUser != null"> <if test="createUser != null">
create_user = #{createUser,jdbcType=VARCHAR}, create_user = #{createUser,jdbcType=VARCHAR},
</if> </if>
<if test="projectId != null">
project_id = #{projectId,jdbcType=VARCHAR},
</if>
<if test="stepDescription != null"> <if test="stepDescription != null">
step_description = #{stepDescription,jdbcType=LONGVARCHAR}, step_description = #{stepDescription,jdbcType=LONGVARCHAR},
</if> </if>
@ -427,12 +427,12 @@
case_name = #{caseName,jdbcType=VARCHAR}, case_name = #{caseName,jdbcType=VARCHAR},
`system` = #{system,jdbcType=BIT}, `system` = #{system,jdbcType=BIT},
`global` = #{global,jdbcType=BIT}, `global` = #{global,jdbcType=BIT},
workspace_id = #{workspaceId,jdbcType=VARCHAR},
prerequisite = #{prerequisite,jdbcType=VARCHAR}, prerequisite = #{prerequisite,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT},
step_model = #{stepModel,jdbcType=VARCHAR}, step_model = #{stepModel,jdbcType=VARCHAR},
create_user = #{createUser,jdbcType=VARCHAR}, create_user = #{createUser,jdbcType=VARCHAR},
project_id = #{projectId,jdbcType=VARCHAR},
step_description = #{stepDescription,jdbcType=LONGVARCHAR}, step_description = #{stepDescription,jdbcType=LONGVARCHAR},
expected_result = #{expectedResult,jdbcType=LONGVARCHAR}, expected_result = #{expectedResult,jdbcType=LONGVARCHAR},
actual_result = #{actualResult,jdbcType=LONGVARCHAR}, actual_result = #{actualResult,jdbcType=LONGVARCHAR},
@ -447,12 +447,12 @@
case_name = #{caseName,jdbcType=VARCHAR}, case_name = #{caseName,jdbcType=VARCHAR},
`system` = #{system,jdbcType=BIT}, `system` = #{system,jdbcType=BIT},
`global` = #{global,jdbcType=BIT}, `global` = #{global,jdbcType=BIT},
workspace_id = #{workspaceId,jdbcType=VARCHAR},
prerequisite = #{prerequisite,jdbcType=VARCHAR}, prerequisite = #{prerequisite,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT},
step_model = #{stepModel,jdbcType=VARCHAR}, step_model = #{stepModel,jdbcType=VARCHAR},
create_user = #{createUser,jdbcType=VARCHAR} create_user = #{createUser,jdbcType=VARCHAR},
project_id = #{projectId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
</mapper> </mapper>

View File

@ -50,6 +50,19 @@
) )
) )
</if> </if>
<if test="request.projectId != null">
and (
cf.project_id = #{request.projectId}
or (
cf.global = 1 and
not exists (
select id
from custom_field cf_child
where cf_child.name = cf.name and cf_child.scene = cf.scene and cf_child.global != 1 and cf_child.project_id = #{request.projectId}
)
)
)
</if>
<if test="request.ids != null and request.ids.size() > 0"> <if test="request.ids != null and request.ids.size() > 0">
and cf.id in and cf.id in

View File

@ -31,6 +31,19 @@
) )
) )
</if> </if>
<if test="request.projectId != null">
and (
it.project_id = #{request.projectId}
or (
it.global = 1 and
not exists (
select id
from issue_template it_child
where it_child.name = it.name and it_child.global != 1 and it_child.project_id = #{request.projectId}
)
)
)
</if>
<if test="request.filters != null and request.filters.size() > 0"> <if test="request.filters != null and request.filters.size() > 0">
<foreach collection="request.filters.entrySet()" index="key" item="values"> <foreach collection="request.filters.entrySet()" index="key" item="values">

View File

@ -34,7 +34,9 @@ public interface ExtProjectMapper {
long getProjectMemberSize(@Param("projectId") String projectId); long getProjectMemberSize(@Param("projectId") String projectId);
List<Project>getProjectByUserId(@Param("userId")String userId); List<Project> getProjectByUserId(@Param("userId") String userId);
int getProjectPlanBugSize(@Param("projectId") String projectId); int getProjectPlanBugSize(@Param("projectId") String projectId);
void setDefaultMessageTask(@Param("projectId") String projectId);
} }

View File

@ -257,4 +257,118 @@
and (issues.status != 'closed' or issues.status is null) and (issues.status != 'closed' or issues.status is null)
and test_case.status != 'Trash'; and test_case.status != 'Trash';
</select> </select>
<insert id="setDefaultMessageTask">
INSERT INTO message_task (id, type, event, user_id, task_type, webhook, identification, is_set, project_id,
test_id, create_time, template)
VALUES (UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'PERFORMANCE_TEST_TASK', '',
'ce692111-166b-491a-ae69-f047c31de971', 0,
#{projectId}, NULL, 1629686472659, NULL),
(UUID(), 'IN_SITE', 'COMPLETE', 'CREATOR', 'REVIEW_TASK',
'',
'72836b2d-4c2f-4185-95aa-1894c6f0d1c3', 0, #{projectId}, NULL, 1629697096803,
NULL),
(UUID(), 'IN_SITE', 'CLOSE_SCHEDULE', 'CREATOR', 'TRACK_HOME_TASK', '',
'ceb0aeb5-f194-4183-a995-3607a769c61d',
0, #{projectId}, NULL, 1629705930753, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'API_AUTOMATION_TASK', '',
'e2865464-0da3-42bc-a041-7d21bd70d339', 0,
#{projectId}, NULL, 1629446356866, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'FOLLOW_PEOPLE', 'PERFORMANCE_TEST_TASK', '',
'79d7dcdc-68a2-47a2-9ef5-21fdf9bde65c', 0, #{projectId}, NULL, 1629446379928,
NULL),
(UUID(), 'IN_SITE', 'CLOSE_SCHEDULE', 'CREATOR', 'API_HOME_TASK', '',
'dbe5dfcd-927f-4065-93cf-22f33d9570ac', 0,
#{projectId}, NULL, 1629446330438, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'FOLLOW_PEOPLE', 'TRACK_TEST_CASE_TASK', '',
'3a632784-c73b-4f5f-824c-bdf4fccf6f4d', 0, #{projectId}, NULL, 1629705939795,
NULL),
(UUID(), 'IN_SITE', 'CASE_UPDATE', 'FOLLOW_PEOPLE', 'API_DEFINITION_TASK', '',
'a6a3979a-bd80-414c-a253-06f0364c434f', 0, #{projectId}, NULL, 1629446346104,
NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'FOLLOW_PEOPLE', 'API_AUTOMATION_TASK', '',
'019de091-1a19-4b30-bd5e-23b83bc820fb',
0, #{projectId}, NULL, 1629618010742, NULL),
(UUID(), 'IN_SITE', 'CASE_UPDATE', 'CREATOR', 'API_DEFINITION_TASK', '',
'a6a3979a-bd80-414c-a253-06f0364c434f',
0, #{projectId}, NULL, 1629446346104, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'DEFECT_TASK', '', '66568b56-4f9e-4bf6-8621-7402403368b9', 0,
#{projectId}, NULL, 1629446306675, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'FOLLOW_PEOPLE', 'PERFORMANCE_TEST_TASK', '',
'ce692111-166b-491a-ae69-f047c31de971', 0, #{projectId}, NULL, 1629686472659,
NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'DEFECT_TASK', '', '3a913f72-7cee-4e36-ae1d-0443c7cb5f97', 0,
#{projectId}, NULL, 1629699608062, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'FOLLOW_PEOPLE', 'API_DEFINITION_TASK', '',
'7ca324cd-7113-412b-8714-5cbe1bffa535',
0, #{projectId}, NULL, 1629706088088, NULL),
(UUID(), 'IN_SITE', 'CASE_DELETE', 'CREATOR', 'API_DEFINITION_TASK', '',
'aeb9d21a-855c-44d3-a715-dfb1bba8ad6c',
0, #{projectId}, NULL, 1629446334332, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'API_REPORT_TASK', '', '4d3309f3-7ab2-492e-b9c9-1127c3e005d1',
0,
#{projectId}, NULL, 1629446364391, NULL),
(UUID(), 'IN_SITE', 'COMMENT', 'CREATOR', 'TRACK_TEST_CASE_TASK', '',
'2e8db54f-2d39-42a6-9832-43bb3384e7d5', 0,
#{projectId}, NULL, 1629446247833, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'API_DEFINITION_TASK', '',
'90f2be5d-0a71-44f0-a750-f16bf39d690b', 0,
#{projectId}, NULL, 1629446338557, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'PERFORMANCE_REPORT_TASK', '',
'4c1bfa4a-b02b-4e8e-bc09-b13613723a11',
0, #{projectId}, NULL, 1629446384995, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'API_AUTOMATION_TASK', '',
'019de091-1a19-4b30-bd5e-23b83bc820fb', 0,
#{projectId}, NULL, 1629618010742, NULL),
(UUID(), 'IN_SITE', 'COMPLETE', 'CREATOR', 'TEST_PLAN_TASK', '', '86b42beb-a86f-4ff3-a73c-d25112c2f104',
0,
#{projectId}, NULL, 1629446286106, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'PERFORMANCE_TEST_TASK', '',
'79d7dcdc-68a2-47a2-9ef5-21fdf9bde65c', 0,
#{projectId}, NULL, 1629446379928, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'TRACK_TEST_CASE_TASK', '',
'3a632784-c73b-4f5f-824c-bdf4fccf6f4d', 0,
#{projectId}, NULL, 1629705939795, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'API_DEFINITION_TASK', '',
'7ca324cd-7113-412b-8714-5cbe1bffa535', 0,
#{projectId}, NULL, 1629706088088, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'TEST_PLAN_TASK', '', '04ea4fbd-a392-4f80-a61c-51d31a302cac', 0,
#{projectId}, NULL, 1629446289522, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'REVIEW_TASK', '', 'db515209-f864-46d3-a2e5-63db6d1339c3', 0,
#{projectId}, NULL, 1629446276516, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'TRACK_REPORT_TASK', '', 'ea2fee85-8a44-413a-a128-16bfa01ada0d',
0,
#{projectId}, NULL, 1629283758941, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'REVIEW_TASK', '', 'f9b1f60b-6dee-48af-8217-0428b27dcbab', 0,
#{projectId}, NULL, 1629446272477, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'TRACK_TEST_CASE_TASK', '',
'7c26254e-85e9-4269-be13-a2ffcfe0b9f5', 0,
#{projectId}, NULL, 1629446251939, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'FOLLOW_PEOPLE', 'TRACK_TEST_CASE_TASK', '',
'7c26254e-85e9-4269-be13-a2ffcfe0b9f5', 0, #{projectId}, NULL, 1629446251939,
NULL),
(UUID(), 'IN_SITE', 'EXECUTE_SUCCESSFUL', 'CREATOR', 'API_DEFINITION_TASK', '',
'7efddbdb-2b6c-4425-96a4-0bc2aa9e2cd2', 0, #{projectId}, NULL, 1629775183917,
NULL),
(UUID(), 'IN_SITE', 'EXECUTE_FAILED', 'CREATOR', 'API_DEFINITION_TASK', '',
'e508035c-1318-40ea-9457-0bbe9865f4ce', 0, #{projectId}, NULL, 1629775194857,
NULL),
(UUID(), 'IN_SITE', 'EXECUTE_COMPLETED', 'CREATOR', 'PERFORMANCE_TEST_TASK', '',
'e3db90c6-fb49-4e89-bc25-1d14b5ce94d0', 0, #{projectId}, NULL, 1629790602744,
NULL),
(UUID(), 'IN_SITE', 'EXECUTE_FAILED', 'CREATOR', 'API_AUTOMATION_TASK', '',
'c25930e8-b617-45f7-af5e-cc94adc14192', 0, #{projectId}, NULL, 1629780485724,
NULL),
(UUID(), 'IN_SITE', 'EXECUTE_SUCCESSFUL', 'CREATOR', 'API_AUTOMATION_TASK', '',
'9f91e5e5-1744-4160-bfc6-3851bfd59e05', 0, #{projectId}, NULL, 1629780475764,
NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'PROCESSOR', 'DEFECT_TASK', '',
'6cad944e-db8d-4786-9ef3-7d6370940325', 0, #{projectId}, NULL, 1629791388405,
NULL),
(UUID(), 'IN_SITE', 'CREATE', 'PROCESSOR', 'DEFECT_TASK', '',
'4a890e41-e755-44fc-b734-d6a0ca25a65c', 0, #{projectId}, NULL, 1629790487682,
NULL)
</insert>
</mapper> </mapper>

View File

@ -30,6 +30,19 @@
) )
) )
</if> </if>
<if test="request.projectId != null">
and (
tcft.project_id = #{request.projectId}
or (
tcft.global = 1 and
not exists (
select id
from test_case_template tcft_child
where tcft_child.name = tcft.name and tcft_child.global != 1 and tcft_child.project_id = #{request.projectId}
)
)
)
</if>
<if test="request.filters != null and request.filters.size() > 0"> <if test="request.filters != null and request.filters.size() > 0">
<foreach collection="request.filters.entrySet()" index="key" item="values"> <foreach collection="request.filters.entrySet()" index="key" item="values">

View File

@ -11,7 +11,5 @@ public interface ExtWorkspaceMapper {
List<WorkspaceDTO> getWorkspaces(@Param("request") WorkspaceRequest request); List<WorkspaceDTO> getWorkspaces(@Param("request") WorkspaceRequest request);
void setDefaultMessageTask(@Param("workspaceId") String workspaceId);
List<Workspace> getWorkspaceByUserId(@Param("userId")String userId); List<Workspace> getWorkspaceByUserId(@Param("userId")String userId);
} }

View File

@ -13,118 +13,6 @@
order by w.update_time desc order by w.update_time desc
</select> </select>
<insert id="setDefaultMessageTask">
INSERT INTO message_task (id, type, event, user_id, task_type, webhook, identification, is_set, workspace_id,
test_id, create_time, template)
VALUES (UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'PERFORMANCE_TEST_TASK', '',
'ce692111-166b-491a-ae69-f047c31de971', 0,
#{workspaceId}, NULL, 1629686472659, NULL),
(UUID(), 'IN_SITE', 'COMPLETE', 'CREATOR', 'REVIEW_TASK',
'',
'72836b2d-4c2f-4185-95aa-1894c6f0d1c3', 0, #{workspaceId}, NULL, 1629697096803,
NULL),
(UUID(), 'IN_SITE', 'CLOSE_SCHEDULE', 'CREATOR', 'TRACK_HOME_TASK', '',
'ceb0aeb5-f194-4183-a995-3607a769c61d',
0, #{workspaceId}, NULL, 1629705930753, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'API_AUTOMATION_TASK', '',
'e2865464-0da3-42bc-a041-7d21bd70d339', 0,
#{workspaceId}, NULL, 1629446356866, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'FOLLOW_PEOPLE', 'PERFORMANCE_TEST_TASK', '',
'79d7dcdc-68a2-47a2-9ef5-21fdf9bde65c', 0, #{workspaceId}, NULL, 1629446379928,
NULL),
(UUID(), 'IN_SITE', 'CLOSE_SCHEDULE', 'CREATOR', 'API_HOME_TASK', '',
'dbe5dfcd-927f-4065-93cf-22f33d9570ac', 0,
#{workspaceId}, NULL, 1629446330438, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'FOLLOW_PEOPLE', 'TRACK_TEST_CASE_TASK', '',
'3a632784-c73b-4f5f-824c-bdf4fccf6f4d', 0, #{workspaceId}, NULL, 1629705939795,
NULL),
(UUID(), 'IN_SITE', 'CASE_UPDATE', 'FOLLOW_PEOPLE', 'API_DEFINITION_TASK', '',
'a6a3979a-bd80-414c-a253-06f0364c434f', 0, #{workspaceId}, NULL, 1629446346104,
NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'FOLLOW_PEOPLE', 'API_AUTOMATION_TASK', '',
'019de091-1a19-4b30-bd5e-23b83bc820fb',
0, #{workspaceId}, NULL, 1629618010742, NULL),
(UUID(), 'IN_SITE', 'CASE_UPDATE', 'CREATOR', 'API_DEFINITION_TASK', '',
'a6a3979a-bd80-414c-a253-06f0364c434f',
0, #{workspaceId}, NULL, 1629446346104, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'DEFECT_TASK', '', '66568b56-4f9e-4bf6-8621-7402403368b9', 0,
#{workspaceId}, NULL, 1629446306675, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'FOLLOW_PEOPLE', 'PERFORMANCE_TEST_TASK', '',
'ce692111-166b-491a-ae69-f047c31de971', 0, #{workspaceId}, NULL, 1629686472659,
NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'DEFECT_TASK', '', '3a913f72-7cee-4e36-ae1d-0443c7cb5f97', 0,
#{workspaceId}, NULL, 1629699608062, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'FOLLOW_PEOPLE', 'API_DEFINITION_TASK', '',
'7ca324cd-7113-412b-8714-5cbe1bffa535',
0, #{workspaceId}, NULL, 1629706088088, NULL),
(UUID(), 'IN_SITE', 'CASE_DELETE', 'CREATOR', 'API_DEFINITION_TASK', '',
'aeb9d21a-855c-44d3-a715-dfb1bba8ad6c',
0, #{workspaceId}, NULL, 1629446334332, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'API_REPORT_TASK', '', '4d3309f3-7ab2-492e-b9c9-1127c3e005d1',
0,
#{workspaceId}, NULL, 1629446364391, NULL),
(UUID(), 'IN_SITE', 'COMMENT', 'CREATOR', 'TRACK_TEST_CASE_TASK', '',
'2e8db54f-2d39-42a6-9832-43bb3384e7d5', 0,
#{workspaceId}, NULL, 1629446247833, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'API_DEFINITION_TASK', '',
'90f2be5d-0a71-44f0-a750-f16bf39d690b', 0,
#{workspaceId}, NULL, 1629446338557, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'PERFORMANCE_REPORT_TASK', '',
'4c1bfa4a-b02b-4e8e-bc09-b13613723a11',
0, #{workspaceId}, NULL, 1629446384995, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'API_AUTOMATION_TASK', '',
'019de091-1a19-4b30-bd5e-23b83bc820fb', 0,
#{workspaceId}, NULL, 1629618010742, NULL),
(UUID(), 'IN_SITE', 'COMPLETE', 'CREATOR', 'TEST_PLAN_TASK', '', '86b42beb-a86f-4ff3-a73c-d25112c2f104',
0,
#{workspaceId}, NULL, 1629446286106, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'PERFORMANCE_TEST_TASK', '',
'79d7dcdc-68a2-47a2-9ef5-21fdf9bde65c', 0,
#{workspaceId}, NULL, 1629446379928, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'TRACK_TEST_CASE_TASK', '',
'3a632784-c73b-4f5f-824c-bdf4fccf6f4d', 0,
#{workspaceId}, NULL, 1629705939795, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'API_DEFINITION_TASK', '',
'7ca324cd-7113-412b-8714-5cbe1bffa535', 0,
#{workspaceId}, NULL, 1629706088088, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'TEST_PLAN_TASK', '', '04ea4fbd-a392-4f80-a61c-51d31a302cac', 0,
#{workspaceId}, NULL, 1629446289522, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'REVIEW_TASK', '', 'db515209-f864-46d3-a2e5-63db6d1339c3', 0,
#{workspaceId}, NULL, 1629446276516, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'TRACK_REPORT_TASK', '', 'ea2fee85-8a44-413a-a128-16bfa01ada0d',
0,
#{workspaceId}, NULL, 1629283758941, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'REVIEW_TASK', '', 'f9b1f60b-6dee-48af-8217-0428b27dcbab', 0,
#{workspaceId}, NULL, 1629446272477, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'TRACK_TEST_CASE_TASK', '',
'7c26254e-85e9-4269-be13-a2ffcfe0b9f5', 0,
#{workspaceId}, NULL, 1629446251939, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'FOLLOW_PEOPLE', 'TRACK_TEST_CASE_TASK', '',
'7c26254e-85e9-4269-be13-a2ffcfe0b9f5', 0, #{workspaceId}, NULL, 1629446251939,
NULL),
(UUID(), 'IN_SITE', 'EXECUTE_SUCCESSFUL', 'CREATOR', 'API_DEFINITION_TASK', '',
'7efddbdb-2b6c-4425-96a4-0bc2aa9e2cd2', 0, #{workspaceId}, NULL, 1629775183917,
NULL),
(UUID(), 'IN_SITE', 'EXECUTE_FAILED', 'CREATOR', 'API_DEFINITION_TASK', '',
'e508035c-1318-40ea-9457-0bbe9865f4ce', 0, #{workspaceId}, NULL, 1629775194857,
NULL),
(UUID(), 'IN_SITE', 'EXECUTE_COMPLETED', 'CREATOR', 'PERFORMANCE_TEST_TASK', '',
'e3db90c6-fb49-4e89-bc25-1d14b5ce94d0', 0, #{workspaceId}, NULL, 1629790602744,
NULL),
(UUID(), 'IN_SITE', 'EXECUTE_FAILED', 'CREATOR', 'API_AUTOMATION_TASK', '',
'c25930e8-b617-45f7-af5e-cc94adc14192', 0, #{workspaceId}, NULL, 1629780485724,
NULL),
(UUID(), 'IN_SITE', 'EXECUTE_SUCCESSFUL', 'CREATOR', 'API_AUTOMATION_TASK', '',
'9f91e5e5-1744-4160-bfc6-3851bfd59e05', 0, #{workspaceId}, NULL, 1629780475764,
NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'PROCESSOR', 'DEFECT_TASK', '',
'6cad944e-db8d-4786-9ef3-7d6370940325', 0, #{workspaceId}, NULL, 1629791388405,
NULL),
(UUID(), 'IN_SITE', 'CREATE', 'PROCESSOR', 'DEFECT_TASK', '',
'4a890e41-e755-44fc-b734-d6a0ca25a65c', 0, #{workspaceId}, NULL, 1629790487682,
NULL)
</insert>
<select id="getWorkspaceByUserId" resultType="io.metersphere.base.domain.Workspace"> <select id="getWorkspaceByUserId" resultType="io.metersphere.base.domain.Workspace">
SELECT * from workspace where workspace.id in (SELECT user_group.source_id from user_group where user_group.user_id = #{userId}) SELECT * from workspace where workspace.id in (SELECT user_group.source_id from user_group where user_group.user_id = #{userId})
</select> </select>

View File

@ -41,21 +41,12 @@ public class PermissionConstants {
public static final String WORKSPACE_SERVICE_READ = "WORKSPACE_SERVICE:READ"; public static final String WORKSPACE_SERVICE_READ = "WORKSPACE_SERVICE:READ";
public static final String WORKSPACE_SERVICE_READ_EDIT = "WORKSPACE_SERVICE:READ+EDIT"; public static final String WORKSPACE_SERVICE_READ_EDIT = "WORKSPACE_SERVICE:READ+EDIT";
public static final String WORKSPACE_MESSAGE_READ = "WORKSPACE_MESSAGE:READ";
public static final String WORKSPACE_MESSAGE_READ_EDIT = "WORKSPACE_MESSAGE:READ+EDIT";
public static final String WORKSPACE_USER_READ = "WORKSPACE_USER:READ"; public static final String WORKSPACE_USER_READ = "WORKSPACE_USER:READ";
public static final String WORKSPACE_USER_READ_CREATE = "WORKSPACE_USER:READ+CREATE"; public static final String WORKSPACE_USER_READ_CREATE = "WORKSPACE_USER:READ+CREATE";
public static final String WORKSPACE_USER_READ_EDIT = "WORKSPACE_USER:READ+EDIT"; public static final String WORKSPACE_USER_READ_EDIT = "WORKSPACE_USER:READ+EDIT";
public static final String WORKSPACE_USER_READ_DELETE = "WORKSPACE_USER:READ+DELETE"; public static final String WORKSPACE_USER_READ_DELETE = "WORKSPACE_USER:READ+DELETE";
public static final String WORKSPACE_TEMPLATE_READ = "WORKSPACE_TEMPLATE:READ";
public static final String WORKSPACE_TEMPLATE_READ_CASE_TEMPLATE = "WORKSPACE_TEMPLATE:READ+CASE_TEMPLATE";
public static final String WORKSPACE_TEMPLATE_READ_ISSUE_TEMPLATE = "WORKSPACE_TEMPLATE:READ+ISSUE_TEMPLATE";
public static final String WORKSPACE_TEMPLATE_READ_CUSTOM = "WORKSPACE_TEMPLATE:READ+CUSTOM";
public static final String WORKSPACE_TEMPLATE_READ_REPORT_TEMPLATE = "WORKSPACE_TEMPLATE:READ+REPORT_TEMPLATE";
public static final String WORKSPACE_PROJECT_MANAGER_READ = "WORKSPACE_PROJECT_MANAGER:READ"; public static final String WORKSPACE_PROJECT_MANAGER_READ = "WORKSPACE_PROJECT_MANAGER:READ";
public static final String WORKSPACE_PROJECT_MANAGER_READ_CREATE = "WORKSPACE_PROJECT_MANAGER:READ+CREATE"; public static final String WORKSPACE_PROJECT_MANAGER_READ_CREATE = "WORKSPACE_PROJECT_MANAGER:READ+CREATE";
public static final String WORKSPACE_PROJECT_MANAGER_READ_EDIT = "WORKSPACE_PROJECT_MANAGER:READ+EDIT"; public static final String WORKSPACE_PROJECT_MANAGER_READ_EDIT = "WORKSPACE_PROJECT_MANAGER:READ+EDIT";
@ -184,4 +175,12 @@ public class PermissionConstants {
public static final String PROJECT_ERROR_REPORT_LIBRARY_DELETE = "PROJECT_ERROR_REPORT_LIBRARY:READ+DELETE"; public static final String PROJECT_ERROR_REPORT_LIBRARY_DELETE = "PROJECT_ERROR_REPORT_LIBRARY:READ+DELETE";
public static final String PROJECT_ERROR_REPORT_LIBRARY_COPY = "PROJECT_ERROR_REPORT_LIBRARY:READ+COPY"; public static final String PROJECT_ERROR_REPORT_LIBRARY_COPY = "PROJECT_ERROR_REPORT_LIBRARY:READ+COPY";
public static final String PROJECT_ERROR_REPORT_LIBRARY_SCHEDULE = "PROJECT_ERROR_REPORT_LIBRARY:READ+SCHEDULE"; public static final String PROJECT_ERROR_REPORT_LIBRARY_SCHEDULE = "PROJECT_ERROR_REPORT_LIBRARY:READ+SCHEDULE";
public static final String PROJECT_MESSAGE_READ = "PROJECT_MESSAGE:READ";
public static final String PROJECT_MESSAGE_READ_EDIT = "PROJECT_MESSAGE:READ+EDIT";
public static final String PROJECT_TEMPLATE_READ = "PROJECT_TEMPLATE:READ";
public static final String PROJECT_TEMPLATE_READ_CASE_TEMPLATE = "PROJECT_TEMPLATE:READ+CASE_TEMPLATE";
public static final String PROJECT_TEMPLATE_READ_ISSUE_TEMPLATE = "PROJECT_TEMPLATE:READ+ISSUE_TEMPLATE";
public static final String PROJECT_TEMPLATE_READ_CUSTOM = "PROJECT_TEMPLATE:READ+CUSTOM";
public static final String PROJECT_TEMPLATE_READ_REPORT_TEMPLATE = "PROJECT_TEMPLATE:READ+REPORT_TEMPLATE";
} }

View File

@ -48,9 +48,9 @@ public class IssueTemplateController {
issueTemplateService.update(request); issueTemplateService.update(request);
} }
@GetMapping("/option/{workspaceId}") @GetMapping("/option/{projectId}")
public List<IssueTemplate> list(@PathVariable String workspaceId) { public List<IssueTemplate> list(@PathVariable String projectId) {
return issueTemplateService.getOption(workspaceId); return issueTemplateService.getOption(projectId);
} }
@GetMapping("/get/relate/{projectId}") @GetMapping("/get/relate/{projectId}")

View File

@ -50,9 +50,9 @@ public class TestCaseTemplateController {
testCaseTemplateService.update(request); testCaseTemplateService.update(request);
} }
@GetMapping("/option/{workspaceId}") @GetMapping("/option/{projectId}")
public List<TestCaseTemplate> list(@PathVariable String workspaceId) { public List<TestCaseTemplate> list(@PathVariable String projectId) {
return testCaseTemplateService.getOption(workspaceId); return testCaseTemplateService.getOption(projectId);
} }
@GetMapping("/get/relate/{projectId}") @GetMapping("/get/relate/{projectId}")

View File

@ -98,7 +98,7 @@ public class NoticeSendService {
if (StringUtils.equals(triggerMode, NoticeConstants.Mode.API)) { if (StringUtils.equals(triggerMode, NoticeConstants.Mode.API)) {
String projectId = (String) noticeModel.getParamMap().get("projectId"); String projectId = (String) noticeModel.getParamMap().get("projectId");
messageDetails = noticeService.searchMessageByTypeBySend(NoticeConstants.TaskType.JENKINS_TASK, projectId); messageDetails = noticeService.searchMessageByTypeAndProjectId(NoticeConstants.TaskType.JENKINS_TASK, projectId);
} }
// 异步发送通知 // 异步发送通知
@ -132,7 +132,7 @@ public class NoticeSendService {
// default: // default:
// break; // break;
// } // }
messageDetails = noticeService.searchMessageByTypeAndWorkspaceId(taskType, project.getWorkspaceId()); messageDetails = noticeService.searchMessageByTypeAndProjectId(taskType, project.getId());
// 异步发送通知 // 异步发送通知
messageDetails.stream() messageDetails.stream()

View File

@ -3,7 +3,6 @@ package io.metersphere.notice.service;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import io.metersphere.base.domain.MessageTask; import io.metersphere.base.domain.MessageTask;
import io.metersphere.base.domain.MessageTaskExample; import io.metersphere.base.domain.MessageTaskExample;
import io.metersphere.base.domain.Project;
import io.metersphere.base.mapper.MessageTaskMapper; import io.metersphere.base.mapper.MessageTaskMapper;
import io.metersphere.base.mapper.ProjectMapper; import io.metersphere.base.mapper.ProjectMapper;
import io.metersphere.commons.exception.MSException; import io.metersphere.commons.exception.MSException;
@ -40,14 +39,14 @@ public class NoticeService {
if (messageTaskLists.size() > 0) { if (messageTaskLists.size() > 0) {
delMessage(messageDetail.getIdentification()); delMessage(messageDetail.getIdentification());
} }
String workspaceId = SessionUtils.getCurrentWorkspaceId(); String projectId = SessionUtils.getCurrentProjectId();
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
String identification = messageDetail.getIdentification(); String identification = messageDetail.getIdentification();
if (StringUtils.isBlank(identification)) { if (StringUtils.isBlank(identification)) {
identification = UUID.randomUUID().toString(); identification = UUID.randomUUID().toString();
} }
for (String userId : messageDetail.getUserIds()) { for (String userId : messageDetail.getUserIds()) {
checkUserIdExist(userId, messageDetail, workspaceId); checkUserIdExist(userId, messageDetail, projectId);
MessageTask messageTask = new MessageTask(); MessageTask messageTask = new MessageTask();
messageTask.setId(UUID.randomUUID().toString()); messageTask.setId(UUID.randomUUID().toString());
messageTask.setEvent(messageDetail.getEvent()); messageTask.setEvent(messageDetail.getEvent());
@ -57,7 +56,7 @@ public class NoticeService {
messageTask.setWebhook(messageDetail.getWebhook()); messageTask.setWebhook(messageDetail.getWebhook());
messageTask.setIdentification(identification); messageTask.setIdentification(identification);
messageTask.setIsSet(false); messageTask.setIsSet(false);
messageTask.setWorkspaceId(workspaceId); messageTask.setProjectId(projectId);
messageTask.setTestId(messageDetail.getTestId()); messageTask.setTestId(messageDetail.getTestId());
messageTask.setCreateTime(time); messageTask.setCreateTime(time);
setTemplate(messageDetail, messageTask); setTemplate(messageDetail, messageTask);
@ -72,7 +71,7 @@ public class NoticeService {
} }
} }
private void checkUserIdExist(String userId, MessageDetail list, String workspaceId) { private void checkUserIdExist(String userId, MessageDetail list, String projectId) {
MessageTaskExample example = new MessageTaskExample(); MessageTaskExample example = new MessageTaskExample();
if (StringUtils.isBlank(list.getTestId())) { if (StringUtils.isBlank(list.getTestId())) {
example.createCriteria() example.createCriteria()
@ -81,7 +80,7 @@ public class NoticeService {
.andTypeEqualTo(list.getType()) .andTypeEqualTo(list.getType())
.andTaskTypeEqualTo(list.getTaskType()) .andTaskTypeEqualTo(list.getTaskType())
.andWebhookEqualTo(list.getWebhook()) .andWebhookEqualTo(list.getWebhook())
.andWorkspaceIdEqualTo(workspaceId); .andProjectIdEqualTo(projectId);
} else { } else {
example.createCriteria() example.createCriteria()
.andUserIdEqualTo(userId) .andUserIdEqualTo(userId)
@ -90,7 +89,7 @@ public class NoticeService {
.andTaskTypeEqualTo(list.getTaskType()) .andTaskTypeEqualTo(list.getTaskType())
.andWebhookEqualTo(list.getWebhook()) .andWebhookEqualTo(list.getWebhook())
.andTestIdEqualTo(list.getTestId()) .andTestIdEqualTo(list.getTestId())
.andWorkspaceIdEqualTo(workspaceId); .andProjectIdEqualTo(projectId);
} }
if (messageTaskMapper.countByExample(example) > 0) { if (messageTaskMapper.countByExample(example) > 0) {
MSException.throwException(Translator.get("message_task_already_exists")); MSException.throwException(Translator.get("message_task_already_exists"));
@ -113,8 +112,8 @@ public class NoticeService {
public List<MessageDetail> searchMessageByType(String type) { public List<MessageDetail> searchMessageByType(String type) {
try { try {
String workspaceId = SessionUtils.getCurrentWorkspaceId(); String projectId = SessionUtils.getCurrentProjectId();
return getMessageDetails(type, workspaceId); return getMessageDetails(type, projectId);
} catch (Exception e) { } catch (Exception e) {
LogUtil.error(e.getMessage(), e); LogUtil.error(e.getMessage(), e);
return new ArrayList<>(); return new ArrayList<>();
@ -122,38 +121,22 @@ public class NoticeService {
} }
public List<MessageDetail> searchMessageByTypeAndWorkspaceId(String type, String workspaceId) { public List<MessageDetail> searchMessageByTypeAndProjectId(String type, String projectId) {
try { try {
return getMessageDetails(type, workspaceId); return getMessageDetails(type, projectId);
} catch (Exception e) { } catch (Exception e) {
LogUtil.error(e.getMessage(), e); LogUtil.error(e.getMessage(), e);
return new ArrayList<>(); return new ArrayList<>();
} }
} }
public List<MessageDetail> searchMessageByTypeBySend(String type, String projectId) { private List<MessageDetail> getMessageDetails(String type, String projectId) {
try {
String workspaceId = "";
if (null == SessionUtils.getCurrentWorkspaceId()) {
Project project = projectMapper.selectByPrimaryKey(projectId);
workspaceId = project.getWorkspaceId();
} else {
workspaceId = SessionUtils.getCurrentWorkspaceId();
}
return getMessageDetails(type, workspaceId);
} catch (Exception e) {
LogUtil.error(e.getMessage(), e);
return new ArrayList<>();
}
}
private List<MessageDetail> getMessageDetails(String type, String workspaceId) {
List<MessageDetail> messageDetails = new ArrayList<>(); List<MessageDetail> messageDetails = new ArrayList<>();
MessageTaskExample example = new MessageTaskExample(); MessageTaskExample example = new MessageTaskExample();
example.createCriteria() example.createCriteria()
.andTaskTypeEqualTo(type) .andTaskTypeEqualTo(type)
.andWorkspaceIdEqualTo(workspaceId); .andProjectIdEqualTo(projectId);
List<MessageTask> messageTaskLists = messageTaskMapper.selectByExampleWithBLOBs(example); List<MessageTask> messageTaskLists = messageTaskMapper.selectByExampleWithBLOBs(example);
Map<String, List<MessageTask>> messageTaskMap = messageTaskLists.stream() Map<String, List<MessageTask>> messageTaskMap = messageTaskLists.stream()

View File

@ -153,7 +153,7 @@ public class CustomFieldService {
example.createCriteria() example.createCriteria()
.andSystemEqualTo(true) .andSystemEqualTo(true)
.andSceneEqualTo(request.getScene()) .andSceneEqualTo(request.getScene())
.andWorkspaceIdEqualTo(request.getWorkspaceId()); .andProjectIdEqualTo(request.getProjectId());
List<CustomField> workspaceSystemFields = customFieldMapper.selectByExampleWithBLOBs(example); List<CustomField> workspaceSystemFields = customFieldMapper.selectByExampleWithBLOBs(example);
Set<String> workspaceSystemFieldNames = workspaceSystemFields.stream() Set<String> workspaceSystemFieldNames = workspaceSystemFields.stream()
.map(CustomField::getName) .map(CustomField::getName)
@ -189,7 +189,7 @@ public class CustomFieldService {
CustomFieldExample example = new CustomFieldExample(); CustomFieldExample example = new CustomFieldExample();
CustomFieldExample.Criteria criteria = example.createCriteria(); CustomFieldExample.Criteria criteria = example.createCriteria();
criteria.andNameEqualTo(customField.getName()); criteria.andNameEqualTo(customField.getName());
criteria.andWorkspaceIdEqualTo(customField.getWorkspaceId()); criteria.andProjectIdEqualTo(customField.getProjectId());
criteria.andSceneEqualTo(customField.getScene()); criteria.andSceneEqualTo(customField.getScene());
if (StringUtils.isNotBlank(customField.getId())) { if (StringUtils.isNotBlank(customField.getId())) {
criteria.andIdNotEqualTo(customField.getId()); criteria.andIdNotEqualTo(customField.getId());

View File

@ -91,7 +91,7 @@ public class IssueTemplateService extends TemplateBaseService {
String originId = request.getId(); String originId = request.getId();
// 如果是全局字段则创建对应工作空间字段 // 如果是全局字段则创建对应工作空间字段
String id = add(request); String id = add(request);
projectService.updateIssueTemplate(originId, id, request.getWorkspaceId()); projectService.updateIssueTemplate(originId, id, request.getProjectId());
} else { } else {
checkExist(request); checkExist(request);
customFieldTemplateService.deleteByTemplateId(request.getId()); customFieldTemplateService.deleteByTemplateId(request.getId());
@ -108,12 +108,13 @@ public class IssueTemplateService extends TemplateBaseService {
* 获取该工作空间的系统模板 * 获取该工作空间的系统模板
* - 如果没有则创建该工作空间模板并关联默认的字段 * - 如果没有则创建该工作空间模板并关联默认的字段
* - 如果有则更新原来关联的 fieldId * - 如果有则更新原来关联的 fieldId
*
* @param customField * @param customField
*/ */
public void handleSystemFieldCreate(CustomField customField) { public void handleSystemFieldCreate(CustomField customField) {
IssueTemplate workspaceSystemTemplate = getWorkspaceSystemTemplate(customField.getWorkspaceId()); IssueTemplate workspaceSystemTemplate = getWorkspaceSystemTemplate(customField.getProjectId());
if (workspaceSystemTemplate == null) { if (workspaceSystemTemplate == null) {
createTemplateWithUpdateField(customField.getWorkspaceId(), customField); createTemplateWithUpdateField(customField.getProjectId(), customField);
} else { } else {
updateRelateWithUpdateField(workspaceSystemTemplate, customField); updateRelateWithUpdateField(workspaceSystemTemplate, customField);
} }
@ -122,7 +123,7 @@ public class IssueTemplateService extends TemplateBaseService {
private IssueTemplate getWorkspaceSystemTemplate(String workspaceId) { private IssueTemplate getWorkspaceSystemTemplate(String workspaceId) {
IssueTemplateExample example = new IssueTemplateExample(); IssueTemplateExample example = new IssueTemplateExample();
example.createCriteria() example.createCriteria()
.andWorkspaceIdEqualTo(workspaceId) .andProjectIdEqualTo(workspaceId)
.andSystemEqualTo(true); .andSystemEqualTo(true);
List<IssueTemplate> issueTemplates = issueTemplateMapper.selectByExampleWithBLOBs(example); List<IssueTemplate> issueTemplates = issueTemplateMapper.selectByExampleWithBLOBs(example);
if (CollectionUtils.isNotEmpty(issueTemplates)) { if (CollectionUtils.isNotEmpty(issueTemplates)) {
@ -131,14 +132,14 @@ public class IssueTemplateService extends TemplateBaseService {
return null; return null;
} }
private void createTemplateWithUpdateField(String workspaceId, CustomField customField) { private void createTemplateWithUpdateField(String projectId, CustomField customField) {
UpdateIssueTemplateRequest request = new UpdateIssueTemplateRequest(); UpdateIssueTemplateRequest request = new UpdateIssueTemplateRequest();
IssueTemplate issueTemplate = new IssueTemplate(); IssueTemplate issueTemplate = new IssueTemplate();
issueTemplate.setName("default"); issueTemplate.setName("default");
issueTemplate.setPlatform(TemplateConstants.IssueTemplatePlatform.metersphere.name()); issueTemplate.setPlatform(TemplateConstants.IssueTemplatePlatform.metersphere.name());
issueTemplate.setGlobal(false); issueTemplate.setGlobal(false);
issueTemplate.setSystem(true); issueTemplate.setSystem(true);
issueTemplate.setWorkspaceId(workspaceId); issueTemplate.setProjectId(projectId);
BeanUtils.copyBean(request, issueTemplate); BeanUtils.copyBean(request, issueTemplate);
List<CustomFieldTemplate> systemFieldCreateTemplate = List<CustomFieldTemplate> systemFieldCreateTemplate =
customFieldTemplateService.getSystemFieldCreateTemplate(customField, TemplateConstants.FieldTemplateScene.ISSUE.name()); customFieldTemplateService.getSystemFieldCreateTemplate(customField, TemplateConstants.FieldTemplateScene.ISSUE.name());
@ -156,7 +157,7 @@ public class IssueTemplateService extends TemplateBaseService {
IssueTemplateExample example = new IssueTemplateExample(); IssueTemplateExample example = new IssueTemplateExample();
IssueTemplateExample.Criteria criteria = example.createCriteria(); IssueTemplateExample.Criteria criteria = example.createCriteria();
criteria.andNameEqualTo(issueTemplate.getName()) criteria.andNameEqualTo(issueTemplate.getName())
.andWorkspaceIdEqualTo(issueTemplate.getWorkspaceId()); .andProjectIdEqualTo(issueTemplate.getProjectId());
if (StringUtils.isNotBlank(issueTemplate.getId())) { if (StringUtils.isNotBlank(issueTemplate.getId())) {
criteria.andIdNotEqualTo(issueTemplate.getId()); criteria.andIdNotEqualTo(issueTemplate.getId());
} }
@ -166,16 +167,16 @@ public class IssueTemplateService extends TemplateBaseService {
} }
} }
public List<IssueTemplate> getSystemTemplates(String workspaceId) { public List<IssueTemplate> getSystemTemplates(String projectId) {
IssueTemplateExample example = new IssueTemplateExample(); IssueTemplateExample example = new IssueTemplateExample();
example.createCriteria().andWorkspaceIdEqualTo(workspaceId) example.createCriteria().andProjectIdEqualTo(projectId)
.andSystemEqualTo(true); .andSystemEqualTo(true);
example.or(example.createCriteria().andGlobalEqualTo(true)); example.or(example.createCriteria().andGlobalEqualTo(true));
List<IssueTemplate> issueTemplates = issueTemplateMapper.selectByExample(example); List<IssueTemplate> issueTemplates = issueTemplateMapper.selectByExample(example);
Iterator<IssueTemplate> iterator = issueTemplates.iterator(); Iterator<IssueTemplate> iterator = issueTemplates.iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
IssueTemplate next = iterator.next(); IssueTemplate next = iterator.next();
for (IssueTemplate item: issueTemplates) { for (IssueTemplate item : issueTemplates) {
if (next.getGlobal() && !item.getGlobal() && StringUtils.equals(item.getName(), next.getName())) { if (next.getGlobal() && !item.getGlobal() && StringUtils.equals(item.getName(), next.getName())) {
// 如果有工作空间的模板则过滤掉全局模板 // 如果有工作空间的模板则过滤掉全局模板
iterator.remove(); iterator.remove();
@ -186,10 +187,10 @@ public class IssueTemplateService extends TemplateBaseService {
return issueTemplates; return issueTemplates;
} }
public IssueTemplate getDefaultTemplate(String workspaceId) { public IssueTemplate getDefaultTemplate(String projectId) {
IssueTemplateExample example = new IssueTemplateExample(); IssueTemplateExample example = new IssueTemplateExample();
example.createCriteria() example.createCriteria()
.andWorkspaceIdEqualTo(workspaceId) .andProjectIdEqualTo(projectId)
.andSystemEqualTo(true); .andSystemEqualTo(true);
List<IssueTemplate> issueTemplates = issueTemplateMapper.selectByExample(example); List<IssueTemplate> issueTemplates = issueTemplateMapper.selectByExample(example);
if (CollectionUtils.isNotEmpty(issueTemplates)) { if (CollectionUtils.isNotEmpty(issueTemplates)) {
@ -202,13 +203,13 @@ public class IssueTemplateService extends TemplateBaseService {
} }
} }
public List<IssueTemplate> getOption(String workspaceId) { public List<IssueTemplate> getOption(String projectId) {
IssueTemplateExample example = new IssueTemplateExample(); IssueTemplateExample example = new IssueTemplateExample();
example.createCriteria() example.createCriteria()
.andWorkspaceIdEqualTo(workspaceId) .andProjectIdEqualTo(projectId)
.andSystemEqualTo(false); .andSystemEqualTo(false);
List<IssueTemplate> issueTemplates = issueTemplateMapper.selectByExample(example); List<IssueTemplate> issueTemplates = issueTemplateMapper.selectByExample(example);
issueTemplates.addAll(getSystemTemplates(workspaceId)); issueTemplates.addAll(getSystemTemplates(projectId));
return issueTemplates; return issueTemplates;
} }
@ -234,18 +235,18 @@ public class IssueTemplateService extends TemplateBaseService {
return issueTemplateDao; return issueTemplateDao;
} }
public String getLogDetails(String id, List<CustomFieldTemplate>newCustomFieldTemplates) { public String getLogDetails(String id, List<CustomFieldTemplate> newCustomFieldTemplates) {
List<DetailColumn> columns = new LinkedList<>(); List<DetailColumn> columns = new LinkedList<>();
IssueTemplate templateWithBLOBs = issueTemplateMapper.selectByPrimaryKey(id); IssueTemplate templateWithBLOBs = issueTemplateMapper.selectByPrimaryKey(id);
if(templateWithBLOBs==null){ if (templateWithBLOBs == null) {
return null; return null;
} }
CustomFieldTemplateExample example = new CustomFieldTemplateExample(); CustomFieldTemplateExample example = new CustomFieldTemplateExample();
example.createCriteria().andTemplateIdEqualTo(templateWithBLOBs.getId()); example.createCriteria().andTemplateIdEqualTo(templateWithBLOBs.getId());
example.createCriteria().andSceneEqualTo("ISSUE"); example.createCriteria().andSceneEqualTo("ISSUE");
List<CustomFieldTemplate> customFieldTemplates = customFieldTemplateMapper.selectByExample(example); List<CustomFieldTemplate> customFieldTemplates = customFieldTemplateMapper.selectByExample(example);
if(newCustomFieldTemplates.size()>customFieldTemplates.size()){ if (newCustomFieldTemplates.size() > customFieldTemplates.size()) {
for (int i = 0; i < newCustomFieldTemplates.size()-customFieldTemplates.size(); i++) { for (int i = 0; i < newCustomFieldTemplates.size() - customFieldTemplates.size(); i++) {
CustomFieldTemplate customFieldTemplate = new CustomFieldTemplate(); CustomFieldTemplate customFieldTemplate = new CustomFieldTemplate();
customFieldTemplates.add(customFieldTemplate); customFieldTemplates.add(customFieldTemplate);
} }
@ -258,7 +259,7 @@ public class IssueTemplateService extends TemplateBaseService {
public String getLogDetails(UpdateIssueTemplateRequest request) { public String getLogDetails(UpdateIssueTemplateRequest request) {
List<DetailColumn> columns = new LinkedList<>(); List<DetailColumn> columns = new LinkedList<>();
IssueTemplate templateWithBLOBs = issueTemplateMapper.selectByPrimaryKey(request.getId()); IssueTemplate templateWithBLOBs = issueTemplateMapper.selectByPrimaryKey(request.getId());
if(templateWithBLOBs==null){ if (templateWithBLOBs == null) {
return null; return null;
} }
List<CustomFieldTemplate> newCustomFieldTemplates = request.getCustomFields(); List<CustomFieldTemplate> newCustomFieldTemplates = request.getCustomFields();
@ -266,8 +267,8 @@ public class IssueTemplateService extends TemplateBaseService {
example.createCriteria().andTemplateIdEqualTo(templateWithBLOBs.getId()); example.createCriteria().andTemplateIdEqualTo(templateWithBLOBs.getId());
example.createCriteria().andSceneEqualTo("ISSUE"); example.createCriteria().andSceneEqualTo("ISSUE");
List<CustomFieldTemplate> customFieldTemplates = customFieldTemplateMapper.selectByExample(example); List<CustomFieldTemplate> customFieldTemplates = customFieldTemplateMapper.selectByExample(example);
if(newCustomFieldTemplates.size()<customFieldTemplates.size()){ if (newCustomFieldTemplates.size() < customFieldTemplates.size()) {
for (int i = 0; i < customFieldTemplates.size()-newCustomFieldTemplates.size(); i++) { for (int i = 0; i < customFieldTemplates.size() - newCustomFieldTemplates.size(); i++) {
CustomFieldTemplate customFieldTemplate = new CustomFieldTemplate(); CustomFieldTemplate customFieldTemplate = new CustomFieldTemplate();
newCustomFieldTemplates.add(customFieldTemplate); newCustomFieldTemplates.add(customFieldTemplate);
} }
@ -278,8 +279,10 @@ public class IssueTemplateService extends TemplateBaseService {
private String getCustomFieldColums(List<DetailColumn> columns, IssueTemplate templateWithBLOBs, List<CustomFieldTemplate> customFields) { private String getCustomFieldColums(List<DetailColumn> columns, IssueTemplate templateWithBLOBs, List<CustomFieldTemplate> customFields) {
for (CustomFieldTemplate customFieldTemplate : customFields) { for (CustomFieldTemplate customFieldTemplate : customFields) {
CustomField customField = customFieldMapper.selectByPrimaryKey(customFieldTemplate.getFieldId()); CustomField customField = customFieldMapper.selectByPrimaryKey(customFieldTemplate.getFieldId());
customField.setDefaultValue(customFieldTemplate.getDefaultValue()); CustomFieldDao customFieldDao = new CustomFieldDao();
List<DetailColumn> columnsField = ReflexObjectUtil.getColumns(customField, SystemReference.issueFieldColumns); BeanUtils.copyBean(customFieldDao, customField);
customFieldDao.setDefaultValue(customFieldTemplate.getDefaultValue());
List<DetailColumn> columnsField = ReflexObjectUtil.getColumns(customFieldDao, SystemReference.issueFieldColumns);
columns.addAll(columnsField); columns.addAll(columnsField);
} }
List<DetailColumn> columnIssues = ReflexObjectUtil.getColumns(templateWithBLOBs, SystemReference.issueFieldColumns); List<DetailColumn> columnIssues = ReflexObjectUtil.getColumns(templateWithBLOBs, SystemReference.issueFieldColumns);

View File

@ -154,6 +154,9 @@ public class ProjectService {
// 创建新项目检查当前用户 last_project_id // 创建新项目检查当前用户 last_project_id
extUserMapper.updateLastProjectIdIfNull(project.getId(), SessionUtils.getUserId()); extUserMapper.updateLastProjectIdIfNull(project.getId(), SessionUtils.getUserId());
// 设置默认的通知
extProjectMapper.setDefaultMessageTask(project.getId());
ProjectVersionService projectVersionService = CommonBeanFactory.getBean(ProjectVersionService.class); ProjectVersionService projectVersionService = CommonBeanFactory.getBean(ProjectVersionService.class);
if (projectVersionService != null) { if (projectVersionService != null) {
ProjectVersion projectVersion = new ProjectVersion(); ProjectVersion projectVersion = new ProjectVersion();

View File

@ -82,7 +82,7 @@ public class TestCaseTemplateService extends TemplateBaseService {
String originId = request.getId(); String originId = request.getId();
// 如果是全局字段则创建对应工作空间字段 // 如果是全局字段则创建对应工作空间字段
String id = add(request); String id = add(request);
projectService.updateCaseTemplate(originId, id, request.getWorkspaceId()); projectService.updateCaseTemplate(originId, id, request.getProjectId());
} else { } else {
checkExist(request); checkExist(request);
customFieldTemplateService.deleteByTemplateId(request.getId()); customFieldTemplateService.deleteByTemplateId(request.getId());
@ -102,22 +102,22 @@ public class TestCaseTemplateService extends TemplateBaseService {
* @param customField * @param customField
*/ */
public void handleSystemFieldCreate(CustomField customField) { public void handleSystemFieldCreate(CustomField customField) {
TestCaseTemplateWithBLOBs workspaceSystemTemplate = getWorkspaceSystemTemplate(customField.getWorkspaceId()); TestCaseTemplateWithBLOBs workspaceSystemTemplate = getWorkspaceSystemTemplate(customField.getProjectId());
if (workspaceSystemTemplate == null) { if (workspaceSystemTemplate == null) {
createTemplateWithUpdateField(customField.getWorkspaceId(), customField); createTemplateWithUpdateField(customField.getProjectId(), customField);
} else { } else {
updateRelateWithUpdateField(workspaceSystemTemplate, customField); updateRelateWithUpdateField(workspaceSystemTemplate, customField);
} }
} }
private void createTemplateWithUpdateField(String workspaceId, CustomField customField) { private void createTemplateWithUpdateField(String projectId, CustomField customField) {
UpdateCaseFieldTemplateRequest request = new UpdateCaseFieldTemplateRequest(); UpdateCaseFieldTemplateRequest request = new UpdateCaseFieldTemplateRequest();
TestCaseTemplate testCaseTemplate = new TestCaseTemplate(); TestCaseTemplate testCaseTemplate = new TestCaseTemplate();
testCaseTemplate.setName("default"); testCaseTemplate.setName("default");
testCaseTemplate.setType(TemplateConstants.TestCaseTemplateScene.functional.name()); testCaseTemplate.setType(TemplateConstants.TestCaseTemplateScene.functional.name());
testCaseTemplate.setGlobal(false); testCaseTemplate.setGlobal(false);
testCaseTemplate.setSystem(true); testCaseTemplate.setSystem(true);
testCaseTemplate.setWorkspaceId(workspaceId); testCaseTemplate.setProjectId(projectId);
BeanUtils.copyBean(request, testCaseTemplate); BeanUtils.copyBean(request, testCaseTemplate);
List<CustomFieldTemplate> systemFieldCreateTemplate = List<CustomFieldTemplate> systemFieldCreateTemplate =
customFieldTemplateService.getSystemFieldCreateTemplate(customField, TemplateConstants.FieldTemplateScene.TEST_CASE.name()); customFieldTemplateService.getSystemFieldCreateTemplate(customField, TemplateConstants.FieldTemplateScene.TEST_CASE.name());
@ -133,7 +133,7 @@ public class TestCaseTemplateService extends TemplateBaseService {
private TestCaseTemplateWithBLOBs getWorkspaceSystemTemplate(String workspaceId) { private TestCaseTemplateWithBLOBs getWorkspaceSystemTemplate(String workspaceId) {
TestCaseTemplateExample example = new TestCaseTemplateExample(); TestCaseTemplateExample example = new TestCaseTemplateExample();
example.createCriteria() example.createCriteria()
.andWorkspaceIdEqualTo(workspaceId) .andProjectIdEqualTo(workspaceId)
.andSystemEqualTo(true); .andSystemEqualTo(true);
List<TestCaseTemplateWithBLOBs> testCaseTemplates = testCaseTemplateMapper.selectByExampleWithBLOBs(example); List<TestCaseTemplateWithBLOBs> testCaseTemplates = testCaseTemplateMapper.selectByExampleWithBLOBs(example);
if (CollectionUtils.isNotEmpty(testCaseTemplates)) { if (CollectionUtils.isNotEmpty(testCaseTemplates)) {
@ -147,7 +147,7 @@ public class TestCaseTemplateService extends TemplateBaseService {
TestCaseTemplateExample example = new TestCaseTemplateExample(); TestCaseTemplateExample example = new TestCaseTemplateExample();
TestCaseTemplateExample.Criteria criteria = example.createCriteria(); TestCaseTemplateExample.Criteria criteria = example.createCriteria();
criteria.andNameEqualTo(testCaseTemplate.getName()) criteria.andNameEqualTo(testCaseTemplate.getName())
.andWorkspaceIdEqualTo(testCaseTemplate.getWorkspaceId()); .andProjectIdEqualTo(testCaseTemplate.getProjectId());
if (StringUtils.isNotBlank(testCaseTemplate.getId())) { if (StringUtils.isNotBlank(testCaseTemplate.getId())) {
criteria.andIdNotEqualTo(testCaseTemplate.getId()); criteria.andIdNotEqualTo(testCaseTemplate.getId());
} }
@ -160,7 +160,7 @@ public class TestCaseTemplateService extends TemplateBaseService {
public TestCaseTemplateWithBLOBs getDefaultTemplate(String workspaceId) { public TestCaseTemplateWithBLOBs getDefaultTemplate(String workspaceId) {
TestCaseTemplateExample example = new TestCaseTemplateExample(); TestCaseTemplateExample example = new TestCaseTemplateExample();
example.createCriteria() example.createCriteria()
.andWorkspaceIdEqualTo(workspaceId) .andProjectIdEqualTo(workspaceId)
.andSystemEqualTo(true); .andSystemEqualTo(true);
List<TestCaseTemplateWithBLOBs> testCaseTemplates = testCaseTemplateMapper.selectByExampleWithBLOBs(example); List<TestCaseTemplateWithBLOBs> testCaseTemplates = testCaseTemplateMapper.selectByExampleWithBLOBs(example);
if (CollectionUtils.isNotEmpty(testCaseTemplates)) { if (CollectionUtils.isNotEmpty(testCaseTemplates)) {
@ -173,13 +173,13 @@ public class TestCaseTemplateService extends TemplateBaseService {
} }
} }
public List<TestCaseTemplate> getOption(String workspaceId) { public List<TestCaseTemplate> getOption(String projectId) {
TestCaseTemplateExample example = new TestCaseTemplateExample(); TestCaseTemplateExample example = new TestCaseTemplateExample();
example.createCriteria() example.createCriteria()
.andWorkspaceIdEqualTo(workspaceId) .andProjectIdEqualTo(projectId)
.andSystemNotEqualTo(true); .andSystemNotEqualTo(true);
List<TestCaseTemplate> testCaseTemplates = testCaseTemplateMapper.selectByExample(example); List<TestCaseTemplate> testCaseTemplates = testCaseTemplateMapper.selectByExample(example);
testCaseTemplates.add(getDefaultTemplate(workspaceId)); testCaseTemplates.add(getDefaultTemplate(projectId));
return testCaseTemplates; return testCaseTemplates;
} }

View File

@ -14,7 +14,10 @@ import io.metersphere.commons.constants.UserGroupType;
import io.metersphere.commons.exception.MSException; import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.SessionUtils; import io.metersphere.commons.utils.SessionUtils;
import io.metersphere.controller.request.WorkspaceRequest; import io.metersphere.controller.request.WorkspaceRequest;
import io.metersphere.dto.*; import io.metersphere.dto.RelatedSource;
import io.metersphere.dto.WorkspaceDTO;
import io.metersphere.dto.WorkspaceMemberDTO;
import io.metersphere.dto.WorkspaceResource;
import io.metersphere.i18n.Translator; import io.metersphere.i18n.Translator;
import io.metersphere.log.utils.ReflexObjectUtil; import io.metersphere.log.utils.ReflexObjectUtil;
import io.metersphere.log.vo.DetailColumn; import io.metersphere.log.vo.DetailColumn;
@ -82,8 +85,6 @@ public class WorkspaceService {
userGroupMapper.insert(userGroup); userGroupMapper.insert(userGroup);
// 新项目创建新工作空间时设置 // 新项目创建新工作空间时设置
extUserMapper.updateLastWorkspaceIdIfNull(workspace.getId(), SessionUtils.getUserId()); extUserMapper.updateLastWorkspaceIdIfNull(workspace.getId(), SessionUtils.getUserId());
// 设置默认的通知
extWorkspaceMapper.setDefaultMessageTask(workspace.getId());
} else { } else {
workspace.setUpdateTime(currentTime); workspace.setUpdateTime(currentTime);
workspaceMapper.updateByPrimaryKeySelective(workspace); workspaceMapper.updateByPrimaryKeySelective(workspace);
@ -216,8 +217,6 @@ public class WorkspaceService {
userGroup.setGroupId(UserGroupConstants.WS_ADMIN); userGroup.setGroupId(UserGroupConstants.WS_ADMIN);
userGroup.setSourceId(workspace.getId()); userGroup.setSourceId(workspace.getId());
userGroupMapper.insert(userGroup); userGroupMapper.insert(userGroup);
// 设置默认的通知
extWorkspaceMapper.setDefaultMessageTask(workspace.getId());
return workspace; return workspace;
} }

View File

@ -77,9 +77,9 @@ public class TestPlanController {
return testPlanService.listTestAllPlan(request); return testPlanService.listTestAllPlan(request);
} }
@GetMapping("/get/stage/option/{workspaceId}") @GetMapping("/get/stage/option/{projectId}")
public JSONArray getStageOption(@PathVariable("workspaceId") String workspaceId) { public JSONArray getStageOption(@PathVariable("projectId") String projectId) {
return testPlanService.getStageOption(workspaceId); return testPlanService.getStageOption(projectId);
} }
@GetMapping("recent/{count}/{id}") @GetMapping("recent/{count}/{id}")

View File

@ -1986,10 +1986,10 @@ public class TestPlanService {
return testPlanMapper.selectByPrimaryKey(planId).getRepeatCase(); return testPlanMapper.selectByPrimaryKey(planId).getRepeatCase();
} }
public JSONArray getStageOption(String workspaceId) { public JSONArray getStageOption(String projectId) {
CustomFieldExample example = new CustomFieldExample(); CustomFieldExample example = new CustomFieldExample();
example.createCriteria() example.createCriteria()
.andWorkspaceIdEqualTo(workspaceId) .andProjectIdEqualTo(projectId)
.andSceneEqualTo("PLAN") .andSceneEqualTo("PLAN")
.andNameEqualTo("测试阶段"); .andNameEqualTo("测试阶段");

View File

@ -41,4 +41,495 @@ CALL project_api_appl();
DROP PROCEDURE IF EXISTS project_api_appl; DROP PROCEDURE IF EXISTS project_api_appl;
ALTER TABLE `api_definition` ADD INDEX methodIndex ( `method` ); ALTER TABLE `api_definition` ADD INDEX methodIndex ( `method` );
ALTER TABLE `api_definition` ADD INDEX protocolIndex ( `protocol` ); ALTER TABLE `api_definition` ADD INDEX protocolIndex ( `protocol` );
--
ALTER TABLE message_task
ADD project_id VARCHAR(64) NULL;
-- 消息通知去掉工作空间
DROP PROCEDURE IF EXISTS message_task_ws;
DELIMITER //
CREATE PROCEDURE message_task_ws()
BEGIN
DECLARE userId VARCHAR(64);
DECLARE testId VARCHAR(64);
DECLARE type VARCHAR(64);
DECLARE event VARCHAR(64);
DECLARE taskType VARCHAR(64);
DECLARE webhook VARCHAR(255);
DECLARE identification VARCHAR(64);
DECLARE isSet VARCHAR(64);
DECLARE workspaceId VARCHAR(64);
DECLARE createTime BIGINT;
DECLARE template TEXT;
DECLARE done INT DEFAULT 0;
# 必须用 table_name.column_name
DECLARE cursor1 CURSOR FOR SELECT message_task.type,
message_task.event,
message_task.user_id,
message_task.task_type,
message_task.webhook,
message_task.identification,
message_task.is_set,
message_task.workspace_id,
message_task.test_id,
message_task.create_time,
message_task.template
FROM message_task;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
OPEN cursor1;
outer_loop:
LOOP
FETCH cursor1 INTO type, event, userId, taskType, webhook, identification, isSet,
workspaceId,
testId, createTime, template;
IF done
THEN
LEAVE outer_loop;
END IF;
INSERT INTO message_task(id, type, event, user_id, task_type, webhook, identification, is_set, project_id,
test_id, create_time, template)
SELECT UUID(),
type,
event,
userId,
taskType,
webhook,
identification,
isSet,
id,
testId,
createTime,
template
FROM project
WHERE workspace_id = workspaceId;
DELETE FROM message_task WHERE workspace_id = workspaceId;
END LOOP;
CLOSE cursor1;
END
//
DELIMITER ;
CALL message_task_ws();
DROP PROCEDURE IF EXISTS message_task_ws;
-- 去掉组织id
ALTER TABLE message_task
DROP COLUMN workspace_id;
-- 默认设置权限
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES (UUID(), 'project_admin', 'PROJECT_MESSAGE:READ', 'PROJECT_MESSAGE');
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES (UUID(), 'project_admin', 'PROJECT_MESSAGE:READ+EDIT', 'PROJECT_MESSAGE');
--
ALTER TABLE custom_field
ADD project_id VARCHAR(64) NULL;
ALTER TABLE test_case_template
ADD project_id VARCHAR(64) NULL;
ALTER TABLE issue_template
ADD project_id VARCHAR(64) NULL;
ALTER TABLE custom_field
MODIFY id VARCHAR(100);
ALTER TABLE test_case_template
MODIFY id VARCHAR(100);
ALTER TABLE issue_template
MODIFY id VARCHAR(100);
UPDATE custom_field
SET project_id = 'global'
WHERE global = 1;
UPDATE test_case_template
SET project_id = 'global'
WHERE global = 1;
UPDATE issue_template
SET project_id = 'global'
WHERE global = 1;
-- 自定义字段去掉工作空间
DROP PROCEDURE IF EXISTS custom_field_ws;
DELIMITER //
CREATE PROCEDURE custom_field_ws()
BEGIN
DECLARE fieldId VARCHAR(64);
DECLARE name VARCHAR(64);
DECLARE scene VARCHAR(64);
DECLARE type VARCHAR(64);
DECLARE remark VARCHAR(255);
DECLARE options TEXT;
DECLARE `system` TINYINT(1);
DECLARE global TINYINT(1);
DECLARE workspaceId VARCHAR(64);
DECLARE createTime BIGINT;
DECLARE updateTime BIGINT;
DECLARE createUser VARCHAR(64);
DECLARE done INT DEFAULT 0;
# 必须用 table_name.column_name
DECLARE cursor1 CURSOR FOR SELECT custom_field.id,
custom_field.name,
custom_field.scene,
custom_field.type,
custom_field.remark,
custom_field.options,
custom_field.`system`,
custom_field.global,
custom_field.workspace_id,
custom_field.create_time,
custom_field.update_time,
custom_field.create_user
FROM custom_field
WHERE custom_field.global = 0;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
OPEN cursor1;
outer_loop:
LOOP
FETCH cursor1 INTO fieldId, name, scene, type, remark, options, `system`, global, workspaceId,
createTime, updateTime, createUser;
IF done
THEN
LEAVE outer_loop;
END IF;
-- 自定义字段数据下发到项目
INSERT INTO custom_field (id, name, scene, type, remark, options, `system`, global, create_time,
update_time, create_user, project_id, workspace_id)
SELECT CONCAT(fieldId, '-', SUBSTRING(MD5(RAND()), 1, 10)),
custom_field.name,
scene,
type,
remark,
options,
`system`,
global,
custom_field.create_time,
custom_field.update_time,
custom_field.create_user,
project.id,
project.workspace_id
FROM project
JOIN custom_field ON project.workspace_id = custom_field.workspace_id
WHERE custom_field.id = fieldId;
-- 删除处理过的数据
DELETE FROM custom_field WHERE id = fieldId;
END LOOP;
CLOSE cursor1;
END
//
DELIMITER ;
CALL custom_field_ws();
DROP PROCEDURE IF EXISTS custom_field_ws;
-- 用例模版去掉工作空间
DROP PROCEDURE IF EXISTS case_template_ws;
DELIMITER //
CREATE PROCEDURE case_template_ws()
BEGIN
DECLARE templateId VARCHAR(64);
DECLARE name VARCHAR(64);
DECLARE type VARCHAR(64);
DECLARE description VARCHAR(64);
DECLARE caseName VARCHAR(255);
DECLARE `system` TINYINT(1);
DECLARE global TINYINT(1);
DECLARE workspaceId VARCHAR(64);
DECLARE prerequisite VARCHAR(255);
DECLARE stepDescription TEXT;
DECLARE expectedResult TEXT;
DECLARE actualResult TEXT;
DECLARE createTime BIGINT;
DECLARE updateTime BIGINT;
DECLARE stepModel VARCHAR(10);
DECLARE steps TEXT;
DECLARE createUser VARCHAR(64);
DECLARE done INT DEFAULT 0;
# 必须用 table_name.column_name
DECLARE cursor1 CURSOR FOR SELECT test_case_template.id,
test_case_template.name,
test_case_template.type,
test_case_template.description,
test_case_template.case_name,
test_case_template.`system`,
test_case_template.global,
test_case_template.workspace_id,
test_case_template.prerequisite,
test_case_template.step_description,
test_case_template.expected_result,
test_case_template.actual_result,
test_case_template.create_time,
test_case_template.update_time,
test_case_template.step_model,
test_case_template.steps,
test_case_template.create_user
FROM test_case_template
WHERE test_case_template.global = 0;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
OPEN cursor1;
outer_loop:
LOOP
FETCH cursor1 INTO templateId, name, type, description, caseName, `system`, global, workspaceId,
prerequisite, stepDescription, expectedResult, actualResult, createTime,
updateTime, stepModel, steps, createUser;
IF done
THEN
LEAVE outer_loop;
END IF;
-- 自定义字段数据下发到项目
INSERT INTO test_case_template (id, name, type, description, case_name, `system`, global, workspace_id,
prerequisite, step_description, expected_result, actual_result, create_time,
update_time, step_model, steps, create_user, project_id)
SELECT CONCAT(templateId, '-', SUBSTRING(MD5(RAND()), 1, 10)),
test_case_template.name,
type,
test_case_template.description,
case_name,
`system`,
global,
test_case_template.workspace_id,
prerequisite,
step_description,
expected_result,
actual_result,
test_case_template.create_time,
test_case_template.update_time,
step_model,
steps,
test_case_template.create_user,
project.id
FROM project
JOIN test_case_template ON project.workspace_id = test_case_template.workspace_id
WHERE test_case_template.id = templateId;
-- 删除处理过的数据
DELETE FROM test_case_template WHERE id = templateId;
END LOOP;
CLOSE cursor1;
END
//
DELIMITER ;
CALL case_template_ws();
DROP PROCEDURE IF EXISTS case_template_ws;
-- 缺陷模版去掉工作空间
DROP PROCEDURE IF EXISTS issue_template_ws;
DELIMITER //
CREATE PROCEDURE issue_template_ws()
BEGIN
DECLARE templateId VARCHAR(64);
DECLARE name VARCHAR(64);
DECLARE platform VARCHAR(64);
DECLARE description VARCHAR(64);
DECLARE title VARCHAR(255);
DECLARE `system` TINYINT(1);
DECLARE global TINYINT(1);
DECLARE workspaceId VARCHAR(64);
DECLARE content TEXT;
DECLARE createTime BIGINT;
DECLARE updateTime BIGINT;
DECLARE createUser VARCHAR(64);
DECLARE done INT DEFAULT 0;
# 必须用 table_name.column_name
DECLARE cursor1 CURSOR FOR SELECT issue_template.id,
issue_template.name,
issue_template.platform,
issue_template.description,
issue_template.title,
issue_template.`system`,
issue_template.global,
issue_template.workspace_id,
issue_template.content,
issue_template.create_time,
issue_template.update_time,
issue_template.create_user
FROM issue_template
WHERE issue_template.global = 0;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
OPEN cursor1;
outer_loop:
LOOP
FETCH cursor1 INTO templateId, name, platform, description, title, `system`, global, workspaceId, content,
createTime, updateTime, createUser;
IF done
THEN
LEAVE outer_loop;
END IF;
-- 自定义字段数据下发到项目
INSERT INTO issue_template(id, name, platform, description, title, `system`, global, content,
create_time, update_time, create_user, project_id, workspace_id)
SELECT CONCAT(templateId, '-', SUBSTRING(MD5(RAND()), 1, 10)),
issue_template.name,
issue_template.platform,
issue_template.description,
title,
`system`,
global,
content,
issue_template.create_time,
issue_template.update_time,
issue_template.create_user,
project.id,
issue_template.workspace_id
FROM project
JOIN issue_template ON project.workspace_id = issue_template.workspace_id
WHERE issue_template.id = templateId;
-- 删除处理过的数据
DELETE FROM issue_template WHERE id = templateId;
END LOOP;
CLOSE cursor1;
END
//
DELIMITER ;
CALL issue_template_ws();
DROP PROCEDURE IF EXISTS issue_template_ws;
DROP TABLE IF EXISTS custom_field_template_bak;
CREATE TEMPORARY TABLE custom_field_template_bak LIKE custom_field_template;
INSERT INTO custom_field_template_bak
SELECT *
FROM custom_field_template;
TRUNCATE TABLE custom_field_template;
-- 关系表去掉工作空间
DROP PROCEDURE IF EXISTS custom_field_template_ws;
DELIMITER //
CREATE PROCEDURE custom_field_template_ws()
BEGIN
DECLARE fieldId VARCHAR(64);
DECLARE templateId VARCHAR(64);
DECLARE scene VARCHAR(64);
DECLARE required TINYINT(1);
DECLARE `order` INT;
DECLARE defaultValue VARCHAR(100);
DECLARE customData VARCHAR(255);
DECLARE `key` VARCHAR(1);
DECLARE done INT DEFAULT 0;
# 必须用 table_name.column_name
DECLARE cursor1 CURSOR FOR SELECT custom_field_template_bak.field_id,
custom_field_template_bak.template_id,
custom_field_template_bak.scene,
custom_field_template_bak.required,
custom_field_template_bak.`order`,
custom_field_template_bak.default_value,
custom_field_template_bak.custom_data,
custom_field_template_bak.`key`
FROM custom_field_template_bak;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
OPEN cursor1;
outer_loop:
LOOP
FETCH cursor1 INTO fieldId, templateId, scene, required, `order`, defaultValue, customData, `key`;
IF done
THEN
LEAVE outer_loop;
END IF;
#
-- 关联数据下发到项目
INSERT INTO custom_field_template(id, field_id, template_id, scene, required, `order`, default_value,
custom_data, `key`)
SELECT UUID(),
custom_field.id,
test_case_template.id,
scene,
required,
`order`,
defaultValue,
customData,
`key`
FROM custom_field,
test_case_template
WHERE custom_field.id LIKE CONCAT(fieldId, '%')
AND test_case_template.id LIKE CONCAT(templateId, '%');
INSERT INTO custom_field_template(id, field_id, template_id, scene, required, `order`, default_value,
custom_data, `key`)
SELECT UUID(),
custom_field.id,
issue_template.id,
scene,
required,
`order`,
defaultValue,
customData,
`key`
FROM custom_field,
issue_template
WHERE custom_field.id LIKE CONCAT(fieldId, '%')
AND issue_template.id LIKE CONCAT(templateId, '%');
END LOOP;
CLOSE cursor1;
END
//
DELIMITER ;
CALL custom_field_template_ws();
DROP PROCEDURE IF EXISTS custom_field_template_ws;
DROP TABLE IF EXISTS custom_field_template_bak;
-- 去掉组织id
ALTER TABLE test_case_template
DROP COLUMN workspace_id;
ALTER TABLE issue_template
DROP COLUMN workspace_id;
ALTER TABLE custom_field
DROP COLUMN workspace_id;
-- project 数据调整
UPDATE project
JOIN test_case_template ON project.id = test_case_template.project_id
SET project.case_template_id = test_case_template.id
WHERE case_template_id IS NOT NULL
AND test_case_template.id LIKE CONCAT(case_template_id, '%');
UPDATE project
JOIN issue_template ON project.id = issue_template.project_id
SET project.issue_template_id = issue_template.id
WHERE issue_template_id IS NOT NULL
AND issue_template.id LIKE CONCAT(issue_template_id, '%');
-- 默认设置权限
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES (UUID(), 'project_admin', 'PROJECT_TEMPLATE:READ+CASE_TEMPLATE', 'PROJECT_TEMPLATE');
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES (UUID(), 'project_admin', 'PROJECT_TEMPLATE:READ', 'PROJECT_TEMPLATE');
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES (UUID(), 'project_admin', 'PROJECT_TEMPLATE:READ+CUSTOM', 'PROJECT_TEMPLATE');
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES (UUID(), 'project_admin', 'PROJECT_TEMPLATE:READ+ISSUE_TEMPLATE', 'PROJECT_TEMPLATE');

View File

@ -140,16 +140,6 @@
"name": "permission.workspace_service.edit", "name": "permission.workspace_service.edit",
"resourceId": "WORKSPACE_SERVICE" "resourceId": "WORKSPACE_SERVICE"
}, },
{
"id": "WORKSPACE_MESSAGE:READ",
"name": "permission.workspace_message.read",
"resourceId": "WORKSPACE_MESSAGE"
},
{
"id": "WORKSPACE_MESSAGE:READ+EDIT",
"name": "permission.workspace_message.edit",
"resourceId": "WORKSPACE_MESSAGE"
},
{ {
"id": "WORKSPACE_USER:READ", "id": "WORKSPACE_USER:READ",
"name": "permission.workspace_user.read", "name": "permission.workspace_user.read",
@ -255,26 +245,6 @@
"name": "permission.workspace_operation_log.read", "name": "permission.workspace_operation_log.read",
"resourceId": "WORKSPACE_OPERATING_LOG" "resourceId": "WORKSPACE_OPERATING_LOG"
}, },
{
"id": "WORKSPACE_TEMPLATE:READ",
"name": "permission.workspace_template.read",
"resourceId": "WORKSPACE_TEMPLATE"
},
{
"id": "WORKSPACE_TEMPLATE:READ+CASE_TEMPLATE",
"name": "permission.workspace_template.case_template",
"resourceId": "WORKSPACE_TEMPLATE"
},
{
"id": "WORKSPACE_TEMPLATE:READ+ISSUE_TEMPLATE",
"name": "permission.workspace_template.issue_template",
"resourceId": "WORKSPACE_TEMPLATE"
},
{
"id": "WORKSPACE_TEMPLATE:READ+CUSTOM",
"name": "permission.workspace_template.custom",
"resourceId": "WORKSPACE_TEMPLATE"
},
{ {
"id": "PROJECT_USER:READ", "id": "PROJECT_USER:READ",
"name": "permission.project_user.read", "name": "permission.project_user.read",
@ -405,6 +375,36 @@
"name": "permission.project_file.delete_file", "name": "permission.project_file.delete_file",
"resourceId": "PROJECT_FILE" "resourceId": "PROJECT_FILE"
}, },
{
"id": "PROJECT_TEMPLATE:READ",
"name": "permission.project_template.read",
"resourceId": "PROJECT_TEMPLATE"
},
{
"id": "PROJECT_TEMPLATE:READ+CASE_TEMPLATE",
"name": "permission.project_template.case_template",
"resourceId": "PROJECT_TEMPLATE"
},
{
"id": "PROJECT_TEMPLATE:READ+ISSUE_TEMPLATE",
"name": "permission.project_template.issue_template",
"resourceId": "PROJECT_TEMPLATE"
},
{
"id": "PROJECT_TEMPLATE:READ+CUSTOM",
"name": "permission.project_template.custom",
"resourceId": "PROJECT_TEMPLATE"
},
{
"id": "PROJECT_MESSAGE:READ",
"name": "permission.project_message.read",
"resourceId": "PROJECT_MESSAGE"
},
{
"id": "PROJECT_MESSAGE:READ+EDIT",
"name": "permission.project_message.edit",
"resourceId": "PROJECT_MESSAGE"
},
{ {
"id": "PROJECT_CUSTOM_CODE:READ", "id": "PROJECT_CUSTOM_CODE:READ",
"name": "permission.project_custom_code.read", "name": "permission.project_custom_code.read",
@ -1006,14 +1006,6 @@
"id": "WORKSPACE_SERVICE", "id": "WORKSPACE_SERVICE",
"name": "permission.workspace_service.name" "name": "permission.workspace_service.name"
}, },
{
"id": "WORKSPACE_MESSAGE",
"name": "permission.workspace_message.name"
},
{
"id": "WORKSPACE_TEMPLATE",
"name": "permission.workspace_template.name"
},
{ {
"id": "WORKSPACE_PROJECT_MANAGER", "id": "WORKSPACE_PROJECT_MANAGER",
"name": "permission.workspace_project_manager.name" "name": "permission.workspace_project_manager.name"
@ -1054,6 +1046,14 @@
"id": "PROJECT_FILE", "id": "PROJECT_FILE",
"name": "permission.project_file.name" "name": "permission.project_file.name"
}, },
{
"id": "PROJECT_TEMPLATE",
"name": "permission.project_template.name"
},
{
"id": "PROJECT_MESSAGE",
"name": "permission.project_message.name"
},
{ {
"id": "PROJECT_VERSION", "id": "PROJECT_VERSION",
"name": "project.version_manage", "name": "project.version_manage",

View File

@ -99,7 +99,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
:tip="$t('commons.edit')" :tip="$t('commons.edit')"
@click="handleEditTask(scope.$index,scope.row)" @click="handleEditTask(scope.$index,scope.row)"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
<ms-tip-button <ms-tip-button
circle circle
type="danger" type="danger"
@ -108,7 +108,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
@click="deleteRowTask(scope.$index,scope.row)" @click="deleteRowTask(scope.$index,scope.row)"
:tip="$t('commons.delete')" :tip="$t('commons.delete')"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -99,7 +99,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
:tip="$t('commons.edit')" :tip="$t('commons.edit')"
@click="handleEditTask(scope.$index,scope.row)" @click="handleEditTask(scope.$index,scope.row)"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
<ms-tip-button <ms-tip-button
circle circle
type="danger" type="danger"
@ -108,7 +108,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
@click="deleteRowTask(scope.$index,scope.row)" @click="deleteRowTask(scope.$index,scope.row)"
:tip="$t('commons.delete')" :tip="$t('commons.delete')"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -41,16 +41,11 @@
</template> </template>
<script> <script>
import { import {getCurrentUser, getCurrentWorkspaceId, listenGoBack, removeGoBackListener} from "@/common/js/utils";
getCurrentUser,
getCurrentWorkspaceId,
listenGoBack,
removeGoBackListener
} from "@/common/js/utils";
import Crontab from "../cron/Crontab"; import Crontab from "../cron/Crontab";
import CrontabResult from "../cron/CrontabResult"; import CrontabResult from "../cron/CrontabResult";
import {cronValidate} from "@/common/js/cron"; import {cronValidate} from "@/common/js/cron";
import ScheduleTaskNotification from "../../settings/workspace/components/ScheduleTaskNotification"; import ScheduleTaskNotification from "../../project/notification/ScheduleTaskNotification";
function defaultCustomValidate() { function defaultCustomValidate() {
return {pass: true}; return {pass: true};

View File

@ -25,7 +25,7 @@
<script> <script>
import {SYSTEM_FIELD_NAME_MAP} from "@/common/js/table-constants"; import {SYSTEM_FIELD_NAME_MAP} from "@/common/js/table-constants";
import CustomFiledComponent from "@/business/components/settings/workspace/template/CustomFiledComponent"; import CustomFiledComponent from "@/business/components/project/template/CustomFiledComponent";
export default { export default {
name: "CustomFiledFormItem", name: "CustomFiledFormItem",

View File

@ -33,13 +33,14 @@
</el-menu-item> </el-menu-item>
<el-menu-item index="/project" onselectstart="return false" <el-menu-item index="/project" onselectstart="return false"
v-permission="['PROJECT_USER:READ', 'PROJECT_ENVIRONMENT:READ', 'PROJECT_OPERATING_LOG:READ', 'PROJECT_FILE:READ+JAR', 'PROJECT_FILE:READ+FILE', 'PROJECT_CUSTOM_CODE:READ','PROJECT_ERROR_REPORT_LIBRARY:READ']"> v-permission="['PROJECT_USER:READ', 'PROJECT_ENVIRONMENT:READ', 'PROJECT_OPERATING_LOG:READ', 'PROJECT_FILE:READ+JAR', 'PROJECT_FILE:READ+FILE',
'PROJECT_CUSTOM_CODE:READ','PROJECT_ERROR_REPORT_LIBRARY:READ', 'PROJECT_TEMPLATE:READ', 'PROJECT_MESSAGE:READ']">
{{ $t('commons.project_setting') }} {{ $t('commons.project_setting') }}
</el-menu-item> </el-menu-item>
<el-menu-item index="/setting" onselectstart="return false" <el-menu-item index="/setting" onselectstart="return false"
v-permission="['SYSTEM_USER:READ', 'SYSTEM_WORKSPACE:READ', 'SYSTEM_GROUP:READ', 'SYSTEM_TEST_POOL:READ', 'SYSTEM_SETTING:READ', 'SYSTEM_AUTH:READ', 'SYSTEM_QUOTA:READ','SYSTEM_OPERATING_LOG:READ', v-permission="['SYSTEM_USER:READ', 'SYSTEM_WORKSPACE:READ', 'SYSTEM_GROUP:READ', 'SYSTEM_TEST_POOL:READ', 'SYSTEM_SETTING:READ', 'SYSTEM_AUTH:READ', 'SYSTEM_QUOTA:READ','SYSTEM_OPERATING_LOG:READ',
'WORKSPACE_SERVICE:READ', 'WORKSPACE_MESSAGE:READ', 'WORKSPACE_USER:READ', 'WORKSPACE_PROJECT_MANAGER:READ', 'WORKSPACE_PROJECT_ENVIRONMENT:READ', 'WORKSPACE_OPERATING_LOG:READ', 'WORKSPACE_TEMPLATE:READ']"> 'WORKSPACE_SERVICE:READ', 'PROJECT_MESSAGE:READ', 'WORKSPACE_USER:READ', 'WORKSPACE_PROJECT_MANAGER:READ', 'WORKSPACE_PROJECT_ENVIRONMENT:READ', 'WORKSPACE_OPERATING_LOG:READ']">
{{ $t('commons.system_setting') }} {{ $t('commons.system_setting') }}
</el-menu-item> </el-menu-item>
</el-menu> </el-menu>

View File

@ -59,9 +59,9 @@ function redirectLoginPath(originPath) {
let loginSuccess = sessionStorage.getItem('loginSuccess'); let loginSuccess = sessionStorage.getItem('loginSuccess');
if (!redirectUrl || redirectUrl === '/') { if (!redirectUrl || redirectUrl === '/') {
if (hasPermissions('PROJECT_USER:READ', 'PROJECT_ENVIRONMENT:READ', 'PROJECT_OPERATING_LOG:READ', 'PROJECT_FILE:READ+JAR', 'PROJECT_FILE:READ+FILE', 'PROJECT_CUSTOM_CODE:READ')) { if (hasPermissions('PROJECT_USER:READ', 'PROJECT_ENVIRONMENT:READ', 'PROJECT_OPERATING_LOG:READ', 'PROJECT_FILE:READ+JAR', 'PROJECT_FILE:READ+FILE', 'PROJECT_CUSTOM_CODE:READ', 'PROJECT_TEMPLATE:READ', 'PROJECT_MESSAGE:READ')) {
redirectUrl = '/project/home'; redirectUrl = '/project/home';
} else if (hasPermissions('WORKSPACE_SERVICE:READ', 'WORKSPACE_MESSAGE:READ', 'WORKSPACE_USER:READ', 'WORKSPACE_PROJECT_MANAGER:READ', 'WORKSPACE_PROJECT_ENVIRONMENT:READ', 'WORKSPACE_OPERATING_LOG:READ', 'WORKSPACE_TEMPLATE:READ')) { } else if (hasPermissions('WORKSPACE_SERVICE:READ', 'PROJECT_MESSAGE:READ', 'WORKSPACE_USER:READ', 'WORKSPACE_PROJECT_MANAGER:READ', 'WORKSPACE_PROJECT_ENVIRONMENT:READ', 'WORKSPACE_OPERATING_LOG:READ')) {
redirectUrl = '/setting/project/:type'; redirectUrl = '/setting/project/:type';
} else if (hasPermissions('SYSTEM_USER:READ', 'SYSTEM_WORKSPACE:READ', 'SYSTEM_GROUP:READ', 'SYSTEM_TEST_POOL:READ', 'SYSTEM_SETTING:READ', 'SYSTEM_AUTH:READ', 'SYSTEM_QUOTA:READ', 'SYSTEM_OPERATING_LOG:READ')) { } else if (hasPermissions('SYSTEM_USER:READ', 'SYSTEM_WORKSPACE:READ', 'SYSTEM_GROUP:READ', 'SYSTEM_TEST_POOL:READ', 'SYSTEM_SETTING:READ', 'SYSTEM_AUTH:READ', 'SYSTEM_QUOTA:READ', 'SYSTEM_OPERATING_LOG:READ')) {
redirectUrl = '/setting'; redirectUrl = '/setting';

View File

@ -27,9 +27,16 @@
v-permission="['PROJECT_CUSTOM_CODE:READ']"> v-permission="['PROJECT_CUSTOM_CODE:READ']">
{{ $t('project.code_segment.code_segment') }} {{ $t('project.code_segment.code_segment') }}
</el-menu-item> </el-menu-item>
<el-menu-item :index="'/project/errorreportlibrary'" v-permission="['PROJECT_ERROR_REPORT_LIBRARY:READ']" v-xpack> <el-menu-item :index="'/project/errorreportlibrary'" v-permission="['PROJECT_ERROR_REPORT_LIBRARY:READ']"
v-xpack>
{{ $t("error_report_library.name") }} {{ $t("error_report_library.name") }}
</el-menu-item> </el-menu-item>
<el-menu-item index="/project/template" v-permission="['PROJECT_TEMPLATE:READ']">
<template slot="title">{{ $t('workspace.template_manage') }}</template>
</el-menu-item>
<el-menu-item :index="'/project/messagesettings'" v-permission="['PROJECT_MESSAGE:READ']">
{{ $t("organization.message_settings") }}
</el-menu-item>
<el-menu-item :index="'/project/log'" popper-class="submenu" v-permission="['PROJECT_OPERATING_LOG:READ']"> <el-menu-item :index="'/project/log'" popper-class="submenu" v-permission="['PROJECT_OPERATING_LOG:READ']">
{{ $t('project.log') }} {{ $t('project.log') }}
</el-menu-item> </el-menu-item>

View File

@ -79,7 +79,8 @@
import { import {
getCurrentProjectID, getCurrentProjectID,
getCurrentUser, getCurrentUserId, getCurrentUser,
getCurrentUserId,
getCurrentWorkspaceId, getCurrentWorkspaceId,
listenGoBack, listenGoBack,
removeGoBackListener removeGoBackListener
@ -88,7 +89,7 @@ import {
import {AZURE_DEVOPS, JIRA, PROJECT_ID, TAPD, ZEN_TAO} from "@/common/js/constants"; import {AZURE_DEVOPS, JIRA, PROJECT_ID, TAPD, ZEN_TAO} from "@/common/js/constants";
import {PROJECT_CONFIGS} from "@/business/components/common/components/search/search-components"; import {PROJECT_CONFIGS} from "@/business/components/common/components/search/search-components";
import MsInstructionsIcon from "@/business/components/common/components/MsInstructionsIcon"; import MsInstructionsIcon from "@/business/components/common/components/MsInstructionsIcon";
import TemplateSelect from "@/business/components/settings/workspace/template/TemplateSelect"; import TemplateSelect from "@/business/components/project/template/TemplateSelect";
import MsResourceFiles from "@/business/components/performance/test/components/ResourceFiles"; import MsResourceFiles from "@/business/components/performance/test/components/ResourceFiles";
import MsTableButton from "@/business/components/common/components/MsTableButton"; import MsTableButton from "@/business/components/common/components/MsTableButton";
import MsJarConfig from "@/business/components/api/test/components/jar/JarConfig"; import MsJarConfig from "@/business/components/api/test/components/jar/JarConfig";

View File

@ -99,7 +99,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
:tip="$t('commons.edit')" :tip="$t('commons.edit')"
@click="handleEditTask(scope.$index,scope.row)" @click="handleEditTask(scope.$index,scope.row)"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
<ms-tip-button <ms-tip-button
circle circle
type="danger" type="danger"
@ -108,7 +108,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
@click="deleteRowTask(scope.$index,scope.row)" @click="deleteRowTask(scope.$index,scope.row)"
:tip="$t('commons.delete')" :tip="$t('commons.delete')"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -78,27 +78,24 @@
<script> <script>
import {getCurrentUser, getCurrentWorkspaceId} from "@/common/js/utils"; import {getCurrentUser, getCurrentWorkspaceId} from "@/common/js/utils";
import JenkinsNotification from "@/business/components/settings/workspace/components/jenkins/JenkinsNotification"; import JenkinsNotification from "@/business/components/project/notification/jenkins/JenkinsNotification";
import TestPlanTaskNotification import TestPlanTaskNotification from "@/business/components/project/notification/track/TestPlanTaskNotification";
from "@/business/components/settings/workspace/components/track/TestPlanTaskNotification"; import TestReviewNotification from "@/business/components/project/notification/track/TestReviewNotification";
import TestReviewNotification from "@/business/components/settings/workspace/components/track/TestReviewNotification"; import DefectTaskNotification from "@/business/components/project/notification/track/DefectTaskNotification";
import DefectTaskNotification from "@/business/components/settings/workspace/components/track/DefectTaskNotification";
import MsContainer from "@/business/components/common/components/MsContainer"; import MsContainer from "@/business/components/common/components/MsContainer";
import MsMainContainer from "@/business/components/common/components/MsMainContainer"; import MsMainContainer from "@/business/components/common/components/MsMainContainer";
import HomeNotification from "@/business/components/settings/workspace/components/track/TrackHomeNotification"; import HomeNotification from "@/business/components/project/notification/track/TrackHomeNotification";
import TrackHomeNotification from "@/business/components/settings/workspace/components/track/TrackHomeNotification"; import TrackHomeNotification from "@/business/components/project/notification/track/TrackHomeNotification";
import TestCaseNotification from "@/business/components/settings/workspace/components/track/TestCaseNotification"; import TestCaseNotification from "@/business/components/project/notification/track/TestCaseNotification";
import TrackReportNotification from "@/business/components/settings/workspace/components/track/TrackReportNotification"; import TrackReportNotification from "@/business/components/project/notification/track/TrackReportNotification";
import ApiDefinitionNotification import ApiDefinitionNotification from "@/business/components/project/notification/api/ApiDefinitionNotification";
from "@/business/components/settings/workspace/components/api/ApiDefinitionNotification"; import ApiAutomationNotification from "@/business/components/project/notification/api/ApiAutomationNotification";
import ApiAutomationNotification import ApiReportNotification from "@/business/components/project/notification/api/ApiReportNotification";
from "@/business/components/settings/workspace/components/api/ApiAutomationNotification";
import ApiReportNotification from "@/business/components/settings/workspace/components/api/ApiReportNotification";
import PerformanceTestNotification import PerformanceTestNotification
from "@/business/components/settings/workspace/components/performance/PerformanceTestNotification"; from "@/business/components/project/notification/performance/PerformanceTestNotification";
import PerformanceReportNotification import PerformanceReportNotification
from "@/business/components/settings/workspace/components/performance/PerformanceReportNotification"; from "@/business/components/project/notification/performance/PerformanceReportNotification";
import ApiHomeNotification from "@/business/components/settings/workspace/components/api/ApiHomeNotification"; import ApiHomeNotification from "@/business/components/project/notification/api/ApiHomeNotification";
let taskData = { let taskData = {
jenkins: [], jenkins: [],
@ -203,7 +200,7 @@ export default {
<style scoped> <style scoped>
.task-notification { .task-notification {
height: calc(100vh - 200px); height: calc(100vh - 230px);
overflow: auto; overflow: auto;
} }

View File

@ -4,7 +4,7 @@
<el-col :span="24"> <el-col :span="24">
<h5>{{ $t('i18n.automation') }}</h5> <h5>{{ $t('i18n.automation') }}</h5>
<el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel" <el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"> v-permission="['PROJECT_MESSAGE:READ+EDIT']">
{{ $t('organization.message.create_new_notification') }} {{ $t('organization.message.create_new_notification') }}
</el-button> </el-button>
</el-col> </el-col>
@ -101,7 +101,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
:tip="$t('commons.edit')" :tip="$t('commons.edit')"
@click="handleEditTask(scope.$index,scope.row)" @click="handleEditTask(scope.$index,scope.row)"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
<ms-tip-button <ms-tip-button
circle circle
type="danger" type="danger"
@ -110,7 +110,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
@click="deleteRowTask(scope.$index,scope.row)" @click="deleteRowTask(scope.$index,scope.row)"
:tip="$t('commons.delete')" :tip="$t('commons.delete')"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -4,7 +4,7 @@
<el-col :span="24"> <el-col :span="24">
<h5>{{ $t('i18n.definition') }}</h5> <h5>{{ $t('i18n.definition') }}</h5>
<el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel" <el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"> v-permission="['PROJECT_MESSAGE:READ+EDIT']">
{{ $t('organization.message.create_new_notification') }} {{ $t('organization.message.create_new_notification') }}
</el-button> </el-button>
</el-col> </el-col>
@ -101,7 +101,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
:tip="$t('commons.edit')" :tip="$t('commons.edit')"
@click="handleEditTask(scope.$index,scope.row)" @click="handleEditTask(scope.$index,scope.row)"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
<ms-tip-button <ms-tip-button
circle circle
type="danger" type="danger"
@ -110,7 +110,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
@click="deleteRowTask(scope.$index,scope.row)" @click="deleteRowTask(scope.$index,scope.row)"
:tip="$t('commons.delete')" :tip="$t('commons.delete')"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -4,7 +4,7 @@
<el-col :span="24"> <el-col :span="24">
<h5>{{ $t('i18n.home') }}</h5> <h5>{{ $t('i18n.home') }}</h5>
<el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel" <el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"> v-permission="['PROJECT_MESSAGE:READ+EDIT']">
{{ $t('organization.message.create_new_notification') }} {{ $t('organization.message.create_new_notification') }}
</el-button> </el-button>
</el-col> </el-col>
@ -101,7 +101,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
:tip="$t('commons.edit')" :tip="$t('commons.edit')"
@click="handleEditTask(scope.$index,scope.row)" @click="handleEditTask(scope.$index,scope.row)"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
<ms-tip-button <ms-tip-button
circle circle
type="danger" type="danger"
@ -110,7 +110,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
@click="deleteRowTask(scope.$index,scope.row)" @click="deleteRowTask(scope.$index,scope.row)"
:tip="$t('commons.delete')" :tip="$t('commons.delete')"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -4,7 +4,7 @@
<el-col :span="24"> <el-col :span="24">
<h5>{{ $t('i18n.report') }}</h5> <h5>{{ $t('i18n.report') }}</h5>
<el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel" <el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"> v-permission="['PROJECT_MESSAGE:READ+EDIT']">
{{ $t('organization.message.create_new_notification') }} {{ $t('organization.message.create_new_notification') }}
</el-button> </el-button>
</el-col> </el-col>
@ -101,7 +101,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
:tip="$t('commons.edit')" :tip="$t('commons.edit')"
@click="handleEditTask(scope.$index,scope.row)" @click="handleEditTask(scope.$index,scope.row)"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
<ms-tip-button <ms-tip-button
circle circle
type="danger" type="danger"
@ -110,7 +110,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
@click="deleteRowTask(scope.$index,scope.row)" @click="deleteRowTask(scope.$index,scope.row)"
:tip="$t('commons.delete')" :tip="$t('commons.delete')"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -4,7 +4,7 @@
<el-col :span="24"> <el-col :span="24">
<h3>{{ $t('organization.message.jenkins_task_notification') }}</h3> <h3>{{ $t('organization.message.jenkins_task_notification') }}</h3>
<el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel" <el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"> v-permission="['PROJECT_MESSAGE:READ+EDIT']">
{{ $t('organization.message.create_new_notification') }} {{ $t('organization.message.create_new_notification') }}
</el-button> </el-button>
</el-col> </el-col>
@ -102,7 +102,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
:tip="$t('commons.edit')" :tip="$t('commons.edit')"
@click="handleEditTask(scope.$index,scope.row)" @click="handleEditTask(scope.$index,scope.row)"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
<ms-tip-button <ms-tip-button
circle circle
type="danger" type="danger"
@ -111,7 +111,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
@click="deleteRowTask(scope.$index,scope.row)" @click="deleteRowTask(scope.$index,scope.row)"
:tip="$t('commons.delete')" :tip="$t('commons.delete')"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -4,7 +4,7 @@
<el-col :span="24"> <el-col :span="24">
<h5>{{ $t('i18n.report') }}</h5> <h5>{{ $t('i18n.report') }}</h5>
<el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel" <el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"> v-permission="['PROJECT_MESSAGE:READ+EDIT']">
{{ $t('organization.message.create_new_notification') }} {{ $t('organization.message.create_new_notification') }}
</el-button> </el-button>
</el-col> </el-col>
@ -101,7 +101,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
:tip="$t('commons.edit')" :tip="$t('commons.edit')"
@click="handleEditTask(scope.$index,scope.row)" @click="handleEditTask(scope.$index,scope.row)"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
<ms-tip-button <ms-tip-button
circle circle
type="danger" type="danger"
@ -110,7 +110,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
@click="deleteRowTask(scope.$index,scope.row)" @click="deleteRowTask(scope.$index,scope.row)"
:tip="$t('commons.delete')" :tip="$t('commons.delete')"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -4,7 +4,7 @@
<el-col :span="24"> <el-col :span="24">
<h5>{{ $t('commons.performance') }}</h5> <h5>{{ $t('commons.performance') }}</h5>
<el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel" <el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"> v-permission="['PROJECT_MESSAGE:READ+EDIT']">
{{ $t('organization.message.create_new_notification') }} {{ $t('organization.message.create_new_notification') }}
</el-button> </el-button>
</el-col> </el-col>
@ -101,7 +101,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
:tip="$t('commons.edit')" :tip="$t('commons.edit')"
@click="handleEditTask(scope.$index,scope.row)" @click="handleEditTask(scope.$index,scope.row)"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
<ms-tip-button <ms-tip-button
circle circle
type="danger" type="danger"
@ -110,7 +110,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
@click="deleteRowTask(scope.$index,scope.row)" @click="deleteRowTask(scope.$index,scope.row)"
:tip="$t('commons.delete')" :tip="$t('commons.delete')"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -4,7 +4,7 @@
<el-col :span="24"> <el-col :span="24">
<h5>{{ $t('test_track.issue.issue') }}</h5> <h5>{{ $t('test_track.issue.issue') }}</h5>
<el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel" <el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"> v-permission="['PROJECT_MESSAGE:READ+EDIT']">
{{ $t('organization.message.create_new_notification') }} {{ $t('organization.message.create_new_notification') }}
</el-button> </el-button>
</el-col> </el-col>
@ -101,7 +101,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
:tip="$t('commons.edit')" :tip="$t('commons.edit')"
@click="handleEditTask(scope.$index,scope.row)" @click="handleEditTask(scope.$index,scope.row)"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
<ms-tip-button <ms-tip-button
circle circle
type="danger" type="danger"
@ -110,7 +110,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
@click="deleteRowTask(scope.$index,scope.row)" @click="deleteRowTask(scope.$index,scope.row)"
:tip="$t('commons.delete')" :tip="$t('commons.delete')"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -4,7 +4,7 @@
<el-col :span="24"> <el-col :span="24">
<h5>{{ $t('test_track.case.test_case') }}</h5> <h5>{{ $t('test_track.case.test_case') }}</h5>
<el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel" <el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"> v-permission="['PROJECT_MESSAGE:READ+EDIT']">
{{ $t('organization.message.create_new_notification') }} {{ $t('organization.message.create_new_notification') }}
</el-button> </el-button>
</el-col> </el-col>
@ -101,7 +101,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
:tip="$t('commons.edit')" :tip="$t('commons.edit')"
@click="handleEditTask(scope.$index,scope.row)" @click="handleEditTask(scope.$index,scope.row)"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
<ms-tip-button <ms-tip-button
circle circle
type="danger" type="danger"
@ -110,7 +110,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
@click="deleteRowTask(scope.$index,scope.row)" @click="deleteRowTask(scope.$index,scope.row)"
:tip="$t('commons.delete')" :tip="$t('commons.delete')"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -4,7 +4,7 @@
<el-col :span="24"> <el-col :span="24">
<h5>{{ $t('test_track.plan.test_plan') }}</h5> <h5>{{ $t('test_track.plan.test_plan') }}</h5>
<el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel" <el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"> v-permission="['PROJECT_MESSAGE:READ+EDIT']">
{{ $t('organization.message.create_new_notification') }} {{ $t('organization.message.create_new_notification') }}
</el-button> </el-button>
</el-col> </el-col>
@ -100,7 +100,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
:tip="$t('commons.edit')" :tip="$t('commons.edit')"
@click="handleEditTask(scope.$index,scope.row)" @click="handleEditTask(scope.$index,scope.row)"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
<ms-tip-button <ms-tip-button
circle circle
type="danger" type="danger"
@ -109,7 +109,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
@click="deleteRowTask(scope.$index,scope.row)" @click="deleteRowTask(scope.$index,scope.row)"
:tip="$t('commons.delete')" :tip="$t('commons.delete')"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -4,7 +4,7 @@
<el-col :span="24"> <el-col :span="24">
<h5>{{ $t('test_track.review.test_review') }}</h5> <h5>{{ $t('test_track.review.test_review') }}</h5>
<el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel" <el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"> v-permission="['PROJECT_MESSAGE:READ+EDIT']">
{{ $t('organization.message.create_new_notification') }} {{ $t('organization.message.create_new_notification') }}
</el-button> </el-button>
</el-col> </el-col>
@ -101,7 +101,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
:tip="$t('commons.edit')" :tip="$t('commons.edit')"
@click="handleEditTask(scope.$index,scope.row)" @click="handleEditTask(scope.$index,scope.row)"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
<ms-tip-button <ms-tip-button
circle circle
type="danger" type="danger"
@ -110,7 +110,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
@click="deleteRowTask(scope.$index,scope.row)" @click="deleteRowTask(scope.$index,scope.row)"
:tip="$t('commons.delete')" :tip="$t('commons.delete')"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -4,7 +4,7 @@
<el-col :span="24"> <el-col :span="24">
<h5>{{ $t('i18n.home') }}</h5> <h5>{{ $t('i18n.home') }}</h5>
<el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel" <el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"> v-permission="['PROJECT_MESSAGE:READ+EDIT']">
{{ $t('organization.message.create_new_notification') }} {{ $t('organization.message.create_new_notification') }}
</el-button> </el-button>
</el-col> </el-col>
@ -101,7 +101,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
:tip="$t('commons.edit')" :tip="$t('commons.edit')"
@click="handleEditTask(scope.$index,scope.row)" @click="handleEditTask(scope.$index,scope.row)"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
<ms-tip-button <ms-tip-button
circle circle
type="danger" type="danger"
@ -110,7 +110,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
@click="deleteRowTask(scope.$index,scope.row)" @click="deleteRowTask(scope.$index,scope.row)"
:tip="$t('commons.delete')" :tip="$t('commons.delete')"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -4,7 +4,7 @@
<el-col :span="24"> <el-col :span="24">
<h5>{{ $t('i18n.report') }}</h5> <h5>{{ $t('i18n.report') }}</h5>
<el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel" <el-button icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"> v-permission="['PROJECT_MESSAGE:READ+EDIT']">
{{ $t('organization.message.create_new_notification') }} {{ $t('organization.message.create_new_notification') }}
</el-button> </el-button>
</el-col> </el-col>
@ -101,7 +101,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
:tip="$t('commons.edit')" :tip="$t('commons.edit')"
@click="handleEditTask(scope.$index,scope.row)" @click="handleEditTask(scope.$index,scope.row)"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
<ms-tip-button <ms-tip-button
circle circle
type="danger" type="danger"
@ -110,7 +110,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
@click="deleteRowTask(scope.$index,scope.row)" @click="deleteRowTask(scope.$index,scope.row)"
:tip="$t('commons.delete')" :tip="$t('commons.delete')"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -1,12 +1,15 @@
const ProjectSetting = () => import('@/business/components/project/ProjectSetting') const ProjectSetting = () => import('@/business/components/project/ProjectSetting');
const ProjectHome = () => import('@/business/components/project/home/ProjectHome') const ProjectHome = () => import('@/business/components/project/home/ProjectHome');
const ProjectMember = () => import('@/business/components/project/menu/Member') const ProjectMember = () => import('@/business/components/project/menu/Member');
const ProjectEnv = () => import('@/business/components/project/menu/EnvironmentList') const ProjectEnv = () => import('@/business/components/project/menu/EnvironmentList');
const ProjectLog = () => import('@/business/components/project/menu/Log') const ProjectLog = () => import('@/business/components/project/menu/Log');
const ProjectCodeSegment = () => import('@/business/components/project/menu/function/CustomFunction') const ProjectCodeSegment = () => import('@/business/components/project/menu/function/CustomFunction');
const ProjectFileManage = () => import('@/business/components/project/menu/file/FileManage') const ProjectFileManage = () => import('@/business/components/project/menu/file/FileManage');
const ProjectUserGroup = () => import('@/business/components/project/menu/UserGroup') const ProjectUserGroup = () => import('@/business/components/project/menu/UserGroup');
const ProjectAppManage = () => import('@/business/components/project/menu/appmanage/AppManage') const ProjectAppManage = () => import('@/business/components/project/menu/appmanage/AppManage');
const MessageSetting = () => import('@/business/components/project/notification/MessageSettings');
const TemplateSetting = () => import('@/business/components/project/template/TemplateSetting');
const requireContext = require.context('@/business/components/xpack/', true, /router\.js$/); const requireContext = require.context('@/business/components/xpack/', true, /router\.js$/);
const ProjectVersion = requireContext.keys().map(key => requireContext(key).projectVersion); const ProjectVersion = requireContext.keys().map(key => requireContext(key).projectVersion);
@ -57,6 +60,14 @@ export default {
path: 'app', path: 'app',
component: ProjectAppManage component: ProjectAppManage
}, },
{
path: 'template',
component: TemplateSetting,
},
{
path: 'messagesettings',
component: MessageSetting,
},
...ProjectVersion, ...ProjectVersion,
...ErrorReportLibrary, ...ErrorReportLibrary,
] ]

View File

@ -57,9 +57,10 @@
<script> <script>
import MsEditDialog from "@/business/components/common/components/MsEditDialog"; import MsEditDialog from "@/business/components/common/components/MsEditDialog";
import MsSingleHandleDrag from "@/business/components/common/components/MsSingleHandleDrag"; import MsSingleHandleDrag from "@/business/components/common/components/MsSingleHandleDrag";
import {getCurrentWorkspaceId} from "@/common/js/utils"; import {getCurrentProjectID} from "@/common/js/utils";
import {CUSTOM_FIELD_SCENE_OPTION, CUSTOM_FIELD_TYPE_OPTION, SYSTEM_FIELD_NAME_MAP} from "@/common/js/table-constants"; import {CUSTOM_FIELD_SCENE_OPTION, CUSTOM_FIELD_TYPE_OPTION, SYSTEM_FIELD_NAME_MAP} from "@/common/js/table-constants";
import i18n from "@/i18n/i18n"; import i18n from "@/i18n/i18n";
export default { export default {
name: "CustomFieldEdit", name: "CustomFieldEdit",
components: {MsSingleHandleDrag, MsEditDialog}, components: {MsSingleHandleDrag, MsEditDialog},
@ -162,7 +163,7 @@ export default {
return; return;
} }
Object.assign(param, this.form); Object.assign(param, this.form);
param.workspaceId = getCurrentWorkspaceId(); param.projectId = getCurrentProjectID();
if (['select','multipleSelect','radio','checkbox'].indexOf(param.type) > -1) { if (['select','multipleSelect','radio','checkbox'].indexOf(param.type) > -1) {
if (param.options.length < 1) { if (param.options.length < 1) {
this.$warning(this.$t('custom_field.option_check')); this.$warning(this.$t('custom_field.option_check'));

View File

@ -70,14 +70,16 @@
import MsTableOperatorButton from "@/business/components/common/components/MsTableOperatorButton"; import MsTableOperatorButton from "@/business/components/common/components/MsTableOperatorButton";
import MsTable from "@/business/components/common/components/table/MsTable"; import MsTable from "@/business/components/common/components/table/MsTable";
import MsTableColumn from "@/business/components/common/components/table/MsTableColumn"; import MsTableColumn from "@/business/components/common/components/table/MsTableColumn";
import FieldCustomDataTableItem from "@/business/components/settings/workspace/template/FieldCustomDataTableItem"; import FieldCustomDataTableItem from "@/business/components/project/template/FieldCustomDataTableItem";
import CustomFiledComponent from "@/business/components/settings/workspace/template/CustomFiledComponent"; import CustomFiledComponent from "@/business/components/project/template/CustomFiledComponent";
import {SYSTEM_FIELD_NAME_MAP} from "@/common/js/table-constants"; import {SYSTEM_FIELD_NAME_MAP} from "@/common/js/table-constants";
export default { export default {
name: "CustomFieldFormList", name: "CustomFieldFormList",
components: { components: {
CustomFiledComponent, CustomFiledComponent,
FieldCustomDataTableItem, MsTableColumn, MsTable, MsTableOperatorButton}, FieldCustomDataTableItem, MsTableColumn, MsTable, MsTableOperatorButton
},
data() { data() {
return { return {
result: {}, result: {},

View File

@ -3,7 +3,7 @@
<template v-slot:header> <template v-slot:header>
<ms-table-header :condition.sync="condition" @search="getCustomFields" @create="handleCreate" <ms-table-header :condition.sync="condition" @search="getCustomFields" @create="handleCreate"
:create-tip="$t('custom_field.create')" :title="$t('custom_field.name')"/> :create-tip="$t('custom_field.create')"/>
</template> </template>
<ms-table <ms-table
@ -30,10 +30,10 @@
prop="name"> prop="name">
<template v-slot="scope"> <template v-slot="scope">
<span v-if="scope.row.system"> <span v-if="scope.row.system">
{{$t(systemNameMap[scope.row.name])}} {{ $t(systemNameMap[scope.row.name]) }}
</span> </span>
<span v-else> <span v-else>
{{scope.row.name}} {{ scope.row.name }}
</span> </span>
</template> </template>
</ms-table-column> </ms-table-column>
@ -67,10 +67,10 @@
prop="system"> prop="system">
<template v-slot="scope"> <template v-slot="scope">
<span v-if="scope.row.system"> <span v-if="scope.row.system">
{{$t('commons.yes')}} {{ $t('commons.yes') }}
</span> </span>
<span v-else> <span v-else>
{{$t('commons.no')}} {{ $t('commons.no') }}
</span> </span>
</template> </template>
</ms-table-column> </ms-table-column>
@ -108,7 +108,8 @@
</ms-table> </ms-table>
<ms-table-pagination :change="getCustomFields" :current-page.sync="currentPage" :page-size.sync="pageSize" :total="total"/> <ms-table-pagination :change="getCustomFields" :current-page.sync="currentPage" :page-size.sync="pageSize"
:total="total"/>
<custom-field-edit <custom-field-edit
@refresh="getCustomFields" @refresh="getCustomFields"
@ -120,17 +121,18 @@
<script> <script>
import MsTable from "@/business/components/common/components/table/MsTable"; import MsTable from "@/business/components/common/components/table/MsTable";
import {getCurrentWorkspaceId, getDefaultTableHeight, getTranslateOptions} from "@/common/js/utils"; import {getCurrentProjectID, getTranslateOptions} from "@/common/js/utils";
import MsTableColumn from "@/business/components/common/components/table/MsTableColumn"; import MsTableColumn from "@/business/components/common/components/table/MsTableColumn";
import MsTableOperators from "@/business/components/common/components/MsTableOperators"; import MsTableOperators from "@/business/components/common/components/MsTableOperators";
import MsTableButton from "@/business/components/common/components/MsTableButton"; import MsTableButton from "@/business/components/common/components/MsTableButton";
import CustomFieldEdit from "@/business/components/settings/workspace/template/CustomFieldEdit"; import CustomFieldEdit from "@/business/components/project/template/CustomFieldEdit";
import MsTablePagination from "@/business/components/common/pagination/TablePagination"; import MsTablePagination from "@/business/components/common/pagination/TablePagination";
import { import {
CUSTOM_FIELD_SCENE_OPTION, CUSTOM_FIELD_SCENE_OPTION,
CUSTOM_FIELD_TYPE_OPTION, CUSTOM_FIELD_TYPE_OPTION,
FIELD_TYPE_MAP, FIELD_TYPE_MAP,
SCENE_MAP, SYSTEM_FIELD_NAME_MAP SCENE_MAP,
SYSTEM_FIELD_NAME_MAP
} from "@/common/js/table-constants"; } from "@/common/js/table-constants";
import MsTableHeader from "@/business/components/common/components/MsTableHeader"; import MsTableHeader from "@/business/components/common/components/MsTableHeader";
import HeaderCustom from "@/business/components/common/head/HeaderCustom"; import HeaderCustom from "@/business/components/common/head/HeaderCustom";
@ -143,7 +145,8 @@ export default {
MsCustomTableHeader, MsCustomTableHeader,
HeaderCustom, HeaderCustom,
MsTableHeader, MsTableHeader,
MsTablePagination, CustomFieldEdit, MsTableButton, MsTableOperators, MsTableColumn, MsTable}, MsTablePagination, CustomFieldEdit, MsTableButton, MsTableOperators, MsTableColumn, MsTable
},
data() { data() {
return { return {
tableData: [], tableData: [],
@ -172,7 +175,7 @@ export default {
sceneFilters: [], sceneFilters: [],
}; };
}, },
activated() { created() {
this.getCustomFields(); this.getCustomFields();
this.fieldFilters = getTranslateOptions(CUSTOM_FIELD_TYPE_OPTION); this.fieldFilters = getTranslateOptions(CUSTOM_FIELD_TYPE_OPTION);
this.sceneFilters = getTranslateOptions(CUSTOM_FIELD_SCENE_OPTION); this.sceneFilters = getTranslateOptions(CUSTOM_FIELD_SCENE_OPTION);
@ -188,18 +191,19 @@ export default {
return SYSTEM_FIELD_NAME_MAP; return SYSTEM_FIELD_NAME_MAP;
}, },
tableHeight() { tableHeight() {
return getDefaultTableHeight(); return document.documentElement.clientHeight - 240;
} }
}, },
methods: { methods: {
getCustomFields() { getCustomFields() {
this.condition.workspaceId = getCurrentWorkspaceId(); this.condition.projectId = getCurrentProjectID();
this.result = this.$post('custom/field/list/' + this.currentPage + '/' + this.pageSize, this.result = this.$post('custom/field/list/' + this.currentPage + '/' + this.pageSize, this.condition, (response) => {
this.condition, (response) => {
let data = response.data; let data = response.data;
this.total = data.itemCount; this.total = data.itemCount;
this.tableData = data.listObject; this.tableData = data.listObject;
this.$refs.table.reloadTable(); if (this.$refs.table) {
this.$refs.table.reloadTable();
}
}); });
}, },
handleEdit(data) { handleEdit(data) {
@ -216,7 +220,7 @@ export default {
this.$refs.customFieldEdit.open(copyData); this.$refs.customFieldEdit.open(copyData);
}, },
handleDelete(data) { handleDelete(data) {
this.result = this.$get('custom/field/delete/' + data.id, () => { this.result = this.$get('custom/field/delete/' + data.id, () => {
this.$success(this.$t('commons.delete_success')); this.$success(this.$t('commons.delete_success'));
this.getCustomFields(); this.getCustomFields();
}); });

View File

@ -103,6 +103,7 @@ import MsTablePagination from "@/business/components/common/pagination/TablePagi
import {CUSTOM_FIELD_TYPE_OPTION, FIELD_TYPE_MAP, SYSTEM_FIELD_NAME_MAP} from "@/common/js/table-constants"; import {CUSTOM_FIELD_TYPE_OPTION, FIELD_TYPE_MAP, SYSTEM_FIELD_NAME_MAP} from "@/common/js/table-constants";
import MsTableHeader from "@/business/components/common/components/MsTableHeader"; import MsTableHeader from "@/business/components/common/components/MsTableHeader";
import MsEditDialog from "@/business/components/common/components/MsEditDialog"; import MsEditDialog from "@/business/components/common/components/MsEditDialog";
export default { export default {
name: "CustomFieldRelateList", name: "CustomFieldRelateList",
components: { components: {

View File

@ -115,6 +115,7 @@ import MsTableColumn from "@/business/components/common/components/table/MsTable
import {getCurrentProjectID} from "@/common/js/utils"; import {getCurrentProjectID} from "@/common/js/utils";
import MsInputTag from "@/business/components/api/automation/scenario/MsInputTag"; import MsInputTag from "@/business/components/api/automation/scenario/MsInputTag";
import MsMarkDownText from "@/business/components/track/case/components/MsMarkDownText"; import MsMarkDownText from "@/business/components/track/case/components/MsMarkDownText";
export default { export default {
name: "CustomFiledComponent", name: "CustomFiledComponent",
components: {MsMarkDownText, MsInputTag, MsTableColumn}, components: {MsMarkDownText, MsInputTag, MsTableColumn},

View File

@ -13,6 +13,7 @@
<script> <script>
import MsTableColumn from "@/business/components/common/components/table/MsTableColumn"; import MsTableColumn from "@/business/components/common/components/table/MsTableColumn";
export default { export default {
name: "FieldCustomDataTableItem", name: "FieldCustomDataTableItem",
components: {MsTableColumn}, components: {MsTableColumn},

View File

@ -71,10 +71,10 @@ import draggable from 'vuedraggable';
import TemplateComponentEditHeader import TemplateComponentEditHeader
from "@/business/components/track/plan/view/comonents/report/TemplateComponentEditHeader"; from "@/business/components/track/plan/view/comonents/report/TemplateComponentEditHeader";
import MsFormDivider from "@/business/components/common/components/MsFormDivider"; import MsFormDivider from "@/business/components/common/components/MsFormDivider";
import CustomFieldFormList from "@/business/components/settings/workspace/template/CustomFieldFormList"; import CustomFieldFormList from "@/business/components/project/template/CustomFieldFormList";
import CustomFieldRelateList from "@/business/components/settings/workspace/template/CustomFieldRelateList"; import CustomFieldRelateList from "@/business/components/project/template/CustomFieldRelateList";
import {getCurrentWorkspaceId} from "@/common/js/utils"; import {getCurrentProjectID} from "@/common/js/utils";
import CustomFieldEdit from "@/business/components/settings/workspace/template/CustomFieldEdit"; import CustomFieldEdit from "@/business/components/project/template/CustomFieldEdit";
import {generateTableHeaderKey, getCustomFieldsKeys} from "@/common/js/tableUtils"; import {generateTableHeaderKey, getCustomFieldsKeys} from "@/common/js/tableUtils";
export default { export default {
@ -145,7 +145,7 @@ export default {
param.steps = JSON.stringify(this.form.steps); param.steps = JSON.stringify(this.form.steps);
} }
param.options = JSON.stringify(this.form.options); param.options = JSON.stringify(this.form.options);
param.workspaceId = getCurrentWorkspaceId(); param.projectId = getCurrentProjectID();
let customFields = this.relateFields; let customFields = this.relateFields;
if (customFields) { if (customFields) {
let keys = getCustomFieldsKeys(customFields); let keys = getCustomFieldsKeys(customFields);
@ -207,7 +207,7 @@ export default {
}, },
appendDefaultFiled() { appendDefaultFiled() {
let condition = { let condition = {
workspaceId: getCurrentWorkspaceId(), projectId: getCurrentProjectID(),
scene: this.scene scene: this.scene
}; };
this.result = this.$post('custom/field/default', condition, (response) => { this.result = this.$post('custom/field/default', condition, (response) => {

View File

@ -43,9 +43,9 @@ import TemplateComponentEditHeader
from "@/business/components/track/plan/view/comonents/report/TemplateComponentEditHeader"; from "@/business/components/track/plan/view/comonents/report/TemplateComponentEditHeader";
import MsFormDivider from "@/business/components/common/components/MsFormDivider"; import MsFormDivider from "@/business/components/common/components/MsFormDivider";
import {ISSUE_PLATFORM_OPTION} from "@/common/js/table-constants"; import {ISSUE_PLATFORM_OPTION} from "@/common/js/table-constants";
import CustomFieldFormList from "@/business/components/settings/workspace/template/CustomFieldFormList"; import CustomFieldFormList from "@/business/components/project/template/CustomFieldFormList";
import CustomFieldRelateList from "@/business/components/settings/workspace/template/CustomFieldRelateList"; import CustomFieldRelateList from "@/business/components/project/template/CustomFieldRelateList";
import FieldTemplateEdit from "@/business/components/settings/workspace/template/FieldTemplateEdit"; import FieldTemplateEdit from "@/business/components/project/template/FieldTemplateEdit";
import FormRIchTextItem from "@/business/components/track/case/components/FormRichTextItem"; import FormRIchTextItem from "@/business/components/track/case/components/FormRichTextItem";
import {LOCAL} from "@/common/js/constants"; import {LOCAL} from "@/common/js/constants";

View File

@ -3,8 +3,7 @@
<template v-slot:header> <template v-slot:header>
<ms-table-header :condition.sync="condition" @search="initTableData" @create="handleCreate" <ms-table-header :condition.sync="condition" @search="initTableData" @create="handleCreate"
:create-tip="$t('custom_field.create_issue_template')" :create-tip="$t('custom_field.create_issue_template')"/>
:title="$t('custom_field.issue_template')"/>
</template> </template>
<ms-table <ms-table
@ -67,7 +66,8 @@
</ms-table-column> </ms-table-column>
</ms-table> </ms-table>
<ms-table-pagination :change="initTableData" :current-page.sync="currentPage" :page-size.sync="pageSize" :total="total"/> <ms-table-pagination :change="initTableData" :current-page.sync="currentPage" :page-size.sync="pageSize"
:total="total"/>
<issue-template-edit ref="templateEdit" @refresh="initTableData"/> <issue-template-edit ref="templateEdit" @refresh="initTableData"/>
@ -77,16 +77,16 @@
<script> <script>
import {ISSUE_TEMPLATE_LIST} from "@/common/js/default-table-header"; import {ISSUE_TEMPLATE_LIST} from "@/common/js/default-table-header";
import {ISSUE_PLATFORM_OPTION} from "@/common/js/table-constants"; import {ISSUE_PLATFORM_OPTION} from "@/common/js/table-constants";
import {getCurrentWorkspaceId, getDefaultTableHeight} from "@/common/js/utils"; import {getCurrentProjectID} from "@/common/js/utils";
import MsTableHeader from "@/business/components/common/components/MsTableHeader"; import MsTableHeader from "@/business/components/common/components/MsTableHeader";
import MsTablePagination from "@/business/components/common/pagination/TablePagination"; import MsTablePagination from "@/business/components/common/pagination/TablePagination";
import MsTableButton from "@/business/components/common/components/MsTableButton"; import MsTableButton from "@/business/components/common/components/MsTableButton";
import MsTableOperators from "@/business/components/common/components/MsTableOperators"; import MsTableOperators from "@/business/components/common/components/MsTableOperators";
import MsTableColumn from "@/business/components/common/components/table/MsTableColumn"; import MsTableColumn from "@/business/components/common/components/table/MsTableColumn";
import MsTable from "@/business/components/common/components/table/MsTable"; import MsTable from "@/business/components/common/components/table/MsTable";
import TestCaseReportTemplate from "@/business/components/settings/workspace/template/TestCaseReportTemplate"; import TestCaseReportTemplate from "@/business/components/project/template/TestCaseReportTemplate";
import TestCaseTemplateEdit from "@/business/components/settings/workspace/template/TestCaseTemplateEdit"; import TestCaseTemplateEdit from "@/business/components/project/template/TestCaseTemplateEdit";
import IssueTemplateEdit from "@/business/components/settings/workspace/template/IssueTemplateEdit"; import IssueTemplateEdit from "@/business/components/project/template/IssueTemplateEdit";
export default { export default {
name: "IssuesTemplateList", name: "IssuesTemplateList",
@ -95,7 +95,8 @@ export default {
TestCaseTemplateEdit, TestCaseTemplateEdit,
TestCaseReportTemplate, TestCaseReportTemplate,
MsTableHeader, MsTableHeader,
MsTablePagination, MsTableButton, MsTableOperators, MsTableColumn, MsTable}, MsTablePagination, MsTableButton, MsTableOperators, MsTableColumn, MsTable
},
data() { data() {
return { return {
tableData: [], tableData: [],
@ -104,7 +105,7 @@ export default {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
result: {}, result: {},
issuePlatformMap:{ issuePlatformMap: {
Local: 'Metersphere', Local: 'Metersphere',
Jira: 'JIRA', Jira: 'JIRA',
Tapd: 'Tapd', Tapd: 'Tapd',
@ -127,7 +128,7 @@ export default {
], ],
}; };
}, },
activated() { created() {
this.initTableData(); this.initTableData();
}, },
computed: { computed: {
@ -138,18 +139,20 @@ export default {
return ISSUE_PLATFORM_OPTION; return ISSUE_PLATFORM_OPTION;
}, },
tableHeight() { tableHeight() {
return getDefaultTableHeight(); return document.documentElement.clientHeight - 240;
} }
}, },
methods: { methods: {
initTableData() { initTableData() {
this.condition.workspaceId = getCurrentWorkspaceId(); this.condition.projectId = getCurrentProjectID();
this.result = this.$post('field/template/issue/list/' + this.currentPage + '/' + this.pageSize, this.result = this.$post('field/template/issue/list/' + this.currentPage + '/' + this.pageSize,
this.condition, (response) => { this.condition, (response) => {
let data = response.data; let data = response.data;
this.total = data.itemCount; this.total = data.itemCount;
this.tableData = data.listObject; this.tableData = data.listObject;
this.$refs.table.reloadTable(); if (this.$refs.table) {
this.$refs.table.reloadTable();
}
}); });
}, },
handleEdit(data) { handleEdit(data) {
@ -165,7 +168,7 @@ export default {
this.$refs.templateEdit.open(copyData, true); this.$refs.templateEdit.open(copyData, true);
}, },
handleDelete(data) { handleDelete(data) {
this.result = this.$get('field/template/issue/delete/' + data.id, () => { this.result = this.$get('field/template/issue/delete/' + data.id, () => {
this.$success(this.$t('commons.delete_success')); this.$success(this.$t('commons.delete_success'));
this.initTableData(); this.initTableData();
}); });

View File

@ -11,7 +11,7 @@
</template> </template>
<script> <script>
import {getCurrentWorkspaceId} from "@/common/js/utils"; import {getCurrentProjectID} from "@/common/js/utils";
import {LOCAL} from "@/common/js/constants"; import {LOCAL} from "@/common/js/constants";
export default { export default {
@ -52,7 +52,7 @@ export default {
if (this.scene === 'ISSUE') { if (this.scene === 'ISSUE') {
url = 'field/template/issue/option/'; url = 'field/template/issue/option/';
} }
this.$get(url + getCurrentWorkspaceId(), (response) => { this.$get(url + getCurrentProjectID(), (response) => {
this.templateOptions = response.data; this.templateOptions = response.data;
this.templateFilterOptions = this.templateOptions; this.templateFilterOptions = this.templateOptions;
if (!this.data[this.prop]) { if (!this.data[this.prop]) {

View File

@ -0,0 +1,64 @@
<template>
<el-card>
<el-tabs class="system-setting" v-model="activeName" @change="changeTab">
<el-tab-pane :label="$t('custom_field.name')" name="field" v-if="fieldEnable">
<custom-field-list v-if="activeName === 'field'"/>
</el-tab-pane>
<el-tab-pane :label="$t('workspace.case_template_manage')" name="caseTemplate" v-if="caseTemplateEnable">
<test-case-template-list v-if="activeName === 'caseTemplate'"/>
</el-tab-pane>
<el-tab-pane :label="$t('workspace.issue_template_manage')" name="issueTemplate" v-if="issueTemplateEnable">
<issues-template-list v-if="activeName === 'issueTemplate'"/>
</el-tab-pane>
</el-tabs>
</el-card>
</template>
<script>
import CustomFieldList from "@/business/components/project/template/CustomFieldList";
import TestCaseTemplateList from "@/business/components/project/template/TestCaseTemplateList";
import IssuesTemplateList from "@/business/components/project/template/IssuesTemplateList";
import {hasPermissions} from "@/common/js/utils";
export default {
name: "TemplateSetting",
components: {IssuesTemplateList, TestCaseTemplateList, CustomFieldList},
data() {
return {
activeName: 'field',
fieldEnable: false,
caseTemplateEnable: false,
issueTemplateEnable: false,
};
},
created() {
this.changeTab();
},
methods: {
hasPermissions,
changeTab() {
// 1
if (hasPermissions('PROJECT_TEMPLATE:READ+ISSUE_TEMPLATE')) {
this.activeName = 'issueTemplate';
this.issueTemplateEnable = true;
}
// 2
if (hasPermissions('PROJECT_TEMPLATE:READ+CASE_TEMPLATE')) {
this.activeName = 'caseTemplate';
this.caseTemplateEnable = true;
}
// 3
if (hasPermissions('PROJECT_TEMPLATE:READ+CUSTOM')) {
this.activeName = 'field';
this.fieldEnable = true;
}
}
}
};
</script>
<style scoped>
</style>

View File

@ -17,24 +17,23 @@
<script> <script>
import MsTableHeader from "../../../common/components/MsTableHeader"; import MsTableHeader from "../../common/components/MsTableHeader";
import TestCaseReportTemplateEdit from "../../../track/plan/view/comonents/report/TestCaseReportTemplateEdit"; import TestCaseReportTemplateEdit from "../../track/plan/view/comonents/report/TestCaseReportTemplateEdit";
import TestcaseTemplateItem from "../../../track/plan/view/comonents/report/TestcaseTemplateItem"; import TestcaseTemplateItem from "../../track/plan/view/comonents/report/TestcaseTemplateItem";
import {WORKSPACE_ID} from '../../../../../common/js/constants'; import MsMainContainer from "../../common/components/MsMainContainer";
import MsMainContainer from "../../../common/components/MsMainContainer"; import {getCurrentWorkspaceId} from "@/common/js/utils";
import {getCurrentWorkspaceId} from "@/common/js/utils";
export default { export default {
name: "TestCaseReportTemplate", name: "TestCaseReportTemplate",
components: {MsMainContainer, TestcaseTemplateItem, TestCaseReportTemplateEdit, MsTableHeader}, components: {MsMainContainer, TestcaseTemplateItem, TestCaseReportTemplateEdit, MsTableHeader},
data() { data() {
return { return {
result: {}, result: {},
condition: {}, condition: {},
templates: [] templates: []
} };
}, },
mounted() { mounted() {
this.initData(); this.initData();
}, },
watch: { watch: {

View File

@ -48,9 +48,9 @@ import TemplateComponentEditHeader
from "@/business/components/track/plan/view/comonents/report/TemplateComponentEditHeader"; from "@/business/components/track/plan/view/comonents/report/TemplateComponentEditHeader";
import MsFormDivider from "@/business/components/common/components/MsFormDivider"; import MsFormDivider from "@/business/components/common/components/MsFormDivider";
import {CASE_TYPE_OPTION} from "@/common/js/table-constants"; import {CASE_TYPE_OPTION} from "@/common/js/table-constants";
import CustomFieldFormList from "@/business/components/settings/workspace/template/CustomFieldFormList"; import CustomFieldFormList from "@/business/components/project/template/CustomFieldFormList";
import CustomFieldRelateList from "@/business/components/settings/workspace/template/CustomFieldRelateList"; import CustomFieldRelateList from "@/business/components/project/template/CustomFieldRelateList";
import FieldTemplateEdit from "@/business/components/settings/workspace/template/FieldTemplateEdit"; import FieldTemplateEdit from "@/business/components/project/template/FieldTemplateEdit";
import FormRichTextItem from "@/business/components/track/case/components/FormRichTextItem"; import FormRichTextItem from "@/business/components/track/case/components/FormRichTextItem";
import TestCaseStepItem from "@/business/components/track/case/components/TestCaseStepItem"; import TestCaseStepItem from "@/business/components/track/case/components/TestCaseStepItem";
import StepChangeItem from "@/business/components/track/case/components/StepChangeItem"; import StepChangeItem from "@/business/components/track/case/components/StepChangeItem";

View File

@ -3,7 +3,7 @@
<template v-slot:header> <template v-slot:header>
<ms-table-header :condition.sync="condition" @search="initTableData" @create="handleCreate" <ms-table-header :condition.sync="condition" @search="initTableData" @create="handleCreate"
:create-tip="$t('custom_field.template_create')" :title="$t('custom_field.case_template')"/> :create-tip="$t('custom_field.template_create')"/>
</template> </template>
<ms-table <ms-table
@ -45,10 +45,10 @@
prop="system"> prop="system">
<template v-slot="scope"> <template v-slot="scope">
<span v-if="scope.row.system"> <span v-if="scope.row.system">
{{$t('commons.yes')}} {{ $t('commons.yes') }}
</span> </span>
<span v-else> <span v-else>
{{$t('commons.no')}} {{ $t('commons.no') }}
</span> </span>
</template> </template>
</ms-table-column> </ms-table-column>
@ -80,7 +80,8 @@
</ms-table-column> </ms-table-column>
</ms-table> </ms-table>
<ms-table-pagination :change="initTableData" :current-page.sync="currentPage" :page-size.sync="pageSize" :total="total"/> <ms-table-pagination :change="initTableData" :current-page.sync="currentPage" :page-size.sync="pageSize"
:total="total"/>
<test-case-template-edit ref="templateEdit" @refresh="initTableData"/> <test-case-template-edit ref="templateEdit" @refresh="initTableData"/>
@ -90,15 +91,15 @@
<script> <script>
import {CUSTOM_FIELD_LIST} from "@/common/js/default-table-header"; import {CUSTOM_FIELD_LIST} from "@/common/js/default-table-header";
import {CASE_TYPE_OPTION} from "@/common/js/table-constants"; import {CASE_TYPE_OPTION} from "@/common/js/table-constants";
import {getCurrentWorkspaceId, getDefaultTableHeight} from "@/common/js/utils"; import {getCurrentProjectID} from "@/common/js/utils";
import MsTableHeader from "@/business/components/common/components/MsTableHeader"; import MsTableHeader from "@/business/components/common/components/MsTableHeader";
import MsTablePagination from "@/business/components/common/pagination/TablePagination"; import MsTablePagination from "@/business/components/common/pagination/TablePagination";
import MsTableButton from "@/business/components/common/components/MsTableButton"; import MsTableButton from "@/business/components/common/components/MsTableButton";
import MsTableOperators from "@/business/components/common/components/MsTableOperators"; import MsTableOperators from "@/business/components/common/components/MsTableOperators";
import MsTableColumn from "@/business/components/common/components/table/MsTableColumn"; import MsTableColumn from "@/business/components/common/components/table/MsTableColumn";
import MsTable from "@/business/components/common/components/table/MsTable"; import MsTable from "@/business/components/common/components/table/MsTable";
import TestCaseReportTemplate from "@/business/components/settings/workspace/template/TestCaseReportTemplate"; import TestCaseReportTemplate from "@/business/components/project/template/TestCaseReportTemplate";
import TestCaseTemplateEdit from "@/business/components/settings/workspace/template/TestCaseTemplateEdit"; import TestCaseTemplateEdit from "@/business/components/project/template/TestCaseTemplateEdit";
export default { export default {
name: "TestCaseTemplateList", name: "TestCaseTemplateList",
@ -106,7 +107,8 @@ export default {
TestCaseTemplateEdit, TestCaseTemplateEdit,
TestCaseReportTemplate, TestCaseReportTemplate,
MsTableHeader, MsTableHeader,
MsTablePagination, MsTableButton, MsTableOperators, MsTableColumn, MsTable}, MsTablePagination, MsTableButton, MsTableOperators, MsTableColumn, MsTable
},
data() { data() {
return { return {
tableData: [], tableData: [],
@ -115,7 +117,7 @@ export default {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
result: {}, result: {},
caseTypeMap:{ caseTypeMap: {
functional: this.$t('api_test.home_page.failed_case_list.table_value.case_type.functional') functional: this.$t('api_test.home_page.failed_case_list.table_value.case_type.functional')
}, },
operators: [ operators: [
@ -134,7 +136,7 @@ export default {
], ],
}; };
}, },
activated() { created() {
this.initTableData(); this.initTableData();
}, },
computed: { computed: {
@ -145,18 +147,20 @@ export default {
return new CASE_TYPE_OPTION(); return new CASE_TYPE_OPTION();
}, },
tableHeight() { tableHeight() {
return getDefaultTableHeight(); return document.documentElement.clientHeight - 240;
} }
}, },
methods: { methods: {
initTableData() { initTableData() {
this.condition.workspaceId = getCurrentWorkspaceId(); this.condition.projectId = getCurrentProjectID();
this.result = this.$post('field/template/case/list/' + this.currentPage + '/' + this.pageSize, this.result = this.$post('field/template/case/list/' + this.currentPage + '/' + this.pageSize,
this.condition, (response) => { this.condition, (response) => {
let data = response.data; let data = response.data;
this.total = data.itemCount; this.total = data.itemCount;
this.tableData = data.listObject; this.tableData = data.listObject;
this.$refs.table.reloadTable(); if (this.$refs.table) {
this.$refs.table.reloadTable();
}
}); });
}, },
handleEdit(data) { handleEdit(data) {
@ -172,7 +176,7 @@ export default {
this.$refs.templateEdit.open(copyData, true); this.$refs.templateEdit.open(copyData, true);
}, },
handleDelete(data) { handleDelete(data) {
this.result = this.$get('field/template/case/delete/' + data.id, () => { this.result = this.$get('field/template/case/delete/' + data.id, () => {
this.$success(this.$t('commons.delete_success')); this.$success(this.$t('commons.delete_success'));
this.initTableData(); this.initTableData();
}); });

View File

@ -54,9 +54,9 @@ export default {
let projectPermissions = hasPermissions('PROJECT_USER:READ', 'PROJECT_ENVIRONMENT:READ', 'PROJECT_OPERATING_LOG:READ', let projectPermissions = hasPermissions('PROJECT_USER:READ', 'PROJECT_ENVIRONMENT:READ', 'PROJECT_OPERATING_LOG:READ',
'PROJECT_FILE:READ+JAR', 'PROJECT_FILE:READ+FILE', 'PROJECT_CUSTOM_CODE:READ'); 'PROJECT_FILE:READ+JAR', 'PROJECT_FILE:READ+FILE', 'PROJECT_CUSTOM_CODE:READ');
let wsPermissions = hasPermissions('WORKSPACE_SERVICE:READ', 'WORKSPACE_MESSAGE:READ', 'WORKSPACE_USER:READ', let wsPermissions = hasPermissions('WORKSPACE_SERVICE:READ', 'PROJECT_MESSAGE:READ', 'WORKSPACE_USER:READ',
'WORKSPACE_PROJECT_MANAGER:READ', 'WORKSPACE_PROJECT_ENVIRONMENT:READ', 'WORKSPACE_OPERATING_LOG:READ', 'WORKSPACE_PROJECT_MANAGER:READ', 'WORKSPACE_PROJECT_ENVIRONMENT:READ', 'WORKSPACE_OPERATING_LOG:READ',
'WORKSPACE_TEMPLATE:READ'); 'PROJECT_TEMPLATE:READ');
let sysPermissions = hasPermissions('SYSTEM_USER:READ', 'SYSTEM_WORKSPACE:READ', 'SYSTEM_GROUP:READ', let sysPermissions = hasPermissions('SYSTEM_USER:READ', 'SYSTEM_WORKSPACE:READ', 'SYSTEM_GROUP:READ',
'SYSTEM_TEST_POOL:READ', 'SYSTEM_SETTING:READ', 'SYSTEM_AUTH:READ', 'SYSTEM_TEST_POOL:READ', 'SYSTEM_SETTING:READ', 'SYSTEM_AUTH:READ',

View File

@ -19,13 +19,6 @@
:index="menu.index" class="setting-item"> :index="menu.index" class="setting-item">
{{ $t(menu.title) }} {{ $t(menu.title) }}
</el-menu-item> </el-menu-item>
<el-submenu index="2-1" v-permission="['WORKSPACE_TEMPLATE:READ']" class="lower_submenu_title">
<template slot="title">{{ $t('workspace.template_manage') }}</template>
<el-menu-item v-for="menu in workspaceTemplate" v-permission="menu.permissions" :key="menu.index"
:index="menu.index" class="setting-item">
{{ $t(menu.title) }}
</el-menu-item>
</el-submenu>
</el-submenu> </el-submenu>
</el-menu> </el-menu>
</template> </template>
@ -64,9 +57,9 @@ export default {
'ORGANIZATION_GROUP:READ', 'SYSTEM_WORKSPACE:READ', 'SYSTEM_TEST_POOL:READ', 'ORGANIZATION_GROUP:READ', 'SYSTEM_WORKSPACE:READ', 'SYSTEM_TEST_POOL:READ',
'SYSTEM_SETTING:READ', 'SYSTEM_QUOTA:READ', 'SYSTEM_AUTH:READ' 'SYSTEM_SETTING:READ', 'SYSTEM_QUOTA:READ', 'SYSTEM_AUTH:READ'
], ],
workspacePermission: ['WORKSPACE_USER:READ', 'WORKSPACE_SERVICE:READ', 'WORKSPACE_MESSAGE:READ', workspacePermission: ['WORKSPACE_USER:READ', 'WORKSPACE_SERVICE:READ',
'WORKSPACE_PROJECT_MANAGER:READ', 'WORKSPACE_PROJECT_ENVIRONMENT:READ', 'WORKSPACE_PROJECT_MANAGER:READ', 'WORKSPACE_PROJECT_ENVIRONMENT:READ',
'WORKSPACE_OPERATING_LOG:READ', 'WORKSPACE_TEMPLATE:READ'] 'WORKSPACE_OPERATING_LOG:READ']
}; };
}, },
methods: { methods: {

View File

@ -28,21 +28,6 @@ export default {
component: () => import('@/business/components/settings/system/group/UserGroup'), component: () => import('@/business/components/settings/system/group/UserGroup'),
meta: {system: true, title: 'group.group_permission', permissions: ['SYSTEM_GROUP:READ', 'ORGANIZATION_GROUP:READ']} meta: {system: true, title: 'group.group_permission', permissions: ['SYSTEM_GROUP:READ', 'ORGANIZATION_GROUP:READ']}
}, },
{
path: 'workspace/template/field',
component: () => import('@/business/components/settings/workspace/template/CustomFieldList'),
meta: {workspaceTemplate: true, title: 'custom_field.name', permissions: ['WORKSPACE_TEMPLATE:READ+CUSTOM']},
},
{
path: 'workspace/template/case',
component: () => import('@/business/components/settings/workspace/template/TestCaseTemplateList'),
meta: {workspaceTemplate: true, title: 'workspace.case_template_manage', permissions: ['WORKSPACE_TEMPLATE:READ+CASE_TEMPLATE']},
},
{
path: 'workspace/template/issues',
component: () => import('@/business/components/settings/workspace/template/IssuesTemplateList'),
meta: {workspaceTemplate: true, title: 'workspace.issue_template_manage', permissions: ['WORKSPACE_TEMPLATE:READ+ISSUE_TEMPLATE']},
},
{ {
path: 'testresourcepool', path: 'testresourcepool',
component: () => import('@/business/components/settings/system/TestResourcePool'), component: () => import('@/business/components/settings/system/TestResourcePool'),
@ -65,11 +50,6 @@ export default {
component: () => import('@/business/components/settings/workspace/ServiceIntegration'), component: () => import('@/business/components/settings/workspace/ServiceIntegration'),
meta: {workspace: true, title: 'organization.service_integration', permissions: ['WORKSPACE_SERVICE:READ']} meta: {workspace: true, title: 'organization.service_integration', permissions: ['WORKSPACE_SERVICE:READ']}
}, },
{
path: 'messagesettings',
component: () => import('@/business/components/settings/workspace/MessageSettings'),
meta: {workspace: true, title: 'organization.message_settings', permissions: ['WORKSPACE_MESSAGE:READ']}
},
{ {
path: 'personsetting', path: 'personsetting',
name: 'PersonSetting', name: 'PersonSetting',

View File

@ -204,7 +204,7 @@ import MsJarConfig from "@/business/components/settings/workspace/JarConfig";
import MsTableButton from "../../common/components/MsTableButton"; import MsTableButton from "../../common/components/MsTableButton";
import {_filter, _sort} from "@/common/js/tableUtils"; import {_filter, _sort} from "@/common/js/tableUtils";
import MsResourceFiles from "@/business/components/performance/test/components/ResourceFiles"; import MsResourceFiles from "@/business/components/performance/test/components/ResourceFiles";
import TemplateSelect from "@/business/components/settings/workspace/template/TemplateSelect"; import TemplateSelect from "@/business/components/project/template/TemplateSelect";
import {PROJECT_CONFIGS} from "@/business/components/common/components/search/search-components"; import {PROJECT_CONFIGS} from "@/business/components/common/components/search/search-components";
import MsRolesTag from "@/business/components/common/components/MsRolesTag"; import MsRolesTag from "@/business/components/common/components/MsRolesTag";
import AddMember from "@/business/components/settings/common/AddMember"; import AddMember from "@/business/components/settings/common/AddMember";

View File

@ -50,22 +50,23 @@
</template> </template>
<script> <script>
import MsDialogFooter from "../../../common/components/MsDialogFooter"; import MsDialogFooter from "../../../common/components/MsDialogFooter";
import {listenGoBack, removeGoBackListener} from "@/common/js/utils"; import {listenGoBack, removeGoBackListener} from "@/common/js/utils";
import EnvPopover from "@/business/components/api/automation/scenario/EnvPopover"; import EnvPopover from "@/business/components/api/automation/scenario/EnvPopover";
import {ENV_TYPE} from "@/common/js/constants"; import {ENV_TYPE} from "@/common/js/constants";
import CustomFiledComponent from "@/business/components/settings/workspace/template/CustomFiledComponent"; import CustomFiledComponent from "@/business/components/project/template/CustomFiledComponent";
export default {
name: "BatchEdit", export default {
components: { name: "BatchEdit",
CustomFiledComponent, components: {
EnvPopover, CustomFiledComponent,
MsDialogFooter EnvPopover,
}, MsDialogFooter
props: { },
typeArr: Array, props: {
valueArr: Object, typeArr: Array,
dialogTitle: { valueArr: Object,
dialogTitle: {
type: String, type: String,
default() { default() {
return this.$t('test_track.case.batch_operate') return this.$t('test_track.case.batch_operate')

View File

@ -165,7 +165,7 @@
<script> <script>
import {TokenKey} from '@/common/js/constants'; import {TokenKey} from '@/common/js/constants';
import MsDialogFooter from '../../../common/components/MsDialogFooter' import MsDialogFooter from '../../../common/components/MsDialogFooter';
import { import {
getCurrentProjectID, getCurrentProjectID,
getCurrentUser, getCurrentUser,
@ -188,7 +188,7 @@ import {API_STATUS, REVIEW_STATUS} from "@/business/components/api/definition/mo
import MsTableButton from "@/business/components/common/components/MsTableButton"; import MsTableButton from "@/business/components/common/components/MsTableButton";
import MsSelectTree from "../../../common/select-tree/SelectTree"; import MsSelectTree from "../../../common/select-tree/SelectTree";
import MsTestCaseStepRichText from "./MsRichText"; import MsTestCaseStepRichText from "./MsRichText";
import CustomFiledComponent from "@/business/components/settings/workspace/template/CustomFiledComponent"; import CustomFiledComponent from "@/business/components/project/template/CustomFiledComponent";
import {buildCustomFields, buildTestCaseOldFields, getTemplate, parseCustomField} from "@/common/js/custom_field"; import {buildCustomFields, buildTestCaseOldFields, getTemplate, parseCustomField} from "@/common/js/custom_field";
import MsFormDivider from "@/business/components/common/components/MsFormDivider"; import MsFormDivider from "@/business/components/common/components/MsFormDivider";
import TestCaseEditOtherInfo from "@/business/components/track/case/components/TestCaseEditOtherInfo"; import TestCaseEditOtherInfo from "@/business/components/track/case/components/TestCaseEditOtherInfo";

View File

@ -150,12 +150,14 @@
<script> <script>
import {TokenKey} from '@/common/js/constants'; import {TokenKey} from '@/common/js/constants';
import MsDialogFooter from '../../../common/components/MsDialogFooter' import MsDialogFooter from '../../../common/components/MsDialogFooter';
import { import {
getCurrentProjectID, getCurrentProjectID,
getCurrentUser, getCurrentUser,
getNodePath, getUUID, getNodePath,
handleCtrlSEvent, hasLicense, hasPermission, getUUID,
handleCtrlSEvent,
hasLicense,
listenGoBack, listenGoBack,
removeGoBackListener removeGoBackListener
} from "@/common/js/utils"; } from "@/common/js/utils";
@ -170,13 +172,8 @@ import {API_STATUS, REVIEW_STATUS} from "@/business/components/api/definition/mo
import MsTableButton from "@/business/components/common/components/MsTableButton"; import MsTableButton from "@/business/components/common/components/MsTableButton";
import MsSelectTree from "../../../common/select-tree/SelectTree"; import MsSelectTree from "../../../common/select-tree/SelectTree";
import MsTestCaseStepRichText from "./MsRichText"; import MsTestCaseStepRichText from "./MsRichText";
import CustomFiledComponent from "@/business/components/settings/workspace/template/CustomFiledComponent"; import CustomFiledComponent from "@/business/components/project/template/CustomFiledComponent";
import { import {buildCustomFields, buildTestCaseOldFields, getTemplate, parseCustomField} from "@/common/js/custom_field";
buildCustomFields,
buildTestCaseOldFields,
getTemplate,
parseCustomField
} from "@/common/js/custom_field";
import MsFormDivider from "@/business/components/common/components/MsFormDivider"; import MsFormDivider from "@/business/components/common/components/MsFormDivider";
import TestCaseEditOtherInfo from "@/business/components/track/case/components/TestCaseEditOtherInfo"; import TestCaseEditOtherInfo from "@/business/components/track/case/components/TestCaseEditOtherInfo";
import FormRichTextItem from "@/business/components/track/case/components/FormRichTextItem"; import FormRichTextItem from "@/business/components/track/case/components/FormRichTextItem";

View File

@ -110,19 +110,14 @@
import TemplateComponentEditHeader import TemplateComponentEditHeader
from "@/business/components/track/plan/view/comonents/report/TemplateComponentEditHeader"; from "@/business/components/track/plan/view/comonents/report/TemplateComponentEditHeader";
import MsFormDivider from "@/business/components/common/components/MsFormDivider"; import MsFormDivider from "@/business/components/common/components/MsFormDivider";
import CustomFieldFormList from "@/business/components/settings/workspace/template/CustomFieldFormList"; import CustomFieldFormList from "@/business/components/project/template/CustomFieldFormList";
import CustomFieldRelateList from "@/business/components/settings/workspace/template/CustomFieldRelateList"; import CustomFieldRelateList from "@/business/components/project/template/CustomFieldRelateList";
import FormRichTextItem from "@/business/components/track/case/components/FormRichTextItem"; import FormRichTextItem from "@/business/components/track/case/components/FormRichTextItem";
import {buildCustomFields, parseCustomField} from "@/common/js/custom_field"; import {buildCustomFields, parseCustomField} from "@/common/js/custom_field";
import CustomFiledComponent from "@/business/components/settings/workspace/template/CustomFiledComponent"; import CustomFiledComponent from "@/business/components/project/template/CustomFiledComponent";
import TestCaseIssueList from "@/business/components/track/issue/TestCaseIssueList"; import TestCaseIssueList from "@/business/components/track/issue/TestCaseIssueList";
import IssueEditDetail from "@/business/components/track/issue/IssueEditDetail"; import IssueEditDetail from "@/business/components/track/issue/IssueEditDetail";
import { import {getCurrentProjectID, getCurrentUser, getCurrentUserId, getCurrentWorkspaceId,} from "@/common/js/utils";
getCurrentProjectID,
getCurrentUser,
getCurrentUserId,
getCurrentWorkspaceId,
} from "@/common/js/utils";
import {enableThirdPartTemplate, getIssuePartTemplateWithProject} from "@/network/Issue"; import {enableThirdPartTemplate, getIssuePartTemplateWithProject} from "@/network/Issue";
import CustomFiledFormItem from "@/business/components/common/components/form/CustomFiledFormItem"; import CustomFiledFormItem from "@/business/components/common/components/form/CustomFiledFormItem";
import MsMarkDownText from "@/business/components/track/case/components/MsMarkDownText"; import MsMarkDownText from "@/business/components/track/case/components/MsMarkDownText";

View File

@ -99,7 +99,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
:tip="$t('commons.edit')" :tip="$t('commons.edit')"
@click="handleEditTask(scope.$index,scope.row)" @click="handleEditTask(scope.$index,scope.row)"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
<ms-tip-button <ms-tip-button
circle circle
type="danger" type="danger"
@ -108,7 +108,7 @@
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
@click="deleteRowTask(scope.$index,scope.row)" @click="deleteRowTask(scope.$index,scope.row)"
:tip="$t('commons.delete')" :tip="$t('commons.delete')"
v-permission="['WORKSPACE_MESSAGE:READ+EDIT']"/> v-permission="['PROJECT_MESSAGE:READ+EDIT']"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -161,12 +161,13 @@ import {buildTestCaseOldFields, getTemplate, parseCustomField} from "@/common/js
import FormRichTextItem from "@/business/components/track/case/components/FormRichTextItem"; import FormRichTextItem from "@/business/components/track/case/components/FormRichTextItem";
import MsFormDivider from "@/business/components/common/components/MsFormDivider"; import MsFormDivider from "@/business/components/common/components/MsFormDivider";
import TestCaseEditOtherInfo from "@/business/components/track/case/components/TestCaseEditOtherInfo"; import TestCaseEditOtherInfo from "@/business/components/track/case/components/TestCaseEditOtherInfo";
import CustomFiledComponent from "@/business/components/settings/workspace/template/CustomFiledComponent"; import CustomFiledComponent from "@/business/components/project/template/CustomFiledComponent";
import {SYSTEM_FIELD_NAME_MAP} from "@/common/js/table-constants"; import {SYSTEM_FIELD_NAME_MAP} from "@/common/js/table-constants";
import IssueDescriptionTableItem from "@/business/components/track/issue/IssueDescriptionTableItem"; import IssueDescriptionTableItem from "@/business/components/track/issue/IssueDescriptionTableItem";
import StepChangeItem from "@/business/components/track/case/components/StepChangeItem"; import StepChangeItem from "@/business/components/track/case/components/StepChangeItem";
import TestCaseStepItem from "@/business/components/track/case/components/TestCaseStepItem"; import TestCaseStepItem from "@/business/components/track/case/components/TestCaseStepItem";
import TestPlanCaseStepResultsItem from "@/business/components/track/plan/view/comonents/functional/TestPlanCaseStepResultsItem"; import TestPlanCaseStepResultsItem
from "@/business/components/track/plan/view/comonents/functional/TestPlanCaseStepResultsItem";
export default { export default {
name: "FunctionalTestCaseEdit", name: "FunctionalTestCaseEdit",

View File

@ -167,7 +167,7 @@ import {buildTestCaseOldFields, getTemplate, parseCustomField} from "@/common/js
import TestCaseEditOtherInfo from "@/business/components/track/case/components/TestCaseEditOtherInfo"; import TestCaseEditOtherInfo from "@/business/components/track/case/components/TestCaseEditOtherInfo";
import {SYSTEM_FIELD_NAME_MAP} from "@/common/js/table-constants"; import {SYSTEM_FIELD_NAME_MAP} from "@/common/js/table-constants";
import FormRichTextItem from "@/business/components/track/case/components/FormRichTextItem"; import FormRichTextItem from "@/business/components/track/case/components/FormRichTextItem";
import CustomFiledComponent from "@/business/components/settings/workspace/template/CustomFiledComponent"; import CustomFiledComponent from "@/business/components/project/template/CustomFiledComponent";
import StepChangeItem from "@/business/components/track/case/components/StepChangeItem"; import StepChangeItem from "@/business/components/track/case/components/StepChangeItem";
import TestCaseStepItem from "@/business/components/track/case/components/TestCaseStepItem"; import TestCaseStepItem from "@/business/components/track/case/components/TestCaseStepItem";
import MsPreviousNextButton from "@/business/components/common/components/MsPreviousNextButton"; import MsPreviousNextButton from "@/business/components/common/components/MsPreviousNextButton";

View File

@ -2823,12 +2823,12 @@ export default {
read: "READ", read: "READ",
edit: "EDIT", edit: "EDIT",
}, },
workspace_message: { project_message: {
name: "Message", name: "Message",
read: "READ", read: "READ",
edit: "EDIT", edit: "EDIT",
}, },
workspace_template: { project_template: {
name: "Template", name: "Template",
read: "READ", read: "READ",
case_template: "CASE TEMPLATE", case_template: "CASE TEMPLATE",

View File

@ -2826,12 +2826,12 @@ export default {
read: "查询", read: "查询",
edit: "编辑" edit: "编辑"
}, },
workspace_message: { project_message: {
name: "消息设置", name: "消息设置",
read: "查询", read: "查询",
edit: "编辑" edit: "编辑"
}, },
workspace_template: { project_template: {
name: "模版设置", name: "模版设置",
read: "查询", read: "查询",
case_template: "用例模版", case_template: "用例模版",

View File

@ -2825,12 +2825,12 @@ export default {
read: "查詢", read: "查詢",
edit: "編輯" edit: "編輯"
}, },
workspace_message: { project_message: {
name: "消息設置", name: "消息設置",
read: "查詢", read: "查詢",
edit: "編輯" edit: "編輯"
}, },
workspace_template: { project_template: {
name: "模版設置", name: "模版設置",
read: "查詢", read: "查詢",
case_template: "用例模版", case_template: "用例模版",

View File

@ -229,9 +229,9 @@ export default {
return; return;
} }
let redirectUrl = '/'; let redirectUrl = '/';
if (hasPermissions('PROJECT_USER:READ', 'PROJECT_ENVIRONMENT:READ', 'PROJECT_OPERATING_LOG:READ', 'PROJECT_FILE:READ+JAR', 'PROJECT_FILE:READ+FILE', 'PROJECT_CUSTOM_CODE:READ')) { if (hasPermissions('PROJECT_USER:READ', 'PROJECT_ENVIRONMENT:READ', 'PROJECT_OPERATING_LOG:READ', 'PROJECT_FILE:READ+JAR', 'PROJECT_FILE:READ+FILE', 'PROJECT_CUSTOM_CODE:READ', 'PROJECT_MESSAGE:READ', 'PROJECT_TEMPLATE:READ')) {
redirectUrl = '/project/home'; redirectUrl = '/project/home';
} else if (hasPermissions('WORKSPACE_SERVICE:READ', 'WORKSPACE_MESSAGE:READ', 'WORKSPACE_USER:READ', 'WORKSPACE_PROJECT_MANAGER:READ', 'WORKSPACE_PROJECT_ENVIRONMENT:READ', 'WORKSPACE_OPERATING_LOG:READ', 'WORKSPACE_TEMPLATE:READ')) { } else if (hasPermissions('WORKSPACE_SERVICE:READ', 'WORKSPACE_USER:READ', 'WORKSPACE_PROJECT_MANAGER:READ', 'WORKSPACE_PROJECT_ENVIRONMENT:READ', 'WORKSPACE_OPERATING_LOG:READ')) {
redirectUrl = '/setting/project/:type'; redirectUrl = '/setting/project/:type';
} else if (hasPermissions('SYSTEM_USER:READ', 'SYSTEM_WORKSPACE:READ', 'SYSTEM_GROUP:READ', 'SYSTEM_TEST_POOL:READ', 'SYSTEM_SETTING:READ', 'SYSTEM_AUTH:READ', 'SYSTEM_QUOTA:READ', 'SYSTEM_OPERATING_LOG:READ')) { } else if (hasPermissions('SYSTEM_USER:READ', 'SYSTEM_WORKSPACE:READ', 'SYSTEM_GROUP:READ', 'SYSTEM_TEST_POOL:READ', 'SYSTEM_SETTING:READ', 'SYSTEM_AUTH:READ', 'SYSTEM_QUOTA:READ', 'SYSTEM_OPERATING_LOG:READ')) {
redirectUrl = '/setting'; redirectUrl = '/setting';