geonetwork-ui 2.6.0-dev.26001d617 → 2.6.0-dev.34911f182

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 (56) hide show
  1. package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +2 -1
  2. package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
  3. package/esm2022/libs/feature/dataviz/src/lib/chart-view/chart-view.component.mjs +45 -9
  4. package/esm2022/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.mjs +2 -2
  5. package/esm2022/libs/feature/dataviz/src/lib/table-view/table-view.component.mjs +25 -6
  6. package/esm2022/libs/feature/record/src/lib/data-view/data-view.component.mjs +3 -3
  7. package/esm2022/libs/feature/record/src/lib/map-view/map-view.component.mjs +3 -3
  8. package/esm2022/libs/ui/dataviz/src/lib/chart/chart.component.mjs +5 -3
  9. package/esm2022/libs/ui/dataviz/src/lib/data-table/data-table.component.mjs +11 -6
  10. package/esm2022/libs/ui/layout/src/index.mjs +2 -1
  11. package/esm2022/libs/ui/layout/src/lib/truncated-text/truncated-text.component.mjs +56 -0
  12. package/esm2022/libs/ui/map/src/lib/components/feature-detail/feature-detail.component.mjs +29 -4
  13. package/esm2022/libs/ui/map/src/lib/components/spatial-extent/spatial-extent.component.mjs +2 -1
  14. package/esm2022/translations/en.json +2 -0
  15. package/esm2022/translations/fr.json +2 -0
  16. package/fesm2022/geonetwork-ui.mjs +168 -30
  17. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  18. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts.map +1 -1
  19. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +2 -0
  20. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
  21. package/libs/feature/dataviz/src/lib/chart-view/chart-view.component.d.ts +12 -8
  22. package/libs/feature/dataviz/src/lib/chart-view/chart-view.component.d.ts.map +1 -1
  23. package/libs/feature/dataviz/src/lib/table-view/table-view.component.d.ts +5 -2
  24. package/libs/feature/dataviz/src/lib/table-view/table-view.component.d.ts.map +1 -1
  25. package/libs/ui/dataviz/src/lib/chart/chart.component.d.ts +2 -1
  26. package/libs/ui/dataviz/src/lib/chart/chart.component.d.ts.map +1 -1
  27. package/libs/ui/dataviz/src/lib/data-table/data-table.component.d.ts +6 -1
  28. package/libs/ui/dataviz/src/lib/data-table/data-table.component.d.ts.map +1 -1
  29. package/libs/ui/layout/src/index.d.ts +1 -0
  30. package/libs/ui/layout/src/index.d.ts.map +1 -1
  31. package/libs/ui/layout/src/lib/truncated-text/truncated-text.component.d.ts +18 -0
  32. package/libs/ui/layout/src/lib/truncated-text/truncated-text.component.d.ts.map +1 -0
  33. package/libs/ui/map/src/lib/components/feature-detail/feature-detail.component.d.ts +6 -2
  34. package/libs/ui/map/src/lib/components/feature-detail/feature-detail.component.d.ts.map +1 -1
  35. package/libs/ui/map/src/lib/components/spatial-extent/spatial-extent.component.d.ts.map +1 -1
  36. package/package.json +1 -1
  37. package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +1 -0
  38. package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +2 -2
  39. package/src/libs/feature/dataviz/src/lib/chart-view/chart-view.component.html +12 -9
  40. package/src/libs/feature/dataviz/src/lib/chart-view/chart-view.component.ts +54 -10
  41. package/src/libs/feature/dataviz/src/lib/table-view/table-view.component.html +1 -0
  42. package/src/libs/feature/dataviz/src/lib/table-view/table-view.component.ts +27 -1
  43. package/src/libs/feature/record/src/lib/data-view/data-view.component.html +2 -0
  44. package/src/libs/feature/record/src/lib/map-view/map-view.component.html +4 -1
  45. package/src/libs/ui/dataviz/src/lib/chart/chart.component.ts +2 -1
  46. package/src/libs/ui/dataviz/src/lib/data-table/data-table.component.html +6 -3
  47. package/src/libs/ui/dataviz/src/lib/data-table/data-table.component.ts +5 -4
  48. package/src/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.ts +0 -0
  49. package/src/libs/ui/layout/src/index.ts +1 -0
  50. package/src/libs/ui/layout/src/lib/truncated-text/truncated-text.component.html +46 -0
  51. package/src/libs/ui/layout/src/lib/truncated-text/truncated-text.component.ts +62 -0
  52. package/src/libs/ui/map/src/lib/components/feature-detail/feature-detail.component.html +3 -3
  53. package/src/libs/ui/map/src/lib/components/feature-detail/feature-detail.component.ts +27 -3
  54. package/src/libs/ui/map/src/lib/components/spatial-extent/spatial-extent.component.ts +1 -0
  55. package/translations/en.json +2 -0
  56. package/translations/fr.json +2 -0
