Skip to content

Commit 28b82a6

Browse files
committed
Added Table and chart view component to record view
1 parent ce85785 commit 28b82a6

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

apps/geoadmin-demo/src/index.html

+2
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@
103103
recordView.setAttribute('primary-color', '#0f4395')
104104
recordView.setAttribute('secondary-color', '#8bc832')
105105
recordView.setAttribute('record-id', uuid)
106+
recordView.style.height = '100%'
107+
106108

107109
container.appendChild(closeButton)
108110
container.appendChild(recordView)

apps/webcomponents/src/app/components/gn-record-view/gn-record-view.component.html

+31
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,37 @@
2222
[metadata]="record"
2323
></gn-ui-metadata-contact>
2424
</div>
25+
<div class="w-full h-full flex flex-col">
26+
<div class="font-title text-lg mt-4 mb-2">
27+
<span translate>record.metadata.preview</span>
28+
</div>
29+
<mat-tab-group>
30+
<mat-tab label="Table View">
31+
<div class="relative h-full" style="height: 500px;">
32+
<wc-gn-dataset-view-table
33+
class="overflow-auto grow h-full"
34+
[apiUrl]="apiUrl"
35+
[searchId]="searchId"
36+
[datasetId]="record.uniqueIdentifier"
37+
></wc-gn-dataset-view-table>
38+
</div>
39+
</mat-tab>
40+
<mat-tab label="Chart View">
41+
<div class="relative h-full" style="height: 500px;">
42+
<wc-gn-dataset-view-chart
43+
class="overflow-auto grow h-full"
44+
[apiUrl]="apiUrl"
45+
[searchId]="searchId"
46+
[datasetId]="record.uniqueIdentifier"
47+
[aggregation]="'average'"
48+
[xProperty]="'adresse'"
49+
[chartType]="'line'"
50+
></wc-gn-dataset-view-chart>
51+
</div>
52+
</mat-tab>
53+
</mat-tab-group>
54+
</div>
55+
2556
<div *ngIf="getDownloads(record?.onlineResources)?.length > 0">
2657
<div
2758
class="font-title text-lg mt-4 mb-2 flex flex-row gap-4 items-center"

apps/webcomponents/src/app/webcomponents.module.ts

+5
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ import {
6464
BlockListComponent,
6565
PreviousNextButtonsComponent,
6666
} from '@geonetwork-ui/ui/layout'
67+
import {ChartViewComponent, TableViewComponent} from "@geonetwork-ui/feature/dataviz";
68+
import {MatTabsModule} from "@angular/material/tabs";
6769

6870
const CUSTOM_ELEMENTS: [new (...args) => BaseComponent, string][] = [
6971
[GnFacetsComponent, 'gn-facets'],
@@ -132,6 +134,9 @@ const CUSTOM_ELEMENTS: [new (...args) => BaseComponent, string][] = [
132134
DownloadItemComponent,
133135
PreviousNextButtonsComponent,
134136
ErrorComponent,
137+
TableViewComponent,
138+
ChartViewComponent,
139+
MatTabsModule,
135140
],
136141
providers: [
137142
provideGn4(),

0 commit comments

Comments
 (0)