修改nps issue

This commit is contained in:
谢思 2022-09-02 15:52:50 +08:00
parent 0dbe7d9f0f
commit e9b1deb9a0
7 changed files with 38 additions and 17 deletions

13
package-lock.json generated
View File

@ -7245,7 +7245,8 @@
"ansi-regex": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
"optional": true
},
"aproba": {
"version": "1.2.0",
@ -7662,7 +7663,8 @@
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
@ -7718,6 +7720,7 @@
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@ -7761,12 +7764,14 @@
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"optional": true
},
"yallist": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
"optional": true
}
}
},

View File

@ -25,7 +25,7 @@ if (isDev) {
}
debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' :
window.location.search.indexOf('debug=s') !== -1 ? 'student' :
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin'
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'student'
}
window._debugType = debugType;
export function initAxiosInterceptors(props) {

View File

@ -239,6 +239,7 @@ class order_form extends Component {
this.props.showNotification("任务更新成功!");
const { getDetail } = this.props;
getDetail && getDetail();
this.props.showNpsModal("submitIssue", 1);
}
this.setState({
isSpin: false

View File

@ -162,7 +162,7 @@ function Data(props) {
repeatBranch={repeatBranch}
/>
<div className="servertitle">
<span className="systitle">重晴鸟代码溯源</span>
<span className="systitle">重晴鸟代码溯源服务</span>
{!operateTime && isManager && <a className="btnhover" onClick={createCheck}>新建分析</a>}
</div>
<Spin spinning={spining}>
@ -170,7 +170,7 @@ function Data(props) {
{operateTime && <div className='operateBox mt25'>
<img src={img} alt='' width={130}/>
<div className='font-20 mt20 mb5'>系统维护中</div>
<div className='font-17'>预计<span className='timeBox'>{operateTime}小时后</span>代码溯源系统将恢复正常访问给您带来不便敬请谅解!</div>
<div className='font-17'>预计<span className='timeBox'>{operateTime}小时后</span>代码溯源服务将恢复正常访问给您带来不便敬请谅解!</div>
</div>}
{
!operateTime && dataSource && dataSource.length > 0 &&

View File

@ -35,14 +35,14 @@ function StoreList(props){
return <div className="storeListBox">
<div className="headBox font-16 pl15">Reposyncer仓库同步
<div className="headBox font-16 pl15">Reposyncer仓库同步服务
{storeDetail !== null && <Tooltip title="Reposyncer仓库同步系统提供跨托管平台的项目协同开发同步功能。支持用户在任何一个托管平台上的代码提交、代码推送、合并请求等操作自动同步至其他托管平台。不仅增加每个开源项目与开发者的流量也使不同平台的开源项目维护与更新变得方便与快捷" overlayStyle={{width: 400}}><span className="helpBox1 font-12 ml10">?</span></Tooltip>}
</div>
{/* 空数据 */}
{!storeDetail && <div className="nullStoreBox mt25">
<img src={logo} alt="" className="loBox mt50"/>
<p className="font-22 mt10">欢迎使用跨平台代码同步</p>
<div className="introBox font-15">跨平台代码同步提供跨托管平台的项目协同开发同步功能支持用户在任何一个托管平台上的代码提交代码推送合并请求等操作自动同步至其他托管平台不仅增加每个开源项目与开发者的流量也使不同平台的开源项目维护与更新变得方便与快捷</div>
<p className="font-22 mt10">欢迎使用跨平台代码同步服务</p>
<div className="introBox font-15">跨平台代码同步服务提供跨托管平台的项目协同开发同步功能支持用户在任何一个托管平台上的代码提交代码推送合并请求等操作自动同步至其他托管平台不仅增加每个开源项目与开发者的流量也使不同平台的开源项目维护与更新变得方便与快捷</div>
<div className="borBox"></div>
<Button type="primary" style={{width: '112px', height: '36px'}}><Link to={`/${owner}/${projectsId}/server/reposyncer/store/edit`}>开始体验</Link></Button>
</div>}

View File

@ -9,16 +9,18 @@ function NpmModal(props){
const [inputValue, setInputValue] = useState(undefined);
const [success, setSuccess] = useState(false);
const [visible, setVisible] = useState(true);
//
const [disabled, setDisabled] = useState(false);
const arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
//
function submit(){
console.log(activeGrade, checkGroupValue, inputValue);
setDisabled(true);
axios.post(`/nps.json`,{
action_type: npsActionType,
action_id: npsActionId,
score: activeGrade,
memo:checkGroupValue.toString()+"。"+inputValue
memo:`${checkGroupValue && checkGroupValue.length !== 0 ? checkGroupValue.toString() + "。" : ''}${inputValue ? inputValue : ''}`
}).then((response) => {
if (response.data) {
setVisible(false);
@ -39,7 +41,7 @@ function NpmModal(props){
onCancel={props.closeNpsModal}
className='npmModal'
width={690}
footer={(activeGrade || activeGrade === 0) ? <Button type='primary' style={{width:180}} onClick={submit}>提交</Button> : null}
footer={(activeGrade || activeGrade === 0) ? <Button type='primary' style={{width:180}} onClick={submit} disabled={disabled}>提交</Button> : null}
>
<div className='mt40 font-18'>您向朋友或同事推荐GitLink平台的可能性有多大</div>
<div className='gradeBox font-16'>

View File

@ -250,9 +250,22 @@ export function TPMIndexHOC(WrappedComponent) {
}
closeNpsModal(){
this.setState({
npsModalVisible: false
})
axios.post(`/nps.json`,{
action_type: 'close',
action_id: 1,
score: 0,
memo:''
}).then((response) => {
if (response.data) {
// 关闭nps弹框之后需要重新请求一次get_user_info更新用户信息
this.fetchUsers();
this.setState({
npsModalVisible: false
})
}
}).catch(function (error) {
console.log(error);
});
}
render() {
let { isRender , current_user , giteaVisible , email , completeProfile , showCP , showNotice , publicNav , mygetHelmetapi, npsModalVisible, npsActionType, npsActionId } = this.state;
@ -283,7 +296,7 @@ export function TPMIndexHOC(WrappedComponent) {
{...this.props}
{...this.state}
/> : ""}
{(npsModalVisible) && <NpsModal closeNpsModal={()=>{this.closeNpsModal()}} npsActionType={npsActionType} npsActionId={npsActionId}/>}
{npsModalVisible && <NpsModal closeNpsModal={()=>{this.closeNpsModal()}} npsActionType={npsActionType} npsActionId={npsActionId}/>}
<Header {...this.state} {...this.props} {...common} publicNav={publicNav}></Header>
<Spin spinning={this.state.globalLoading} delay={0} className="globalSpin"
size="large" tip={this._gLoadingTip || "加载中..."}