geonetwork-ui 2.6.0-dev.502fa026d → 2.6.0-dev.ed41ee824
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.
- package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
- package/esm2022/libs/ui/elements/src/lib/api-card/api-card.component.mjs +27 -6
- package/esm2022/libs/ui/elements/src/lib/download-item/download-item.component.mjs +22 -6
- package/esm2022/libs/ui/elements/src/lib/downloads-list/downloads-list.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/link-card/link-card.component.mjs +29 -7
- package/esm2022/libs/ui/layout/src/lib/carousel/carousel.component.mjs +3 -3
- package/esm2022/libs/util/shared/src/lib/links/link-utils.mjs +21 -19
- package/esm2022/translations/en.json +1 -1
- package/fesm2022/geonetwork-ui.mjs +98 -40
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +1 -0
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/api-card/api-card.component.d.ts +9 -1
- package/libs/ui/elements/src/lib/api-card/api-card.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/download-item/download-item.component.d.ts +8 -1
- package/libs/ui/elements/src/lib/download-item/download-item.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/link-card/link-card.component.d.ts +10 -2
- package/libs/ui/elements/src/lib/link-card/link-card.component.d.ts.map +1 -1
- package/libs/util/shared/src/lib/links/link-utils.d.ts +16 -16
- package/libs/util/shared/src/lib/links/link-utils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +1 -0
- package/src/libs/ui/elements/src/lib/api-card/api-card.component.html +64 -38
- package/src/libs/ui/elements/src/lib/api-card/api-card.component.ts +26 -2
- package/src/libs/ui/elements/src/lib/download-item/download-item.component.html +17 -17
- package/src/libs/ui/elements/src/lib/download-item/download-item.component.ts +20 -2
- package/src/libs/ui/elements/src/lib/downloads-list/downloads-list.component.html +1 -0
- package/src/libs/ui/elements/src/lib/link-card/link-card.component.html +27 -29
- package/src/libs/ui/elements/src/lib/link-card/link-card.component.ts +33 -3
- package/src/libs/ui/layout/src/lib/carousel/carousel.component.css +0 -4
- package/src/libs/util/shared/src/lib/links/link-utils.ts +20 -18
- package/tailwind.base.css +29 -1
- package/translations/en.json +1 -1
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
DatasetDownloadDistribution,
|
|
4
|
+
DatasetOnlineResource,
|
|
5
|
+
DatasetServiceDistribution,
|
|
6
|
+
} from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
3
7
|
import { CommonModule } from '@angular/common'
|
|
4
8
|
import {
|
|
5
9
|
NgIconComponent,
|
|
@@ -7,14 +11,17 @@ import {
|
|
|
7
11
|
provideNgIconsConfig,
|
|
8
12
|
} from '@ng-icons/core'
|
|
9
13
|
import { matOpenInNew } from '@ng-icons/material-icons/baseline'
|
|
14
|
+
import { getBadgeColor, getFileFormat } from '../../../../../../libs/util/shared/src'
|
|
15
|
+
import { TranslateModule } from '@ngx-translate/core'
|
|
10
16
|
|
|
17
|
+
type CardSize = 'L' | 'M' | 'S' | 'XS'
|
|
11
18
|
@Component({
|
|
12
19
|
selector: 'gn-ui-link-card',
|
|
13
20
|
templateUrl: './link-card.component.html',
|
|
14
21
|
styleUrls: ['./link-card.component.css'],
|
|
15
22
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
16
23
|
standalone: true,
|
|
17
|
-
imports: [CommonModule, NgIconComponent],
|
|
24
|
+
imports: [CommonModule, NgIconComponent, TranslateModule],
|
|
18
25
|
providers: [
|
|
19
26
|
provideIcons({
|
|
20
27
|
matOpenInNew,
|
|
@@ -23,8 +30,23 @@ import { matOpenInNew } from '@ng-icons/material-icons/baseline'
|
|
|
23
30
|
],
|
|
24
31
|
})
|
|
25
32
|
export class LinkCardComponent {
|
|
33
|
+
private _size: 'L' | 'M' | 'S' | 'XS'
|
|
26
34
|
@Input() link: DatasetOnlineResource
|
|
27
|
-
|
|
35
|
+
private readonly sizeClassMap: Record<CardSize, string> = {
|
|
36
|
+
L: 'gn-ui-card-l py-2 px-5',
|
|
37
|
+
M: 'gn-ui-card-m py-2 px-5',
|
|
38
|
+
S: 'gn-ui-card-s p-4',
|
|
39
|
+
XS: 'gn-ui-card-xs py-2 px-5',
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@Input() set size(value: CardSize) {
|
|
43
|
+
this._size = value
|
|
44
|
+
this.cardClass = this.sizeClassMap[value]
|
|
45
|
+
}
|
|
46
|
+
get size(): 'L' | 'M' | 'S' | 'XS' {
|
|
47
|
+
return this._size
|
|
48
|
+
}
|
|
49
|
+
cardClass = ''
|
|
28
50
|
|
|
29
51
|
get title() {
|
|
30
52
|
if (this.link.name && this.link.description) {
|
|
@@ -32,4 +54,12 @@ export class LinkCardComponent {
|
|
|
32
54
|
}
|
|
33
55
|
return this.link.name || this.link.description || ''
|
|
34
56
|
}
|
|
57
|
+
|
|
58
|
+
getLinkFormat(link: any) {
|
|
59
|
+
return getFileFormat(link)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
getLinkColor(link: any) {
|
|
63
|
+
return getBadgeColor(getFileFormat(link))
|
|
64
|
+
}
|
|
35
65
|
}
|
|
@@ -16,7 +16,7 @@ export const FORMATS = {
|
|
|
16
16
|
csv: {
|
|
17
17
|
extensions: ['csv'],
|
|
18
18
|
priority: 1,
|
|
19
|
-
color: '#
|
|
19
|
+
color: '#F6A924',
|
|
20
20
|
mimeTypes: ['text/csv', 'application/csv'],
|
|
21
21
|
},
|
|
22
22
|
excel: {
|
|
@@ -28,7 +28,7 @@ export const FORMATS = {
|
|
|
28
28
|
'openxmlformats-officedocument',
|
|
29
29
|
],
|
|
30
30
|
priority: 2,
|
|
31
|
-
color: '#
|
|
31
|
+
color: '#FFDE10',
|
|
32
32
|
mimeTypes: [
|
|
33
33
|
'application/vnd.ms-excel',
|
|
34
34
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
@@ -37,31 +37,31 @@ export const FORMATS = {
|
|
|
37
37
|
geojson: {
|
|
38
38
|
extensions: ['geojson'],
|
|
39
39
|
priority: 3,
|
|
40
|
-
color: '#
|
|
40
|
+
color: '#293C6F',
|
|
41
41
|
mimeTypes: ['application/geo+json', 'application/vnd.geo+json'],
|
|
42
42
|
},
|
|
43
43
|
json: {
|
|
44
44
|
extensions: ['json'],
|
|
45
45
|
priority: 3,
|
|
46
|
-
color: '#
|
|
46
|
+
color: '#84D0F0',
|
|
47
47
|
mimeTypes: ['application/json'],
|
|
48
48
|
},
|
|
49
49
|
shp: {
|
|
50
50
|
extensions: ['shp', 'shape', 'zipped-shapefile'],
|
|
51
51
|
priority: 4,
|
|
52
|
-
color: '#
|
|
52
|
+
color: '#009036',
|
|
53
53
|
mimeTypes: ['x-gis/x-shapefile'],
|
|
54
54
|
},
|
|
55
55
|
gml: {
|
|
56
56
|
extensions: ['gml'],
|
|
57
57
|
priority: 5,
|
|
58
|
-
color: '#
|
|
58
|
+
color: '#E75113',
|
|
59
59
|
mimeTypes: ['application/gml+xml', 'text/xml; subtype=gml'],
|
|
60
60
|
},
|
|
61
61
|
kml: {
|
|
62
62
|
extensions: ['kml', 'kmz'],
|
|
63
63
|
priority: 6,
|
|
64
|
-
color: '#
|
|
64
|
+
color: '#F4B5D0',
|
|
65
65
|
mimeTypes: [
|
|
66
66
|
'application/vnd.google-earth.kml+xml',
|
|
67
67
|
'application/vnd.google-earth.kmz',
|
|
@@ -70,55 +70,55 @@ export const FORMATS = {
|
|
|
70
70
|
gpkg: {
|
|
71
71
|
extensions: ['gpkg', 'geopackage'],
|
|
72
72
|
priority: 7,
|
|
73
|
-
color: '#
|
|
73
|
+
color: '#7D5D9F',
|
|
74
74
|
mimeTypes: ['application/geopackage+sqlite3'],
|
|
75
75
|
},
|
|
76
76
|
zip: {
|
|
77
77
|
extensions: ['zip', 'tar.gz'],
|
|
78
78
|
priority: 8,
|
|
79
|
-
color: '#
|
|
79
|
+
color: '#B0CB52',
|
|
80
80
|
mimeTypes: ['application/zip', 'application/x-zip'],
|
|
81
81
|
},
|
|
82
82
|
pdf: {
|
|
83
83
|
extensions: ['pdf'],
|
|
84
84
|
priority: 9,
|
|
85
|
-
color: '#
|
|
85
|
+
color: '#49579E',
|
|
86
86
|
mimeTypes: ['application/pdf'],
|
|
87
87
|
},
|
|
88
88
|
jpg: {
|
|
89
89
|
extensions: ['jpg', 'jpeg', 'jfif', 'pjpeg', 'pjp'],
|
|
90
90
|
priority: 9,
|
|
91
|
-
color: '#
|
|
91
|
+
color: '#C4A98F',
|
|
92
92
|
mimeTypes: ['image/jpg'],
|
|
93
93
|
},
|
|
94
94
|
svg: {
|
|
95
95
|
extensions: ['svg'],
|
|
96
96
|
priority: 10,
|
|
97
|
-
color: '#
|
|
97
|
+
color: '#EB6D82',
|
|
98
98
|
mimeTypes: ['image/svg+xml'],
|
|
99
99
|
},
|
|
100
100
|
dxf: {
|
|
101
101
|
extensions: ['dxf'],
|
|
102
102
|
priority: 11,
|
|
103
|
-
color: '#
|
|
103
|
+
color: '#DCCD00',
|
|
104
104
|
mimeTypes: ['application/x-dxf', 'image/x-dxf'],
|
|
105
105
|
},
|
|
106
106
|
html: {
|
|
107
107
|
extensions: ['html', 'htm'],
|
|
108
108
|
priority: 12,
|
|
109
|
-
color: '#
|
|
109
|
+
color: '#C0C9B6',
|
|
110
110
|
mimeTypes: ['text/html'],
|
|
111
111
|
},
|
|
112
112
|
fgb: {
|
|
113
113
|
extensions: ['fgb', 'flatgeobuf'],
|
|
114
114
|
priority: 13,
|
|
115
|
-
color: '#
|
|
115
|
+
color: '#A8111C',
|
|
116
116
|
mimeTypes: ['application/flatgeobuf'],
|
|
117
117
|
},
|
|
118
118
|
jsonfg: {
|
|
119
119
|
extensions: ['jsonfg', 'jsonfgc'],
|
|
120
120
|
priority: 14,
|
|
121
|
-
color: '#
|
|
121
|
+
color: '#009EE0',
|
|
122
122
|
mimeTypes: [
|
|
123
123
|
'application/vnd.ogc.fg+json',
|
|
124
124
|
'application/vnd.ogc.fg+json;compatibility=geojson',
|
|
@@ -207,9 +207,11 @@ export function checkFileFormat(
|
|
|
207
207
|
format: FileFormat
|
|
208
208
|
): boolean {
|
|
209
209
|
return (
|
|
210
|
-
('name' in link &&
|
|
210
|
+
('name' in link &&
|
|
211
|
+
new RegExp(`[./]${format}`, 'i').test(link.name.toLowerCase())) ||
|
|
211
212
|
('url' in link &&
|
|
212
|
-
new RegExp(`[./]${format}`, 'i').test(link.url.toString()))
|
|
213
|
+
new RegExp(`[./]${format}`, 'i').test(link.url.toString())) ||
|
|
214
|
+
('name' in link && link.name.toLowerCase().includes(format))
|
|
213
215
|
)
|
|
214
216
|
}
|
|
215
217
|
|
package/tailwind.base.css
CHANGED
|
@@ -129,6 +129,34 @@
|
|
|
129
129
|
border border-white focus:ring-4 focus:ring-gray-300;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
+
.gn-ui-card-xs {
|
|
133
|
+
@apply min-h-[68px] md:w-[487px];
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.gn-ui-card-s {
|
|
137
|
+
@apply min-h-[135px] md:w-80;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.gn-ui-card-m {
|
|
141
|
+
@apply min-h-[68px] md:w-[487px];
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.gn-ui-card-l {
|
|
145
|
+
@apply min-h-[68px] md:w-[992px];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.gn-ui-card-title {
|
|
149
|
+
@apply font-title font-medium text-black text-ellipsis overflow-hidden break-words line-clamp-3;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.gn-ui-card-icon {
|
|
153
|
+
@apply flex border border-gray-300 rounded-lg py-1 px-2 align-middle;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.gn-ui-card-detail {
|
|
157
|
+
@apply font-medium text-gray-500 text-ellipsis break-words text-sm;
|
|
158
|
+
}
|
|
159
|
+
|
|
132
160
|
/* DROPDOWN MULTISELECT CLASS */
|
|
133
161
|
.gn-ui-multiselect-counter {
|
|
134
162
|
--text-color: var(--gn-ui-multiselect-counter-text-color, white);
|
|
@@ -186,7 +214,7 @@
|
|
|
186
214
|
|
|
187
215
|
/* TODO: add prefix */
|
|
188
216
|
.card-icon {
|
|
189
|
-
@apply text-
|
|
217
|
+
@apply text-black group-hover:text-primary-darkest transition-colors;
|
|
190
218
|
}
|
|
191
219
|
|
|
192
220
|
/* makes spinners appear in the right color */
|
package/translations/en.json
CHANGED
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"datahub.search.back": "Back",
|
|
67
67
|
"datahub.search.filter.all": "All",
|
|
68
68
|
"datahub.search.filter.generatedByAPI": "Generated by an API",
|
|
69
|
-
"datahub.search.filter.generatedByWfs": "",
|
|
69
|
+
"datahub.search.filter.generatedByWfs": "Generated by a WFS",
|
|
70
70
|
"datahub.search.filter.others": "Others",
|
|
71
71
|
"dataset.error.forbidden": "Access to this resource is restricted",
|
|
72
72
|
"dataset.error.http": "The data could not be loaded because of an HTTP error: \"{ info }\"",
|