Skip to content

Commit

Permalink
Merge pull request #858 from geonetwork/DH-add-lastupdated-to-record-…
Browse files Browse the repository at this point in the history
…response

Datahub: Add lastupdated date to record response
  • Loading branch information
Angi-Kinas authored Apr 18, 2024
2 parents c372298 + 6fc73fc commit 179fba8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 1 addition & 4 deletions apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ describe('dataset pages', () => {
})
})
describe('features', () => {
let targetLink
let keyword
it('should go to provider website on click', () => {
cy.get('datahub-record-metadata')
Expand All @@ -206,9 +205,7 @@ describe('dataset pages', () => {
cy.get('@proviLink')
.invoke('attr', 'href')
.then((link) => {
targetLink = link
cy.get('@proviLink').invoke('removeAttr', 'target').click()
cy.url().should('include', targetLink)
expect(link).to.eq('https://www.geo2france.fr/')
})
})
it('should go to dataset search page when clicking on org name and filter by org', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,7 @@ describe('Gn4Converter', () => {
},
],
datasetCreated: new Date('2012-01-01T00:00:00.000Z'),
datasetUpdated: new Date('2021-12-13T00:00:00.000Z'),
distributions: [
{
url: new URL(
Expand Down
6 changes: 6 additions & 0 deletions libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ export class Gn4FieldMapper {
getFirstValue(selectField<string>(source, 'creationDateForResource'))
),
}),
revisionDateForResource: (output, source) => ({
...output,
datasetUpdated: toDate(
getFirstValue(selectField<string>(source, 'revisionDateForResource'))
),
}),
createDate: (output, source) => ({
...output,
recordCreated: toDate(selectField<string>(source, 'createDate')),
Expand Down

0 comments on commit 179fba8

Please sign in to comment.