Skip to content

Commit

Permalink
chore: fix failing storybook entries
Browse files Browse the repository at this point in the history
  • Loading branch information
jahow committed Nov 26, 2024
1 parent 210451d commit ce72548
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import {
UiDatavizModule,
} from '@geonetwork-ui/ui/dataviz'
import { importProvidersFrom } from '@angular/core'
import { TRANSLATE_DEFAULT_CONFIG } from '@geonetwork-ui/util/i18n'
import { TranslateModule } from '@ngx-translate/core'

export default {
title: 'Dataviz/FigureContainerComponent',
Expand All @@ -22,7 +24,10 @@ export default {
imports: [UiDatavizModule],
}),
applicationConfig({
providers: [importProvidersFrom(BrowserAnimationsModule)],
providers: [
importProvidersFrom(BrowserAnimationsModule),
importProvidersFrom(TranslateModule.forRoot(TRANSLATE_DEFAULT_CONFIG)),
],
}),
componentWrapperDecorator(
(story) => `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@ import {
} from '@storybook/angular'
import { TableViewComponent } from './table-view.component'
import { TableComponent, UiDatavizModule } from '@geonetwork-ui/ui/dataviz'
import { LoadingMaskComponent } from '@geonetwork-ui/ui/widgets'
import { importProvidersFrom } from '@angular/core'
import { MatProgressSpinner } from '@angular/material/progress-spinner'

export default {
title: 'Smart/Dataviz/TableView',
component: TableViewComponent,
decorators: [
moduleMetadata({
declarations: [LoadingMaskComponent, MatProgressSpinner],
imports: [
TableComponent,
TranslateModule.forRoot(TRANSLATE_DEFAULT_CONFIG),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
UtilI18nModule,
} from '@geonetwork-ui/util/i18n'
import { UtilSharedModule } from '@geonetwork-ui/util/shared'
import { ThumbnailComponent } from '@geonetwork-ui/ui/elements'
import { OrganisationPreviewComponent } from './organisation-preview.component'
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
import { importProvidersFrom } from '@angular/core'
Expand All @@ -28,7 +27,6 @@ export default {
],
}),
moduleMetadata({
declarations: [ThumbnailComponent],
imports: [
UtilI18nModule,
UtilSharedModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ import {
UtilI18nModule,
} from '@geonetwork-ui/util/i18n'
import { OrganisationsFilterComponent } from './organisations-filter.component'
import { DropdownSelectorComponent } from '@geonetwork-ui/ui/inputs'

export default {
title: 'Catalog/OrganisationsFilterComponent',
component: OrganisationsFilterComponent,
decorators: [
moduleMetadata({
declarations: [DropdownSelectorComponent],
imports: [
UtilI18nModule,
TranslateModule.forRoot(TRANSLATE_DEFAULT_CONFIG),
Expand Down
7 changes: 6 additions & 1 deletion libs/ui/dataviz/src/lib/figure/figure.component.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { FigureComponent } from './figure.component'
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
import { UiDatavizModule } from '../ui-dataviz.module'
import { importProvidersFrom } from '@angular/core'
import { TranslateModule } from '@ngx-translate/core'
import { TRANSLATE_DEFAULT_CONFIG } from '@geonetwork-ui/util/i18n'

export default {
title: 'Dataviz/FigureComponent',
Expand All @@ -18,7 +20,10 @@ export default {
imports: [UiDatavizModule],
}),
applicationConfig({
providers: [importProvidersFrom(BrowserAnimationsModule)],
providers: [
importProvidersFrom(BrowserAnimationsModule),
importProvidersFrom(TranslateModule.forRoot(TRANSLATE_DEFAULT_CONFIG)),
],
}),
componentWrapperDecorator(
(story) => `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ import {
} from '@storybook/angular'
import { ApiCardComponent } from './api-card.component'
import { MatTooltipModule } from '@angular/material/tooltip'
import { CopyTextButtonComponent } from '@geonetwork-ui/ui/libs/copy-text-button'

export default {
title: 'Elements/ApiCardComponent',
component: ApiCardComponent,
decorators: [
moduleMetadata({
declarations: [CopyTextButtonComponent],
imports: [
UtilI18nModule,
TranslateModule.forRoot(TRANSLATE_DEFAULT_CONFIG),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
title: 'Elements/GnUiLinkifyDirective',
decorators: [
moduleMetadata({
declarations: [GnUiLinkifyDirective],
imports: [GnUiLinkifyDirective],
}),
],
} as Meta<GnUiLinkifyDirective>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
} from '@storybook/angular'
import { MetadataInfoComponent } from './metadata-info.component'
import { UtilSharedModule } from '@geonetwork-ui/util/shared'
import { ContentGhostComponent } from '../content-ghost/content-ghost.component'
import { datasetRecordsFixture } from '@geonetwork-ui/common/fixtures'
import { DatasetRecord } from '@geonetwork-ui/common/domain/model/record'

Expand All @@ -20,7 +19,6 @@ export default {
component: MetadataInfoComponent,
decorators: [
moduleMetadata({
declarations: [ContentGhostComponent],
imports: [
UtilI18nModule,
TranslateModule.forRoot(TRANSLATE_DEFAULT_CONFIG),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,14 @@ import {
UtilI18nModule,
} from '@geonetwork-ui/util/i18n'
import { TranslateModule } from '@ngx-translate/core'
import { MetadataQualityItemComponent } from '../metadata-quality-item/metadata-quality-item.component'
import {
PopoverComponent,
ProgressBarComponent,
} from '@geonetwork-ui/ui/widgets'
import { PopoverComponent } from '@geonetwork-ui/ui/widgets'
import { CatalogRecord } from '@geonetwork-ui/common/domain/model/record'

export default {
title: 'Elements/MetadataQualityComponent',
component: MetadataQualityComponent,
decorators: [
moduleMetadata({
declarations: [ProgressBarComponent, MetadataQualityItemComponent],
imports: [
CommonModule,
UtilI18nModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
import { RouterModule } from '@angular/router'
import { APP_BASE_HREF } from '@angular/common'
import { importProvidersFrom } from '@angular/core'
import { ThumbnailComponent } from '../thumbnail/thumbnail.component'
import { MatTooltipModule } from '@angular/material/tooltip'
import { UtilSharedModule } from '@geonetwork-ui/util/shared'
import { datasetRecordsFixture } from '@geonetwork-ui/common/fixtures'
Expand All @@ -26,7 +25,6 @@ export default {
component: RelatedRecordCardComponent,
decorators: [
moduleMetadata({
declarations: [ThumbnailComponent],
imports: [
RouterModule,
UtilI18nModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ import { TimeSincePipe } from './time-since.pipe'
import { HttpClientModule } from '@angular/common/http'
import { importProvidersFrom } from '@angular/core'
import { ButtonComponent, TextAreaComponent } from '@geonetwork-ui/ui/inputs'
import { SpinningLoaderComponent } from '@geonetwork-ui/ui/widgets'

export default {
title: 'Elements/UserFeedbackItemComponent',
component: UserFeedbackItemComponent,
decorators: [
moduleMetadata({
declarations: [UserFeedbackItemComponent, SpinningLoaderComponent],
imports: [
CommonModule,
UtilI18nModule,
Expand Down
22 changes: 17 additions & 5 deletions libs/ui/inputs/src/lib/switch-toggle/switch-toggle.stories.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
import { Meta, moduleMetadata, StoryObj } from '@storybook/angular'
import {
applicationConfig,
Meta,
moduleMetadata,
StoryObj,
} from '@storybook/angular'
import { SwitchToggleComponent } from './switch-toggle.component'
import { MatButtonToggleModule } from '@angular/material/button-toggle'
import { CommonModule } from '@angular/common'
import { importProvidersFrom } from '@angular/core'
import { TranslateModule } from '@ngx-translate/core'
import { TRANSLATE_DEFAULT_CONFIG } from '@geonetwork-ui/util/i18n'
import { HttpClientModule } from '@angular/common/http'

export default {
title: 'Inputs/SwitchToggle',
component: SwitchToggleComponent,
decorators: [
moduleMetadata({
declarations: [],
imports: [SwitchToggleComponent, MatButtonToggleModule, CommonModule],
imports: [SwitchToggleComponent],
}),
applicationConfig({
providers: [
importProvidersFrom(TranslateModule.forRoot(TRANSLATE_DEFAULT_CONFIG)),
importProvidersFrom(HttpClientModule),
],
}),
],
} as Meta<SwitchToggleComponent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
StoryObj,
} from '@storybook/angular'
import { RecordPreviewCardComponent } from './record-preview-card.component'
import { ThumbnailComponent } from '@geonetwork-ui/ui/elements'
import { importProvidersFrom } from '@angular/core'
import { HttpClientModule } from '@angular/common/http'
import { UiDatavizModule } from '@geonetwork-ui/ui/dataviz'
Expand All @@ -19,7 +18,6 @@ export default {
component: RecordPreviewCardComponent,
decorators: [
moduleMetadata({
declarations: [ThumbnailComponent],
imports: [UiDatavizModule, UtilSharedModule],
}),
applicationConfig({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Meta, moduleMetadata, StoryObj } from '@storybook/angular'
import { RecordPreviewListComponent } from './record-preview-list.component'
import { ThumbnailComponent } from '@geonetwork-ui/ui/elements'
import { UtilSharedModule } from '@geonetwork-ui/util/shared'
import { TranslateModule } from '@ngx-translate/core'
import { TRANSLATE_DEFAULT_CONFIG } from '@geonetwork-ui/util/i18n'
Expand All @@ -13,7 +12,6 @@ export default {
component: RecordPreviewListComponent,
decorators: [
moduleMetadata({
declarations: [ThumbnailComponent],
imports: [
TranslateModule.forRoot(TRANSLATE_DEFAULT_CONFIG),
UtilSharedModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
StoryObj,
} from '@storybook/angular'
import { RecordPreviewTextComponent } from './record-preview-text.component'
import { ThumbnailComponent } from '@geonetwork-ui/ui/elements'
import { UtilSharedModule } from '@geonetwork-ui/util/shared'
import { importProvidersFrom } from '@angular/core'
import { RecordPreviewTitleComponent } from '../record-preview-title/record-preview-title.component'
Expand All @@ -22,7 +21,6 @@ export default {
component: RecordPreviewTextComponent,
decorators: [
moduleMetadata({
declarations: [ThumbnailComponent],
imports: [
TranslateModule.forRoot(TRANSLATE_DEFAULT_CONFIG),
UtilSharedModule,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Meta, moduleMetadata, StoryObj } from '@storybook/angular'
import { RecordPreviewTitleComponent } from './record-preview-title.component'
import { ThumbnailComponent } from '@geonetwork-ui/ui/elements'
import { UtilSharedModule } from '@geonetwork-ui/util/shared'
import { TranslateModule } from '@ngx-translate/core'
import { TRANSLATE_DEFAULT_CONFIG } from '@geonetwork-ui/util/i18n'
Expand All @@ -13,7 +12,6 @@ export default {
component: RecordPreviewTitleComponent,
decorators: [
moduleMetadata({
declarations: [ThumbnailComponent],
imports: [
TranslateModule.forRoot(TRANSLATE_DEFAULT_CONFIG),
UtilSharedModule,
Expand Down

0 comments on commit ce72548

Please sign in to comment.