Feature/add icon to asset profile dialog (#3240)
* Add asset profile icon * Update changelog
This commit is contained in:
parent
c10ae431a2
commit
4ae7e9fcbe
@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Added support to override the asset class of an asset profile in the asset profile details dialog of the admin control
|
- Added support to override the asset class of an asset profile in the asset profile details dialog of the admin control
|
||||||
- Added support to override the asset sub class of an asset profile in the asset profile details dialog of the admin control
|
- Added support to override the asset sub class of an asset profile in the asset profile details dialog of the admin control
|
||||||
- Added support to override the url of an asset profile in the asset profile details dialog of the admin control
|
- Added support to override the url of an asset profile in the asset profile details dialog of the admin control
|
||||||
|
- Added the asset profile icon to the asset profile details dialog of the admin control
|
||||||
- Extended the content of the _Self-Hosting_ section by the data providers on the Frequently Asked Questions (FAQ) page
|
- Extended the content of the _Self-Hosting_ section by the data providers on the Frequently Asked Questions (FAQ) page
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
@ -328,6 +328,7 @@ export class AdminMarketDataComponent
|
|||||||
data: <AssetProfileDialogParams>{
|
data: <AssetProfileDialogParams>{
|
||||||
dataSource,
|
dataSource,
|
||||||
symbol,
|
symbol,
|
||||||
|
colorScheme: this.user?.settings.colorScheme,
|
||||||
deviceType: this.deviceType,
|
deviceType: this.deviceType,
|
||||||
locale: this.user?.settings?.locale
|
locale: this.user?.settings?.locale
|
||||||
},
|
},
|
||||||
|
@ -157,34 +157,35 @@
|
|||||||
>Asset Sub Class</gf-value
|
>Asset Sub Class</gf-value
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<ng-container
|
@if (
|
||||||
*ngIf="
|
assetProfile?.countries?.length > 0 || assetProfile?.sectors?.length > 0
|
||||||
assetProfile?.countries?.length > 0 ||
|
) {
|
||||||
assetProfile?.sectors?.length > 0
|
|
||||||
"
|
|
||||||
>
|
|
||||||
@if (
|
@if (
|
||||||
assetProfile?.countries?.length === 1 &&
|
assetProfile?.countries?.length === 1 &&
|
||||||
assetProfile?.sectors?.length === 1
|
assetProfile?.sectors?.length === 1
|
||||||
) {
|
) {
|
||||||
<div *ngIf="assetProfile?.sectors?.length === 1" class="col-6 mb-3">
|
@if (assetProfile?.sectors?.length === 1) {
|
||||||
<gf-value
|
<div class="col-6 mb-3">
|
||||||
i18n
|
<gf-value
|
||||||
size="medium"
|
i18n
|
||||||
[locale]="data.locale"
|
size="medium"
|
||||||
[value]="assetProfile?.sectors[0].name"
|
[locale]="data.locale"
|
||||||
>Sector</gf-value
|
[value]="assetProfile?.sectors[0].name"
|
||||||
>
|
>Sector</gf-value
|
||||||
</div>
|
>
|
||||||
<div *ngIf="assetProfile?.countries?.length === 1" class="col-6 mb-3">
|
</div>
|
||||||
<gf-value
|
}
|
||||||
i18n
|
@if (assetProfile?.countries?.length === 1) {
|
||||||
size="medium"
|
<div class="col-6 mb-3">
|
||||||
[locale]="data.locale"
|
<gf-value
|
||||||
[value]="assetProfile?.countries[0].name"
|
i18n
|
||||||
>Country</gf-value
|
size="medium"
|
||||||
>
|
[locale]="data.locale"
|
||||||
</div>
|
[value]="assetProfile?.countries[0].name"
|
||||||
|
>Country</gf-value
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
} @else {
|
} @else {
|
||||||
<div class="col-md-6 mb-3">
|
<div class="col-md-6 mb-3">
|
||||||
<div class="h5" i18n>Sectors</div>
|
<div class="h5" i18n>Sectors</div>
|
||||||
@ -207,7 +208,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</ng-container>
|
}
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-3">
|
<div class="mt-3">
|
||||||
<mat-form-field appearance="outline" class="w-100 without-hint">
|
<mat-form-field appearance="outline" class="w-100 without-hint">
|
||||||
@ -215,15 +216,17 @@
|
|||||||
<input formControlName="name" matInput type="text" />
|
<input formControlName="name" matInput type="text" />
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="assetProfile?.dataSource === 'MANUAL'" class="mt-3">
|
@if (assetProfile?.dataSource === 'MANUAL') {
|
||||||
<mat-form-field appearance="outline" class="w-100 without-hint">
|
<div class="mt-3">
|
||||||
<mat-label i18n>Currency</mat-label>
|
<mat-form-field appearance="outline" class="w-100 without-hint">
|
||||||
<gf-currency-selector
|
<mat-label i18n>Currency</mat-label>
|
||||||
formControlName="currency"
|
<gf-currency-selector
|
||||||
[currencies]="currencies"
|
formControlName="currency"
|
||||||
/>
|
[currencies]="currencies"
|
||||||
</mat-form-field>
|
/>
|
||||||
</div>
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
<div class="mt-3">
|
<div class="mt-3">
|
||||||
<mat-form-field appearance="outline" class="w-100 without-hint">
|
<mat-form-field appearance="outline" class="w-100 without-hint">
|
||||||
<mat-label i18n>Asset Class</mat-label>
|
<mat-label i18n>Asset Class</mat-label>
|
||||||
@ -282,57 +285,66 @@
|
|||||||
></textarea>
|
></textarea>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="assetProfile?.dataSource === 'MANUAL'">
|
@if (assetProfile?.dataSource === 'MANUAL') {
|
||||||
<mat-form-field appearance="outline" class="w-100">
|
<div>
|
||||||
<mat-label i18n>Scraper Configuration</mat-label>
|
<mat-form-field appearance="outline" class="w-100">
|
||||||
<div class="align-items-end d-flex">
|
<mat-label i18n>Scraper Configuration</mat-label>
|
||||||
|
<div class="align-items-end d-flex">
|
||||||
|
<textarea
|
||||||
|
cdkTextareaAutosize
|
||||||
|
formControlName="scraperConfiguration"
|
||||||
|
matInput
|
||||||
|
type="text"
|
||||||
|
(keyup.enter)="$event.stopPropagation()"
|
||||||
|
></textarea>
|
||||||
|
<button
|
||||||
|
color="accent"
|
||||||
|
mat-flat-button
|
||||||
|
type="button"
|
||||||
|
[disabled]="
|
||||||
|
assetProfileForm.controls['scraperConfiguration'].value === '{}'
|
||||||
|
"
|
||||||
|
(click)="onTestMarketData()"
|
||||||
|
>
|
||||||
|
<ng-container i18n>Test</ng-container>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<mat-form-field appearance="outline" class="w-100">
|
||||||
|
<mat-label i18n>Sectors</mat-label>
|
||||||
<textarea
|
<textarea
|
||||||
cdkTextareaAutosize
|
cdkTextareaAutosize
|
||||||
formControlName="scraperConfiguration"
|
formControlName="sectors"
|
||||||
matInput
|
matInput
|
||||||
type="text"
|
type="text"
|
||||||
(keyup.enter)="$event.stopPropagation()"
|
|
||||||
></textarea>
|
></textarea>
|
||||||
<button
|
</mat-form-field>
|
||||||
color="accent"
|
</div>
|
||||||
mat-flat-button
|
<div>
|
||||||
type="button"
|
<mat-form-field appearance="outline" class="w-100">
|
||||||
[disabled]="
|
<mat-label i18n>Countries</mat-label>
|
||||||
assetProfileForm.controls['scraperConfiguration'].value === '{}'
|
<textarea
|
||||||
"
|
cdkTextareaAutosize
|
||||||
(click)="onTestMarketData()"
|
formControlName="countries"
|
||||||
>
|
matInput
|
||||||
<ng-container i18n>Test</ng-container>
|
type="text"
|
||||||
</button>
|
></textarea>
|
||||||
</div>
|
</mat-form-field>
|
||||||
</mat-form-field>
|
</div>
|
||||||
</div>
|
}
|
||||||
<div *ngIf="assetProfile?.dataSource === 'MANUAL'">
|
|
||||||
<mat-form-field appearance="outline" class="w-100">
|
|
||||||
<mat-label i18n>Sectors</mat-label>
|
|
||||||
<textarea
|
|
||||||
cdkTextareaAutosize
|
|
||||||
formControlName="sectors"
|
|
||||||
matInput
|
|
||||||
type="text"
|
|
||||||
></textarea>
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
<div *ngIf="assetProfile?.dataSource === 'MANUAL'">
|
|
||||||
<mat-form-field appearance="outline" class="w-100">
|
|
||||||
<mat-label i18n>Countries</mat-label>
|
|
||||||
<textarea
|
|
||||||
cdkTextareaAutosize
|
|
||||||
formControlName="countries"
|
|
||||||
matInput
|
|
||||||
type="text"
|
|
||||||
></textarea>
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
<div>
|
<div>
|
||||||
<mat-form-field appearance="outline" class="w-100 without-hint">
|
<mat-form-field appearance="outline" class="w-100 without-hint">
|
||||||
<mat-label i18n>Url</mat-label>
|
<mat-label i18n>Url</mat-label>
|
||||||
<input formControlName="url" matInput type="text" />
|
<input formControlName="url" matInput type="text" />
|
||||||
|
@if (assetProfileForm.controls['url'].value) {
|
||||||
|
<gf-symbol-icon
|
||||||
|
class="mr-3"
|
||||||
|
matSuffix
|
||||||
|
[url]="assetProfileForm.controls['url'].value"
|
||||||
|
/>
|
||||||
|
}
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-3">
|
<div class="mt-3">
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { GfAdminMarketDataDetailModule } from '@ghostfolio/client/components/admin-market-data-detail/admin-market-data-detail.module';
|
import { GfAdminMarketDataDetailModule } from '@ghostfolio/client/components/admin-market-data-detail/admin-market-data-detail.module';
|
||||||
import { AdminMarketDataService } from '@ghostfolio/client/components/admin-market-data/admin-market-data.service';
|
import { AdminMarketDataService } from '@ghostfolio/client/components/admin-market-data/admin-market-data.service';
|
||||||
|
import { GfSymbolIconModule } from '@ghostfolio/client/components/symbol-icon/symbol-icon.module';
|
||||||
import { GfCurrencySelectorModule } from '@ghostfolio/ui/currency-selector/currency-selector.module';
|
import { GfCurrencySelectorModule } from '@ghostfolio/ui/currency-selector/currency-selector.module';
|
||||||
import { GfPortfolioProportionChartModule } from '@ghostfolio/ui/portfolio-proportion-chart/portfolio-proportion-chart.module';
|
import { GfPortfolioProportionChartModule } from '@ghostfolio/ui/portfolio-proportion-chart/portfolio-proportion-chart.module';
|
||||||
import { GfValueModule } from '@ghostfolio/ui/value';
|
import { GfValueModule } from '@ghostfolio/ui/value';
|
||||||
@ -26,6 +27,7 @@ import { AssetProfileDialog } from './asset-profile-dialog.component';
|
|||||||
GfAdminMarketDataDetailModule,
|
GfAdminMarketDataDetailModule,
|
||||||
GfCurrencySelectorModule,
|
GfCurrencySelectorModule,
|
||||||
GfPortfolioProportionChartModule,
|
GfPortfolioProportionChartModule,
|
||||||
|
GfSymbolIconModule,
|
||||||
GfValueModule,
|
GfValueModule,
|
||||||
MatButtonModule,
|
MatButtonModule,
|
||||||
MatCheckboxModule,
|
MatCheckboxModule,
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
|
import { ColorScheme } from '@ghostfolio/common/types';
|
||||||
|
|
||||||
import { DataSource } from '@prisma/client';
|
import { DataSource } from '@prisma/client';
|
||||||
|
|
||||||
export interface AssetProfileDialogParams {
|
export interface AssetProfileDialogParams {
|
||||||
|
colorScheme: ColorScheme;
|
||||||
dataSource: DataSource;
|
dataSource: DataSource;
|
||||||
deviceType: string;
|
deviceType: string;
|
||||||
locale: string;
|
locale: string;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user