Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions apps/datahub/src/app/app.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,11 @@
background-color: var(--background-alt-blue-france);
padding: 1.5rem 0;
}
.bouton-cartes-gouv {
background-color: var(--background-action-high-blue-france) !important;
color: var(--text-inverted-blue-france) !important;
}

.bouton-cartes-gouv:hover {
background-color: var(--background-action-high-blue-france-hover) !important;
}
14 changes: 11 additions & 3 deletions apps/datahub/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[operatorImagePath]="
'https://data.geopf.fr/annexes/ressources/header/cartes-gouv-logo.svg'
"
[serviceTagline]="'Le service public des cartes et données du territoire'"
[serviceTagline]="'Notre territoire commun'"
[menu]="[]"
>
<ng-template #toolsLinksTemplate>
Expand Down Expand Up @@ -39,6 +39,14 @@
[customClass]="'fr-nav__link'"
[iconPosition]="'left'"
></dsfr-link>
<dsfr-link
[link]="'https://cartes.gouv.fr/aide/fr/niveau-de-service/'"
[linkTarget]="'_blank'"
[label]="'Niveau de service'"
[icon]="'fr-icon-rfid-line'"
[customClass]="'fr-nav__link'"
[iconPosition]="'left'"
></dsfr-link>
<dsfr-link
[link]="'https://cartes.gouv.fr/nous-ecrire'"
[linkTarget]="'_blank'"
Expand Down Expand Up @@ -87,8 +95,8 @@
<li style="display: flex">
<a
style="margin: 16px 24px"
class="fr-btn fr-btn--tertiary"
target="_blank"
class="fr-btn bouton-cartes-gouv"
target="_self"
href="https://cartes.gouv.fr/decouvrir"
>Découvrir cartes.gouv.fr</a
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@
[style.opacity]="expandRatio"
[innerHTML]="'datahub.header.title.html' | translate"
></div>
<a
href="https://cartes.gouv.fr/aide/fr/partenaires/"
target="_blank"
rel="noopener noreferrer"
style="display: inline-block; margin-bottom: 10px"
>
Découvrez les producteurs partenaires et leur offre
</a>

<gn-ui-fuzzy-search
class="text-[18px] pointer-events-auto"
style="
Expand Down
20 changes: 14 additions & 6 deletions apps/datahub/src/app/record/record-apis/record-apis.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,20 @@
<div class="flex flex-col px-4 gap-8 container-lg lg:mx-auto">
<div class="flex flex-wrap justify-between sm:mb-2 ng-star-inserted">
@if (selectedApiLink?.accessServiceProtocol) {
<p class="text-[21px] text-title font-title" translate>
{{
selectedApiLink?.accessServiceProtocol === 'GPFDL'
? 'record.metadata.api.form.title.gpf'
: 'record.metadata.api.form.title'
}}
<p class="text-[21px] text-title font-title">
<span translate>
{{
selectedApiLink?.accessServiceProtocol === 'GPFDL'
? 'record.metadata.api.form.title.gpf'
: 'record.metadata.api.form.title'
}}
</span>

<ng-container
*ngIf="selectedApiLink?.accessServiceProtocol === 'GPFDL'"
>
{{ selectedApiLink?.name }}
</ng-container>
</p>
}
<button
Expand Down
26 changes: 7 additions & 19 deletions libs/feature/record/src/lib/gpf-api-dl/gpf-api-dl.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { Choice, DropdownSelectorComponent } from '@geonetwork-ui/ui/inputs'
import { CommonModule } from '@angular/common'
import { TranslateDirective, TranslatePipe } from '@ngx-translate/core'
import { GpfApiDlListItemComponent } from '../gpf-api-dl-list-item/gpf-api-dl-list-item.component'
import { de } from 'date-fns/locale'

export interface Label {
label: string
Expand Down Expand Up @@ -90,8 +91,6 @@ export class GpfApiDlComponent implements OnInit, AfterViewInit {
editionDateFrom$ = new BehaviorSubject<string | null>(null)
editionDateTo$ = new BehaviorSubject<string | null>(null)

url =
'https://data.geopf.fr/telechargement/capabilities?outputFormat=application/json'
choices: any
bucketPromisesZone: Choice[]
bucketPromisesFormat: Choice[]
Expand Down Expand Up @@ -286,23 +285,11 @@ export class GpfApiDlComponent implements OnInit, AfterViewInit {
}

async getCapabilities() {
let page = 0
let choicesTest = undefined
let pageCount = 1

while (choicesTest === undefined && pageCount > page) {
const response = await this.http
.get<any>(this.url.concat(`&limit=200&page=${page}`))
.toPromise()

choicesTest = response.entry.filter(
(element: any) => element['id'] === this.apiBaseUrl
)[0]
page += 1
pageCount = response.pagecount + 1
}
const response = await this.http.get<any>(this.apiBaseUrl).toPromise()

console.log('helloresponse', response)

return choicesTest
return response
}

async getFields() {
Expand All @@ -324,7 +311,7 @@ export class GpfApiDlComponent implements OnInit, AfterViewInit {
tempFormat.unshift({ value: 'null', label: 'FORMAT' })
this.bucketPromisesFormat = tempFormat

const tempCrs = this.choices.category.map((bucket: TermBucket) => ({
const tempCrs = this.choices.categories.map((bucket: TermBucket) => ({
value: bucket.term,
label: bucket.label,
}))
Expand All @@ -336,6 +323,7 @@ export class GpfApiDlComponent implements OnInit, AfterViewInit {
this.choices.editionDateStart,
this.choices.editionDateEnd,
]
console.log('this.defaultEditionDate', this.defaultEditionDate)

this.editionDateFrom$.next(this.defaultEditionDate[0])
this.editionDateTo$.next(this.defaultEditionDate[1])
Expand Down
Loading