Skip to content

Commit

Permalink
feat: upgrade gn-ui and make search work
Browse files Browse the repository at this point in the history
  • Loading branch information
cmoinier committed Jul 16, 2024
1 parent 6216f71 commit 807de74
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
9 changes: 9 additions & 0 deletions apps/datahub-e2e/src/e2e/dataset.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@ describe('datasets', () => {
.should('have.length.gt', 0)
})

it('should go to a dedicated search page when clicking on a category', () => {
cy.get('@mainInfo')
.children('div')
.eq(1)
.find('div')
.children('span')
.first()
})

it('should display the territories', () => {
cy.get('@mainInfo')
.children('div')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
@for(category of displayCategories; track $index) {
<button
class="mel-badge-primary truncate"
(click)="onCategoryKeywordClick(category.key)"
(click)="onCategoryKeywordClick(category)"
>
{{ category.label }}
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from '@angular/core'
import { TranslateService } from '@ngx-translate/core'
import { RouterFacade } from 'geonetwork-ui'
import { CatalogRecord } from 'geonetwork-ui/libs/common/domain/src/lib/model/record'
import { CatalogRecord, Keyword } from 'geonetwork-ui/libs/common/domain/src/lib/model/record'

@Component({
selector: 'mel-datahub-dataset-information',
Expand Down Expand Up @@ -41,7 +41,7 @@ export class DatasetInformationComponent {
return categoryKeywords
}

onCategoryKeywordClick(category: string) {
this.routerFacade.updateSearch({ categoryKeyword: category })
onCategoryKeywordClick(category: Keyword) {
this.routerFacade.updateSearch({ categoryKeyword: category.key })
}
}

0 comments on commit 807de74

Please sign in to comment.