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

geonetwork / geonetwork-ui / 17642169514

11 Sep 2025 10:48AM UTC coverage: 81.779% (-2.1%) from 83.872%
17642169514

Pull #1347

github

web-flow
Merge 4e66c4a19 into d3eeddaf5
Pull Request #1347: [WIP] Convert remaining components to standalone

2159 of 3067 branches covered (70.39%)

Branch coverage included in aggregate %.

120 of 121 new or added lines in 51 files covered. (99.17%)

46 existing lines in 12 files now uncovered.

7091 of 8244 relevant lines covered (86.01%)

11.53 hits per line

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

65.63
/libs/ui/elements/src/lib/api-card/api-card.component.ts
1
import { DatasetServiceDistribution } from '@geonetwork-ui/common/domain/model/record'
1✔
2
import {
1✔
3
  ChangeDetectionStrategy,
4
  Component,
5
  EventEmitter,
6
  Input,
7
  OnChanges,
8
  OnInit,
9
  Output,
10
  SimpleChanges,
11
} from '@angular/core'
12
import { CommonModule } from '@angular/common'
1✔
13
import { CopyTextButtonComponent } from '@geonetwork-ui/ui/inputs'
1✔
14
import { TranslateDirective, TranslatePipe } from '@ngx-translate/core'
1✔
15
import { MatTooltipModule } from '@angular/material/tooltip'
1✔
16
import { NgIcon, provideIcons } from '@ng-icons/core'
1✔
17
import { iconoirSettings } from '@ng-icons/iconoir'
1✔
18

19
type CardSize = 'L' | 'M' | 'S' | 'XS'
20

21
@Component({
22
  selector: 'gn-ui-api-card',
23
  templateUrl: './api-card.component.html',
24
  styleUrls: ['./api-card.component.css'],
25
  changeDetection: ChangeDetectionStrategy.OnPush,
26
  standalone: true,
27
  imports: [
28
    CommonModule,
29
    CopyTextButtonComponent,
30
    TranslateDirective,
31
    TranslatePipe,
32
    MatTooltipModule,
33
    NgIcon,
34
  ],
35
  viewProviders: [
36
    provideIcons({
37
      iconoirSettings,
38
    }),
39
  ],
40
})
41
export class ApiCardComponent implements OnInit, OnChanges {
1✔
42
  private _size: 'L' | 'M' | 'S' | 'XS'
43
  @Input() link: DatasetServiceDistribution
44
  @Input() currentLink: DatasetServiceDistribution
45
  private readonly sizeClassMap: Record<CardSize, string> = {
3✔
46
    L: 'gn-ui-card-l py-2 px-5 flex-row',
47
    M: 'gn-ui-card-m py-2 px-5 flex-row',
48
    S: 'gn-ui-card-s p-4 flex-col',
49
    XS: 'gn-ui-card-xs py-2 px-5 flex-row',
50
  }
51

52
  @Input() set size(value: CardSize) {
UNCOV
53
    this._size = value
×
UNCOV
54
    this.cardClass = this.sizeClassMap[value]
×
55
  }
56
  get size(): 'L' | 'M' | 'S' | 'XS' {
57
    return this._size
9✔
58
  }
59
  cardClass = ''
3✔
60
  displayApiFormButton: boolean
61
  currentlyActive = false
3✔
62
  @Output() openRecordApiForm: EventEmitter<DatasetServiceDistribution> =
3✔
63
    new EventEmitter<DatasetServiceDistribution>()
64

65
  get generatedText() {
UNCOV
66
    return this.link.accessServiceProtocol === 'wfs'
×
67
      ? 'datahub.search.filter.generatedByWfs'
68
      : 'datahub.search.filter.generatedByAPI'
69
  }
70

71
  ngOnInit() {
72
    this.displayApiFormButton =
4✔
73
      this.link.accessServiceProtocol === 'ogcFeatures' ||
4!
74
      this.link.accessServiceProtocol === 'wfs' ||
75
      this.link.accessServiceProtocol === 'GPFDL'
76
  }
77

78
  ngOnChanges(changes: SimpleChanges) {
UNCOV
79
    this.currentlyActive =
×
80
      changes.currentLink.currentValue === this.link ? true : false
×
81
  }
82

83
  openRecordApiFormPanel() {
84
    if (this.displayApiFormButton) {
1✔
85
      this.currentlyActive = !this.currentlyActive
1✔
86
      this.openRecordApiForm.emit(this.currentlyActive ? this.link : undefined)
1!
87
    }
88
  }
89
}
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

© 2026 Coveralls, Inc