From e013b2b9a6f1afb120722eaf422081a136eb0cfd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gr=C3=A9goire=20Aubert?= Date: Tue, 17 Oct 2017 16:30:21 +0200 Subject: [PATCH] SONAR-9936 Update marketplace pending plugins notif --- .../components/nav/settings/SettingsNav.tsx | 7 +++- .../src/main/js/apps/marketplace/App.tsx | 35 +++++++++---------- .../js/apps/marketplace/PendingActions.tsx | 29 ++++----------- .../src/main/js/apps/marketplace/Search.tsx | 2 +- .../PendingActions-test.tsx.snap | 14 +++----- .../components/EditionsStatusNotif.tsx | 6 ++-- .../marketplace/components/PluginActions.tsx | 4 +-- .../components/PluginUpdateButton.tsx | 5 ++- .../EditionsStatusNotif-test.tsx.snap | 6 ++-- .../src/main/js/apps/marketplace/style.css | 8 +++++ .../src/main/less/components/alerts.less | 5 --- server/sonar-web/src/main/less/init/misc.less | 3 ++ 12 files changed, 58 insertions(+), 66 deletions(-) diff --git a/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.tsx b/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.tsx index 7f7632d6630..34dc8b4f72c 100644 --- a/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.tsx @@ -61,6 +61,11 @@ export default class SettingsNav extends React.PureComponent { return this.isSomethingActive(urls); } + isMarketplace() { + const urls = ['/admin/marketplace']; + return this.isSomethingActive(urls); + } + renderExtension = ({ key, name }: Extension) => { return (
  • @@ -82,7 +87,7 @@ export default class SettingsNav extends React.PureComponent { const projectsClassName = classNames('dropdown-toggle', { active: isProjects }); const systemClassName = classNames('dropdown-toggle', { active: isSystem }); const configurationClassNames = classNames('dropdown-toggle', { - active: !isSecurity && !isProjects && !isSystem && !isSupport + active: !isSecurity && !isProjects && !isSystem && !isSupport && !this.isMarketplace() }); const extensionsWithoutSupport = extensions.filter( 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 02910f26c5e..74512fb5dd6 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/App.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/App.tsx @@ -164,24 +164,21 @@ export default class App extends React.PureComponent { this.setState({ editionStatus: editionStatus }); updateQuery = (newQuery: Partial) => { - const query = serializeQuery({ - ...parseQuery(this.props.location.query), - ...newQuery - }); - this.context.router.push({ - pathname: this.props.location.pathname, - query - }); + const query = serializeQuery({ ...parseQuery(this.props.location.query), ...newQuery }); + this.context.router.push({ pathname: this.props.location.pathname, query }); }; render() { - const { editionStatus, plugins, pending } = this.state; + const { editionStatus, loading, plugins, pending } = this.state; const query = parseQuery(this.props.location.query); const filteredPlugins = query.search ? filterPlugins(plugins, query.search) : plugins; return (
    - {editionStatus && } +
    + {editionStatus && } + +
    { updateCenterActive={this.props.updateCenterActive} updateEditionStatus={this.updateEditionStatus} /> - - -
    + {loading && } + {!loading && ( + + )} + {!loading &&
    }
    ); } diff --git a/server/sonar-web/src/main/js/apps/marketplace/PendingActions.tsx b/server/sonar-web/src/main/js/apps/marketplace/PendingActions.tsx index bc96da9bbf0..a42c72145b3 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/PendingActions.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/PendingActions.tsx @@ -53,9 +53,8 @@ export default class PendingActions extends React.PureComponent { return null; } - const nbPluginsClass = 'big little-spacer-left little-spacer-right'; return ( -
    +

    {translate('marketplace.sonarqube_needs_to_be_restarted_to')}

      @@ -64,13 +63,7 @@ export default class PendingActions extends React.PureComponent { - {installing.length} - - ) - }} + values={{ nb: {installing.length} }} /> )} @@ -79,13 +72,7 @@ export default class PendingActions extends React.PureComponent { - {updating.length} - - ) - }} + values={{ nb: {updating.length} }} /> )} @@ -94,18 +81,14 @@ export default class PendingActions extends React.PureComponent { {removing.length} - ) - }} + values={{ nb: {removing.length} }} /> )}
    -
    - ); diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/EditionsStatusNotif-test.tsx.snap b/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/EditionsStatusNotif-test.tsx.snap index 807a7c6714a..537348e08af 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/EditionsStatusNotif-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/EditionsStatusNotif-test.tsx.snap @@ -2,7 +2,7 @@ exports[`should display a ready notification 1`] = `