export interface Plugin {
key: string;
name: string;
- description: string;
category?: string;
+ description: string;
+ editionBundled?: boolean;
license?: string;
organizationName?: string;
- organizationUrl?: string;
homepageUrl?: string;
+ organizationUrl?: string;
issueTrackerUrl?: string;
termsAndConditionsUrl?: string;
}
return [];
}
const lastUpdate = [
- 'INCOMPATIBLE',
+ 'COMPATIBLE',
'REQUIRES_SYSTEM_UPGRADE',
'DEPS_REQUIRE_SYSTEM_UPGRADE'
].map(status => {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import Checkbox from '../../components/controls/Checkbox';
+import Checkbox from '../../../components/controls/Checkbox';
+import CheckIcon from '../../../components/icons-components/CheckIcon';
import PluginUpdateButton from './PluginUpdateButton';
-import { Plugin, installPlugin, updatePlugin, uninstallPlugin } from '../../api/plugins';
-import { isPluginAvailable, isPluginInstalled } from './utils';
-import { translate } from '../../helpers/l10n';
+import { Plugin, installPlugin, updatePlugin, uninstallPlugin } from '../../../api/plugins';
+import { isPluginAvailable, isPluginInstalled } from '../utils';
+import { translate } from '../../../helpers/l10n';
interface Props {
plugin: Plugin;
render() {
const { plugin } = this.props;
const { loading } = this.state;
+
+ if (plugin.editionBundled) {
+ return (
+ <div className="js-actions">
+ {isPluginAvailable(plugin) && (
+ <div>
+ <p className="little-spacer-bottom">
+ {translate('marketplace.available_under_commercial_license')}
+ </p>
+ <a href={plugin.homepageUrl} target="_blank">
+ {translate('marketplace.learn_more')}
+ </a>
+ </div>
+ )}
+ {isPluginInstalled(plugin) && (
+ <p>
+ <CheckIcon className="little-spacer-right" />
+ {translate('marketplace.installed')}
+ </p>
+ )}
+ {isPluginInstalled(plugin) &&
+ plugin.updates &&
+ plugin.updates.length > 0 && (
+ <div className="spacer-top button-group">
+ {plugin.updates.map((update, idx) => (
+ <PluginUpdateButton
+ key={idx}
+ onClick={this.handleUpdate}
+ update={update}
+ disabled={loading}
+ />
+ ))}
+ </div>
+ )}
+ </div>
+ );
+ }
+
return (
<div className="js-actions">
{isPluginAvailable(plugin) &&
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import PluginChangeLogButton from './PluginChangeLogButton';
import PluginDescription from './PluginDescription';
import PluginLicense from './PluginLicense';
import PluginOrganization from './PluginOrganization';
import PluginStatus from './PluginStatus';
-import PluginChangeLogButton from './PluginChangeLogButton';
+import PluginUrls from './PluginUrls';
import { PluginAvailable } from '../../api/plugins';
import { translateWithParameters } from '../../helpers/l10n';
import { Query } from './utils';
<td className="text-top width-20 big-spacer-right">
<ul>
+ <PluginUrls plugin={plugin} />
<PluginLicense license={plugin.license} />
<PluginOrganization plugin={plugin} />
</ul>
};
toggleChangelog = (show?: boolean) => {
- if (show != undefined) {
+ if (show !== undefined) {
this.setState({ changelogOpen: show });
} else {
this.setState(state => ({ changelogOpen: !state.changelogOpen }));
import * as React from 'react';
import PluginDescription from './PluginDescription';
import PluginLicense from './PluginLicense';
-import PluginStatus from './PluginStatus';
import PluginOrganization from './PluginOrganization';
+import PluginStatus from './PluginStatus';
import PluginUpdates from './PluginUpdates';
+import PluginUrls from './PluginUrls';
import { PluginInstalled } from '../../api/plugins';
import { translate } from '../../helpers/l10n';
import { Query } from './utils';
<td className="text-top width-20 big-spacer-right">
<ul>
- {(plugin.homepageUrl || plugin.issueTrackerUrl) && (
- <li className="little-spacer-bottom">
- <ul className="list-inline">
- {plugin.homepageUrl && (
- <li>
- <a className="js-plugin-homepage" href={plugin.homepageUrl} target="_blank">
- {translate('marketplace.homepage')}
- </a>
- </li>
- )}
- {plugin.issueTrackerUrl && (
- <li>
- <a className="js-plugin-issues" href={plugin.issueTrackerUrl} target="_blank">
- {translate('marketplace.issue_tracker')}
- </a>
- </li>
- )}
- </ul>
- </li>
- )}
+ <PluginUrls plugin={plugin} />
<PluginLicense license={plugin.license} />
<PluginOrganization plugin={plugin} />
</ul>
};
toggleChangelog = (show?: boolean) => {
- if (show != undefined) {
+ if (show !== undefined) {
this.setState({ changelogOpen: show });
} else {
this.setState(state => ({ changelogOpen: !state.changelogOpen }));
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import * as React from 'react';
+import { Plugin } from '../../api/plugins';
+import { translate } from '../../helpers/l10n';
+
+interface Props {
+ plugin: Plugin;
+}
+
+export default function PluginUrls({ plugin }: Props) {
+ if (!plugin.homepageUrl && !plugin.issueTrackerUrl) {
+ return null;
+ }
+ return (
+ <li className="little-spacer-bottom">
+ <ul className="list-inline">
+ {plugin.homepageUrl && (
+ <li>
+ <a className="js-plugin-homepage" href={plugin.homepageUrl} target="_blank">
+ {translate('marketplace.homepage')}
+ </a>
+ </li>
+ )}
+ {plugin.issueTrackerUrl && (
+ <li>
+ <a className="js-plugin-issues" href={plugin.issueTrackerUrl} target="_blank">
+ {translate('marketplace.issue_tracker')}
+ </a>
+ </li>
+ )}
+ </ul>
+ </li>
+ );
+}
marketplace.revert=Revert
marketplace.system_upgrades=System Upgrades
marketplace.install=Install
+marketplace.installed=Installed
marketplace._installed=installed
+marketplace.available_under_commercial_license=Available under our commercial editions
+marketplace.learn_more=Learn more
marketplace.homepage=Homepage
marketplace.issue_tracker=Issue Tracker
marketplace.licensed_under_x=Licensed under {license}