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/search/src/lib/record-table/record-table.component.html b/libs/ui/search/src/lib/record-table/record-table.component.html index 7d5036d744..e93f1977c4 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 @@ -23,13 +23,13 @@ > record.metadata.title expand_more expand_less record.metadata.author expand_more expand_less - record.metadata.completion + record.metadata.updatedOn expand_more expand_less record.metadata.createdOn expand_more expand_less = { + component: RecordTableComponent, + title: 'Search/RecordTableComponent', + decorators: [ + moduleMetadata({ + declarations: [RecordTableComponent], + imports: [UiInputsModule, MatIconModule], + }), + ], + render: (args: RecordTableComponent) => ({ + props: { + ...args, + recordSelect: action('recordSelect'), + sortByChange: action('sortByChange'), + }, + }), +} +export default meta +type Story = StoryObj + +export const Primary: Story = { + args: { + records: DATASET_RECORDS.concat(DATASET_RECORDS, DATASET_RECORDS), + totalHits: 1234, + }, +} diff --git a/libs/ui/search/src/lib/record-table/record-table.component.ts b/libs/ui/search/src/lib/record-table/record-table.component.ts index a64c25f8d8..e98926e42a 100644 --- a/libs/ui/search/src/lib/record-table/record-table.component.ts +++ b/libs/ui/search/src/lib/record-table/record-table.component.ts @@ -83,6 +83,7 @@ export class RecordTableComponent { newOrder = 'asc' } this.sortByChange.emit([newOrder, col]) + this.sortBy = [newOrder, col] } isSortedBy(col: string, order: 'asc' | 'desc'): boolean {