geonetwork-ui 2.2.0-dev.auto-publish-npm-package → 2.2.0-dev.f866474c

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/esm2022/libs/api/repository/src/index.mjs +2 -1
  2. package/esm2022/libs/feature/auth/src/lib/feature-auth.module.mjs +2 -2
  3. package/esm2022/libs/feature/catalog/src/lib/feature-catalog.module.mjs +2 -2
  4. package/esm2022/libs/feature/catalog/src/lib/organisations/organisations.component.mjs +4 -15
  5. package/esm2022/libs/feature/map/src/lib/add-layer-from-wms/add-layer-from-wms.component.mjs +63 -0
  6. package/esm2022/libs/feature/map/src/lib/feature-map.module.mjs +5 -2
  7. package/esm2022/libs/feature/map/src/lib/layers-panel/layers-panel.component.mjs +4 -3
  8. package/esm2022/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.mjs +3 -3
  9. package/esm2022/libs/feature/search/src/lib/feature-search.module.mjs +2 -2
  10. package/esm2022/libs/feature/search/src/lib/state/effects.mjs +3 -3
  11. package/esm2022/libs/feature/search/src/lib/utils/service/fields.mjs +2 -2
  12. package/esm2022/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.mjs +10 -3
  13. package/esm2022/libs/ui/inputs/src/lib/button/button.component.mjs +22 -3
  14. package/esm2022/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.mjs +6 -3
  15. package/esm2022/libs/util/i18n/src/index.mjs +2 -1
  16. package/esm2022/libs/util/shared/src/lib/utils/fuzzy-filter.mjs +27 -0
  17. package/esm2022/libs/util/shared/src/lib/utils/index.mjs +2 -1
  18. package/esm2022/translations/de.json +4 -0
  19. package/esm2022/translations/en.json +4 -0
  20. package/esm2022/translations/es.json +4 -0
  21. package/esm2022/translations/fr.json +4 -0
  22. package/esm2022/translations/it.json +4 -0
  23. package/esm2022/translations/nl.json +4 -0
  24. package/esm2022/translations/pt.json +4 -0
  25. package/fesm2022/geonetwork-ui.mjs +147 -23
  26. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  27. package/libs/api/repository/src/index.d.ts +1 -0
  28. package/libs/api/repository/src/index.d.ts.map +1 -1
  29. package/libs/feature/catalog/src/lib/organisations/organisations.component.d.ts +0 -1
  30. package/libs/feature/catalog/src/lib/organisations/organisations.component.d.ts.map +1 -1
  31. package/libs/feature/map/src/lib/add-layer-from-wms/add-layer-from-wms.component.d.ts +22 -0
  32. package/libs/feature/map/src/lib/add-layer-from-wms/add-layer-from-wms.component.d.ts.map +1 -0
  33. package/libs/feature/map/src/lib/feature-map.module.d.ts +13 -12
  34. package/libs/feature/map/src/lib/feature-map.module.d.ts.map +1 -1
  35. package/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.d.ts +1 -1
  36. package/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.d.ts.map +1 -1
  37. package/libs/feature/search/src/lib/state/effects.d.ts +1 -1
  38. package/libs/feature/search/src/lib/state/effects.d.ts.map +1 -1
  39. package/libs/feature/search/src/lib/utils/service/fields.d.ts +1 -1
  40. package/libs/feature/search/src/lib/utils/service/fields.d.ts.map +1 -1
  41. package/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.d.ts +1 -0
  42. package/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.d.ts.map +1 -1
  43. package/libs/ui/inputs/src/lib/button/button.component.d.ts +2 -1
  44. package/libs/ui/inputs/src/lib/button/button.component.d.ts.map +1 -1
  45. package/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.d.ts.map +1 -1
  46. package/libs/util/i18n/src/index.d.ts +1 -0
  47. package/libs/util/i18n/src/index.d.ts.map +1 -1
  48. package/libs/util/shared/src/lib/utils/fuzzy-filter.d.ts +9 -0
  49. package/libs/util/shared/src/lib/utils/fuzzy-filter.d.ts.map +1 -0
  50. package/libs/util/shared/src/lib/utils/index.d.ts +1 -0
  51. package/libs/util/shared/src/lib/utils/index.d.ts.map +1 -1
  52. package/package.json +8 -6
  53. package/src/libs/api/repository/src/index.ts +1 -0
  54. package/src/libs/feature/auth/src/lib/feature-auth.module.ts +1 -1
  55. package/src/libs/feature/catalog/src/lib/feature-catalog.module.ts +1 -1
  56. package/src/libs/feature/catalog/src/lib/organisations/organisations.component.ts +3 -17
  57. package/src/libs/feature/map/src/lib/add-layer-from-wms/add-layer-from-wms.component.css +0 -0
  58. package/src/libs/feature/map/src/lib/add-layer-from-wms/add-layer-from-wms.component.html +55 -0
  59. package/src/libs/feature/map/src/lib/add-layer-from-wms/add-layer-from-wms.component.ts +63 -0
  60. package/src/libs/feature/map/src/lib/feature-map.module.ts +2 -0
  61. package/src/libs/feature/map/src/lib/layers-panel/layers-panel.component.html +3 -1
  62. package/src/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.ts +1 -4
  63. package/src/libs/feature/search/src/lib/feature-search.module.ts +1 -1
  64. package/src/libs/feature/search/src/lib/state/effects.ts +1 -1
  65. package/src/libs/feature/search/src/lib/utils/service/fields.ts +1 -1
  66. package/src/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.html +93 -27
  67. package/src/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.ts +7 -0
  68. package/src/libs/ui/inputs/src/lib/button/button.component.ts +26 -3
  69. package/src/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.ts +7 -4
  70. package/src/libs/util/i18n/src/index.ts +1 -0
  71. package/src/libs/util/shared/src/lib/utils/fuzzy-filter.ts +32 -0
  72. package/src/libs/util/shared/src/lib/utils/index.ts +1 -0
  73. package/translations/de.json +4 -0
  74. package/translations/en.json +4 -0
  75. package/translations/es.json +4 -0
  76. package/translations/fr.json +4 -0
  77. package/translations/it.json +4 -0
  78. package/translations/nl.json +4 -0
  79. package/translations/pt.json +4 -0
  80. package/translations/sk.json +4 -0
