Skip to content

Commit

Permalink
chore: fixes post review
Browse files Browse the repository at this point in the history
The gn-mapviewer web component should work now
layers should appear with their label in the layers panel
Add missing styles in web components
Fix a failing e2e test
  • Loading branch information
jahow committed Sep 18, 2024
1 parent 66308c0 commit d011705
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 9 deletions.
2 changes: 1 addition & 1 deletion apps/metadata-editor-e2e/src/e2e/edit.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ describe('editor form', () => {
describe('geographical coverage', () => {
it('should show a map', () => {
cy.get('gn-ui-form-field-spatial-extent')
.find('gn-ui-map')
.find('gn-ui-map-container')
.should('be.visible')
})
describe('spatial extents', () => {
Expand Down
7 changes: 6 additions & 1 deletion apps/webcomponents/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
"polyfills": "apps/webcomponents/src/polyfills.ts",
"tsConfig": "apps/webcomponents/tsconfig.app.json",
"assets": [],
"styles": [],
"styles": [
"tailwind.base.css",
"apps/webcomponents/src/styles.css",
"node_modules/tippy.js/dist/tippy.css",
"node_modules/ol/ol.css"
],
"scripts": [],
"allowedCommonJsDependencies": [
"duration-relativetimeformat",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="h-full w-full relative">
<gn-ui-map-container></gn-ui-map-container>
<gn-ui-map-state-container></gn-ui-map-state-container>
<gn-ui-layers-panel
class="absolute"
style="top: 20px; left: 20px; bottom: 20px"
Expand Down
8 changes: 7 additions & 1 deletion apps/webcomponents/src/app/webcomponents.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ import { GnResultsListComponent } from './components/gn-results-list/gn-results-
import { GnSearchInputComponent } from './components/gn-search-input/gn-search-input.component'
import { GnDatasetViewTableComponent } from './components/gn-dataset-view-table/gn-dataset-view-table.component'
import { GnMapViewerComponent } from './components/gn-map-viewer/gn-map-viewer.component'
import { FeatureMapModule } from '@geonetwork-ui/feature/map'
import {
FeatureMapModule,
LayersPanelComponent,
MapStateContainerComponent,
} from '@geonetwork-ui/feature/map'
import { GnDatasetViewChartComponent } from './components/gn-dataset-view-chart/gn-dataset-view-chart.component'
import { FeatureDatavizModule } from '@geonetwork-ui/feature/dataviz'
import { FeatureAuthModule } from '@geonetwork-ui/feature/auth'
Expand Down Expand Up @@ -90,6 +94,8 @@ const CUSTOM_ELEMENTS: [new (...args) => BaseComponent, string][] = [
FeatureDatavizModule,
FeatureAuthModule,
BrowserAnimationsModule,
MapStateContainerComponent,
LayersPanelComponent,
],
providers: [
provideGn4(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ describe('GeoTableViewComponent', () => {
coordinates: [2.335333, 51.070817],
type: 'Point',
},
maxZoom: 13,
})
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,23 @@ import {
FeatureDetailComponent,
MapContainerComponent,
} from '@geonetwork-ui/ui/map'
import { polygonFeatureCollectionFixture } from '@geonetwork-ui/common/fixtures'
import { pointFeatureCollectionFixture } from '@geonetwork-ui/common/fixtures'
import { TableComponent } from '@geonetwork-ui/ui/dataviz'
import { HttpClientModule } from '@angular/common/http'
import { TRANSLATE_DEFAULT_CONFIG } from '@geonetwork-ui/util/i18n'
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'

export default {
title: 'Map/GeoTable',
component: GeoTableViewComponent,
decorators: [
moduleMetadata({
imports: [FeatureDetailComponent, MapContainerComponent, TableComponent],
imports: [
FeatureDetailComponent,
MapContainerComponent,
TableComponent,
BrowserAnimationsModule,
],
}),
applicationConfig({
providers: [
Expand All @@ -38,6 +44,6 @@ export default {

export const Primary: StoryObj<GeoTableViewComponent> = {
args: {
data: polygonFeatureCollectionFixture(),
data: pointFeatureCollectionFixture(),
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export class GeoTableViewComponent implements OnInit, OnDestroy {
...this.mapContext,
view: {
geometry: feature.geometry,
maxZoom: 13,
},
}
// FIXME: animate the view
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
<mat-icon class="material-symbols-outlined -ml-2 mr-2 shrink-0"
>chevron_right</mat-icon
>
<span class="mr-2 grow">{{ layer.title }}</span>
<span class="mr-2 grow">{{ layer.label }}</span>
<a
href
class="underline text-sm text-red-700 hover:text-red-900"
(click)="deleteLayer(index)"
(click)="deleteLayer(index); $event.preventDefault()"
>
delete
</a>
Expand Down

0 comments on commit d011705

Please sign in to comment.