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

geonetwork / geonetwork-ui / 15536803519

09 Jun 2025 02:20PM UTC coverage: 83.715% (-0.6%) from 84.332%
15536803519

Pull #1261

github

web-flow
Merge da4a6b6b0 into 320c95c81
Pull Request #1261: [Bug fix]: Use maxFeatureCount for all WFS links

697 of 946 branches covered (73.68%)

Branch coverage included in aggregate %.

17 of 22 new or added lines in 3 files covered. (77.27%)

5 existing lines in 1 file now uncovered.

1827 of 2069 relevant lines covered (88.3%)

7.42 hits per line

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

86.67
/libs/feature/record/src/lib/data-view/data-view.component.ts
1
import {
1✔
2
  ChangeDetectionStrategy,
3
  Component,
4
  EventEmitter,
5
  Input,
6
  Output,
7
} from '@angular/core'
8
import { getLinkLabel, getLinkPriority } from '@geonetwork-ui/util/shared'
1✔
9
import { BehaviorSubject, combineLatest, of } from 'rxjs'
1✔
10
import { catchError, finalize, map, switchMap, tap } from 'rxjs/operators'
1✔
11
import { MdViewFacade } from '../state'
1✔
12
import { DatavizConfigurationModel } from '@geonetwork-ui/common/domain/model/dataviz/dataviz-configuration.model'
13
import {
14
  DatasetOnlineResource,
15
  DatasetServiceDistribution,
16
} from '@geonetwork-ui/common/domain/model/record'
17
import { DropdownSelectorComponent } from '@geonetwork-ui/ui/inputs'
1✔
18
import {
1✔
19
  ChartViewComponent,
20
  TableViewComponent,
21
} from '@geonetwork-ui/feature/dataviz'
22
import { CommonModule } from '@angular/common'
1✔
23
import { TranslateModule } from '@ngx-translate/core'
1✔
24
import { PopupAlertComponent } from '@geonetwork-ui/ui/widgets'
1✔
25

26
@Component({
27
  selector: 'gn-ui-data-view',
28
  templateUrl: './data-view.component.html',
29
  styleUrls: ['./data-view.component.css'],
30
  changeDetection: ChangeDetectionStrategy.OnPush,
31
  standalone: true,
32
  imports: [
33
    CommonModule,
34
    DropdownSelectorComponent,
35
    TableViewComponent,
36
    TranslateModule,
37
    ChartViewComponent,
38
    PopupAlertComponent,
39
  ],
40
})
41
export class DataViewComponent {
1✔
42
  @Input() mode: 'table' | 'chart'
43
  @Input() displaySource = true
8✔
44
  @Input() set exceedsLimit(value: boolean) {
45
    this.excludeWfs$.next(value)
×
46
  }
47
  @Input() set selectedView(value: string) {
NEW
48
    if (value !== 'map') {
×
NEW
49
      this.linkSelected.emit(this.selectedLink$.value)
×
50
    }
51
  }
52
  @Output() chartConfig$ = new BehaviorSubject<DatavizConfigurationModel>(null)
8✔
53
  @Output() linkSelected = new EventEmitter<any>()
8✔
54
  cacheActive$ = this.mdViewFacade.isHighUpdateFrequency$.pipe(
8✔
55
    map((highF) => !highF)
×
56
  )
57
  excludeWfs$ = new BehaviorSubject(false)
8✔
58
  compatibleDataLinks$ = combineLatest([
8✔
59
    this.mdViewFacade.dataLinks$,
60
    this.mdViewFacade.geoDataLinks$,
61
  ]).pipe(
62
    map(([dataLinks, geoDataLinks]) => {
63
      const a = [...dataLinks, ...geoDataLinks]
4✔
64
      a.sort((a, b) => getLinkPriority(b) - getLinkPriority(a))
20✔
65
      return a
4✔
66
    })
67
  )
68
  dropdownChoices$ = this.compatibleDataLinks$.pipe(
8✔
69
    tap((links) => {
70
      if (links.indexOf(this.selectedLink$.value) === -1) {
4✔
71
        this.selectLink(JSON.stringify(links[0]))
4✔
72
      }
73
    }),
74
    map((links) =>
75
      links.map((link) => ({
16✔
76
        label: getLinkLabel(link),
77
        value: JSON.stringify(link),
78
      }))
79
    )
80
  )
81
  selectedLink$ = new BehaviorSubject<DatasetServiceDistribution>(null)
8✔
82

83
  hidePreview$ = this.excludeWfs$.pipe(
8✔
84
    map((excludeWfs) => this.mode === 'chart' && excludeWfs)
9✔
85
  )
86

87
  constructor(private mdViewFacade: MdViewFacade) {}
8!
88

89
  setChartConfig(event: DatavizConfigurationModel) {
90
    this.mdViewFacade.setChartConfig(event)
3✔
91
  }
92

93
  selectLink(linkAsString: string) {
94
    const link: DatasetServiceDistribution = JSON.parse(linkAsString)
6✔
95
    this.linkSelected.emit(link)
6✔
96
    link.url = new URL(link.url)
6✔
97
    this.selectedLink$.next(link)
6✔
98
  }
99
}
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