]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-10465 Remove clickable tags on Marketplace's list of Plugins (#3132)
authorPascal Mugnier <pascal.mugnier@sonarsource.com>
Fri, 9 Mar 2018 06:44:17 +0000 (07:44 +0100)
committerGitHub <noreply@github.com>
Fri, 9 Mar 2018 06:44:17 +0000 (07:44 +0100)
server/sonar-web/src/main/js/apps/marketplace/App.tsx
server/sonar-web/src/main/js/apps/marketplace/PluginsList.tsx
server/sonar-web/src/main/js/apps/marketplace/components/PluginAvailable.tsx
server/sonar-web/src/main/js/apps/marketplace/components/PluginDescription.tsx
server/sonar-web/src/main/js/apps/marketplace/components/PluginInstalled.tsx
server/sonar-web/src/main/js/apps/marketplace/components/__tests__/PluginDescription-test.tsx
server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/PluginDescription-test.tsx.snap
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 0807fd2dabfdb36dfdb091de0fea24553c33a590..2dcf58ab2e0d613ac64937c71c29c3ac4b42cbc5 100644 (file)
@@ -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} />}
index 16e2836c6858b00491daf4f2e46ea74381cf5353..6c08a5e34bd6d7baee82602043ad0047f64e26c6 100644 (file)
@@ -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}
         />
       );
     }
index e3b75d54936a1d321d2f7af54bbe78ebfd194d93..938163782e337cfa7c009393487066ab04b40680 100644 (file)
@@ -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">
index 41af5321e901101d8a892d74c320b5f564fa3831..bd69c992d885aca804d18209bb2a2c948d564ff1 100644 (file)
  */
 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;
index a06e7d9a69de73193272ca535613ca387553dbca..2d6faf4975d607843a964b1422b82445f86f4c73 100644 (file)
@@ -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">
index 06da650618be76e44f9de1bb4fd17e73a41845e9..2195a3ed8eee5e5ee5b444032f25bff28c42a9ec 100644 (file)
@@ -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}
     />
   );
index f9aeacd79ffbd9598ca939effead66b828b5693c..3f3bf5627e51407a02425ffe57554c7f6b3023d5 100644 (file)
@@ -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"
index 28e78bea51dea4f673338064d53ddb23060fba2a..43d19d28015efc81f90f692fd8874ded2209b3c9 100644 (file)
@@ -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...
 
 
 #------------------------------------------------------------------------------