@@ -1,32 +1,98 @@
1
- <div *ngIf="shownOrganization" class="mb-6 sm:mb-12">
2
- <p class="text-gray-700 text-xs mb-3 uppercase" translate>
3
- record.metadata.contact
4
- </p>
5
- <div class="flex mb-1">
1
+ <div class="py-5 px-5 rounded bg-gray-100 text-black mb-6 sm:mb-12">
2
+ <div class="grid gap-3">
3
+ <div>
4
+ <p class="text-sm font-medium" translate>record.metadata.contact</p>
5
+ </div>
6
6
  <div
7
- class="text-primary font-title text-21 mr-2 cursor-pointer hover:underline"
8
- (click)="onOrganizationClick()"
7
+ *ngIf="shownOrganization?.logoUrl?.href"
8
+ class="flex items-center justify-center border-solid border border-gray-300 rounded-md bg-white h-32 overflow-hidden"
9
9
  >
10
- {{ shownOrganization.name }}
10
+ <gn-ui-thumbnail
11
+ class="relative h-full w-full"
12
+ [thumbnailUrl]="shownOrganization.logoUrl.href"
13
+ fit="contain"
14
+ ></gn-ui-thumbnail>
15
+ </div>
16
+ <div class="grid gap-1">
17
+ <div class="flex">
18
+ <div
19
+ class="text-primary font-title text-21 mr-2 cursor-pointer hover:underline"
20
+ (click)="onOrganizationClick()"
21
+ data-cy="organization-name"
22
+ >
23
+ {{ shownOrganization.name }}
24
+ </div>
25
+ </div>
26
+ <div *ngIf="shownOrganization?.website">
27
+ <a
28
+ [href]="shownOrganization.website"
29
+ target="_blank"
30
+ class="contact-website text-primary text-sm cursor-pointer hover:underline transition-all"
31
+ >{{ shownOrganization.website }}
32
+ <mat-icon
33
+ class="material-symbols-outlined !w-[12px] !h-[12px] !text-[12px] opacity-75 shrink-0"
34
+ >open_in_new</mat-icon
35
+ >
36
+ </a>
37
+ </div>
38
+ </div>
39
+ <div class="grid gap-5 py-3 overflow-hidden">
40
+ <div *ngIf="contacts[0]?.phone">
41
+ <div class="flex">
42
+ <mat-icon
43
+ class="material-symbols-outlined !w-5 !h-5 !text-[20px] opacity-75 shrink-0"
44
+ >call_outline</mat-icon
45
+ >
46
+ <div class="flex flex-col ml-2">
47
+ <p class="text-sm">{{ contacts[0].phone }}</p>
48
+ </div>
49
+ </div>
50
+ </div>
51
+ <div *ngIf="contacts[0]?.email">
52
+ <div class="flex">
53
+ <mat-icon
54
+ class="material-symbols-outlined !w-5 !h-5 !text-[20px] opacity-75 shrink-0"
55
+ >
56
+ mail_outline</mat-icon
57
+ >
58
+ <a
59
+ *ngIf="contacts.length"
60
+ [href]="'mailto:' + contacts[0].email"
61
+ class="text-sm hover:underline ml-2"
62
+ target="_blank"
63
+ data-cy="contact-email"
64
+ >{{ contacts[0].email }}</a
65
+ >
66
+ </div>
67
+ </div>
68
+ <div *ngIf="contacts[0]?.firstName || contacts[0]?.lastName">
69
+ <div class="flex">
70
+ <mat-icon
71
+ class="material-symbols-outlined !w-5 !h-5 !text-[20px] opacity-75 shrink-0"
72
+ >person_outline</mat-icon
73
+ >
74
+ <div class="flex flex-col ml-2">
75
+ <p class="text-sm">
76
+ {{ contacts[0]?.firstName || '' }}
77
+ {{ contacts[0]?.lastName || '' }}
78
+ </p>
79
+ </div>
80
+ </div>
81
+ </div>
82
+ <div *ngIf="contacts[0]?.address">
83
+ <div class="flex">
84
+ <mat-icon
85
+ class="material-symbols-outlined !w-5 !h-5 !text-[20px] opacity-75 shrink-0"
86
+ >
87
+ location_on</mat-icon
88
+ >
89
+ <div class="flex flex-col ml-2">
90
+ <p *ngFor="let addressPart of address" class="text-sm">
91
+ {{ addressPart }}
92
+ </p>
93
+ </div>
94
+ </div>
95
+ </div>
11
96
  </div>
