Skip to content

Commit 63b5627

Browse files
authored
Merge pull request #473 from Coding/delete-plugin
现在可以删除插件了
2 parents b816845 + c39fbe2 commit 63b5627

File tree

35 files changed

+336
-320
lines changed

35 files changed

+336
-320
lines changed

app/changelog.html

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@
183183
}
184184
.intro-pc-head .sub {
185185
display: flex;
186+
justify-content: space-between;
186187
align-items: center;
187188
height: 40px;
188189
padding: 0 30px;
@@ -192,6 +193,10 @@
192193
.intro-pc-head .sub a {
193194
color: #e3e6e8;
194195
}
196+
.intro-pc-head .sub .left {
197+
display: flex;
198+
align-items: center;
199+
}
195200
.intro-pc-head .sub-menu {
196201
margin-right: 30px;
197202
position: relative;
@@ -337,7 +342,7 @@
337342
transition: height .2s ease;
338343
}
339344
.intro-mobile-head .dropdown .cs.on .cs-dropdown {
340-
height: 250px;
345+
height: 300px;
341346
}
342347
.intro-mobile-head .dropdown .cs-menu {
343348
display: flex;
@@ -616,21 +621,26 @@
616621
</div>
617622
</div>
618623
<div class="sub">
619-
<div class="sub-menu">
620-
<a class="post-message" href="https://studio.dev.tencent.com/intro">产品介绍</a>
621-
</div>
622-
<div class="sub-menu">
623-
<a href="https://studio.dev.tencent.com/dashboard/workspace" target="_blank" rel="noopener">工作空间</a>
624-
</div>
625-
<div class="sub-menu">
626-
<a class="post-message" href="https://studio.dev.tencent.com/plugins">插件市场</a>
627-
</div>
628-
<div class="sub-menu on">
629-
<a class="post-message" href="https://studio.dev.tencent.com/changelog">更新日志</a>
624+
<div class="left">
625+
<div class="sub-menu">
626+
<a class="post-message" href="https://studio.dev.tencent.com/intro">产品介绍</a>
627+
</div>
628+
<div class="sub-menu">
629+
<a href="https://studio.dev.tencent.com/dashboard/workspace" target="_blank" rel="noopener">工作空间</a>
630+
</div>
631+
<div class="sub-menu">
632+
<a class="post-message" href="https://studio.dev.tencent.com/plugins">插件市场</a>
633+
</div>
634+
<div class="sub-menu on">
635+
<a class="post-message" href="https://studio.dev.tencent.com/changelog">更新日志</a>
636+
</div>
637+
<div class="sub-menu">
638+
<a href="https://studio.qcloud.coding.net/campaign/favorite-plugins/" target="_blank" rel="noopener">插件大赛</a>
639+
<div class="new">NEW</div>
640+
</div>
630641
</div>
631-
<div class="sub-menu">
632-
<a href="https://studio.qcloud.coding.net/campaign/favorite-plugins/" target="_blank" rel="noopener">插件大赛</a>
633-
<div class="new">NEW</div>
642+
<div class="right">
643+
<a href="https://studio.dev.tencent.com/plugins-docs/" target="_blank" rel="noopener noreferrer">插件开发文档</a>
634644
</div>
635645
</div>
636646
</div>
@@ -665,6 +675,9 @@
665675
<div class="cs-menu">
666676
<a class="post-message" href="https://studio.dev.tencent.com/plugins">插件市场</a>
667677
</div>
678+
<div class="cs-menu">
679+
<a href="https://studio.dev.tencent.com/plugins-docs/" target="_blank" rel="noopener noreferrer">插件开发文档</a>
680+
</div>
668681
<div class="cs-menu on">
669682
<a class="post-message" href="https://studio.dev.tencent.com/changelog">更新日志</a>
670683
</div>

app/commons/File/actions.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import flattenDeep from 'lodash/flattenDeep'
22
import { registerAction } from 'utils/actions'
33
import settings from 'settings'
44
import is from 'utils/is'
5-
import { action, when } from 'mobx'
65
import api from 'backendAPI'
76
import config from 'config'
87
import { showModal } from 'components/Modal/actions'

app/components/Modal/modals/About.jsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1+
import React from 'react';
12

2-
import React from 'react'
3-
import i18n from 'utils/createI18n'
4-
import { dismissModal } from '../actions'
3+
const year = new Date().getFullYear();
54

6-
const Alert = (props) => {
7-
const { meta, content } = props
5+
const Alert = () => {
86
return (
97
<div className='modal-content about'>
108
<div className='title'>
@@ -31,12 +29,12 @@ const Alert = (props) => {
3129
</div>
3230
<div className='links'>
3331
<a href='/intro' className='link-item' target='_blank' rel='noopener noreferrer'>产品介绍</a>
34-
<a href='https://coding.net/help/doc/cloud-studio' className='link-item' target='_blank' rel='noopener noreferrer' >帮助文档</a>
32+
<a href='https://dev.tencent.com/help/doc/cloud-studio' className='link-item' target='_blank' rel='noopener noreferrer' >帮助文档</a>
3533
<a href='https://feedback.coding.net' className='link-item' target='_blank' rel='noopener noreferrer'>意见反馈</a>
3634
</div>
37-
Copyright @ 2015-2018. All Rights Reserved. 扣钉网络 版权所有
35+
<div>Copyright @ 2015-{year}. All Rights Reserved. 扣钉网络 版权所有</div>
3836
</div>
3937
)
4038
}
4139

42-
export default Alert
40+
export default Alert;

app/components/PluginDev/index.js

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class PluginDev extends PureComponent {
3131
}
3232

3333
render () {
34+
const deleted = !pluginProjectInfomation.pluginId;
3435
return (
3536
<div className='plugin-dev-container'>
3637
<div className='panel-heading'>
@@ -39,30 +40,48 @@ class PluginDev extends PureComponent {
3940
{i18n`plugin.header`}
4041
</p>
4142
<p>
42-
<span onClick={this.handleDeploy} style={{ cursor: 'pointer', marginRight: 10 }}>
43-
<i className='fa fa-paper-plane' aria-hidden />
44-
发布插件
45-
</span>
43+
{!deleted && (
44+
<span onClick={this.handleDeploy} style={{ cursor: 'pointer', marginRight: 10 }}>
45+
<i className='fa fa-paper-plane' aria-hidden />
46+
<span>发布插件</span>
47+
</span>
48+
)}
4649
<span onClick={this.handleGoDoc} style={{ cursor: 'pointer' }}>
4750
<i className='fa fa-book' aria-hidden />
48-
开发文档
51+
<span>开发文档</span>
4952
</span>
5053
</p>
5154
</div>
55+
<p className='plugin-detail-campaign'>
56+
<span>插件开发大赛正在进行中,</span>
57+
<a href="https://studio.qcloud.coding.net/campaign/favorite-plugins/" target="_blank" rel="noopener">了解更多</a>
58+
<span></span>
59+
</p>
5260
<div className='plugin-detail-panel'>
53-
<p className='plugin-detail-campaign'>
54-
插件开发大赛正在进行中,
55-
<a onClick={() => window.open('/campaign/favorite-plugins/')}>了解更多</a>
56-
</p>
57-
<p className='plugin-name'>
61+
{deleted && (
62+
<p className="plugin-deleted-tip">
63+
<i className="fa fa-exclamation-triangle"></i>
64+
<span>该插件已被删除,无法发布</span>
65+
</p>
66+
)}
67+
{!deleted && (
68+
<p className='plugin-name'>
69+
插件名:
5870
{pluginProjectInfomation.pluginName}
59-
</p>
60-
<p className='plugin-description'>
71+
</p>
72+
)}
73+
{!deleted && (
74+
<p className='plugin-description'>
75+
插件描述:
6176
{pluginProjectInfomation.description}
62-
</p>
63-
<p className='plugin-description'>
64-
{`当前版本:${pluginProjectInfomation.version || ''}`}
65-
</p>
77+
</p>
78+
)}
79+
{!deleted && (
80+
<p className='plugin-description'>
81+
当前版本:
82+
{pluginProjectInfomation.version}
83+
</p>
84+
)}
6685
<div className='plugin-dev-server'>
6786
<p>请先确保已在终端内启动插件(yarn start)</p>
6887
<p>

app/dashboard/api/axios.js

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import getCookie from '../utils/cookie';
2+
import { notify, NOTIFY_TYPE } from 'components/Notification/actions';
23

34
const baseURL = getCookie('BACKEND_URL') || __BACKEND_URL__ || window.location.origin;
45

@@ -26,7 +27,11 @@ axios.get = (url, overrideHeaders = {}) => {
2627
method: 'GET',
2728
credentials: 'include',
2829
headers: { ...headers, ...overrideHeaders },
29-
}).then(res => res.json());
30+
}).then(res => {
31+
return res.json();
32+
}).catch(err => {
33+
notify({ message: err, notifyType: NOTIFY_TYPE.ERROR });
34+
});
3035
}
3136

3237
axios.post = (url, data, overrideHeaders = {}) => {
@@ -35,7 +40,11 @@ axios.post = (url, data, overrideHeaders = {}) => {
3540
credentials: 'include',
3641
headers: { ...headers, ...overrideHeaders },
3742
body: parseFormdata(data),
38-
}).then(res => res.json());
43+
}).then(res => {
44+
return res.json();
45+
}).catch(err => {
46+
notify({ message: err, notifyType: NOTIFY_TYPE.ERROR });
47+
});
3948
}
4049

