• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

geonetwork / geonetwork-ui / 13158336992

05 Feb 2025 12:57PM UTC coverage: 81.754% (-2.8%) from 84.514%
13158336992

Pull #1104

github

web-flow
Merge fce1ed1c7 into c1a684900
Pull Request #1104: Me image input preview

1998 of 2811 branches covered (71.08%)

Branch coverage included in aggregate %.

6 of 6 new or added lines in 2 files covered. (100.0%)

3 existing lines in 2 files now uncovered.

6412 of 7476 relevant lines covered (85.77%)

10.44 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

61.76
/libs/ui/inputs/src/lib/button/button.component.ts
1
import {
10✔
2
  ChangeDetectionStrategy,
3
  Component,
4
  EventEmitter,
5
  Input,
6
  Output,
7
} from '@angular/core'
8
import { propagateToDocumentOnly } from '@geonetwork-ui/util/shared'
10✔
9

10
@Component({
11
  selector: 'gn-ui-button',
12
  templateUrl: './button.component.html',
13
  styleUrls: ['./button.component.css'],
14
  changeDetection: ChangeDetectionStrategy.OnPush,
15
  standalone: true,
16
})
17
export class ButtonComponent {
10✔
18
  private btnClass = 'gn-ui-btn-default'
70✔
19

20
  @Input() set type(
21
    value:
22
      | 'primary'
23
      | 'secondary'
24
      | 'default'
25
      | 'outline'
26
      | 'light'
27
      | 'gray'
28
      | 'black'
29
  ) {
30
    // btn-classes are written in full to be picked up by tailwind
31
    switch (value) {
69!
32
      case 'primary':
33
        this.btnClass = 'gn-ui-btn-primary'
23✔
34
        break
23✔
35
      case 'secondary':
36
        this.btnClass = 'gn-ui-btn-secondary'
×
37
        break
×
38
      case 'outline':
39
        this.btnClass = 'gn-ui-btn-outline'
36✔
40
        break
36✔
41
      case 'light':
42
        this.btnClass = 'gn-ui-btn-light'
10✔
43
        break
10✔
44
      case 'gray':
UNCOV
45
        this.btnClass = 'gn-ui-btn-gray'
×
UNCOV
46
        break
×
47
      case 'black':
48
        this.btnClass = 'gn-ui-btn-black'
×
49
        break
×
50
      case 'default':
51
      default:
52
        this.btnClass = 'gn-ui-btn-default'
×
53
        break
×
54
    }
55
  }
56

57
  @Input() disabled = false
70✔
58
  @Input() extraClass = ''
70✔
59
  @Output() buttonClick = new EventEmitter<void>()
70✔
60

61
  get classList() {
62
    return `${this.btnClass} ${this.extraClass}`
77✔
63
  }
64

65
  handleClick(event: Event) {
66
    this.buttonClick.emit()
8✔
67
    event.preventDefault()
8✔
68
    propagateToDocumentOnly(event)
8✔
69
  }
70
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc