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

geonetwork / geonetwork-ui / 17860518616

19 Sep 2025 02:01PM UTC coverage: 84.469% (+0.07%) from 84.4%
17860518616

push

github

web-flow
Merge pull request #1355 from geonetwork/dh-download-links-forkjoin-inner-errors

[Datahub]: download links fixes on errors

3795 of 5026 branches covered (75.51%)

Branch coverage included in aggregate %.

3 of 3 new or added lines in 1 file covered. (100.0%)

113 existing lines in 31 files now uncovered.

10824 of 12281 relevant lines covered (88.14%)

353.76 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, provideNgIconsConfig } 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
    provideNgIconsConfig({
40
      size: '1.5em',
41
    }),
42
  ],
43
})
44
export class ApiCardComponent implements OnInit, OnChanges {
1✔
45
  private _size: 'L' | 'M' | 'S' | 'XS'
46
  @Input() link: DatasetServiceDistribution
47
  @Input() currentLink: DatasetServiceDistribution
48
  private readonly sizeClassMap: Record<CardSize, string> = {
3✔
49
    L: 'gn-ui-card-l py-2 px-5 flex-row',
50
    M: 'gn-ui-card-m py-2 px-5 flex-row',
51
    S: 'gn-ui-card-s p-4 flex-col',
52
    XS: 'gn-ui-card-xs py-2 px-5 flex-row',
53
  }
54

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

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

74
  ngOnInit() {
75
    this.displayApiFormButton =
4✔
76
      this.link.accessServiceProtocol === 'ogcFeatures' ||
4!
77
      this.link.accessServiceProtocol === 'wfs' ||
78
      this.link.accessServiceProtocol === 'GPFDL'
79
  }
80

81
  ngOnChanges(changes: SimpleChanges) {
UNCOV
82
    this.currentlyActive =
×
83
      changes.currentLink.currentValue === this.link ? true : false
×
84
  }
85

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