From 10940214a508835925bea9514ea1fda1ca3fe734 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Thu, 5 Oct 2023 20:27:39 +0200 Subject: [PATCH 01/10] Update OSS Friends (#2431) --- apps/client/src/assets/oss-friends.json | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/apps/client/src/assets/oss-friends.json b/apps/client/src/assets/oss-friends.json index 24c2d8586..d7d8e1506 100644 --- a/apps/client/src/assets/oss-friends.json +++ b/apps/client/src/assets/oss-friends.json @@ -1,11 +1,6 @@ { - "createdAt": "2023-09-25T08:15:38.055Z", + "createdAt": "2023-10-05T00:00:00.000Z", "data": [ - { - "name": "Appsmith", - "description": "Build build custom software on top of your data.", - "href": "https://www.appsmith.com" - }, { "name": "BoxyHQ", "description": "BoxyHQ’s suite of APIs for security and privacy helps engineering teams build and ship compliant cloud applications faster.", @@ -66,11 +61,6 @@ "description": "Mockoon is the easiest and quickest way to design and run mock REST APIs.", "href": "https://mockoon.com" }, - { - "name": "Novu", - "description": "The open-source notification infrastructure for developers. Simple components and APIs for managing all communication channels in one place.", - "href": "https://novu.co" - }, { "name": "OpenBB", "description": "Democratizing investment research through an open source financial ecosystem. The OpenBB Terminal allows everyone to perform investment research, from everywhere.", From 4af76f6f6d050feb18f837afb08e089beda11597 Mon Sep 17 00:00:00 2001 From: Vlad Prodan <46872670+virus231@users.noreply.github.com> Date: Thu, 5 Oct 2023 20:29:34 +0200 Subject: [PATCH 02/10] Fix hasNotDefinedValuesInObject() in object.helper.ts (#2421) --- apps/api/src/helper/object.helper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api/src/helper/object.helper.ts b/apps/api/src/helper/object.helper.ts index 50a4f2b12..2f0399fb8 100644 --- a/apps/api/src/helper/object.helper.ts +++ b/apps/api/src/helper/object.helper.ts @@ -3,7 +3,7 @@ import { cloneDeep, isArray, isObject } from 'lodash'; export function hasNotDefinedValuesInObject(aObject: Object): boolean { for (const key in aObject) { - if (aObject[key] === null || aObject[key] === null) { + if (aObject[key] === null || aObject[key] === undefined) { return true; } else if (isObject(aObject[key])) { return hasNotDefinedValuesInObject(aObject[key]); From 8ad64924779dbef9e5e087f39d56503c8f2f7873 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Thu, 5 Oct 2023 20:31:00 +0200 Subject: [PATCH 03/10] Feature/various improvements in client (#2434) * Various improvements * Update changelog --- CHANGELOG.md | 4 ++++ apps/client/src/app/app.module.ts | 5 +++-- .../src/app/components/admin-overview/admin-overview.html | 4 ++-- .../src/app/components/header/header.component.html | 2 +- .../src/app/components/home-market/home-market.html | 4 ++-- .../portfolio-performance/portfolio-performance.module.ts | 5 +++-- .../position-detail-dialog/position-detail-dialog.html | 8 ++++---- .../import-activities-dialog.html | 2 +- apps/client/src/app/pages/public/public-page.html | 2 +- .../app/pages/user-account/user-account-page.module.ts | 5 +++-- 10 files changed, 24 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49419da3c..41fa38bc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added the application version to the endpoint `GET api/v1/admin` +### Fixed + +- Fixed the style of the active features page in the navigation on desktop + ## 2.8.0 - 2023-10-03 ### Added diff --git a/apps/client/src/app/app.module.ts b/apps/client/src/app/app.module.ts index a5f0d755c..608ba0100 100644 --- a/apps/client/src/app/app.module.ts +++ b/apps/client/src/app/app.module.ts @@ -1,6 +1,6 @@ import { Platform } from '@angular/cdk/platform'; import { HttpClientModule } from '@angular/common/http'; -import { NgModule } from '@angular/core'; +import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { MatAutocompleteModule } from '@angular/material/autocomplete'; import { MatChipsModule } from '@angular/material/chips'; import { @@ -35,6 +35,7 @@ export function NgxStripeFactory(): string { } @NgModule({ + bootstrap: [AppComponent], declarations: [AppComponent], imports: [ AppRoutingModule, @@ -72,6 +73,6 @@ export function NgxStripeFactory(): string { useFactory: NgxStripeFactory } ], - bootstrap: [AppComponent] + schemas: [CUSTOM_ELEMENTS_SCHEMA] }) export class AppModule {} diff --git a/apps/client/src/app/components/admin-overview/admin-overview.html b/apps/client/src/app/components/admin-overview/admin-overview.html index 2739547b5..e54f8f27b 100644 --- a/apps/client/src/app/components/admin-overview/admin-overview.html +++ b/apps/client/src/app/components/admin-overview/admin-overview.html @@ -11,8 +11,8 @@
User Count
@@ -21,8 +21,8 @@
Activity Count
diff --git a/apps/client/src/app/components/header/header.component.html b/apps/client/src/app/components/header/header.component.html index 2c56cb742..a2c69245c 100644 --- a/apps/client/src/app/components/header/header.component.html +++ b/apps/client/src/app/components/header/header.component.html @@ -272,7 +272,7 @@ mat-flat-button [ngClass]="{ 'font-weight-bold': currentRoute === routeFeatures, - 'text-decoration-underline': currentRoute === routeFeatuers + 'text-decoration-underline': currentRoute === routeFeatures }" [routerLink]="routerLinkFeatures" >Features
Sectors
@@ -225,11 +225,11 @@
Countries
diff --git a/apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.html b/apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.html index 06cadad8e..eab62642a 100644 --- a/apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.html +++ b/apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.html @@ -8,7 +8,7 @@
diff --git a/apps/client/src/app/pages/user-account/user-account-page.module.ts b/apps/client/src/app/pages/user-account/user-account-page.module.ts index 3c6670af4..5ec767170 100644 --- a/apps/client/src/app/pages/user-account/user-account-page.module.ts +++ b/apps/client/src/app/pages/user-account/user-account-page.module.ts @@ -1,5 +1,5 @@ import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; +import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { MatTabsModule } from '@angular/material/tabs'; import { GfUserAccountAccessModule } from '@ghostfolio/client/components/user-account-access/user-account-access.module'; import { GfUserAccountMembershipModule } from '@ghostfolio/client/components/user-account-membership/user-account-membership.module'; @@ -17,6 +17,7 @@ import { UserAccountPageComponent } from './user-account-page.component'; GfUserAccountSettingsModule, MatTabsModule, UserAccountPageRoutingModule - ] + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] }) export class UserAccountPageModule {} From 727340748bca074238e207e1b3a2688df396c0d2 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Thu, 5 Oct 2023 20:40:31 +0200 Subject: [PATCH 04/10] Clean up imports (#2411) --- .../asset-profile-dialog/asset-profile-dialog.component.ts | 1 - apps/client/src/app/services/data.service.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts index bef984729..792025e9b 100644 --- a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts +++ b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts @@ -13,7 +13,6 @@ import { AdminService } from '@ghostfolio/client/services/admin.service'; import { DataService } from '@ghostfolio/client/services/data.service'; import { AdminMarketDataDetails, - ScraperConfiguration, UniqueAsset } from '@ghostfolio/common/interfaces'; import { translate } from '@ghostfolio/ui/i18n'; diff --git a/apps/client/src/app/services/data.service.ts b/apps/client/src/app/services/data.service.ts index 5cc955af2..62845eda1 100644 --- a/apps/client/src/app/services/data.service.ts +++ b/apps/client/src/app/services/data.service.ts @@ -36,7 +36,6 @@ import { } from '@ghostfolio/common/interfaces'; import { filterGlobalPermissions } from '@ghostfolio/common/permissions'; import { AccountWithValue, DateRange, GroupBy } from '@ghostfolio/common/types'; -import { translate } from '@ghostfolio/ui/i18n'; import { DataSource, Order as OrderModel } from '@prisma/client'; import { format, parseISO } from 'date-fns'; import { cloneDeep, groupBy, isNumber } from 'lodash'; From 25112a450b1b9c1653f43c198e7bee23b4745adb Mon Sep 17 00:00:00 2001 From: Arshad Jamal Date: Fri, 6 Oct 2023 00:12:35 +0530 Subject: [PATCH 05/10] Add support for comment in csv import (#2416) * Add support for comment in csv import (activities) * Update changelog --- CHANGELOG.md | 1 + .../app/services/import-activities.service.ts | 16 ++++++++++++++++ test/import/ok.csv | 4 ++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41fa38bc8..d03655ff8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Added support for notes in the activities import - Added the application version to the endpoint `GET api/v1/admin` ### Fixed diff --git a/apps/client/src/app/services/import-activities.service.ts b/apps/client/src/app/services/import-activities.service.ts index 808081bea..0a58e3cdd 100644 --- a/apps/client/src/app/services/import-activities.service.ts +++ b/apps/client/src/app/services/import-activities.service.ts @@ -15,6 +15,7 @@ import { catchError } from 'rxjs/operators'; }) export class ImportActivitiesService { private static ACCOUNT_KEYS = ['account', 'accountid']; + private static COMMENT_KEYS = ['comment', 'note']; private static CURRENCY_KEYS = ['ccy', 'currency', 'currencyprimary']; private static DATA_SOURCE_KEYS = ['datasource']; private static DATE_KEYS = ['date', 'tradedate']; @@ -52,6 +53,7 @@ export class ImportActivitiesService { for (const [index, item] of content.entries()) { activities.push({ accountId: this.parseAccount({ item, userAccounts }), + comment: this.parseComment({ item }), currency: this.parseCurrency({ content, index, item }), dataSource: this.parseDataSource({ item }), date: this.parseDate({ content, index, item }), @@ -122,6 +124,7 @@ export class ImportActivitiesService { private convertToCreateOrderDto({ accountId, + comment, date, fee, quantity, @@ -132,6 +135,7 @@ export class ImportActivitiesService { }: Activity): CreateOrderDto { return { accountId, + comment, fee, quantity, type, @@ -174,6 +178,18 @@ export class ImportActivitiesService { return undefined; } + private parseComment({ item }: { item: any }) { + item = this.lowercaseKeys(item); + + for (const key of ImportActivitiesService.COMMENT_KEYS) { + if (item[key]) { + return item[key]; + } + } + + return undefined; + } + private parseCurrency({ content, index, diff --git a/test/import/ok.csv b/test/import/ok.csv index 732ab4699..9f1f1c768 100644 --- a/test/import/ok.csv +++ b/test/import/ok.csv @@ -1,5 +1,5 @@ -Date,Code,Currency,Price,Quantity,Action,Fee -16-09-2021,MSFT,USD,298.580,5,buy,19.00 +Date,Code,Currency,Price,Quantity,Action,Fee,Note +16-09-2021,MSFT,USD,298.580,5,buy,19.00,My first order 🤓 17/11/2021,MSFT,USD,0.62,5,dividend,0.00 01.01.2022,Penthouse Apartment,USD,500000.0,1,item,0.00 20500606,MSFT,USD,0.00,0,buy,0.00 From 02b433eb1e8a97d4df7210800a27039a98df33cd Mon Sep 17 00:00:00 2001 From: Anirudh Sudhir <137381184+anirudhsudhir@users.noreply.github.com> Date: Fri, 6 Oct 2023 00:32:35 +0530 Subject: [PATCH 06/10] Prevent empty form submission in account dialog (#2428) * Prevent empty form submission in account dialog --- .../create-or-update-account-dialog.html | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.html b/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.html index 69972c7db..2d068dde1 100644 --- a/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.html +++ b/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.html @@ -10,7 +10,11 @@
Name - +
@@ -26,7 +30,12 @@
Cash Balance - + {{ data.account.currency }}
@@ -66,7 +75,7 @@
- + + +
+ +
+ + diff --git a/libs/ui/src/lib/carousel/carousel.component.scss b/libs/ui/src/lib/carousel/carousel.component.scss new file mode 100644 index 000000000..38da7c100 --- /dev/null +++ b/libs/ui/src/lib/carousel/carousel.component.scss @@ -0,0 +1,34 @@ +:host { + display: block; + position: relative; + + ::ng-deep { + [gf-carousel-item] { + flex-shrink: 0; + width: 100%; + } + } + + button { + top: 50%; + transform: translateY(-50%); + + &.carousel-nav-prev { + left: -50px; + } + + &.carousel-nav-next { + right: -50px; + } + } + + .carousel-content { + flex-direction: row; + outline: none; + transition: transform 0.5s ease-in-out; + + .animations-disabled & { + transition: none; + } + } +} diff --git a/libs/ui/src/lib/carousel/carousel.component.ts b/libs/ui/src/lib/carousel/carousel.component.ts new file mode 100644 index 000000000..a0eb0f8a1 --- /dev/null +++ b/libs/ui/src/lib/carousel/carousel.component.ts @@ -0,0 +1,147 @@ +import { FocusKeyManager } from '@angular/cdk/a11y'; +import { LEFT_ARROW, RIGHT_ARROW, TAB } from '@angular/cdk/keycodes'; +import { + AfterContentInit, + ChangeDetectionStrategy, + Component, + ContentChildren, + ElementRef, + HostBinding, + Inject, + Input, + Optional, + QueryList, + ViewChild +} from '@angular/core'; +import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations'; + +import { CarouselItem } from './carousel-item.directive'; + +@Component({ + changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'gf-carousel', + styleUrls: ['./carousel.component.scss'], + templateUrl: './carousel.component.html' +}) +export class CarouselComponent implements AfterContentInit { + @ContentChildren(CarouselItem) public items!: QueryList; + + @HostBinding('class.animations-disabled') + public readonly animationsDisabled: boolean; + + @Input('aria-label') public ariaLabel: string | undefined; + + @ViewChild('list') public list!: ElementRef; + + public showPrevArrow = false; + public showNextArrow = true; + + private index = 0; + private keyManager!: FocusKeyManager; + private position = 0; + + public constructor( + @Optional() @Inject(ANIMATION_MODULE_TYPE) animationsModule?: string + ) { + this.animationsDisabled = animationsModule === 'NoopAnimations'; + } + + public ngAfterContentInit() { + this.keyManager = new FocusKeyManager(this.items); + } + + public next() { + for (let i = this.index; i < this.items.length; i++) { + if (this.isOutOfView(i)) { + this.index = i; + this.scrollToActiveItem(); + break; + } + } + } + + public onKeydown({ keyCode }: KeyboardEvent) { + const manager = this.keyManager; + const previousActiveIndex = manager.activeItemIndex; + + if (keyCode === LEFT_ARROW) { + manager.setPreviousItemActive(); + } else if (keyCode === RIGHT_ARROW) { + manager.setNextItemActive(); + } else if (keyCode === TAB && !manager.activeItem) { + manager.setFirstItemActive(); + } + + if ( + manager.activeItemIndex != null && + manager.activeItemIndex !== previousActiveIndex + ) { + this.index = manager.activeItemIndex; + this.updateItemTabIndices(); + + if (this.isOutOfView(this.index)) { + this.scrollToActiveItem(); + } + } + } + + public previous() { + for (let i = this.index; i > -1; i--) { + if (this.isOutOfView(i)) { + this.index = i; + this.scrollToActiveItem(); + break; + } + } + } + + private isOutOfView(index: number, side?: 'start' | 'end') { + const { offsetWidth, offsetLeft } = + this.items.toArray()[index].element.nativeElement; + + if ((!side || side === 'start') && offsetLeft - this.position < 0) { + return true; + } + + return ( + (!side || side === 'end') && + offsetWidth + offsetLeft - this.position > + this.list.nativeElement.clientWidth + ); + } + + private scrollToActiveItem() { + if (!this.isOutOfView(this.index)) { + return; + } + + const itemsArray = this.items.toArray(); + let targetItemIndex = this.index; + + if (this.index > 0 && !this.isOutOfView(this.index - 1)) { + targetItemIndex = + itemsArray.findIndex((_, i) => !this.isOutOfView(i)) + 1; + } + + this.position = + itemsArray[targetItemIndex].element.nativeElement.offsetLeft; + this.list.nativeElement.style.transform = `translateX(-${this.position}px)`; + this.showPrevArrow = this.index > 0; + this.showNextArrow = false; + + for (let i = itemsArray.length - 1; i > -1; i--) { + if (this.isOutOfView(i, 'end')) { + this.showNextArrow = true; + break; + } + } + } + + private updateItemTabIndices() { + this.items.forEach((item: CarouselItem) => { + if (this.keyManager != null) { + item.tabindex = item === this.keyManager.activeItem ? '0' : '-1'; + } + }); + } +} diff --git a/libs/ui/src/lib/carousel/carousel.module.ts b/libs/ui/src/lib/carousel/carousel.module.ts new file mode 100644 index 000000000..4e43f23b0 --- /dev/null +++ b/libs/ui/src/lib/carousel/carousel.module.ts @@ -0,0 +1,14 @@ +import { CommonModule } from '@angular/common'; +import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; + +import { CarouselItem } from './carousel-item.directive'; +import { CarouselComponent } from './carousel.component'; + +@NgModule({ + declarations: [CarouselComponent, CarouselItem], + exports: [CarouselComponent, CarouselItem], + imports: [CommonModule, MatButtonModule], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}) +export class GfCarouselModule {} diff --git a/libs/ui/src/lib/carousel/index.ts b/libs/ui/src/lib/carousel/index.ts new file mode 100644 index 000000000..2e039a80b --- /dev/null +++ b/libs/ui/src/lib/carousel/index.ts @@ -0,0 +1 @@ +export * from './carousel.module'; From 08d696ce336b14d73f0e4fb90c793fe36e396f77 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 7 Oct 2023 08:44:51 +0200 Subject: [PATCH 08/10] Align ok.json with ok.csv (#2439) --- test/import/ok.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/import/ok.json b/test/import/ok.json index e488c4dc4..8803c9d08 100644 --- a/test/import/ok.json +++ b/test/import/ok.json @@ -52,7 +52,7 @@ }, { "accountId": "b2d3fe1d-d6a8-41a3-be39-07ef5e9480f0", - "comment": "My first order", + "comment": "My first order 🤓", "fee": 19, "quantity": 5, "type": "BUY", From fda4e0ea7d85ea196e7bfe939b24506e1c437251 Mon Sep 17 00:00:00 2001 From: Akshay Wadatkar Date: Sat, 7 Oct 2023 12:41:32 +0530 Subject: [PATCH 09/10] Use application version from API endpoint in Admin Control panel (#2427) * Use application version from API endpoint --------- Co-authored-by: Thomas <4159106+dtslvr@users.noreply.github.com> --- .../admin-overview.component.ts | 23 +++++++++++-------- .../admin-overview/admin-overview.html | 4 +++- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/apps/client/src/app/components/admin-overview/admin-overview.component.ts b/apps/client/src/app/components/admin-overview/admin-overview.component.ts index 2ca3f0724..b1e91dfc9 100644 --- a/apps/client/src/app/components/admin-overview/admin-overview.component.ts +++ b/apps/client/src/app/components/admin-overview/admin-overview.component.ts @@ -43,7 +43,7 @@ export class AdminOverviewComponent implements OnDestroy, OnInit { public transactionCount: number; public userCount: number; public user: User; - public version = environment.version; + public version: string; private unsubscribeSubject = new Subject(); @@ -204,15 +204,18 @@ export class AdminOverviewComponent implements OnDestroy, OnInit { this.adminService .fetchAdminData() .pipe(takeUntil(this.unsubscribeSubject)) - .subscribe(({ exchangeRates, settings, transactionCount, userCount }) => { - this.coupons = (settings[PROPERTY_COUPONS] as Coupon[]) ?? []; - this.customCurrencies = settings[PROPERTY_CURRENCIES] as string[]; - this.exchangeRates = exchangeRates; - this.transactionCount = transactionCount; - this.userCount = userCount; - - this.changeDetectorRef.markForCheck(); - }); + .subscribe( + ({ exchangeRates, settings, transactionCount, userCount, version }) => { + this.coupons = (settings[PROPERTY_COUPONS] as Coupon[]) ?? []; + this.customCurrencies = settings[PROPERTY_CURRENCIES] as string[]; + this.exchangeRates = exchangeRates; + this.transactionCount = transactionCount; + this.userCount = userCount; + this.version = version; + + this.changeDetectorRef.markForCheck(); + } + ); } private generateCouponCode(aLength: number) { diff --git a/apps/client/src/app/components/admin-overview/admin-overview.html b/apps/client/src/app/components/admin-overview/admin-overview.html index e54f8f27b..47f27dd40 100644 --- a/apps/client/src/app/components/admin-overview/admin-overview.html +++ b/apps/client/src/app/components/admin-overview/admin-overview.html @@ -5,7 +5,9 @@
Version
-
{{ version }}
+
+ +
User Count
From d40bc5070ac3a87447cbd3c2df4ca2459b637734 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 7 Oct 2023 09:15:54 +0200 Subject: [PATCH 10/10] Feature/remove permission to markets overview on home page (#2441) * Remove show condition for markets overview * Update changelog --- CHANGELOG.md | 4 ++++ .../app/components/home-market/home-market.html | 2 +- .../src/app/pages/home/home-page.component.ts | 14 +------------- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40c7e843e..17ff05e89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added the application version to the endpoint `GET api/v1/admin` - Introduced a carousel component for the testimonial section on the landing page +### Changed + +- Displayed the link to the markets overview on the home page without any permission + ### Fixed - Fixed the style of the active features page in the navigation on desktop 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 43f560d85..7ce07b6e9 100644 --- a/apps/client/src/app/components/home-market/home-market.html +++ b/apps/client/src/app/components/home-market/home-market.html @@ -1,6 +1,6 @@

Markets

-
+
Last {{ numberOfDays }} Days diff --git a/apps/client/src/app/pages/home/home-page.component.ts b/apps/client/src/app/pages/home/home-page.component.ts index a39a371c4..fea8e9ac3 100644 --- a/apps/client/src/app/pages/home/home-page.component.ts +++ b/apps/client/src/app/pages/home/home-page.component.ts @@ -1,8 +1,6 @@ import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core'; -import { DataService } from '@ghostfolio/client/services/data.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; import { TabConfiguration, User } from '@ghostfolio/common/interfaces'; -import { hasPermission, permissions } from '@ghostfolio/common/permissions'; import { DeviceDetectorService } from 'ngx-device-detector'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; @@ -15,7 +13,6 @@ import { takeUntil } from 'rxjs/operators'; }) export class HomePageComponent implements OnDestroy, OnInit { public deviceType: string; - public hasPermissionToAccessFearAndGreedIndex: boolean; public tabs: TabConfiguration[] = []; public user: User; @@ -23,17 +20,9 @@ export class HomePageComponent implements OnDestroy, OnInit { public constructor( private changeDetectorRef: ChangeDetectorRef, - private dataService: DataService, private deviceService: DeviceDetectorService, private userService: UserService ) { - const { globalPermissions } = this.dataService.fetchInfo(); - - this.hasPermissionToAccessFearAndGreedIndex = hasPermission( - globalPermissions, - permissions.enableFearAndGreedIndex - ); - this.userService.stateChanged .pipe(takeUntil(this.unsubscribeSubject)) .subscribe((state) => { @@ -57,8 +46,7 @@ export class HomePageComponent implements OnDestroy, OnInit { { iconName: 'newspaper-outline', label: $localize`Markets`, - path: ['/home', 'market'], - showCondition: this.hasPermissionToAccessFearAndGreedIndex + path: ['/home', 'market'] } ]; this.user = state.user;