diff --git a/src/forge/Issues/Pages/details.jsx b/src/forge/Issues/Pages/details.jsx index ac2b4b137..1ae7de470 100644 --- a/src/forge/Issues/Pages/details.jsx +++ b/src/forge/Issues/Pages/details.jsx @@ -59,7 +59,7 @@ function Details(props){ const permission = props && props.projectDetail && props.projectDetail.permission; let colors = ["#1abcb1","#28be6c","#e67e22","#db3d1d"]; - const {projectDetail , open_blockchain ,current_user } = props; + const {projectDetail , open_blockchain ,current_user, showNpsModal } = props; useEffect(()=>{ if(pathname === `/${owner}/${projectsId}/issues/${index}/copy`){ setEdit(true); @@ -284,6 +284,7 @@ function Details(props){ setEdit(false); // 刷新操作记录 setCommentReload(Math.random()); + showNpsModal("submitIssue", 1); } }).catch(error=>{}) }else{ @@ -310,6 +311,7 @@ function Details(props){ window.scrollTo(0,0); props.showNotification("疑修复制成功!"); props.history.push(`/${owner}/${projectsId}/issues/${result.data.project_issues_index}`); + showNpsModal("createIssue", 1); } }).catch(error=>{}) } diff --git a/src/forge/Issues/Pages/new.jsx b/src/forge/Issues/Pages/new.jsx index 474131b5b..73927dbb3 100644 --- a/src/forge/Issues/Pages/new.jsx +++ b/src/forge/Issues/Pages/new.jsx @@ -10,7 +10,7 @@ import axios from 'axios'; function New(props){ // history search 是否含有意见反馈标识 - const {location:{search}, projectDetail} = props; + const {location:{search}, projectDetail, showNpsModal} = props; const feedBack = search && search.indexOf('type=feedback') !== -1; // 里程碑id const milepostId = props.match.params.milepostId; @@ -200,6 +200,7 @@ function New(props){ window.scrollTo(0,0); props.showNotification("疑修创建成功!"); props.history.push(`/${owner}/${projectsId}/issues/${result.data.project_issues_index}`); + showNpsModal("createIssue", 1); } }).catch(error=>{}) } diff --git a/src/modules/modals/npsModal.jsx b/src/modules/modals/npsModal.jsx index 373815a2f..ebfb043e5 100644 --- a/src/modules/modals/npsModal.jsx +++ b/src/modules/modals/npsModal.jsx @@ -1,4 +1,4 @@ -import { Button, Checkbox, Input, Modal } from 'antd'; +import { Button, Checkbox, Divider, Input, Modal } from 'antd'; import axios from 'axios'; import React, { useState } from 'react'; @@ -12,16 +12,20 @@ function NpmModal(props){ // 提交按钮失效 const [disabled, setDisabled] = useState(false); const arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + const list = [ + "代码库基本功能", "疑修", "合并请求", "流水线引擎", "维基Wiki", "数据集", "特色专区", "BOT功能", "跨平台同步服务", "代码溯源及扫描服务", "开源软件健康度量服务", "HiAgent", "非常满意,没有需要吐槽的功能" + ] // 提交意见 function submit(){ setDisabled(true); - axios.post(`/nps.json`,{ + const params = { action_type: npsActionType, action_id: npsActionId, score: activeGrade, memo:`${checkGroupValue && checkGroupValue.length !== 0 ? checkGroupValue.toString() + "。" : ''}${inputValue ? inputValue : ''}` - }).then((response) => { + } + axios.post(`/nps.json`, params).then((response) => { if (response.data) { setVisible(false); setSuccess(true); @@ -44,20 +48,21 @@ function NpmModal(props){ footer={(activeGrade || activeGrade === 0) ? : null} >