superdesk-ui-framework 4.0.33 → 4.0.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,7 @@ interface IProps {
5
5
  orientation?: 'horizontal' | 'vertical'; // defaults to 'horizontal'
6
6
  children: React.ReactNode;
7
7
  groupLabelledBy?: string;
8
+ 'data-test-id'?: string;
8
9
  }
9
10
 
10
11
  export class CheckGroup extends React.PureComponent<IProps> {
@@ -14,7 +15,11 @@ export class CheckGroup extends React.PureComponent<IProps> {
14
15
  });
15
16
 
16
17
  return (
17
- <div className={classes} aria-labelledby={this.props.groupLabelledBy}>
18
+ <div
19
+ className={classes}
20
+ aria-labelledby={this.props.groupLabelledBy}
21
+ data-test-id={this.props['data-test-id']}
22
+ >
18
23
  {this.props.children}
19
24
  </div>
20
25
  );
@@ -12,6 +12,7 @@ interface IProps {
12
12
  noTransform?: boolean;
13
13
  hexColor?: string;
14
14
  style?: 'filled' | 'hollow' | 'translucent'; // defaults to 'filled'
15
+ 'data-test-id'?: string;
15
16
  }
16
17
  export class Label extends React.PureComponent<IProps> {
17
18
  render() {
@@ -23,13 +24,16 @@ export class Label extends React.PureComponent<IProps> {
23
24
  [`label--${this.props.style}`]: this.props.style !== 'filled' && this.props.style !== undefined,
24
25
  [`hollow-${this.props.color}`]: this.props.color && this.props.style === 'hollow',
25
26
  });
27
+
26
28
  if (this.props.link || this.props.onClick) {
27
29
  if (this.props.style === 'hollow') {
28
30
  return (
29
31
  <a className={classes}
30
32
  href={this.props.link}
31
33
  onClick={this.props.onClick}
32
- style={{color: this.props.hexColor, borderColor: this.props.hexColor}}>
34
+ style={{color: this.props.hexColor, borderColor: this.props.hexColor}}
35
+ data-test-id={this.props['data-test-id']}
36
+ >
33
37
  {this.props.text}
34
38
  </a>
35
39
  );
@@ -38,7 +42,9 @@ export class Label extends React.PureComponent<IProps> {
38
42
  <a className={classes}
39
43
  href={this.props.link}
40
44
  onClick={this.props.onClick}
41
- style={{color: this.props.hexColor, backgroundColor: `${this.props.hexColor}33`}}>
45
+ style={{color: this.props.hexColor, backgroundColor: `${this.props.hexColor}33`}}
46
+ data-test-id={this.props['data-test-id']}
47
+ >
42
48
  {this.props.text}
43
49
  </a>
44
50
  );
@@ -46,7 +52,9 @@ export class Label extends React.PureComponent<IProps> {
46
52
  return (
47
53
  <a className={classes}
48
54
  href={this.props.link}
49
- onClick={this.props.onClick} style={{backgroundColor: this.props.hexColor}}>
55
+ onClick={this.props.onClick} style={{backgroundColor: this.props.hexColor}}
56
+ data-test-id={this.props['data-test-id']}
57
+ >
50
58
  {this.props.text}
51
59
  </a>
52
60
  );
@@ -54,25 +62,36 @@ export class Label extends React.PureComponent<IProps> {
54
62
  } else {
55
63
  if (this.props.style === 'hollow') {
56
64
  return (
57
- <span className={classes}
58
- style={{color: this.props.hexColor, borderColor: this.props.hexColor}}>
65
+ <span
66
+ className={classes}
67
+ style={{color: this.props.hexColor, borderColor: this.props.hexColor}}
68
+ data-test-id={this.props['data-test-id']}
69
+ >
59
70
  {this.props.text}
60
71
  </span>
61
72
  );
62
73
  } else if (this.props.style === 'translucent') {
63
74
  return (
64
- <span className={classes}
65
- style={{color: this.props.hexColor, backgroundColor: `${this.props.hexColor}33`}}>
75
+ <span
76
+ className={classes}
77
+ style={{color: this.props.hexColor, backgroundColor: `${this.props.hexColor}33`}}
78
+ data-test-id={this.props['data-test-id']}
79
+ >
66
80
  {this.props.text}
67
81
  </span>
68
82
  );
69
83
  } else {
70
84
  return (
71
- <span className={classes}
72
- style={this.props.hexColor
73
- ? {backgroundColor: this.props.hexColor, color: getTextColor(this.props.hexColor)}
74
- : undefined}>
75
- {this.props.text}
85
+ <span
86
+ className={classes}
87
+ style={
88
+ this.props.hexColor
89
+ ? {backgroundColor: this.props.hexColor, color: getTextColor(this.props.hexColor)}
90
+ : undefined
91
+ }
92
+ data-test-id={this.props['data-test-id']}
93
+ >
94
+ {this.props.text}
76
95
  </span>
77
96
  );
78
97
  }
@@ -27,7 +27,7 @@ interface IProps {
27
27
  maximizable?: boolean;
28
28
  headerTemplate?: JSX.Element | string;
29
29
  footerTemplate?: JSX.Element | string;
30
- ['data-test-id']?: string;
30
+ 'data-test-id'?: string;
31
31
  onShow?(): void;
32
32
  onHide?(): void;
33
33
  }
@@ -47,7 +47,6 @@ export class Modal extends React.Component<IProps, {}> {
47
47
  <div
48
48
  style={{display: 'content'}}
49
49
  data-theme={this.props.theme !== 'dark' ? null : 'dark-ui' }
50
- data-test-id={this.props['data-test-id']}
51
50
  >
52
51
  <PrimeDialog
53
52
  id={this.props.id}
@@ -63,6 +62,7 @@ export class Modal extends React.Component<IProps, {}> {
63
62
  zIndex={this.zIndex}
64
63
  position={this.props.position}
65
64
  closable={this.props.onHide != null ? true : false}
65
+ data-test-id={this.props['data-test-id']}
66
66
  >
67
67
  {this.props.children}
68
68
  </PrimeDialog>
@@ -82,6 +82,7 @@ export class RadioButtonGroup extends React.Component<IProps> {
82
82
  htmlFor={this.htmlId + index}
83
83
  aria-label={item.labelHidden ? item.label : undefined}
84
84
  data-test-id="item"
85
+ data-test-value={item.label}
85
86
  >
86
87
 
87
88
  { item.icon ? <i className={`icon-${item.icon}`} aria-hidden="true" /> : null }
@@ -92,7 +92,7 @@ export class TreeSelectItem<T> extends React.Component<IProps<T>> {
92
92
  </span>
93
93
 
94
94
  {this.props.option.children
95
- && <span className="suggestion-item__icon" aria-hidden="true">
95
+ && <span className="suggestion-item__icon" aria-hidden="true" data-test-id="children-indicator">
96
96
  <Icon name="chevron-right-thin"></Icon>
97
97
  </span>
98
98
  }