Skip to content

Commit

Permalink
Merge pull request #126 from camptocamp/migrate-angular-18
Browse files Browse the repository at this point in the history
Migrate angular to 18
  • Loading branch information
cmoinier authored Feb 13, 2025
2 parents 6ca0cc3 + 346cc92 commit b7570f0
Show file tree
Hide file tree
Showing 12 changed files with 14,373 additions and 21,415 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CI

env:
NODE_VERSION: 18.16.1
NODE_VERSION: 20.18.1

on:
push:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ Thumbs.db

.nx/cache
.angular
.nx/
2 changes: 1 addition & 1 deletion apps/datahub-e2e/src/e2e/dataset.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ describe('datasets', () => {
.as('downloadLink')
cy.get('@downloadLink').should(
'contain',
'/geoserver/insee/ows?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=insee%3Arectangles_200m_menage_erbm&OUTPUTFORMAT=csv'
'/geoserver/insee/wfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=insee%3Arectangles_200m_menage_erbm&OUTPUTFORMAT=csv'
)
cy.get('[data-cy="download-button"]')
.first()
Expand Down
5 changes: 4 additions & 1 deletion apps/datahub/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ import { matMoreHoriz } from '@ng-icons/material-icons/baseline'
}
),
EffectsModule.forRoot([]),
StoreDevtoolsModule.instrument({ logOnly: !isDevMode() }),
StoreDevtoolsModule.instrument({
logOnly: !isDevMode(),
connectInZone: true,
}),
RouterModule.forRoot([], {
initialNavigation: 'enabledBlocking',
scrollPositionRestoration: 'enabled',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ marker('mel.datahub.search.filters.keyword')
marker('mel.datahub.search.filters.isSpatial')
marker('mel.datahub.search.filters.resourceType')
marker('mel.datahub.search.filters.representationType')
marker('mel.datahub.search.filters.revisionYear')

@Component({
selector: 'mel-datahub-search-filters',
Expand Down
5 changes: 4 additions & 1 deletion apps/home/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ import { HomePageComponent } from './home/home-page/home-page.component'
}
),
EffectsModule.forRoot([]),
StoreDevtoolsModule.instrument({ logOnly: !isDevMode() }),
StoreDevtoolsModule.instrument({
logOnly: !isDevMode(),
connectInZone: true,
}),
],
providers: [
importProvidersFrom(FeatureAuthModule),
Expand Down
16 changes: 10 additions & 6 deletions libs/mel/src/lib/results-list/results-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,18 @@ export class ResultsListComponent implements OnInit, OnDestroy {
}

onInfoKeywordClick(keyword: Keyword) {
this.routerFacade
? this.routerFacade.updateSearch({ q: keyword.label })
: goFromHomeToSearch(keyword.label)
if (this.routerFacade) {
this.routerFacade.updateSearch({ q: keyword.label })
} else {
goFromHomeToSearch(keyword.label)
}
}

onMetadataSelection(metadata: CatalogRecord): void {
this.routerFacade
? this.routerFacade.goToMetadata(metadata)
: goFromHomeToRecord(metadata)
if (this.routerFacade) {
this.routerFacade.goToMetadata(metadata)
} else {
goFromHomeToRecord(metadata)
}
}
}
6 changes: 4 additions & 2 deletions libs/mel/src/lib/route.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ export const DATAHUB_ROUTE_DATASET = 'dataset'
export const DATAHUB_ROUTE_SEARCH = 'search'

export function goFromHomeToRecord(record: CatalogRecord) {
window.location.href = `${DATAHUB_ROOT}/${DATAHUB_ROUTE_DATASET}/${record.uniqueIdentifier}`
window.location.assign(
`${DATAHUB_ROOT}/${DATAHUB_ROUTE_DATASET}/${record.uniqueIdentifier}`
)
}

export function goFromHomeToSearch(query: string) {
window.location.href = `${DATAHUB_ROOT}/${DATAHUB_ROUTE_SEARCH}?q=${query}`
window.location.assign(`${DATAHUB_ROOT}/${DATAHUB_ROUTE_SEARCH}?q=${query}`)
}
Loading

0 comments on commit b7570f0

Please sign in to comment.