Browse Source

Merge branch 'main' into feature/migrate-value-component-to-control-flow

pull/4592/head
Thomas Kaul 4 months ago
committed by GitHub
parent
commit
5c8f32e4fd
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 23
      apps/api/src/services/data-provider/data-provider.service.ts
  3. 86
      libs/ui/src/lib/assistant/assistant.html

1
CHANGELOG.md

@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Renamed `User` to `user` in the `Subscription` database schema - Renamed `User` to `user` in the `Subscription` database schema
- Migrated the `@ghostfolio/ui/assistant` component to control flow
- Migrated the `@ghostfolio/ui/value` component to control flow - Migrated the `@ghostfolio/ui/value` component to control flow
### Fixed ### Fixed

23
apps/api/src/services/data-provider/data-provider.service.ts

@ -18,6 +18,7 @@ import {
DATE_FORMAT, DATE_FORMAT,
getCurrencyFromSymbol, getCurrencyFromSymbol,
getStartOfUtcDate, getStartOfUtcDate,
isCurrency,
isDerivedCurrency isDerivedCurrency
} from '@ghostfolio/common/helper'; } from '@ghostfolio/common/helper';
import { import {
@ -468,17 +469,21 @@ export class DataProviderService {
)) { )) {
const dataProvider = this.getDataProvider(DataSource[dataSource]); const dataProvider = this.getDataProvider(DataSource[dataSource]);
if (
dataProvider.getDataProviderInfo().isPremium &&
this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION') &&
user?.subscription.type === 'Basic'
) {
continue;
}
const symbols = assetProfileIdentifiers const symbols = assetProfileIdentifiers
.filter(({ symbol }) => { .filter(({ symbol }) => {
return !isDerivedCurrency(getCurrencyFromSymbol(symbol)); if (isCurrency(getCurrencyFromSymbol(symbol))) {
// Keep non-derived currencies
return !isDerivedCurrency(getCurrencyFromSymbol(symbol));
} else if (
dataProvider.getDataProviderInfo().isPremium &&
this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION') &&
user?.subscription.type === 'Basic'
) {
// Skip symbols of Premium data providers for users without subscription
return false;
}
return true;
}) })
.map(({ symbol }) => { .map(({ symbol }) => {
return symbol; return symbol;

86
libs/ui/src/lib/assistant/assistant.html

@ -15,28 +15,26 @@
[formControl]="searchFormControl" [formControl]="searchFormControl"
[placeholder]="placeholder" [placeholder]="placeholder"
/> />
<div @if (deviceType !== 'mobile' && !searchFormControl.value) {
*ngIf="deviceType !== 'mobile' && !searchFormControl.value" <div class="hot-key-hint mx-1 px-1">/</div>
class="hot-key-hint mx-1 px-1" }
> @if (searchFormControl.value) {
/ <button
</div> class="h-100 no-min-width px-3 rounded-0"
<button mat-button
*ngIf="searchFormControl.value" (click)="initialize()"
class="h-100 no-min-width px-3 rounded-0" >
mat-button <ion-icon class="m-0" name="close-circle-outline" />
(click)="initialize()" </button>
> } @else {
<ion-icon class="m-0" name="close-circle-outline" /> <button
</button> class="h-100 no-min-width px-3 rounded-0"
<button mat-button
*ngIf="!searchFormControl.value" (click)="onCloseAssistant()"
class="h-100 no-min-width px-3 rounded-0" >
mat-button <ion-icon class="m-0" name="close-outline" />
(click)="onCloseAssistant()" </button>
> }
<ion-icon class="m-0" name="close-outline" />
</button>
</div> </div>
<div <div
*ngIf="isLoading || searchFormControl.value" *ngIf="isLoading || searchFormControl.value"
@ -51,16 +49,18 @@
(clicked)="onCloseAssistant()" (clicked)="onCloseAssistant()"
/> />
<ng-container *ngIf="searchResults?.holdings?.length === 0"> <ng-container *ngIf="searchResults?.holdings?.length === 0">
<ngx-skeleton-loader @if (isLoading) {
*ngIf="isLoading" <ngx-skeleton-loader
animation="pulse" animation="pulse"
class="mx-2" class="mx-2"
[theme]="{ [theme]="{
height: '1.5rem', height: '1.5rem',
width: '100%' width: '100%'
}" }"
/> />
<div *ngIf="!isLoading" class="px-2 py-1" i18n>No entries...</div> } @else {
<div class="px-2 py-1" i18n>No entries...</div>
}
</ng-container> </ng-container>
</div> </div>
<div *ngIf="hasPermissionToAccessAdminControl" class="mt-3"> <div *ngIf="hasPermissionToAccessAdminControl" class="mt-3">
@ -72,16 +72,18 @@
(clicked)="onCloseAssistant()" (clicked)="onCloseAssistant()"
/> />
<ng-container *ngIf="searchResults?.assetProfiles?.length === 0"> <ng-container *ngIf="searchResults?.assetProfiles?.length === 0">
<ngx-skeleton-loader @if (isLoading) {
*ngIf="isLoading" <ngx-skeleton-loader
animation="pulse" animation="pulse"
class="mx-2" class="mx-2"
[theme]="{ [theme]="{
height: '1.5rem', height: '1.5rem',
width: '100%' width: '100%'
}" }"
/> />
<div *ngIf="!isLoading" class="px-2 py-1" i18n>No entries...</div> } @else {
<div class="px-2 py-1" i18n>No entries...</div>
}
</ng-container> </ng-container>
</div> </div>
</div> </div>

Loading…
Cancel
Save