diff --git a/apps/datahub/src/app/home/search/search-filters/search-filters.component.html b/apps/datahub/src/app/home/search/search-filters/search-filters.component.html
index 4a52f47ae2..bad4e63e70 100644
--- a/apps/datahub/src/app/home/search/search-filters/search-filters.component.html
+++ b/apps/datahub/src/app/home/search/search-filters/search-filters.component.html
@@ -78,7 +78,7 @@
*ngIf="!isOpen"
(buttonClick)="open()"
type="outline"
- extraClass="!p-[8px]"
+ extraClass="!px-[8px]"
data-cy="filters-expand"
>
more_horiz
diff --git a/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts b/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts
index d4004611b1..485afd352b 100644
--- a/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts
+++ b/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts
@@ -1,7 +1,7 @@
describe('dashboard', () => {
- let originalList
- let newList
describe('pagination', () => {
+ let originalList
+ let newList
it('should display different results on click on arrow', () => {
cy.visit('/')
cy.get('gn-ui-record-table')
@@ -36,4 +36,33 @@ describe('dashboard', () => {
})
})
})
+
+ // NEEDS TO WAIT UNTIL STYLE IS DONE
+ describe('sorting', () => {
+ let originalList
+ let newList
+ it('should order the result list on click', () => {
+ cy.visit('/')
+ cy.get('gn-ui-record-table')
+ .find('.record-table-col')
+ .first()
+ .as('pageOne')
+
+ cy.get('@pageOne')
+ .invoke('text')
+ .then((list) => {
+ originalList = list.trim()
+ cy.get('.record-table-header').first().click()
+ cy.get('gn-ui-sort').find('gn-ui-button').first().click()
+ cy.get('gn-ui-record-table')
+ .find('.record-table-col')
+ .first()
+ .invoke('text')
+ .then((list) => {
+ newList = list.trim()
+ expect(newList).not.to.be(originalList)
+ })
+ })
+ })
+ })
})
diff --git a/apps/metadata-editor/src/app/records/records-list.component.html b/apps/metadata-editor/src/app/records/records-list.component.html
index 71204476fc..01198dccb5 100644
--- a/apps/metadata-editor/src/app/records/records-list.component.html
+++ b/apps/metadata-editor/src/app/records/records-list.component.html
@@ -10,6 +10,8 @@ {{ title }}
[records]="results"
[totalHits]="searchFacade.resultsHits$ | async"
(recordSelect)="editRecord($event)"
+ (sortByChange)="setSortBy($event)"
+ [sortBy]="searchFacade.sortBy$ | async"
>
{
let fixture: ComponentFixture
let router: Router
let searchService: SearchService
+ let searchFacade: SearchFacade
beforeEach(() => {
TestBed.configureTestingModule({
@@ -89,6 +90,7 @@ describe('RecordsListComponent', () => {
})
router = TestBed.inject(Router)
searchService = TestBed.inject(SearchService)
+ searchFacade = TestBed.inject(SearchFacade)
fixture = TestBed.createComponent(RecordsListComponent)
component = fixture.componentInstance
fixture.detectChanges()
@@ -116,6 +118,12 @@ describe('RecordsListComponent', () => {
expect(pagination.currentPage).toEqual(currentPage)
expect(pagination.totalPages).toEqual(totalPages)
})
+ it('orders the completion column', () => {
+ expect(searchFacade.setSortBy).toHaveBeenCalledWith([
+ 'desc',
+ 'changeDate',
+ ])
+ })
describe('when click on a record', () => {
beforeEach(() => {
table.recordSelect.emit({ uniqueIdentifier: 123 })
diff --git a/apps/metadata-editor/src/app/records/records-list.component.ts b/apps/metadata-editor/src/app/records/records-list.component.ts
index e11c1f9dbb..f3511d531c 100644
--- a/apps/metadata-editor/src/app/records/records-list.component.ts
+++ b/apps/metadata-editor/src/app/records/records-list.component.ts
@@ -6,6 +6,7 @@ import { CatalogRecord } from '@geonetwork-ui/common/domain/record'
import { SearchFacade, SearchService } from '@geonetwork-ui/feature/search'
import { UiSearchModule } from '@geonetwork-ui/ui/search'
import { UiElementsModule } from '@geonetwork-ui/ui/elements'
+import { SortByField } from '@geonetwork-ui/common/domain/search'
const includes = [
'uuid',
@@ -49,4 +50,8 @@ export class RecordsListComponent {
editRecord(record: CatalogRecord) {
this.router.navigate(['/edit', record.uniqueIdentifier])
}
+
+ setSortBy(newSortBy: SortByField) {
+ this.searchFacade.setSortBy(newSortBy)
+ }
}
diff --git a/apps/metadata-editor/src/styles.css b/apps/metadata-editor/src/styles.css
index e3a2850c1c..41d06136c0 100644
--- a/apps/metadata-editor/src/styles.css
+++ b/apps/metadata-editor/src/styles.css
@@ -21,3 +21,7 @@ body {
.menu-title {
@apply text-xl px-9 py-3;
}
+
+.mat-mdc-button-base {
+ line-height: normal;
+}
diff --git a/libs/ui/elements/src/lib/pagination-buttons/pagination-buttons.component.stories.ts b/libs/ui/elements/src/lib/pagination-buttons/pagination-buttons.component.stories.ts
index 8a382eb52c..94d61ccaed 100644
--- a/libs/ui/elements/src/lib/pagination-buttons/pagination-buttons.component.stories.ts
+++ b/libs/ui/elements/src/lib/pagination-buttons/pagination-buttons.component.stories.ts
@@ -1,15 +1,10 @@
import { TranslateModule } from '@ngx-translate/core'
-import {
- componentWrapperDecorator,
- Meta,
- moduleMetadata,
- StoryObj,
-} from '@storybook/angular'
+import { Meta, moduleMetadata, StoryObj } from '@storybook/angular'
import {
TRANSLATE_DEFAULT_CONFIG,
UtilI18nModule,
} from '@geonetwork-ui/util/i18n'
-import { UiInputsModule, ButtonComponent } from '@geonetwork-ui/ui/inputs'
+import { ButtonComponent } from '@geonetwork-ui/ui/inputs'
import { PaginationButtonsComponent } from './pagination-buttons.component'
import { FormsModule } from '@angular/forms'
import { action } from '@storybook/addon-actions'
diff --git a/libs/ui/inputs/src/lib/button/button.component.css b/libs/ui/inputs/src/lib/button/button.component.css
index e69de29bb2..d458e57363 100644
--- a/libs/ui/inputs/src/lib/button/button.component.css
+++ b/libs/ui/inputs/src/lib/button/button.component.css
@@ -0,0 +1,5 @@
+/* makes sure icons will not make the buttons grow vertically */
+mat-icon.mat-icon {
+ margin-top: -0.3em;
+ margin-bottom: -0.3em;
+}
diff --git a/libs/ui/inputs/src/lib/button/button.component.stories.ts b/libs/ui/inputs/src/lib/button/button.component.stories.ts
index a106ef86ea..af7bee315b 100644
--- a/libs/ui/inputs/src/lib/button/button.component.stories.ts
+++ b/libs/ui/inputs/src/lib/button/button.component.stories.ts
@@ -5,6 +5,7 @@ import {
TRANSLATE_DEFAULT_CONFIG,
UtilI18nModule,
} from '@geonetwork-ui/util/i18n'
+import { MatIconModule } from '@angular/material/icon'
export default {
title: 'Inputs/ButtonComponent',
@@ -14,6 +15,7 @@ export default {
imports: [
UtilI18nModule,
TranslateModule.forRoot(TRANSLATE_DEFAULT_CONFIG),
+ MatIconModule,
],
}),
],
@@ -36,7 +38,22 @@ export const Primary: StoryObj = {
},
render: (args) => ({
props: args,
- template:
- '{{ content }}',
+ template: `
+
+ {{ content }}
+
+
+ with an icon downloading
+
+
+ globe_asia bigger
+
+
+ pest_control smaller
+
+
+ different waves shape
+
+
`,
}),
}
diff --git a/libs/ui/inputs/src/lib/button/button.component.ts b/libs/ui/inputs/src/lib/button/button.component.ts
index 65935b7a59..46764cb0d4 100644
--- a/libs/ui/inputs/src/lib/button/button.component.ts
+++ b/libs/ui/inputs/src/lib/button/button.component.ts
@@ -61,7 +61,7 @@ export class ButtonComponent {
case 'primary':
return 'focus:ring-4 focus:ring-primary-lightest'
case 'outline':
- return 'border border-gray-300 hover:border-primary-lighter focus:border-primary-lighter focus:ring-4 focus:ring-primary-lightest active:border-primary-darker'
+ return 'border border-gray-300 -m-[1px] hover:border-primary-lighter focus:border-primary-lighter focus:ring-4 focus:ring-primary-lightest active:border-primary-darker'
case 'light':
return 'focus:ring-4 focus:ring-gray-300'
}
diff --git a/libs/ui/search/src/lib/record-table/record-table.component.html b/libs/ui/search/src/lib/record-table/record-table.component.html
index 53365b9bb3..249ef181d4 100644
--- a/libs/ui/search/src/lib/record-table/record-table.component.html
+++ b/libs/ui/search/src/lib/record-table/record-table.component.html
@@ -10,24 +10,97 @@
>
results.records.hits.displayedOn
+