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

geonetwork / geonetwork-ui / 13919058536

18 Mar 2025 08:52AM UTC coverage: 84.393% (-0.6%) from 84.954%
13919058536

push

github

web-flow
Merge pull request #1162 from geonetwork/wfs-pagination-feedback

[Datahub]: Improve maxFeatureCount error message display in preview

640 of 850 branches covered (75.29%)

Branch coverage included in aggregate %.

12 of 13 new or added lines in 2 files covered. (92.31%)

1 existing line in 1 file now uncovered.

1669 of 1886 relevant lines covered (88.49%)

6.76 hits per line

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

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

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

74
  constructor(private mdViewFacade: MdViewFacade) {}
8!
75

76
  setChartConfig(event: DatavizConfigurationModel) {
77
    this.mdViewFacade.setChartConfig(event)
3✔
78
  }
79

80
  selectLink(linkAsString: string) {
81
    const link: DatasetOnlineResource = JSON.parse(linkAsString)
6✔
82
    link.url = new URL(link.url)
6✔
83
    this.excludeWfs$
6✔
84
      .pipe(
85
        tap((excludeWfs) => {
86
          this.hidePreview =
8✔
87
            link['accessServiceProtocol'] === 'wfs' &&
20✔
88
            excludeWfs &&
89
            this.mode === 'chart'
90
              ? true
91
              : false
92
          this.selectedLink$.next(link)
8✔
93
        })
94
      )
95
      .subscribe()
96
  }
97
}
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