diff options
author | Pascal Mugnier <pascal.mugnier@sonarsource.com> | 2018-03-09 07:44:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-09 07:44:17 +0100 |
commit | 0fc431e6994c9e4568cb3683ba6ae0330ce78cf1 (patch) | |
tree | bb29e13e133a07b02d1cad0ec8589c3d969af5ef | |
parent | 113d961e033dfa90642be93eb7a45be47850f274 (diff) | |
download | sonarqube-0fc431e6994c9e4568cb3683ba6ae0330ce78cf1.tar.gz sonarqube-0fc431e6994c9e4568cb3683ba6ae0330ce78cf1.zip |
SONAR-10465 Remove clickable tags on Marketplace's list of Plugins (#3132)
8 files changed, 22 insertions, 66 deletions
diff --git a/server/sonar-web/src/main/js/apps/marketplace/App.tsx b/server/sonar-web/src/main/js/apps/marketplace/App.tsx index 0807fd2dabf..2dcf58ab2e0 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/App.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/App.tsx @@ -184,7 +184,6 @@ export default class App extends React.PureComponent<Props, State> { plugins={filteredPlugins} readOnly={!standaloneMode} refreshPending={this.fetchPendingPlugins} - updateQuery={this.updateQuery} /> )} {!loadingPlugins && <Footer total={filteredPlugins.length} />} diff --git a/server/sonar-web/src/main/js/apps/marketplace/PluginsList.tsx b/server/sonar-web/src/main/js/apps/marketplace/PluginsList.tsx index 16e2836c685..6c08a5e34bd 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/PluginsList.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/PluginsList.tsx @@ -20,7 +20,7 @@ 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 { @@ -32,7 +32,6 @@ interface Props { }; readOnly: boolean; refreshPending: () => void; - updateQuery: (newQuery: Partial<Query>) => void; } export default class PluginsList extends React.PureComponent<Props> { @@ -59,7 +58,6 @@ export default class PluginsList extends React.PureComponent<Props> { readOnly={this.props.readOnly} refreshPending={this.props.refreshPending} status={status} - updateQuery={this.props.updateQuery} /> ); } @@ -70,7 +68,6 @@ export default class PluginsList extends React.PureComponent<Props> { readOnly={this.props.readOnly} refreshPending={this.props.refreshPending} status={status} - updateQuery={this.props.updateQuery} /> ); } diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginAvailable.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginAvailable.tsx index e3b75d54936..938163782e3 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginAvailable.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginAvailable.tsx @@ -26,26 +26,18 @@ import PluginStatus from './PluginStatus'; 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"> diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginDescription.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginDescription.tsx index 41af5321e90..bd69c992d88 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginDescription.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginDescription.tsx @@ -19,36 +19,23 @@ */ 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; diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginInstalled.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginInstalled.tsx index a06e7d9a69d..2d6faf4975d 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginInstalled.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginInstalled.tsx @@ -26,26 +26,18 @@ import PluginUpdates from './PluginUpdates'; 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"> diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/PluginDescription-test.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/PluginDescription-test.tsx index 06da650618b..2195a3ed8ee 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/PluginDescription-test.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/PluginDescription-test.tsx @@ -19,7 +19,6 @@ */ 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', () => { @@ -32,13 +31,6 @@ it('should not display any 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 @@ -48,7 +40,6 @@ function getWrapper(props = {}) { description: 'foo description', category: 'foocategory' }} - updateQuery={() => {}} {...props} /> ); diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/PluginDescription-test.tsx.snap b/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/PluginDescription-test.tsx.snap index f9aeacd79ff..3f3bf5627e5 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/PluginDescription-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/PluginDescription-test.tsx.snap @@ -10,13 +10,11 @@ exports[`should display the description and category 1`] = ` > 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" diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index 28e78bea51d..43d19d28015 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -2175,7 +2175,7 @@ marketplace.wrong_license_type=Your license is not compatible with any existing 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... #------------------------------------------------------------------------------ |