Skip to content

Commit

Permalink
插件被管理员禁用应该用 allowRelease 字段判断
Browse files Browse the repository at this point in the history
  • Loading branch information
veedrin committed Dec 19, 2018
1 parent 8e1f3bf commit f5edb80
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 95 deletions.
160 changes: 80 additions & 80 deletions app/dashboard/i18n/en_US/global.json
Original file line number Diff line number Diff line change
@@ -1,81 +1,81 @@
{
"dashboard": "Dashboard",
"workspace": "Workspace",
"setting": "Setting",
"config": "Config",
"about": "About",
"readme": "README",
"changelog": "Changelog",
"plugin": "Plugin Management",
"thirdparty": "Third Party",
"builtin": "Built-in",
"mine": "Developed By Me",
"tencentCloudDevPlatform": "Tencent Cloud Dev Platform",
"devPlatform": "Dev Platform",
"docs": "Help Document",
"feedback": "Feedback",
"logout": "Log Out",
"produce": "Produced",
"computeSupport": "Compute Support",
"copyright": "CODING. All Rights Reserved.",
"language": "Language",
"sshPublicKey": "SSH Public Key",
"more": "Learn more",
"source": "Source",
"description": "Description",
"search": "Search",
"filter": "Filter",
"project": "Project",
"template": "Template",
"env": "Environment",
"create": "Create",
"creating": "Creating...",
"cancel": "Cancel",
"back": "Back",
"ok": "OK",
"run": "Run",
"running": "Running",
"stop": "Stop",
"stoping": "Stoping",
"restore": "Restore",
"restoring": "Restoring",
"delete": "Delete",
"deleting": "Deleting",
"repoUrl": "Repo Url",
"recentdeleted": "Recently Deleted",
"inputTip": "Only letters, numbers, or underscores (_), underscores (-), dots (.)",
"sync": "Sync",
"syncing": "Syncing",
"nodata": "No Data",
"lastModified": "Last modified {{days}} days ago",
"lastModifiedToday": "Last modified Today",
"deletedDaysAgo": "Deleted {{days}} days ago",
"deletedTime": "Deleted {{hours}} hours {{minutes}} minutes ago",
"copyed": "Copyed",
"noDesc": "[No Description]",
"manage": "Manage",
"install": "Install",
"uninstall": "Uninstall",
"category": "Category",
"desc": "Description",
"save": "Save",
"publish": "Publish",
"status": "Status",
"release": "Release",
"modify": "Modification",
"notification": "Notifications",
"message": "Messages",
"readAllNotification": "Read All Notification",
"readAllMessage": "Read All Message",
"noNotification": "No Notification yet",
"noMessage": "No Messages yet",
"quit": "Quit",
"quiting": "Quiting",
"period": ".",
"globalTip": "You have not set a username yet. Please set a username first, which will be your unique identifier on this platform.",
"submitting": "Submitting...",
"eventStreamBulletin1": "Dear developer, due to ",
"eventStreamBulletin2": "[ event-stream package event ]",
"eventStreamBulletin3": " Impact, your plugin needs to manually delete the `yarn.lock` file and reinstall the dependencies, then push the code to release a new version or pre-release.",
"remove": "Remove"
}
"dashboard": "Dashboard",
"workspace": "Workspace",
"setting": "Setting",
"config": "Config",
"about": "About",
"readme": "README",
"changelog": "Changelog",
"plugin": "Plugin Management",
"thirdparty": "Third Party",
"builtin": "Built-in",
"mine": "Developed By Me",
"tencentCloudDevPlatform": "Tencent Cloud Dev Platform",
"devPlatform": "Dev Platform",
"docs": "Help Document",
"feedback": "Feedback",
"logout": "Log Out",
"produce": "Produced",
"computeSupport": "Compute Support",
"copyright": "CODING. All Rights Reserved.",
"language": "Language",
"sshPublicKey": "SSH Public Key",
"more": "Learn more",
"source": "Source",
"description": "Description",
"search": "Search",
"filter": "Filter",
"project": "Project",
"template": "Template",
"env": "Environment",
"create": "Create",
"creating": "Creating...",
"cancel": "Cancel",
"back": "Back",
"ok": "OK",
"run": "Run",
"running": "Running",
"stop": "Stop",
"stoping": "Stoping",
"restore": "Restore",
"restoring": "Restoring",
"delete": "Delete",
"deleting": "Deleting",
"repoUrl": "Repo Url",
"recentdeleted": "Recently Deleted",
"inputTip": "Only letters, numbers, or underscores (_), underscores (-), dots (.)",
"sync": "Sync",
"syncing": "Syncing",
"nodata": "No Data",
"lastModified": "Last modified {{days}} days ago",
"lastModifiedToday": "Last modified Today",
"deletedDaysAgo": "Deleted {{days}} days ago",
"deletedTime": "Deleted {{hours}} hours {{minutes}} minutes ago",
"copyed": "Copyed",
"noDesc": "[No Description]",
"manage": "Manage",
"install": "Install",
"uninstall": "Uninstall",
"category": "Category",
"desc": "Description",
"save": "Save",
"publish": "Publish",
"status": "Status",
"release": "Release",
"modify": "Modification",
"notification": "Notifications",
"message": "Messages",
"readAllNotification": "Read All Notification",
"readAllMessage": "Read All Message",
"noNotification": "No Notification yet",
"noMessage": "No Messages yet",
"quit": "Quit",
"quiting": "Quiting",
"period": ".",
"globalTip": "You have not set a username yet. Please set a username first, which will be your unique identifier on this platform.",
"submitting": "Submitting...",
"eventStreamBulletin1": "Dear developer, due to ",
"eventStreamBulletin2": "[ event-stream package event ]",
"eventStreamBulletin3": " Impact, your plugin needs to manually delete the `yarn.lock` file and reinstall the dependencies, then push the code to release a new version or pre-release.",
"remove": "Remove"
}
2 changes: 1 addition & 1 deletion app/dashboard/view/home/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class Home extends Component {
const pathname = location.pathname;
// 跳转
if (pathname === '/dashboard') {
history.push({ pathname: '/dashboard/workspace' });
history.replace({ pathname: '/dashboard/workspace' });
}
// 给顶层 window 发送消息
history.listen(route => {
Expand Down
6 changes: 3 additions & 3 deletions app/dashboard/view/plugin/mCard/MCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ import parseStatus from '../../pluginSet/status';

class MCard extends Component {
render() {
const { id, pluginName, remark, createdBy, repoName, pluginVersions, globalStatus } = this.props;
const { id, pluginName, remark, createdBy, repoName, pluginVersions, allowRelease } = this.props;
const { version, status, hasPrePublish, preStatus } = parseStatus(pluginVersions);
const marketHref = window === window.top ? `${window.location.origin}/plugins/detail/${id}` : `${config.studioOrigin}/plugins/detail/${id}`;
const wsHref = `${window === window.top ? window.location.origin : config.studioOrigin}/ws/?ownerName=${createdBy}&projectName=${repoName}`;
return (
<div className = "plugin-card">
<div className="top">
{
(status === 5 && globalStatus === 1) ? (
(status === 5 && allowRelease) ? (
<a className="name" href={marketHref} target="_blank" rel="noopener noreferrer">{pluginName}</a>
) : <span className="name">{pluginName}</span>
}
{globalStatus === 1 ? (
{allowRelease ? (
<div className="right">
{status === 5 && <div className="version">v{version}</div>}
{
Expand Down
12 changes: 6 additions & 6 deletions app/dashboard/view/pluginSet/PluginSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class PluginSet extends Component {
countScoreUser: 0,
repoName: '',
repoUrl: '',
globalStatus: 1,
allowRelease: true,
historyVersions: [],
status: 0,
version: '0.0.0',
Expand All @@ -41,9 +41,9 @@ class PluginSet extends Component {
timer = null

render() {
const { pluginId, pluginName, remark, historyVersions, status, version, createdBy, repoName, globalStatus, hasPrePublish, preStatus, preLog, tab } = this.state;
const { pluginId, pluginName, remark, historyVersions, status, version, createdBy, repoName, allowRelease, hasPrePublish, preStatus, preLog, tab } = this.state;
const prePublishProps = { hasPrePublish, preStatus, preLog };
const settingProps = { pluginId, pluginName, remark, createdBy, repoName, globalStatus };
const settingProps = { pluginId, pluginName, remark, createdBy, repoName, allowRelease };
return (
<div className="dash-pluginset">
<Overview {...this.state} cancelRelease={this.cancelPrePublish} />
Expand All @@ -53,7 +53,7 @@ class PluginSet extends Component {
<div className={`tab-item${tab === 3 ? ' on' : ''}`} onClick={() => this.handleTab(3)}>{i18n('plugin.pluginSet')}</div>
</div>
{tab === 1 && pluginName && (
globalStatus === 1 ? (
allowRelease ? (
<div className="panel">
<PrePublish {...prePublishProps} release={this.handleRelease} cancelRelease={this.cancelPrePublish} />
<Publish version={version} status={status} release={this.handleRelease} />
Expand All @@ -77,7 +77,7 @@ class PluginSet extends Component {
const { pluginId } = this.state;
api.getPluginInfo(pluginId).then(res => {
if (res.code === 0) {
const { createdBy, pluginName, remark, avgScore, countScoreUser, pluginTypes, pluginVersions, repoName, repoUrl, globalStatus } = res.data;
const { createdBy, pluginName, remark, avgScore, countScoreUser, pluginTypes, pluginVersions, repoName, repoUrl, allowRelease } = res.data;
const { historyVersions, status, version, versionId, log, auditRemark, hasPrePublish, preStatus, preVersionId, preLog } = parseStatus(pluginVersions);
this.setState({
createdBy,
Expand All @@ -88,7 +88,7 @@ class PluginSet extends Component {
pluginType: pluginTypes[0].typeName,
repoName,
repoUrl,
globalStatus,
allowRelease,
historyVersions,
status,
version,
Expand Down
6 changes: 3 additions & 3 deletions app/dashboard/view/pluginSet/overview/Overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import config from '../../../utils/config';

class Overview extends Component {
render() {
const { pluginId, pluginName, remark, version, pluginType, avgScore, countScoreUser, createdBy, repoName, repoUrl, globalStatus } = this.props;
const { pluginId, pluginName, remark, version, pluginType, avgScore, countScoreUser, createdBy, repoName, repoUrl, allowRelease } = this.props;
const { status, auditRemark, hasPrePublish, preStatus } = this.props;
const { cancelRelease } = this.props;
const repoHref = `${config.devOrigin}/u/${createdBy}/p/${repoUrl.split('/').pop().split('.').join('/')}`;
Expand All @@ -22,7 +22,7 @@ class Overview extends Component {
<div className="top">
<div className="name">
<div>{pluginName}</div>
<div className="tag">{i18n('plugin.disabled')}</div>
{!allowRelease && <div className="tag">{i18n('plugin.disabled')}</div>}
</div>
<div>
<a className="goto" href={repoHref} target="_blank" rel="noopener noreferrer">{i18n('plugin.codeRepo')}</a>
Expand All @@ -44,7 +44,7 @@ class Overview extends Component {
<span className="rate-user-count">({kilo(countScoreUser)} {i18n('plugin.userCount')})</span>
</div>
</div>
{globalStatus === 1 ? (
{allowRelease ? (
<div className="status">
{i18n(`plugin.status${status}`, { version, reason: auditRemark })}
{status === 5 && (
Expand Down
4 changes: 2 additions & 2 deletions app/dashboard/view/pluginSet/setting/Setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class Setting extends Component {

render() {
const { pluginName, remark, deleteWs } = this.state;
const { globalStatus } = this.props;
const { allowRelease } = this.props;
const disabled = !pluginName || !remark || remark.length > 255;
if (globalStatus === 1) {
if (allowRelease) {
return (
<div className="panel">
<div className="panel-sub-title">{i18n('plugin.basicSet')}</div>
Expand Down

0 comments on commit f5edb80

Please # to comment.