return this.isSomethingActive(urls);
}
+ isMarketplace() {
+ const urls = ['/admin/marketplace'];
+ return this.isSomethingActive(urls);
+ }
+
renderExtension = ({ key, name }: Extension) => {
return (
<li key={key}>
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(
this.setState({ editionStatus: editionStatus });
updateQuery = (newQuery: Partial<Query>) => {
- 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 (
<div className="page page-limited" id="marketplace-page">
<Helmet title={translate('marketplace.page')} />
- {editionStatus && <EditionsStatusNotif editionStatus={editionStatus} />}
+ <div className="marketplace-notifs">
+ {editionStatus && <EditionsStatusNotif editionStatus={editionStatus} />}
+ <PendingActions refreshPending={this.fetchPendingPlugins} pending={pending} />
+ </div>
<Header />
<EditionBoxes
editionStatus={editionStatus}
updateCenterActive={this.props.updateCenterActive}
updateEditionStatus={this.updateEditionStatus}
/>
- <PendingActions refreshPending={this.fetchPendingPlugins} pending={pending} />
<Search
query={query}
updateCenterActive={this.props.updateCenterActive}
updateQuery={this.updateQuery}
/>
- <PluginsList
- plugins={filteredPlugins}
- pending={pending}
- refreshPending={this.fetchPendingPlugins}
- updateQuery={this.updateQuery}
- />
- <Footer total={filteredPlugins.length} />
+ {loading && <i className="spinner" />}
+ {!loading && (
+ <PluginsList
+ plugins={filteredPlugins}
+ pending={pending}
+ refreshPending={this.fetchPendingPlugins}
+ updateQuery={this.updateQuery}
+ />
+ )}
+ {!loading && <Footer total={filteredPlugins.length} />}
</div>
);
}
return null;
}
- const nbPluginsClass = 'big little-spacer-left little-spacer-right';
return (
- <div className="js-pending panel panel-warning big-spacer-bottom">
+ <div className="js-pending alert alert-warning">
<div className="display-inline-block">
<p>{translate('marketplace.sonarqube_needs_to_be_restarted_to')}</p>
<ul className="list-styled spacer-top">
<FormattedMessage
defaultMessage={translate('marketplace.install_x_plugins')}
id="marketplace.install_x_plugins"
- values={{
- nb: (
- <strong className={'text-success ' + nbPluginsClass}>
- {installing.length}
- </strong>
- )
- }}
+ values={{ nb: <strong>{installing.length}</strong> }}
/>
</li>
)}
<FormattedMessage
defaultMessage={translate('marketplace.update_x_plugins')}
id="marketplace.update_x_plugins"
- values={{
- nb: (
- <strong className={'text-success ' + nbPluginsClass}>
- {updating.length}
- </strong>
- )
- }}
+ values={{ nb: <strong>{updating.length}</strong> }}
/>
</li>
)}
<FormattedMessage
defaultMessage={translate('marketplace.uninstall_x_plugins')}
id="marketplace.uninstall_x_plugins"
- values={{
- nb: (
- <strong className={'text-danger ' + nbPluginsClass}>{removing.length}</strong>
- )
- }}
+ values={{ nb: <strong>{removing.length}</strong> }}
/>
</li>
)}
</ul>
</div>
- <div className="pull-right button-group">
- <button className="js-restart" onClick={this.handleOpenRestart}>
+ <div className="pull-right">
+ <button className="js-restart little-spacer-right" onClick={this.handleOpenRestart}>
{translate('marketplace.restart')}
</button>
<button className="js-cancel-all button-red" onClick={this.handleRevert}>
];
return (
<div id="marketplace-search" className="panel panel-vertical bordered-bottom spacer-bottom">
- <div className="display-inline-block text-top nowrap big-spacer-right">
+ <div className="display-inline-block text-top nowrap abs-width-150 spacer-right">
<RadioToggle
name="marketplace-filter"
onCheck={this.handleFilterChange}
exports[`should display pending actions 1`] = `
<div
- className="js-pending panel panel-warning big-spacer-bottom"
+ className="js-pending alert alert-warning"
>
<div
className="display-inline-block"
id="marketplace.install_x_plugins"
values={
Object {
- "nb": <strong
- className="text-success big little-spacer-left little-spacer-right"
- >
+ "nb": <strong>
2
</strong>,
}
id="marketplace.uninstall_x_plugins"
values={
Object {
- "nb": <strong
- className="text-danger big little-spacer-left little-spacer-right"
- >
+ "nb": <strong>
1
</strong>,
}
</ul>
</div>
<div
- className="pull-right button-group"
+ className="pull-right"
>
<button
- className="js-restart"
+ className="js-restart little-spacer-right"
onClick={[Function]}
>
marketplace.restart
const { editionStatus } = this.props;
if (editionStatus.installationStatus === 'AUTOMATIC_IN_PROGRESS') {
return (
- <div className="alert alert-page alert-info">
+ <div className="alert alert-info">
<i className="spinner spacer-right text-bottom" />
<span>{translate('marketplace.status.AUTOMATIC_IN_PROGRESS')}</span>
</div>
);
} else if (editionStatus.installationStatus === 'AUTOMATIC_READY') {
return (
- <div className="alert alert-page alert-success">
+ <div className="alert alert-success">
<span>{translate('marketplace.status.AUTOMATIC_READY')}</span>
<button className="js-restart spacer-left" onClick={this.handleOpenRestart}>
{translate('marketplace.restart')}
['MANUAL_IN_PROGRESS', 'AUTOMATIC_FAILURE'].includes(editionStatus.installationStatus)
) {
return (
- <div className="alert alert-page alert-danger">
+ <div className="alert alert-danger">
{translate('marketplace.status', editionStatus.installationStatus)}
<a className="little-spacer-left" href="https://www.sonarsource.com" target="_blank">
{translate('marketplace.how_to_install')}
)}
{loading && <i className="spinner spacer-right" />}
{isPluginInstalled(plugin) && (
- <div className="button-group">
+ <div className="display-inlin-block">
{plugin.updates &&
plugin.updates.map((update, idx) => (
<PluginUpdateButton
/>
))}
<button
- className="js-uninstall button-red"
+ className="js-uninstall button-red little-spacer-left"
disabled={loading}
onClick={this.handleUninstall}>
{translate('marketplace.uninstall')}
return null;
}
return (
- <button className="js-update" onClick={this.handleClick} disabled={disabled}>
+ <button
+ className="js-update little-spacer-bottom"
+ onClick={this.handleClick}
+ disabled={disabled}>
{translateWithParameters('marketplace.update_to_x', update.release.version)}
</button>
);
exports[`should display a ready notification 1`] = `
<div
- className="alert alert-page alert-success"
+ className="alert alert-success"
>
<span>
marketplace.status.AUTOMATIC_READY
exports[`should display an error notification 1`] = `
<div
- className="alert alert-page alert-danger"
+ className="alert alert-danger"
>
marketplace.status.AUTOMATIC_FAILURE
<a
exports[`should display an in progress notif 1`] = `
<div
- className="alert alert-page alert-info"
+ className="alert alert-info"
>
<i
className="spinner spacer-right text-bottom"
align-items: baseline;
justify-content: space-between;
}
+
+.marketplace-notifs .alert {
+ padding: 8px;
+}
+
+.marketplace-notifs .alert:last-child {
+ margin-bottom: 16px;
+}
vertical-align: middle;
}
-.alert-page {
- margin-bottom: 16px;
- padding: 8px;
-}
-
.modal-alert {
margin: -10px -10px 16px;
padding: 10px;
width: 10%;
}
+.abs-width-150 {
+ width: 150px;
+}
.abs-width-240 {
width: 240px;
}