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/forge/Server/measurement/componet/stack.jsx b/src/forge/Server/measurement/componet/stack.jsx index fd9edcf03..203c45bda 100644 --- a/src/forge/Server/measurement/componet/stack.jsx +++ b/src/forge/Server/measurement/componet/stack.jsx @@ -43,7 +43,7 @@ function Stack({name,data , type , pieData}){ if(list && list.length > 0){ let values = []; const monthList = list.map(obj => obj.month); - values = list.map(obj => Math.round(obj[type] || obj["count"] || obj['commits_number'] || 0)); + values = list.map(obj => parseFloat(obj[type] || obj["count"] || obj['commits_number'] || 0).toFixed(2)); Init(monthList,values); } },[list]) @@ -59,9 +59,6 @@ function Stack({name,data , type , pieData}){ trigger: 'axis' }, color:['#5871FF',"#FFBE38"], - // legend: { - // data: ['Email', 'Union Ads'] - // }, grid: { left: '3%', right: '4%', diff --git a/src/forge/Server/measurement/config.js b/src/forge/Server/measurement/config.js index cfd2f8a44..15f7210b6 100644 --- a/src/forge/Server/measurement/config.js +++ b/src/forge/Server/measurement/config.js @@ -57,7 +57,7 @@ export const detailByName={ 活跃开发者占比:{desc:"通过分析每个月活跃的个体贡献者数量对个体贡献者数量指标进行度量",descTitle:"个体贡献者数量"},//个体贡献者数量 项目活跃度:{desc:"不同类型的贡献者每月/周给master分支的贡献次数",month:true,user_login:true,descTitle:"所有个体开发者贡献历史"},//所有个体开发者贡献历史 长期贡献者占比:{desc:"通过分析每个月活跃的长期个体贡献者数量对长期个体贡献者数量指标进行度量",descTitle:"长期个体贡献者数量"},//长期个体贡献者数量 - 长期贡献者稳定性:{desc:"通过分析具体的即将流失的长期贡献者流失概率对个体贡献者流失预测指标进行度量",bar:true,descTitle:"个体贡献者流失预测"},//个体贡献者流失预测 + 长期贡献者稳定性:{desc:"通过分析具体的即将流失的长期贡献者流失概率对个体贡献者流失预测指标进行度量",user_login:true,bar:true,descTitle:"个体贡献者流失预测"},//个体贡献者流失预测 公司贡献者数量:{desc:"通过分析每月做出了贡献的公司贡献者数量对公司贡献者数量指标进行度量"}, 长期公司贡献者数量:{desc:"通过分析每月的长期对项目做出贡献的公司贡献者数量对长期公司贡献者数量指标进行度量"}, 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} >
您向朋友或同事推荐GitLink平台的可能性有多大?
-
+
不可能 {arr.map(item=>{return {setActiveGrade(item)}}>{item}})} 极有可能
- {(activeGrade || activeGrade === 0) &&
-
您觉得以下哪些我们可以做的更好?(选填)
+ {(activeGrade || activeGrade === 0) &&
+ +
【选填】你最想吐槽GitLink以下的哪个功能?欢迎勾选下方想要吐槽的选项并留言
{setCheckGroupValue(e)}}> - 期待更加丰富的功能 - 部分功能不会用,希望有新手引导 - 已有的功能模块,用户体验需进一步提升 - 其他 + {list.map(item=>{item})} - {setInputValue(e.target.value);}}/> +
+ {setInputValue(e.target.value);}}/> + {(inputValue && inputValue.length) || 0}/500 +
} .-task-title { font-size: 22px; } .npmModal .ant-modal-content, .npmSuccessModal .ant-modal-content{ - background-image:linear-gradient(359.37deg,#ebf3ff 0%,#f1f6ff 21.88%,#c1ceff 100%); + background: linear-gradient( 359deg, #EBF3FF 0%, #F4F5FE 22%, #F2F4FF 82%, #D4DDFF 100%); border:1.5px solid#ffffff; - min-height: 280px; + min-height: 230px; } .npmModal .ant-modal-body, .npmModal .ant-modal-footer, .npmSuccessModal .ant-modal-body, .npmSuccessModal .ant-modal-footer{ background-color: rgba(0, 0, 0, 0); @@ -351,9 +351,6 @@ body>.-task-title { background-repeat: no-repeat; color:#202d40; } -.npmSuccessModal .ant-modal-content{ - background-image:linear-gradient(359.37deg,#ebf3ff 0%,#f1f6ff 21.88%,#c1ceff 100%); -} .npmSuccessModal .ant-modal-body{ background-image: url('../../images/nps2.png'); height: 300px; @@ -364,9 +361,6 @@ body>.-task-title { text-align: center; padding-bottom: 30px; } -.gradeBox{ - margin: 30px 0; -} .oneGradeItem{ width:36px; height:36px; @@ -381,11 +375,16 @@ body>.-task-title { background-size: 100% 100%; cursor: pointer; } +.npmModal .gradeCheckbox{ + display: flex; + flex-wrap: wrap; +} .npmModal .gradeCheckbox .ant-checkbox-wrapper{ display: block; margin: 0 0 15px 0; font-size: 16px; color: #3f4e64; + width: 50%; } .gradeInput{ background-color:rgba(255, 255, 255, 0.31) !important; @@ -416,4 +415,18 @@ body>.-task-title { .npmSuccessModal .ant-modal-close-icon{ font-size: 25px; color: white; -} \ No newline at end of file +} +.npmModal{ + .npsFeedBackBox{ + position: relative; + background-color: white; + } + .countNumBox{ + position: absolute; + bottom: 2px; + right: 10px; + span{ + color: #466AFF; + } + } +} diff --git a/src/modules/tpm/TPMIndexHOC.js b/src/modules/tpm/TPMIndexHOC.js index f05816b59..27e179a02 100644 --- a/src/modules/tpm/TPMIndexHOC.js +++ b/src/modules/tpm/TPMIndexHOC.js @@ -259,9 +259,9 @@ export function TPMIndexHOC(WrappedComponent) { npsActionType:type, npsActionId: index }) - const {current_user} = this.state; - current_user && current_user.nps && setTimeout(() => { - this.setState({npsModalVisible: true}) + setTimeout(() => { + const {current_user} = this.state; + current_user && current_user.nps && this.setState({npsModalVisible: true}) }, 500) }