@@ -61,13 +61,14 @@ export interface TableItemModel {
61
61
  changeDetection: ChangeDetectionStrategy.OnPush,
62
62
  })
63
63
  export class DataTableComponent implements OnInit, AfterViewInit, OnChanges {
64
+ _featureAttributes = []
65
+ @Input() set featureAttributes(value: { value: string; label: string }[]) {
66
+ this._featureAttributes = value
67
+ this.properties$.next(value.map((attr) => attr.value))
68
+ }
64
69
  @Input() set dataset(value: BaseReader) {
65
- this.properties$.next(null)
66
70
  this.dataset_ = value
67
71
  this.dataset_.load()
68
- this.dataset_.properties.then((properties) =>
69
- this.properties$.next(properties.map((p) => p.name))
70
- )
71
72
  this.dataset_.info.then((info) => (this.count = info.itemsCount))
72
73
  }
73
74
  @Input() activeId: TableItemId
@@ -16,3 +16,4 @@ export * from './lib/pagination-dots/pagination-dots.component'
16
16
  export * from './lib/previous-next-buttons/previous-next-buttons.component'
17
17
  export * from './lib/paginable.interface'
18
18
  export * from './lib/ui-layout.module'
19
+ export * from './lib/truncated-text/truncated-text.component'
@@ -0,0 +1,46 @@
1
+ <div
2
+ class="flex items-center justify-between w-full gap-2"
3
+ cdkOverlayOrigin
4
+ #trigger="cdkOverlayOrigin"
5
+ >
6
+ <span #textElement class="truncate">
7
+ {{ text }}
8
+ </span>
9
+ <gn-ui-button
10
+ *ngIf="isTextTruncated"
11
+ type="outline"
12
+ extraClass="w-10 h-8 border rounded-lg"
13
+ (buttonClick)="toggleOverlay()"
14
+ >
15
+ <ng-icon name="iconoirExpand" size="24"> </ng-icon>
16
+ </gn-ui-button>
17
+
18
+ <ng-template
19
+ cdkConnectedOverlay
20
+ [cdkConnectedOverlayOrigin]="trigger"
21
+ [cdkConnectedOverlayOpen]="isOpen"
22
+ [cdkConnectedOverlayPositions]="[
23
+ {
24
+ originX: 'end',
25
+ originY: 'top',
26
+ overlayX: 'end',
27
+ overlayY: 'top',
28
+ },
29
+ ]"
30
+ (detach)="isOpen = false"
31
+ >
32
+ <div class="bg-white shadow-lg border border-gray-300 flex">
33
+ <div class="w-64">
34
+ <p class="m-2">{{ text }}</p>
35
+ </div>
36
+ <gn-ui-button
37
+ class="m-2 flex-shrink-0"
38
+ type="light"
39
+ (buttonClick)="close()"
40
+ extraClass="w-10 h-8 px-1 bg-white"
41
+ >
42
+ <ng-icon name="iconoirReduce" size="24"> </ng-icon>
43
+ </gn-ui-button>
44
+ </div>
45
+ </ng-template>
46
+ </div>
@@ -0,0 +1,62 @@
1
+ import {
2
+ AfterViewInit,
3
+ ChangeDetectorRef,
4
+ Component,
5
+ ElementRef,
6
+ Input,
7
+ ViewChild,
8
+ } from '@angular/core'
9
+ import { CommonModule } from '@angular/common'
10
+ import { provideIcons } from '@ng-icons/core'
11
+ import { iconoirExpand, iconoirReduce } from '@ng-icons/iconoir'
12
+ import { TranslateModule } from '@ngx-translate/core'
13
+ import { MatButtonModule } from '@angular/material/button'
14
+ import { OverlayModule } from '@angular/cdk/overlay'
15
+ import { ButtonComponent } from '../../../../../../libs/ui/inputs/src'
16
+ import { NgIconComponent } from '@ng-icons/core'
17
+
18
+ @Component({
19
+ selector: 'gn-ui-truncated-text',
20
+ standalone: true,
21
+ imports: [
22
+ CommonModule,
23
+ TranslateModule,
24
+ MatButtonModule,
25
+ OverlayModule,
26
+ ButtonComponent,
27
+ NgIconComponent,
28
+ ],
29
+ providers: [provideIcons({ iconoirExpand, iconoirReduce })],
30
+ templateUrl: './truncated-text.component.html',
31
+ styles: [],
32
+ })
33
+ export class TruncatedTextComponent implements AfterViewInit {
34
+ @Input() text = ''
35
+ @ViewChild('textElement') textElement: ElementRef<HTMLElement>
36
+ isTextTruncated = false
37
+ isOpen = false
38
+
39
+ constructor(private cd: ChangeDetectorRef) {}
40
+
41
+ ngAfterViewInit() {
42
+ this.checkTextTruncation()
43
+ }
44
+
45
+ ngOnChange() {
46
+ this.checkTextTruncation()
47
+ }
48
+
49
+ toggleOverlay() {
50
+ this.isOpen = !this.isOpen
51
+ }
52
+
53
+ close() {
54
+ this.isOpen = false
55
+ }
56
+
57
+ private checkTextTruncation() {
58
+ const element = this.textElement.nativeElement
59
+ this.isTextTruncated = element.scrollWidth > element.clientWidth
60
+ this.cd.detectChanges()
61
+ }
62
+ }
@@ -1,6 +1,6 @@
1
1
  <div *ngIf="feature" class="root">
