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

geonetwork / geonetwork-ui / 15300108163

28 May 2025 12:27PM UTC coverage: 83.75% (+0.2%) from 83.56%
15300108163

push

github

web-flow
Merge pull request #1223 from geonetwork/prevent-edit-on-harvested-records

Prevent edition on harvested records

3446 of 4629 branches covered (74.44%)

Branch coverage included in aggregate %.

31 of 44 new or added lines in 7 files covered. (70.45%)

9980 of 11402 relevant lines covered (87.53%)

262.85 hits per line

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

70.27
/libs/ui/layout/src/lib/interactive-table/interactive-table.component.ts
1
import {
1✔
2
  ChangeDetectionStrategy,
3
  Component,
4
  ContentChildren,
5
  EventEmitter,
6
  Input,
7
  Output,
8
  QueryList,
9
} from '@angular/core'
10
import { InteractiveTableColumnComponent } from './interactive-table-column/interactive-table-column.component'
1✔
11
import { CommonModule } from '@angular/common'
1✔
12
import { NgIconComponent, provideIcons } from '@ng-icons/core'
1✔
13
import { iconoirNavArrowDown, iconoirNavArrowUp } from '@ng-icons/iconoir'
1✔
14
import { TranslateModule } from '@ngx-translate/core'
1✔
15
import { marker } from '@biesbjerg/ngx-translate-extract-marker'
1✔
16
import { CatalogRecord } from '@geonetwork-ui/common/domain/model/record'
17
import { Observable, of } from 'rxjs'
1✔
18

19
marker('editor.record.lock.resourceType')
1✔
20
marker('editor.record.lock.harvested')
1✔
21
marker('editor.record.lock.owner')
1✔
22
@Component({
23
  selector: 'gn-ui-interactive-table',
24
  templateUrl: './interactive-table.component.html',
25
  styleUrls: ['./interactive-table.component.css'],
26
  changeDetection: ChangeDetectionStrategy.OnPush,
27
  standalone: true,
28
  imports: [CommonModule, NgIconComponent, TranslateModule],
29
  providers: [provideIcons({ iconoirNavArrowDown, iconoirNavArrowUp })],
30
})
31
export class InteractiveTableComponent {
1✔
32
  @ContentChildren(InteractiveTableColumnComponent)
33
  columns: QueryList<InteractiveTableColumnComponent>
34

35
  @Input() items: unknown[] = []
5✔
36
  @Input() canEditItem: (item: unknown) => Observable<boolean> = () => of(true)
30✔
37
  @Input() isDraftPage = false
5✔
38
  @Output() itemClick = new EventEmitter<unknown>()
5✔
39

40
  get gridStyle() {
41
    return {
6✔
42
      'grid-template-columns': this.columns
43
        .map((column) =>
44
          column.width
18!
45
            ? column.width
46
            : column.grow
18✔
47
              ? `minmax(0px,1fr)`
48
              : `minmax(0px,max-content)`
49
        )
50
        .join(' '),
51
    }
52
  }
53

54
  getItemTitle(item: CatalogRecord) {
55
    if (!this.isDraftPage) {
5✔
56
      if (item.kind !== 'dataset') {
5!
57
        return 'editor.record.lock.resourceType'
5✔
NEW
58
      } else if (item.extras?.isHarvested) {
×
NEW
59
        return 'editor.record.lock.harvested'
×
NEW
60
      } else if (!item.extras?.edit) {
×
NEW
61
        return 'editor.record.lock.owner'
×
62
      }
63
    }
64
    return ''
×
65
  }
66

67
  handleRowClick(item: unknown) {
68
    this.itemClick.emit(item)
×
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

© 2026 Coveralls, Inc