aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src
diff options
context:
space:
mode:
authorDavid Cho-Lerat <david.cho-lerat@sonarsource.com>2024-07-25 12:05:37 +0200
committersonartech <sonartech@sonarsource.com>2024-07-25 20:02:50 +0000
commit1432d3b5928938ab77a44791274d51e8e0cebb73 (patch)
treec8f10c696fa1c446a72da24de3af85068415e444 /server/sonar-web/src
parenta9efc68c07bd90a6420f756b071d081fc9a143f0 (diff)
downloadsonarqube-1432d3b5928938ab77a44791274d51e8e0cebb73.tar.gz
sonarqube-1432d3b5928938ab77a44791274d51e8e0cebb73.zip
SONAR-22616 Fix Activity graph dropdown/select buttons
Diffstat (limited to 'server/sonar-web/src')
-rw-r--r--server/sonar-web/src/main/js/components/activity-graph/AddGraphMetric.tsx18
-rw-r--r--server/sonar-web/src/main/js/components/activity-graph/GraphsHeader.tsx25
2 files changed, 23 insertions, 20 deletions
diff --git a/server/sonar-web/src/main/js/components/activity-graph/AddGraphMetric.tsx b/server/sonar-web/src/main/js/components/activity-graph/AddGraphMetric.tsx
index 709fd8f98ea..d8dda386b12 100644
--- a/server/sonar-web/src/main/js/components/activity-graph/AddGraphMetric.tsx
+++ b/server/sonar-web/src/main/js/components/activity-graph/AddGraphMetric.tsx
@@ -17,8 +17,9 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { Button } from '@sonarsource/echoes-react';
-import { ChevronDownIcon, Dropdown, TextMuted } from 'design-system';
+
+import { Button, IconChevronDown } from '@sonarsource/echoes-react';
+import { Dropdown, TextMuted } from 'design-system';
import { sortBy } from 'lodash';
import * as React from 'react';
import { MetricKey, MetricType } from '~sonar-aligned/types/metrics';
@@ -152,14 +153,11 @@ export default class AddGraphMetric extends React.PureComponent<Props, State> {
/>
}
>
- <Button
- className={
- 'sw-ml-2 sw-body-sm sw-flex sw-flex-row sw-justify-between sw-pl-3 sw-pr-2 sw-w-32 ' +
- 'sw-z-normal' // needed because the legends overlap part of the button
- }
- >
- <TextMuted text={translate('project_activity.graphs.custom.add')} />
- <ChevronDownIcon className="sw-ml-1 sw-mr-0 sw-pr-0" />
+ <Button suffix={<IconChevronDown />}>
+ <TextMuted
+ className="sw-body-sm sw-flex"
+ text={translate('project_activity.graphs.custom.add')}
+ />
</Button>
</Dropdown>
);
diff --git a/server/sonar-web/src/main/js/components/activity-graph/GraphsHeader.tsx b/server/sonar-web/src/main/js/components/activity-graph/GraphsHeader.tsx
index 84838048d91..8390f89174f 100644
--- a/server/sonar-web/src/main/js/components/activity-graph/GraphsHeader.tsx
+++ b/server/sonar-web/src/main/js/components/activity-graph/GraphsHeader.tsx
@@ -18,8 +18,14 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { Button, DropdownMenu, DropdownMenuAlign } from '@sonarsource/echoes-react';
-import { ChevronDownIcon, TextMuted } from 'design-system';
+import {
+ Button,
+ ButtonGroup,
+ DropdownMenu,
+ DropdownMenuAlign,
+ IconChevronDown,
+} from '@sonarsource/echoes-react';
+import { TextMuted } from 'design-system';
import * as React from 'react';
import { translate } from '../../helpers/l10n';
import { GraphType } from '../../types/project-activity';
@@ -76,17 +82,16 @@ export default function GraphsHeader(props: Props) {
return (
<div className={className}>
- <div className="sw-flex">
+ <ButtonGroup>
<DropdownMenu.Root align={DropdownMenuAlign.Start} id="activity-graph-type" items={options}>
<Button
aria-label={translate('project_activity.graphs.choose_type')}
- className={
- 'sw-body-sm sw-flex sw-flex-row sw-justify-between sw-pl-3 sw-pr-2 sw-w-32 ' +
- 'sw-z-normal' // needed because the legends overlap part of the button
- }
+ suffix={<IconChevronDown />}
>
- <TextMuted text={translate('project_activity.graphs', graph)} />
- <ChevronDownIcon className="sw-ml-1 sw-mr-0 sw-pr-0" />
+ <TextMuted
+ className="sw-body-sm sw-flex"
+ text={translate('project_activity.graphs', graph)}
+ />
</Button>
</DropdownMenu.Root>
@@ -101,7 +106,7 @@ export default function GraphsHeader(props: Props) {
selectedMetrics={selectedMetrics}
/>
)}
- </div>
+ </ButtonGroup>
</div>
);
}