aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathieu Suen <mathieu.suen@sonarsource.com>2023-01-11 14:00:09 +0100
committersonartech <sonartech@sonarsource.com>2023-01-16 20:03:43 +0000
commit618eb5b837f3cf2d254d41db7a70f0ddffcf35ad (patch)
tree2cc54e01549a8c91d3419a203d9ef69978858243
parenta3cd2185b8705f96a1a6f042e475290d2d4127c6 (diff)
downloadsonarqube-618eb5b837f3cf2d254d41db7a70f0ddffcf35ad.tar.gz
sonarqube-618eb5b837f3cf2d254d41db7a70f0ddffcf35ad.zip
[NO JIRA] Migrate enzyme to RTL for application console
-rw-r--r--server/sonar-web/src/main/js/components/controls/ActionsDropdown.tsx7
-rw-r--r--server/sonar-web/src/main/js/types/application.ts10
2 files changed, 14 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/components/controls/ActionsDropdown.tsx b/server/sonar-web/src/main/js/components/controls/ActionsDropdown.tsx
index 49aa33b9d1a..639e95e79bf 100644
--- a/server/sonar-web/src/main/js/components/controls/ActionsDropdown.tsx
+++ b/server/sonar-web/src/main/js/components/controls/ActionsDropdown.tsx
@@ -64,6 +64,7 @@ interface ItemProps {
className?: string;
children: React.ReactNode;
destructive?: boolean;
+ label?: string;
tooltipOverlay?: React.ReactNode;
tooltipPlacement?: Placement;
/** used to pass a name of downloaded file */
@@ -87,12 +88,13 @@ export class ActionsDropdownItem extends React.PureComponent<ItemProps> {
render() {
const className = classNames(this.props.className, { 'text-danger': this.props.destructive });
let { children } = this.props;
- const { tooltipOverlay, tooltipPlacement } = this.props;
+ const { tooltipOverlay, tooltipPlacement, label } = this.props;
if (this.props.download && typeof this.props.to === 'string') {
children = (
<a
className={className}
+ aria-label={label}
download={this.props.download}
href={this.props.to}
id={this.props.id}
@@ -102,7 +104,7 @@ export class ActionsDropdownItem extends React.PureComponent<ItemProps> {
);
} else if (this.props.to) {
children = (
- <Link className={className} id={this.props.id} to={this.props.to}>
+ <Link className={className} id={this.props.id} to={this.props.to} aria-label={label}>
{children}
</Link>
);
@@ -113,6 +115,7 @@ export class ActionsDropdownItem extends React.PureComponent<ItemProps> {
preventDefault={true}
id={this.props.id}
onClick={this.handleClick}
+ aria-label={label}
>
{children}
</ButtonPlain>
diff --git a/server/sonar-web/src/main/js/types/application.ts b/server/sonar-web/src/main/js/types/application.ts
index daad6a59446..9e0644aa79c 100644
--- a/server/sonar-web/src/main/js/types/application.ts
+++ b/server/sonar-web/src/main/js/types/application.ts
@@ -31,11 +31,19 @@ export interface Application {
description?: string;
key: string;
name: string;
- projects: ApplicationProject[];
+ projects: ApplicationProjectBranch[];
visibility: Visibility;
}
export interface ApplicationProject {
+ enabled?: boolean;
+ key: string;
+ name: string;
+ selected?: boolean;
+ accessible?: boolean;
+}
+
+export interface ApplicationProjectBranch {
branch: string;
enabled?: boolean;
isMain: boolean;