12
- </div>
13
- <a
14
- *ngIf="contacts.length"
15
- [href]="'mailto:' + contacts[0].email"
16
- class="text-gray-700 text-sm hover:underline"
17
- target="_blank"
18
- >{{ contacts[0].email }}</a
19
- >
20
- <div *ngIf="shownOrganization.website" class="mb-2">
21
- <a
22
- [href]="shownOrganization.website"
23
- target="_blank"
24
- class="contact-website text-primary text-sm cursor-pointer hover:underline transition-all"
25
- >{{ shownOrganization.website }}
26
- <mat-icon
27
- class="material-symbols-outlined !w-[12px] !h-[12px] !text-[12px] opacity-75"
28
- >open_in_new</mat-icon
29
- >
30
- </a>
31
97
  </div>
32
98
  </div>
@@ -34,6 +34,13 @@ export class MetadataContactComponent {
34
34
  )
35
35
  }
36
36
 
37
+ get address() {
38
+ const addressParts = this.contacts[0].address
39
+ .split(',')
40
+ .map((part) => part.trim())
41
+ return addressParts
42
+ }
43
+
37
44
  onOrganizationClick() {
38
45
  this.organizationClick.emit(this.shownOrganization)
39
46
  }
@@ -14,14 +14,37 @@ import { propagateToDocumentOnly } from '../../../../../../libs/util/shared/src'
14
14
  changeDetection: ChangeDetectionStrategy.OnPush,
15
15
  })
