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

geonetwork / geonetwork-ui / 15708825682

17 Jun 2025 01:37PM UTC coverage: 83.466% (-0.7%) from 84.189%
15708825682

push

github

web-flow
Merge pull request #1266 from geonetwork/fix-app-banner

[Datahub] Reposition application banner & enable close button by default

1700 of 2327 branches covered (73.06%)

Branch coverage included in aggregate %.

0 of 2 new or added lines in 1 file covered. (0.0%)

5413 of 6195 relevant lines covered (87.38%)

11.75 hits per line

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

34.38
/libs/ui/elements/src/lib/application-banner/application-banner.component.ts
1
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
1✔
2
import { CommonModule } from '@angular/common'
1✔
3
import {
1✔
4
  NgIconComponent,
5
  provideIcons,
6
  provideNgIconsConfig,
7
} from '@ng-icons/core'
8
import {
1✔
9
  matCloseOutline,
10
  matInfoOutline,
11
  matWarningAmberOutline,
12
} from '@ng-icons/material-icons/outline'
13
import { matWarning } from '@ng-icons/material-icons/baseline'
1✔
14

15
@Component({
16
  selector: 'gn-ui-application-banner',
17
  standalone: true,
18
  imports: [CommonModule, NgIconComponent],
19
  changeDetection: ChangeDetectionStrategy.OnPush,
20
  templateUrl: './application-banner.component.html',
21
  styleUrl: './application-banner.component.css',
22
  providers: [
23
    provideIcons({
24
      matWarningAmberOutline,
25
      matInfoOutline,
26
      matCloseOutline,
27
      matWarning,
28
    }),
29
    provideNgIconsConfig({ size: '1.5em' }),
30
  ],
31
})
32
export class ApplicationBannerComponent {
1✔
33
  @Input() message: string
34
  @Input() title: string
35
  @Input() closeEnabled = false
1✔
36
  @Input() extraClass = ''
1✔
37
  @Input() icon = ''
1✔
38
  msgClass = ''
1✔
39
  bannerOpen = true
1✔
40

41
  @Input() set type(value: 'primary' | 'secondary' | 'light') {
42
    switch (value) {
×
43
      case 'primary':
44
        this.msgClass = 'bg-primary-darkest border-primary text-white'
×
45
        this.icon = 'matWarning'
×
46
        break
×
47
      case 'light':
48
        this.msgClass =
×
49
          'bg-primary-opacity-10 border-primary-lightest text-black'
50
        this.icon = 'matInfoOutline'
×
51
        break
×
52
      case 'secondary':
53
      default:
54
        this.msgClass = 'bg-primary-opacity-50 border-primary-darker text-black'
×
55
        this.icon = 'matWarningAmberOutline'
×
56
        break
×
57
    }
58
  }
59

60
  get classList() {
NEW
61
    if (this.message.length > 200 && !this.closeEnabled) {
×
NEW
62
      return `${this.msgClass} ${this.extraClass} overflow-y-scroll items-start max-h-16`
×
63
    }
64
    return `${this.msgClass} ${this.extraClass} items-center`
×
65
  }
66

67
  closeMessage() {
68
    this.bannerOpen = false
×
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