From f127e7c61a64f9d6807bd8afb8e8db1c4cc68436 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Tue, 9 Aug 2022 19:28:13 +0200 Subject: [PATCH 1/2] Feature/improve styling of benchmarks (#1131) * Harmonize benchmark table styling * Update changelog --- CHANGELOG.md | 1 + .../components/home-market/home-market.html | 1 + .../lib/benchmark/benchmark.component.html | 98 +++++++++---------- .../src/lib/benchmark/benchmark.component.ts | 1 + libs/ui/src/lib/benchmark/benchmark.module.ts | 8 +- 5 files changed, 59 insertions(+), 50 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bd17aead..32bce2498 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Simplified the initialization of the exchange rate service +- Improved the styling of the benchmarks in the markets overview ## 1.177.0 - 04.08.2022 diff --git a/apps/client/src/app/components/home-market/home-market.html b/apps/client/src/app/components/home-market/home-market.html index e8cf52bee..b0a01a43c 100644 --- a/apps/client/src/app/components/home-market/home-market.html +++ b/apps/client/src/app/components/home-market/home-market.html @@ -34,6 +34,7 @@ - - - Index - - Change from All Time High - from ATH - - - - - - - -
- {{ benchmark.name }} -
- - - - - -
- {{ resolveMarketCondition(benchmark.marketCondition).emoji }} -
- - - + + + + + + + + + + + + + + + + + +
Index + {{ element?.name }} + + Change from All Time High + from ATH + + + +
+ {{ resolveMarketCondition(element.marketCondition).emoji }} +
+
diff --git a/libs/ui/src/lib/benchmark/benchmark.component.ts b/libs/ui/src/lib/benchmark/benchmark.component.ts index c1e35f438..a5c117c24 100644 --- a/libs/ui/src/lib/benchmark/benchmark.component.ts +++ b/libs/ui/src/lib/benchmark/benchmark.component.ts @@ -18,6 +18,7 @@ export class BenchmarkComponent implements OnChanges { @Input() benchmarks: Benchmark[]; @Input() locale: string; + public displayedColumns = ['name', 'change', 'marketCondition']; public resolveMarketCondition = resolveMarketCondition; public constructor() {} diff --git a/libs/ui/src/lib/benchmark/benchmark.module.ts b/libs/ui/src/lib/benchmark/benchmark.module.ts index 3a0eeb5dd..1768aa39f 100644 --- a/libs/ui/src/lib/benchmark/benchmark.module.ts +++ b/libs/ui/src/lib/benchmark/benchmark.module.ts @@ -1,5 +1,6 @@ import { CommonModule } from '@angular/common'; import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; +import { MatTableModule } from '@angular/material/table'; import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; import { GfValueModule } from '../value'; @@ -8,7 +9,12 @@ import { BenchmarkComponent } from './benchmark.component'; @NgModule({ declarations: [BenchmarkComponent], exports: [BenchmarkComponent], - imports: [CommonModule, GfValueModule, NgxSkeletonLoaderModule], + imports: [ + CommonModule, + GfValueModule, + MatTableModule, + NgxSkeletonLoaderModule + ], schemas: [CUSTOM_ELEMENTS_SCHEMA] }) export class GfBenchmarkModule {} From dbc38e705e3474bb4e1617e438a87fdea8f472e3 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Tue, 9 Aug 2022 19:29:26 +0200 Subject: [PATCH 2/2] Feature/add url to symbol profile overrides (#1132) * Add url to symbol profile overrides * Improve filter by asset class * Update changelog --- CHANGELOG.md | 9 +++++++++ apps/api/src/app/order/order.service.ts | 2 +- apps/api/src/services/symbol-profile.service.ts | 13 ++++++++++--- .../migration.sql | 2 ++ prisma/schema.prisma | 1 + 5 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 prisma/migrations/20220808181846_added_url_to_symbol_profile_overrides/migration.sql diff --git a/CHANGELOG.md b/CHANGELOG.md index 32bce2498..90bb3a275 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Added + +- Added `url` to the symbol profile overrides model for manual adjustments + ### Changed - Simplified the initialization of the exchange rate service +- Improved the orders query for `assetClass` with symbol profile overrides - Improved the styling of the benchmarks in the markets overview +### Todo + +- Apply data migration (`yarn database:migrate`) + ## 1.177.0 - 04.08.2022 ### Added diff --git a/apps/api/src/app/order/order.service.ts b/apps/api/src/app/order/order.service.ts index 6b12bd723..3f2a84200 100644 --- a/apps/api/src/app/order/order.service.ts +++ b/apps/api/src/app/order/order.service.ts @@ -231,7 +231,7 @@ export class OrderService { }, { SymbolProfileOverrides: { - is: null + assetClass: null } } ] diff --git a/apps/api/src/services/symbol-profile.service.ts b/apps/api/src/services/symbol-profile.service.ts index c91da6d61..1c8da554c 100644 --- a/apps/api/src/services/symbol-profile.service.ts +++ b/apps/api/src/services/symbol-profile.service.ts @@ -115,9 +115,16 @@ export class SymbolProfileService { } item.name = item.SymbolProfileOverrides?.name ?? item.name; - item.sectors = - (item.SymbolProfileOverrides.sectors as unknown as Sector[]) ?? - item.sectors; + + if ( + (item.SymbolProfileOverrides.sectors as unknown as Sector[])?.length > + 0 + ) { + item.sectors = item.SymbolProfileOverrides + .sectors as unknown as Sector[]; + } + + item.url = item.SymbolProfileOverrides?.url ?? item.url; delete item.SymbolProfileOverrides; } diff --git a/prisma/migrations/20220808181846_added_url_to_symbol_profile_overrides/migration.sql b/prisma/migrations/20220808181846_added_url_to_symbol_profile_overrides/migration.sql new file mode 100644 index 000000000..288287406 --- /dev/null +++ b/prisma/migrations/20220808181846_added_url_to_symbol_profile_overrides/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "SymbolProfileOverrides" ADD COLUMN "url" TEXT; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 6eb2919ac..12eb5690d 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -136,6 +136,7 @@ model SymbolProfileOverrides { countries Json? name String? sectors Json? + url String? symbolProfileId String @id updatedAt DateTime @updatedAt SymbolProfile SymbolProfile @relation(fields: [symbolProfileId], references: [id])