Skip to content

Commit

Permalink
Updated the geonetwork dump to include ogc api stubs for accroche_velos
Browse files Browse the repository at this point in the history
  • Loading branch information
ronitjadhav committed May 23, 2024
1 parent 1c28342 commit 67f8005
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe('RecordApFormComponent', () => {
expect(component.format$.getValue()).toBe('json')
const url = await firstValueFrom(component.apiQueryUrl$)
expect(url).toBe(
'https://api.example.com/data/collections/mockFeatureType/items?f=json'
'https://api.example.com/data/collections/feature1/items?limit=-1&f=json'
)
})
})
Expand All @@ -107,7 +107,7 @@ describe('RecordApFormComponent', () => {
component.setFormat(mockFormat)
const url = await firstValueFrom(component.apiQueryUrl$)
expect(url).toBe(
`https://api.example.com/data/collections/mockFeatureType/items?limit=${mockLimit}&offset=${mockOffset}&f=${mockFormat}`
`https://api.example.com/data/collections/feature1/items?limit=${mockLimit}&offset=${mockOffset}&f=${mockFormat}`
)
})
it('should remove the param in url if value is null', async () => {
Expand All @@ -119,7 +119,7 @@ describe('RecordApFormComponent', () => {
component.setFormat(mockFormat)
const url = await firstValueFrom(component.apiQueryUrl$)
expect(url).toBe(
`https://api.example.com/data/collections/mockFeatureType/items?limit=${mockLimit}&offset=${mockOffset}&f=${mockFormat}`
`https://api.example.com/data/collections/feature1/items?limit=${mockLimit}&offset=${mockOffset}&f=${mockFormat}`
)
})
it('should remove the param in url if value is zero', async () => {
Expand All @@ -131,7 +131,7 @@ describe('RecordApFormComponent', () => {
component.setFormat(mockFormat)
const url = await firstValueFrom(component.apiQueryUrl$)
expect(url).toBe(
`https://api.example.com/data/collections/mockFeatureType/items?limit=${mockLimit}&offset=${mockOffset}&f=${mockFormat}`
`https://api.example.com/data/collections/feature1/items?limit=${mockLimit}&offset=${mockOffset}&f=${mockFormat}`
)
})
})
Expand Down Expand Up @@ -177,7 +177,7 @@ describe('RecordApFormComponent', () => {
expect(component.format$.getValue()).toBe('json')
const url = await firstValueFrom(component.apiQueryUrl$)
expect(url).toBe(
`https://api.example.com/data?type=mockFeatureType&options={"outputFormat":"json"}`
`https://api.example.com/data?type=mockFeatureType&options={"outputFormat":"json","limit":-1}`
)
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export class RecordApiFormComponent {
accessServiceProtocol: ServiceProtocol | undefined
outputFormats = [{ value: 'json', label: 'JSON' }]
endpoint: WfsEndpoint | OgcApiEndpoint | undefined
firstCollection: string | undefined

apiQueryUrl$ = combineLatest([
this.offset$,
Expand Down Expand Up @@ -121,9 +122,8 @@ export class RecordApiFormComponent {
return this.endpoint.getServiceInfo() as OutputFormats
} else {
{
const firstCollection = (await this.endpoint.featureCollections)[0]
return (await this.endpoint.getCollectionInfo(
firstCollection
this.firstCollection
)) as OutputFormats
}
}
Expand All @@ -136,6 +136,7 @@ export class RecordApiFormComponent {
await (this.endpoint as WfsEndpoint).isReady()
} else {
this.endpoint = new OgcApiEndpoint(this.apiBaseUrl)
this.firstCollection = (await this.endpoint.featureCollections)[0]
}
this.endpoint$.next(this.endpoint)
}
Expand All @@ -151,15 +152,18 @@ export class RecordApiFormComponent {
outputFormat: format,
startIndex: offset ? Number(offset) : undefined,
maxFeatures: limit !== '-1' ? Number(limit) : undefined,
limit: limit !== '-1' ? Number(limit) : undefined,
limit: limit !== '-1' ? Number(limit) : limit === '-1' ? -1 : undefined,
offset: offset !== '' ? Number(offset) : undefined,
}

if (this.endpoint instanceof WfsEndpoint) {
options.maxFeatures = limit !== '-1' ? Number(limit) : undefined
return this.endpoint.getFeatureUrl(this.apiFeatureType, options)
} else {
const firstCollection = (await this.endpoint.featureCollections)[0]
return await this.endpoint.getCollectionItemsUrl(firstCollection, options)
return await this.endpoint.getCollectionItemsUrl(
this.firstCollection,
options
)
}
}
}
Binary file modified support-services/docker-entrypoint-initdb.d/dump
Binary file not shown.

0 comments on commit 67f8005

Please sign in to comment.