4150
axios.put = (url, data, overrideHeaders = {}) => {
@@ -44,7 +53,11 @@ axios.put = (url, data, overrideHeaders = {}) => {
4453
credentials: 'include',
4554
headers: { ...headers, ...overrideHeaders },
4655
body: parseFormdata(data),
47-
}).then(res => res.json());
56+
}).then(res => {
57+
return res.json();
58+
}).catch(err => {
59+
notify({ message: err, notifyType: NOTIFY_TYPE.ERROR });
60+
});
4861
}
4962

5063
axios.delete = (url, data, overrideHeaders = {}) => {
@@ -53,7 +66,11 @@ axios.delete = (url, data, overrideHeaders = {}) => {
5366
credentials: 'include',
5467
headers: { ...headers, ...overrideHeaders },
5568
body: parseFormdata(data),
56-
}).then(res => res.json());
69+
}).then(res => {
70+
return res.json();
71+
}).catch(err => {
72+
notify({ message: err, notifyType: NOTIFY_TYPE.ERROR });
73+
});
5774
}
5875

5976
export default axios;

app/dashboard/api/plugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ export const cancelPrePublish = (data) => {
4848
return axios.post('/user-plugin/pre/deploy/cancel', data);
4949
}
5050

51-
export const recallAudit = (data) => {
52-
return axios.put('/user-plugin/call/audit', data);
51+
export const deletePlugin = (pluginId) => {
52+
return axios.delete(`/user-plugin/${pluginId}`);
5353
}

app/dashboard/common.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
background-color: #18f;
7272
outline: none;
7373
cursor: pointer;
74+
transition: border-color .2s ease, background-color .2s ease;
7475
}
7576
.com-button.default {
7677
border: 1px solid #444;

app/dashboard/i18n/en_US/plugin.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@
2121
"cannotPublishForAuditing": "The last release is under review and is temporarily unavailable",
2222
"cannotPublishForBuilding": "The last release is been building and is temporarily unavailable",
2323
"publishing": "Publishing...",
24-
"pluginInfo": "Plugin Info",
24+
"pluginSet": "Settings",
25+
"basicSet": "Basic Settings",
26+
"otherSet": "Other Settings",
27+
"deletePlugin": "Delete Plugin",
28+
"alsoDeleteWorkspace": "Also delete the workspace",
29+
"deletePluginTip1": "Remove the plugin while deleting the workspace, but not deleting the project (code repo). This operation is not recoverable. Confirm to delete the plugin?",
30+
"deletePluginTip2": "Remove the plugin without deleting the workspace and not deleting the project (code repo). This operation is not recoverable. Confirm to delete the plugin?",
2531
"officialPublish": "Publish",
2632
"prePublish": "Pre Publish",
2733
"versionHistory": "Version History",

app/dashboard/i18n/zh_CN/plugin.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@
2121
"cannotPublishForAuditing": "上次发布正在审核中,暂时无法发布",
2222
"cannotPublishForBuilding": "上次发布正在构建中,暂时无法发布",
2323
"publishing": "正在发布...",
24-
"pluginInfo": "插件信息",
24+
"pluginSet": "插件设置",
25+
"basicSet": "基本设置",
26+
"otherSet": "其他设置",
27+
"deletePlugin": "删除插件",
28+
"alsoDeleteWorkspace": "同时删除工作空间",
29+
"deletePluginTip1": "删除该插件,同时删除工作空间,但不会删除项目 (代码仓库) 。该操作不可恢复,确认要删除插件?",
30+
"deletePluginTip2": "删除该插件,不删除工作空间,同时也不会删除项目 (代码仓库) 。该操作不可恢复,确认要删除插件?",
2531
"officialPublish": "正式发布",
2632
"prePublish": "预发布",
2733
"versionHistory": "版本历史",

app/dashboard/view/create/Create.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ class Create extends Component {
6565
} else {
6666
notify({ notifyType: NOTIFY_TYPE.ERROR, message: res.msg });
6767
}
68-
}).catch(err => {
69-
notify({ notifyType: NOTIFY_TYPE.ERROR, message: err });
7068
});
7169
}
7270

@@ -80,8 +78,6 @@ class Create extends Component {
8078
} else {
8179
notify({ notifyType: NOTIFY_TYPE.ERROR, message: res.msg });
8280
}
83-
}).catch(err => {
84-
notify({ notifyType: NOTIFY_TYPE.ERROR, message: err });
8581
});
8682
}
8783

@@ -95,8 +91,6 @@ class Create extends Component {
9591
} else {
9692
notify({ notifyType: NOTIFY_TYPE.ERROR, message: res.msg });
9793
}
98-
}).catch(err => {
99-
notify({ notifyType: NOTIFY_TYPE.ERROR, message: err });
10094
});
10195
}
10296

0 commit comments

Comments
 (0)