需求更改

同步镜像调用websockt,成功后刷新页面;
合并请求可选标签,仓库设置类别、语言可选
This commit is contained in:
yystopf 2021-09-17 09:43:31 +08:00
commit bcde15cec1
4 changed files with 29 additions and 16 deletions

View File

@ -255,7 +255,11 @@ class Detail extends Component {
open_devops: flag open_devops: flag
}) })
} }
canvasChannel = () => { /**
*
* @param {*} deleteFlag 同步镜像需要提示成功且未成功的情况下不需要删除项目
*/
canvasChannel = (deleteFlag) => {
const name = window.location.hostname === "localhost" ? "testforgeplus.trustie.net" : window.location.hostname; const name = window.location.hostname === "localhost" ? "testforgeplus.trustie.net" : window.location.hostname;
const actioncable = require("actioncable"); const actioncable = require("actioncable");
var project = this.state.project; var project = this.state.project;
@ -272,10 +276,15 @@ class Detail extends Component {
console.log(`###### ---received data--- ######`); console.log(`###### ---received data--- ######`);
console.log(data); console.log(data);
if (data) { if (data) {
if ( data.project && data.project.mirror_status === 2) { if(deleteFlag){
this.deleteProjectBack(); this.props.showNotification("镜像同步成功!");
window.location.reload();
}else{
if (data.project && data.project.mirror_status === 2) {
this.deleteProjectBack();
}
this.getDetail();
} }
this.getDetail();
this.setState({ this.setState({
firstSync: false, firstSync: false,
secondSync: false secondSync: false
@ -428,8 +437,10 @@ class Detail extends Component {
const url = `/${owner}/${projectsId}/sync_mirror.json`; const url = `/${owner}/${projectsId}/sync_mirror.json`;
axios.post(url).then(result => { axios.post(url).then(result => {
if (result && result.data && result.data.status === 0) { if (result && result.data && result.data.status === 0) {
this.props.showNotification("镜像同步成功!"); this.setState({
this.getProject(2); secondSync:true
})
this.canvasChannel(true);
} else { } else {
this.props.showNotification("镜像同步失败!"); this.props.showNotification("镜像同步失败!");
} }

View File

@ -301,7 +301,7 @@ class MergeForm extends Component {
initialValue: assigned_to_id, initialValue: assigned_to_id,
})( })(
<Select placeholder="未选择审查人员" showSearch> <Select placeholder="未选择审查人员" showSearch>
{/* <Option key={0} value={""}>未选择审查人员</Option> */} <Option key={0} value={""}>未选择审查人员</Option>
{this.renderSelect(members)} {this.renderSelect(members)}
</Select> </Select>
)} )}
@ -316,7 +316,7 @@ class MergeForm extends Component {
} }
showSearch showSearch
> >
{/* <Option key={0} value={""}>{issue_versions && issue_versions.length > 0? "未选择里程碑": "请添加里程碑"}</Option> */} <Option key={0} value={""}>{issue_versions && issue_versions.length > 0? "未选择里程碑": "请添加里程碑"}</Option>
{this.renderSelect(issue_versions)} {this.renderSelect(issue_versions)}
</Select> </Select>
)} )}
@ -331,7 +331,7 @@ class MergeForm extends Component {
} }
showSearch showSearch
> >
{/* <Option key={0} value={""}>{issue_tags && issue_tags.length > 0 ? "未选择标记" : "请在仓库设置里添加标记"}</Option> */} <Option key={0} value={""}>{issue_tags && issue_tags.length > 0 ? "未选择标记" : "请在仓库设置里添加标记"}</Option>
{this.renderSelect(issue_tags)} {this.renderSelect(issue_tags)}
</Select> </Select>
)} )}

View File

@ -262,7 +262,7 @@ class Setting extends Component {
message: "请输入项目名称", message: "请输入项目名称",
}, },
], ],
})(<Input placeholder="请输入项目名称" maxLength={"50"}/>)} })(<Input placeholder="请输入项目名称" />)}
</Form.Item> </Form.Item>
<div className="df" style={{ alignItems: "center" }}> <div className="df" style={{ alignItems: "center" }}>
<span className="mr20 mb15 font-16">可见性</span> <span className="mr20 mb15 font-16">可见性</span>
@ -298,7 +298,8 @@ class Setting extends Component {
rules: [], rules: [],
})( })(
<Select> <Select>
{CategoryList} <Option key={0} value={""}>未选择项目类别</Option>
{CategoryList}
</Select> </Select>
)} )}
</Form.Item> </Form.Item>
@ -306,10 +307,11 @@ class Setting extends Component {
{getFieldDecorator("project_language_id", { {getFieldDecorator("project_language_id", {
rules: [], rules: [],
})( })(
<Select> <Select>
{LanguageList} <Option key={0} value={""}>未选择项目语言</Option>
</Select> {LanguageList}
)} </Select>
)}
</Form.Item> </Form.Item>
<Form.Item label="项目导航"> <Form.Item label="项目导航">
{getFieldDecorator("project_units", { {getFieldDecorator("project_units", {

View File

@ -198,7 +198,7 @@ class comments extends Component {
</span> </span>
<span> <span>
{item.value && item.value.length > 0 ? ( {item.value && item.value.length > 0 ? (
(item.detail === "标签" || item.detail === "标记") ? ( item.detail === "标记"? (
<span <span
className="issue-tag-show" className="issue-tag-show"
style={{ background: item.value[0].color }} style={{ background: item.value[0].color }}