plugins={filteredPlugins}
readOnly={!standaloneMode}
refreshPending={this.fetchPendingPlugins}
- updateQuery={this.updateQuery}
/>
)}
{!loadingPlugins && <Footer total={filteredPlugins.length} />}
import * as React from 'react';
import PluginAvailable from './components/PluginAvailable';
import PluginInstalled from './components/PluginInstalled';
-import { isPluginAvailable, isPluginInstalled, Query } from './utils';
+import { isPluginAvailable, isPluginInstalled } from './utils';
import { Plugin, PluginPending } from '../../api/plugins';
interface Props {
};
readOnly: boolean;
refreshPending: () => void;
- updateQuery: (newQuery: Partial<Query>) => void;
}
export default class PluginsList extends React.PureComponent<Props> {
readOnly={this.props.readOnly}
refreshPending={this.props.refreshPending}
status={status}
- updateQuery={this.props.updateQuery}
/>
);
}
readOnly={this.props.readOnly}
refreshPending={this.props.refreshPending}
status={status}
- updateQuery={this.props.updateQuery}
/>
);
}
import PluginUrls from './PluginUrls';
import { PluginAvailable as IPluginAvailable } from '../../../api/plugins';
import { translateWithParameters } from '../../../helpers/l10n';
-import { Query } from '../utils';
interface Props {
plugin: IPluginAvailable;
readOnly: boolean;
refreshPending: () => void;
status?: string;
- updateQuery: (newQuery: Partial<Query>) => void;
}
-export default function PluginAvailable({
- plugin,
- readOnly,
- refreshPending,
- status,
- updateQuery
-}: Props) {
+export default function PluginAvailable({ plugin, readOnly, refreshPending, status }: Props) {
return (
<tr>
- <PluginDescription plugin={plugin} updateQuery={updateQuery} />
+ <PluginDescription plugin={plugin} />
<td className="text-top big-spacer-right">
<ul>
<li className="display-flex-row little-spacer-bottom">
*/
import * as React from 'react';
import { Plugin } from '../../../api/plugins';
-import { Query } from '../utils';
interface Props {
plugin: Plugin;
- updateQuery: (newQuery: Partial<Query>) => void;
}
-export default class PluginDescription extends React.PureComponent<Props> {
- handleCategoryClick = (e: React.SyntheticEvent<HTMLAnchorElement>) => {
- e.preventDefault();
- this.props.updateQuery({ search: this.props.plugin.category });
- };
+const PluginDescription = (props: Props) => {
+ return (
+ <td className="text-top width-25 big-spacer-right">
+ <div>
+ <strong className="js-plugin-name">{props.plugin.name}</strong>
+ {props.plugin.category && (
+ <span className="js-plugin-category badge spacer-left">{props.plugin.category}</span>
+ )}
+ </div>
+ <div className="js-plugin-description little-spacer-top">{props.plugin.description}</div>
+ </td>
+ );
+};
- render() {
- const { plugin } = this.props;
- return (
- <td className="text-top width-25 big-spacer-right">
- <div>
- <strong className="js-plugin-name">{plugin.name}</strong>
- {plugin.category && (
- <a
- className="js-plugin-category badge spacer-left"
- href="#"
- onClick={this.handleCategoryClick}>
- {plugin.category}
- </a>
- )}
- </div>
- <div className="js-plugin-description little-spacer-top">{plugin.description}</div>
- </td>
- );
- }
-}
+export default PluginDescription;
import PluginUrls from './PluginUrls';
import { PluginInstalled as IPluginInstalled } from '../../../api/plugins';
import { translate } from '../../../helpers/l10n';
-import { Query } from '../utils';
interface Props {
plugin: IPluginInstalled;
readOnly: boolean;
refreshPending: () => void;
status?: string;
- updateQuery: (newQuery: Partial<Query>) => void;
}
-export default function PluginInstalled({
- plugin,
- readOnly,
- refreshPending,
- status,
- updateQuery
-}: Props) {
+export default function PluginInstalled({ plugin, readOnly, refreshPending, status }: Props) {
return (
<tr>
- <PluginDescription plugin={plugin} updateQuery={updateQuery} />
+ <PluginDescription plugin={plugin} />
<td className="text-top big-spacer-right">
<ul>
<li className="little-spacer-bottom">
*/
import * as React from 'react';
import { shallow } from 'enzyme';
-import { click } from '../../../../helpers/testUtils';
import PluginDescription from '../PluginDescription';
it('should display the description and category', () => {
).toMatchSnapshot();
});
-it('should update query when clicking on category', () => {
- const updateQuery = jest.fn();
- const wrapper = getWrapper({ updateQuery });
- click(wrapper.find('.js-plugin-category'));
- expect(updateQuery).toHaveBeenCalledWith({ search: 'foocategory' });
-});
-
function getWrapper(props = {}) {
return shallow(
<PluginDescription
description: 'foo description',
category: 'foocategory'
}}
- updateQuery={() => {}}
{...props}
/>
);
>
Foo
</strong>
- <a
+ <span
className="js-plugin-category badge spacer-left"
- href="#"
- onClick={[Function]}
>
foocategory
- </a>
+ </span>
</div>
<div
className="js-plugin-description little-spacer-top"
marketplace.wrong_license_type_x=Your license is not compatible with the selected edition. Please provide a valid license for {0}.
marketplace.i_need_a_license=I need a license key
marketplace.download_package=Download package
-marketplace.search=Search by features or categories...
+marketplace.search=Search by features, tags, or categories...
#------------------------------------------------------------------------------