From ccae660104919253d7a5994a4cd0389752641a42 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sun, 5 Sep 2021 08:34:02 +0200 Subject: [PATCH] Feature/add storybook story for no transactions info component (#345) * Add storybook story for no transactions info component * Update changelog --- CHANGELOG.md | 1 + .../positions-table/positions-table.module.ts | 2 +- .../components/positions/positions.module.ts | 2 +- .../src/app/components/rules/rules.module.ts | 2 +- .../src/app/pages/home/home-page.module.ts | 2 +- .../src/app/pages/zen/zen-page.module.ts | 2 +- libs/ui/.storybook/preview.js | 2 ++ libs/ui/src/lib/no-transactions-info/index.ts | 1 + .../no-transactions-info.component.html | 0 .../no-transactions-info.component.scss | 0 .../no-transactions-info.component.stories.ts | 23 +++++++++++++++++++ .../no-transactions-info.component.ts | 0 .../no-transactions-info.module.ts | 0 13 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 libs/ui/src/lib/no-transactions-info/index.ts rename {apps/client/src/app/components => libs/ui/src/lib}/no-transactions-info/no-transactions-info.component.html (100%) rename {apps/client/src/app/components => libs/ui/src/lib}/no-transactions-info/no-transactions-info.component.scss (100%) create mode 100644 libs/ui/src/lib/no-transactions-info/no-transactions-info.component.stories.ts rename {apps/client/src/app/components => libs/ui/src/lib}/no-transactions-info/no-transactions-info.component.ts (100%) rename {apps/client/src/app/components => libs/ui/src/lib}/no-transactions-info/no-transactions-info.module.ts (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74fe4f486..85515c8f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Extended the statistics section on the about page by the _GitHub_ contributors count - Set up _Storybook_ - Added a story for the logo component + - Added a story for the no transactions info component - Added a story for the value component ## 1.45.0 - 04.09.2021 diff --git a/apps/client/src/app/components/positions-table/positions-table.module.ts b/apps/client/src/app/components/positions-table/positions-table.module.ts index 351008835..1f32b91bb 100644 --- a/apps/client/src/app/components/positions-table/positions-table.module.ts +++ b/apps/client/src/app/components/positions-table/positions-table.module.ts @@ -8,10 +8,10 @@ import { MatSortModule } from '@angular/material/sort'; import { MatTableModule } from '@angular/material/table'; import { RouterModule } from '@angular/router'; import { GfSymbolModule } from '@ghostfolio/client/pipes/symbol/symbol.module'; +import { GfNoTransactionsInfoModule } from '@ghostfolio/ui/no-transactions-info'; import { GfValueModule } from '@ghostfolio/ui/value'; import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; -import { GfNoTransactionsInfoModule } from '../no-transactions-info/no-transactions-info.module'; import { GfPositionDetailDialogModule } from '../position/position-detail-dialog/position-detail-dialog.module'; import { GfSymbolIconModule } from '../symbol-icon/symbol-icon.module'; import { PositionsTableComponent } from './positions-table.component'; diff --git a/apps/client/src/app/components/positions/positions.module.ts b/apps/client/src/app/components/positions/positions.module.ts index b4fd283e9..cfb15be12 100644 --- a/apps/client/src/app/components/positions/positions.module.ts +++ b/apps/client/src/app/components/positions/positions.module.ts @@ -1,8 +1,8 @@ import { CommonModule } from '@angular/common'; import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; +import { GfNoTransactionsInfoModule } from '@ghostfolio/ui/no-transactions-info'; -import { GfNoTransactionsInfoModule } from '../no-transactions-info/no-transactions-info.module'; import { GfPositionModule } from '../position/position.module'; import { PositionsComponent } from './positions.component'; diff --git a/apps/client/src/app/components/rules/rules.module.ts b/apps/client/src/app/components/rules/rules.module.ts index 5a6a5bc8b..905fbce9d 100644 --- a/apps/client/src/app/components/rules/rules.module.ts +++ b/apps/client/src/app/components/rules/rules.module.ts @@ -3,8 +3,8 @@ import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; import { MatCardModule } from '@angular/material/card'; import { GfRuleModule } from '@ghostfolio/client/components/rule/rule.module'; +import { GfNoTransactionsInfoModule } from '@ghostfolio/ui/no-transactions-info'; -import { GfNoTransactionsInfoModule } from '../no-transactions-info/no-transactions-info.module'; import { GfPositionModule } from '../position/position.module'; import { RulesComponent } from './rules.component'; diff --git a/apps/client/src/app/pages/home/home-page.module.ts b/apps/client/src/app/pages/home/home-page.module.ts index a549b0476..1bd5a583c 100644 --- a/apps/client/src/app/pages/home/home-page.module.ts +++ b/apps/client/src/app/pages/home/home-page.module.ts @@ -5,12 +5,12 @@ import { MatCardModule } from '@angular/material/card'; import { MatTabsModule } from '@angular/material/tabs'; import { RouterModule } from '@angular/router'; import { GfLineChartModule } from '@ghostfolio/client/components/line-chart/line-chart.module'; -import { GfNoTransactionsInfoModule } from '@ghostfolio/client/components/no-transactions-info/no-transactions-info.module'; import { GfPerformanceChartDialogModule } from '@ghostfolio/client/components/performance-chart-dialog/performance-chart-dialog.module'; import { GfPortfolioPerformanceModule } from '@ghostfolio/client/components/portfolio-performance/portfolio-performance.module'; import { GfPortfolioSummaryModule } from '@ghostfolio/client/components/portfolio-summary/portfolio-summary.module'; import { GfPositionsModule } from '@ghostfolio/client/components/positions/positions.module'; import { GfToggleModule } from '@ghostfolio/client/components/toggle/toggle.module'; +import { GfNoTransactionsInfoModule } from '@ghostfolio/ui/no-transactions-info'; import { HomePageRoutingModule } from './home-page-routing.module'; import { HomePageComponent } from './home-page.component'; diff --git a/apps/client/src/app/pages/zen/zen-page.module.ts b/apps/client/src/app/pages/zen/zen-page.module.ts index 2b0a650b3..1cc7e8b64 100644 --- a/apps/client/src/app/pages/zen/zen-page.module.ts +++ b/apps/client/src/app/pages/zen/zen-page.module.ts @@ -5,9 +5,9 @@ import { MatCardModule } from '@angular/material/card'; import { MatTabsModule } from '@angular/material/tabs'; import { RouterModule } from '@angular/router'; import { GfLineChartModule } from '@ghostfolio/client/components/line-chart/line-chart.module'; -import { GfNoTransactionsInfoModule } from '@ghostfolio/client/components/no-transactions-info/no-transactions-info.module'; import { GfPortfolioPerformanceModule } from '@ghostfolio/client/components/portfolio-performance/portfolio-performance.module'; import { GfPositionsModule } from '@ghostfolio/client/components/positions/positions.module'; +import { GfNoTransactionsInfoModule } from '@ghostfolio/ui/no-transactions-info'; import { ZenPageRoutingModule } from './zen-page-routing.module'; import { ZenPageComponent } from './zen-page.component'; diff --git a/libs/ui/.storybook/preview.js b/libs/ui/.storybook/preview.js index 267813455..2c0792fcc 100644 --- a/libs/ui/.storybook/preview.js +++ b/libs/ui/.storybook/preview.js @@ -1 +1,3 @@ +import '@angular/localize/init'; + import '!style-loader!css-loader!sass-loader!../../../apps/client/src/styles.scss'; diff --git a/libs/ui/src/lib/no-transactions-info/index.ts b/libs/ui/src/lib/no-transactions-info/index.ts new file mode 100644 index 000000000..8a907c9ec --- /dev/null +++ b/libs/ui/src/lib/no-transactions-info/index.ts @@ -0,0 +1 @@ +export * from './no-transactions-info.module'; diff --git a/apps/client/src/app/components/no-transactions-info/no-transactions-info.component.html b/libs/ui/src/lib/no-transactions-info/no-transactions-info.component.html similarity index 100% rename from apps/client/src/app/components/no-transactions-info/no-transactions-info.component.html rename to libs/ui/src/lib/no-transactions-info/no-transactions-info.component.html diff --git a/apps/client/src/app/components/no-transactions-info/no-transactions-info.component.scss b/libs/ui/src/lib/no-transactions-info/no-transactions-info.component.scss similarity index 100% rename from apps/client/src/app/components/no-transactions-info/no-transactions-info.component.scss rename to libs/ui/src/lib/no-transactions-info/no-transactions-info.component.scss diff --git a/libs/ui/src/lib/no-transactions-info/no-transactions-info.component.stories.ts b/libs/ui/src/lib/no-transactions-info/no-transactions-info.component.stories.ts new file mode 100644 index 000000000..e76e670ea --- /dev/null +++ b/libs/ui/src/lib/no-transactions-info/no-transactions-info.component.stories.ts @@ -0,0 +1,23 @@ +import { GfLogoModule } from '@ghostfolio/ui/logo'; +import { Meta, Story, moduleMetadata } from '@storybook/angular'; + +import { NoTransactionsInfoComponent } from './no-transactions-info.component'; + +export default { + title: 'No Transactions Info', + component: NoTransactionsInfoComponent, + decorators: [ + moduleMetadata({ + imports: [GfLogoModule] + }) + ] +} as Meta; + +const Template: Story = ( + args: NoTransactionsInfoComponent +) => ({ + props: args +}); + +export const Default = Template.bind({}); +Default.args = {}; diff --git a/apps/client/src/app/components/no-transactions-info/no-transactions-info.component.ts b/libs/ui/src/lib/no-transactions-info/no-transactions-info.component.ts similarity index 100% rename from apps/client/src/app/components/no-transactions-info/no-transactions-info.component.ts rename to libs/ui/src/lib/no-transactions-info/no-transactions-info.component.ts diff --git a/apps/client/src/app/components/no-transactions-info/no-transactions-info.module.ts b/libs/ui/src/lib/no-transactions-info/no-transactions-info.module.ts similarity index 100% rename from apps/client/src/app/components/no-transactions-info/no-transactions-info.module.ts rename to libs/ui/src/lib/no-transactions-info/no-transactions-info.module.ts