2
- <div class="property" *ngFor="let propName of properties">
3
- <div>{{ propName }}</div>
4
- <div class="font-bold">{{ feature.properties[propName] }}</div>
2
+ <div class="property" *ngFor="let prop of properties | keyvalue">
3
+ <div>{{ prop.key }}</div>
4
+ <div class="font-bold">{{ prop.value }}</div>
5
5
  </div>
6
6
  </div>
@@ -1,6 +1,7 @@
1
1
  import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
2
2
  import { CommonModule } from '@angular/common'
3
3
  import type { Feature } from 'geojson'
4
+ import { DatasetFeatureCatalog } from '../../../../../../../libs/common/domain/src/lib/model/record'
4
5
 
5
6
  const geometryKeys = ['geometry', 'the_geom']
6
7
 
@@ -14,11 +15,34 @@ const geometryKeys = ['geometry', 'the_geom']
14
15
  })
15
16
  export class FeatureDetailComponent {
16
17
  @Input() feature: Feature
18
+ _featureAttributes = []
19
+ @Input() set featureCatalog(value: DatasetFeatureCatalog) {
20
+ if (value) this._featureAttributes = value.featureTypes[0].attributes
21
+ }
17
22
 
18
23
  get properties() {
19
24
  if (!this.feature) return []
20
- return Object.keys(this.feature.properties).filter(
21
- (prop) => !geometryKeys.includes(prop)
22
- )
25
+ return this.setProperties()
26
+ }
27
+
28
+ setProperties() {
29
+ const properties = Object.keys(this.feature.properties)
30
+ .filter((p) => !geometryKeys.includes(p))
31
+ .reduce((acc, p) => {
32
+ let key = p
33
+ if (this._featureAttributes.length) {
34
+ const matchingAttribute = this._featureAttributes.find(
35
+ (attr) => attr.name === p
36
+ )
37
+
38
+ if (matchingAttribute && matchingAttribute.code) {
39
+ key = matchingAttribute.code
40
+ }
41
+ }
42
+ acc[key] = this.feature.properties[p]
43
+ return acc
44
+ }, {})
45
+
46
+ return properties
23
47
  }
24
48
  }
@@ -57,6 +57,7 @@ export class SpatialExtentComponent {
57
57
  style: {
58
58
  'stroke-color': 'black',
59
59
  'stroke-width': 2,
60
+ 'fill-color': 'rgba(153, 153, 153, 0.3)',
60
61
  },
61
62
  }
62
63
  const view = await createViewFromLayer(layer)
@@ -569,6 +569,8 @@
569
569
  "tooltip.url.open": "Open URL",
570
570
  "ui.readLess": "Read less",
571
571
  "ui.readMore": "Read more",
572
+ "ui.hideFullText": "Hide complete text",
573
+ "ui.showAllText": "Show all text",
572
574
  "wfs.feature.limit": "Too many features to display the WFS layer!",
573
575
  "wfs.featuretype.notfound": "No matching feature type was found in the service",
574
576
  "wfs.geojsongml.notsupported": "This service does not support the GeoJSON or GML format",
@@ -569,6 +569,8 @@
569
569
  "tooltip.url.open": "Ouvrir l'URL",
570
570
  "ui.readLess": "Réduire",
571
571
  "ui.readMore": "Lire la suite",
572
+ "ui.hideFullText": "Masquer le texte complet",
573
+ "ui.showAllText": "Tout afficher",
572
574
  "wfs.feature.limit": "Trop d'objets pour afficher la couche WFS !",
573
575
  "wfs.featuretype.notfound": "La classe d'objets n'a pas été trouvée dans le service",
574
576
  "wfs.geojsongml.notsupported": "Le service ne supporte pas le format GeoJSON ou GML",