16
16
  export class ButtonComponent {
17
- @Input() type: 'primary' | 'secondary' | 'default' | 'outline' | 'light' =
18
- 'default'
17
+ private btnClass: string
18
+
19
+ // btn-classes are explicited to allow tailwind recognize them and add it in css.
20
+ @Input() set type(
21
+ value: 'primary' | 'secondary' | 'default' | 'outline' | 'light'
22
+ ) {
23
+ switch (value) {
24
+ case 'primary':
25
+ this.btnClass = 'btn-primary'
26
+ break
27
+ case 'secondary':
28
+ this.btnClass = 'btn-secondary'
29
+ break
30
+ case 'outline':
31
+ this.btnClass = 'btn-outline'
32
+ break
33
+ case 'light':
34
+ this.btnClass = 'btn-light'
35
+ break
36
+ default:
37
+ this.btnClass = 'btn-default'
38
+ break
39
+ }
40
+ }
41
+
19
42
  @Input() disabled = false
20
43
  @Input() extraClass = ''
21
44
  @Output() buttonClick = new EventEmitter<void>()
22
45
 
23
46
  get classList() {
24
- return `btn-${this.type} ${this.extraClass}`
47
+ return `${this.btnClass} ${this.extraClass}`
25
48
  }
26
49
 
27
50
  handleClick(event: Event) {
@@ -17,7 +17,10 @@ import {
17
17
  } from '@angular/cdk/overlay'
18
18
  import { take } from 'rxjs/operators'
19
19
  import { Choice } from './dropdown-multiselect.model'
20
- import { propagateToDocumentOnly } from '../../../../../../libs/util/shared/src'
20
+ import {
21
+ createFuzzyFilter,
22
+ propagateToDocumentOnly,
23
+ } from '../../../../../../libs/util/shared/src'
21
24
 
22
25
  @Component({
23
26
  selector: 'gn-ui-dropdown-multiselect',
@@ -74,9 +77,9 @@ export class DropdownMultiselectComponent {
74
77
  }
75
78
 
76
79
  get filteredChoicesByText() {
77
- return this.choices.filter((choice) =>
78
- choice.label.toLowerCase().includes(this.searchInputValue?.toLowerCase())
79
- )
80
+ if (!this.searchInputValue) return this.choices
81
+ const filter = createFuzzyFilter(this.searchInputValue)
82
+ return this.choices.filter((choice) => filter(choice.label))
80
83
  }
81
84
 
82
85
  get focusedIndex(): number | -1 {
@@ -5,3 +5,4 @@ export * from './lib/lang.service'
5
5
  export * from './lib/file.translate.loader'
6
6
  export * from './lib/testing/test.translate.module'
7
7
  export * from './lib/embedded.translate.loader'
8
+ export * from './lib/translate.loader.utils'
@@ -0,0 +1,32 @@
1
+ type FuzzyFilter = (input: string) => boolean
2
+
3
+ function normalize(input: string) {
4
+ return input
5
+ .toLowerCase()
6
+ .normalize('NFD') // explode composite chars (e.g. é) into multiple chars
7
+ .replace(/[\u0300-\u036f]/g, '') // remove accents
8
+ .replace(/œ/g, 'oe') // remove accents
9
+ .replace(/[^a-z0-9\s]/g, ' ') // replace special characters with space
10
+ }
11
+
12
+ function asNormalizedParts(input: string): string[] {
13
+ return normalize(input)
14
+ .split(/\s+/)
15
+ .map((part) => part.trim())
16
+ .filter((part) => part.length > 0)
17
+ }
18
+
19
+ /**
20
+ * This creates a filter function based on a pattern (typically a user-input
21
+ * search text).
22
+ * @param pattern
23
+ */
24
+ export function createFuzzyFilter(pattern: string): FuzzyFilter {
25
+ const patternParts = asNormalizedParts(pattern)
26
+ return (input: string) => {
27
+ const inputParts = asNormalizedParts(input)
28
+ return patternParts.every((patternPart) =>
29
+ inputParts.some((part) => part.includes(patternPart))
30
+ )
31
+ }
32
+ }
@@ -5,3 +5,4 @@ export * from './geojson'
5
5
  export * from './sort-by'
6
6
  export * from './url'
7
7
  export * from './event'
8
+ export * from './fuzzy-filter'
@@ -175,10 +175,14 @@
175
175
  "map.add.layer.file": "Aus einer Datei",
176
176
  "map.add.layer.wfs": "Aus WFS",
177
177
  "map.add.layer.wms": "Aus WMS",
178
+ "map.layer.add": "",
179
+ "map.layers.available": "",
178
180
  "map.layers.list": "Ebenen",
179
181
  "map.loading.data": "Kartendaten werden geladen...",
182
+ "map.loading.service": "",
180
183
  "map.navigation.message": "Bitte verwenden Sie STRG + Maus (oder zwei Finger auf einem Mobilgerät), um die Karte zu navigieren",
181
184
  "map.select.layer": "Datenquelle",
185
+ "map.wms.urlInput.hint": "",
182
186
  "multiselect.filter.placeholder": "Suche",
183
187
  "nav.back": "Zurück",
184
188
  "next": "weiter",
@@ -175,10 +175,14 @@
175
175
  "map.add.layer.file": "From a file",
176
176
  "map.add.layer.wfs": "From WFS",
177
177
  "map.add.layer.wms": "From WMS",
178
+ "map.layer.add": "Add",
179
+ "map.layers.available": "Available Layers",
178
180
  "map.layers.list": "Layers",
179
181
  "map.loading.data": "Loading map data...",
182
+ "map.loading.service": "Loading service...",
180
183
  "map.navigation.message": "Please use CTRL + mouse (or two fingers on mobile) to navigate the map",
181
184
  "map.select.layer": "Data source",
185
+ "map.wms.urlInput.hint": "Enter WMS service URL",
182
186
  "multiselect.filter.placeholder": "Search",
183
187
  "nav.back": "Back",
184
188
  "next": "next",
@@ -175,10 +175,14 @@
175
175
  "map.add.layer.file": "",
176
176
  "map.add.layer.wfs": "",
177
177
  "map.add.layer.wms": "",
178
+ "map.layer.add": "",
179
+ "map.layers.available": "",
178
180
  "map.layers.list": "",
179
181
  "map.loading.data": "",
182
+ "map.loading.service": "",
180
183
  "map.navigation.message": "",
181
184
  "map.select.layer": "",
185
+ "map.wms.urlInput.hint": "",
182
186
  "multiselect.filter.placeholder": "",
183
187
  "nav.back": "",
184
188
  "next": "",
@@ -175,10 +175,14 @@
175
175
  "map.add.layer.file": "",
176
176
  "map.add.layer.wfs": "",
177
177
  "map.add.layer.wms": "",
178
+ "map.layer.add": "",
179
+ "map.layers.available": "",
178
180
  "map.layers.list": "",
179
181
  "map.loading.data": "Chargement des données...",
182
+ "map.loading.service": "",
180
183
  "map.navigation.message": "Veuillez utiliser CTRL + souris (ou deux doigts sur mobile) pour naviguer sur la carte",
181
184
  "map.select.layer": "Source de données",
185
+ "map.wms.urlInput.hint": "",
182
186
  "multiselect.filter.placeholder": "Rechercher",
183
187
  "nav.back": "Retour",
184
188
  "next": "suivant",
@@ -175,10 +175,14 @@
175
175
  "map.add.layer.file": "Da un file",
176
176
  "map.add.layer.wfs": "Da un WFS",
177
177
  "map.add.layer.wms": "Da un WMS",
178
+ "map.layer.add": "",
179
+ "map.layers.available": "",
178
180
  "map.layers.list": "Layers",
179
181
  "map.loading.data": "Caricamento dati...",
182
+ "map.loading.service": "",
180
183
  "map.navigation.message": "Si prega di utilizzare CTRL + mouse (o due dita su mobile) per navigare sulla mappa",
181
184
  "map.select.layer": "Sorgente dati",
185
+ "map.wms.urlInput.hint": "",
182
186
  "multiselect.filter.placeholder": "Cerca",
183
187
  "nav.back": "Indietro",
184
188
  "next": "successivo",
@@ -175,10 +175,14 @@
175
175
  "map.add.layer.file": "",
176
176
  "map.add.layer.wfs": "",
177
177
  "map.add.layer.wms": "",
178
+ "map.layer.add": "",
179
+ "map.layers.available": "",
178
180
  "map.layers.list": "",
179
181
  "map.loading.data": "",
182
+ "map.loading.service": "",
180
183
  "map.navigation.message": "",
181
184
  "map.select.layer": "",
185
+ "map.wms.urlInput.hint": "",
182
186
  "multiselect.filter.placeholder": "",
183
187
  "nav.back": "",
184
188
  "next": "",
@@ -175,10 +175,14 @@
175
175
  "map.add.layer.file": "",
176
176
  "map.add.layer.wfs": "",
177
177
  "map.add.layer.wms": "",
178
+ "map.layer.add": "",
179
+ "map.layers.available": "",
178
180
  "map.layers.list": "",
179
181
  "map.loading.data": "",
182
+ "map.loading.service": "",
180
183
  "map.navigation.message": "",
181
184
  "map.select.layer": "",
185
+ "map.wms.urlInput.hint": "",
182
186
  "multiselect.filter.placeholder": "",
183
187
  "nav.back": "",
184
188
  "next": "",
@@ -175,10 +175,14 @@
175
175
  "map.add.layer.file": "Zo súboru",
176
176
  "map.add.layer.wfs": "Z WFS",
177
177
  "map.add.layer.wms": "Z WMS",
178
+ "map.layer.add": "",
179
+ "map.layers.available": "",
178
180
  "map.layers.list": "Vrstvy",
179
181
  "map.loading.data": "Načítavanie dát mapy...",
182
+ "map.loading.service": "",
180
183
  "map.navigation.message": "Použite prosím CTRL + myš (alebo dva prsty na mobilnom zariadení) na navigáciu po mape",
181
184
  "map.select.layer": "Zdroj dát",
185
+ "map.wms.urlInput.hint": "",
182
186
  "multiselect.filter.placeholder": "Hľadať",
183
187
  "nav.back": "Späť",
184
188
  "next": "Ďalej",