From 83e2b000bb732ca4bc2ed577f4684d19e04790d7 Mon Sep 17 00:00:00 2001
From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com>
Date: Sat, 6 Apr 2024 13:01:49 +0200
Subject: [PATCH] Refactor symbol icon module to asset profile icon component
---
.../accounts-table/accounts-table.component.html | 4 ++--
.../accounts-table/accounts-table.module.ts | 4 ++--
.../asset-profile-dialog/asset-profile-dialog.html | 2 +-
.../asset-profile-dialog.module.ts | 4 ++--
.../admin-platform/admin-platform.component.html | 2 +-
.../admin-platform/admin-platform.module.ts | 4 ++--
.../create-or-update-platform-dialog.html | 6 +++++-
.../create-or-update-platform-dialog.module.ts | 4 ++--
.../asset-profile-icon.component.html | 8 ++++++++
.../asset-profile-icon.component.scss} | 0
.../asset-profile-icon.component.ts} | 13 +++++++++----
.../symbol-icon/symbol-icon.component.html | 7 -------
.../components/symbol-icon/symbol-icon.module.ts | 12 ------------
.../create-or-update-account-dialog.html | 2 +-
.../create-or-update-account-dialog.module.ts | 4 ++--
.../transfer-balance/transfer-balance-dialog.html | 4 ++--
.../transfer-balance-dialog.module.ts | 4 ++--
.../create-or-update-activity-dialog.html | 2 +-
.../create-or-update-activity-dialog.module.ts | 4 ++--
.../activities-table.component.html | 4 ++--
.../lib/activities-table/activities-table.module.ts | 4 ++--
libs/ui/src/lib/assistant/assistant.html | 2 +-
libs/ui/src/lib/assistant/assistant.module.ts | 4 ++--
.../holdings-table/holdings-table.component.html | 2 +-
.../src/lib/holdings-table/holdings-table.module.ts | 4 ++--
25 files changed, 54 insertions(+), 56 deletions(-)
create mode 100644 apps/client/src/app/components/asset-profile-icon/asset-profile-icon.component.html
rename apps/client/src/app/components/{symbol-icon/symbol-icon.component.scss => asset-profile-icon/asset-profile-icon.component.scss} (100%)
rename apps/client/src/app/components/{symbol-icon/symbol-icon.component.ts => asset-profile-icon/asset-profile-icon.component.ts} (63%)
delete mode 100644 apps/client/src/app/components/symbol-icon/symbol-icon.component.html
delete mode 100644 apps/client/src/app/components/symbol-icon/symbol-icon.module.ts
diff --git a/apps/client/src/app/components/accounts-table/accounts-table.component.html b/apps/client/src/app/components/accounts-table/accounts-table.component.html
index cd4f139c4..241b5d90a 100644
--- a/apps/client/src/app/components/accounts-table/accounts-table.component.html
+++ b/apps/client/src/app/components/accounts-table/accounts-table.component.html
@@ -34,7 +34,7 @@
Name
-
- Url
@if (assetProfileForm.controls['url'].value) {
- Name
- Url
@if (data.platform.url) {
-
+
}
diff --git a/apps/client/src/app/components/admin-platform/create-or-update-platform-dialog/create-or-update-platform-dialog.module.ts b/apps/client/src/app/components/admin-platform/create-or-update-platform-dialog/create-or-update-platform-dialog.module.ts
index 1b7c0bd8f..ac97e57cf 100644
--- a/apps/client/src/app/components/admin-platform/create-or-update-platform-dialog/create-or-update-platform-dialog.module.ts
+++ b/apps/client/src/app/components/admin-platform/create-or-update-platform-dialog/create-or-update-platform-dialog.module.ts
@@ -1,4 +1,4 @@
-import { GfSymbolIconModule } from '@ghostfolio/client/components/symbol-icon/symbol-icon.module';
+import { GfAssetProfileIconComponent } from '@ghostfolio/client/components/asset-profile-icon/asset-profile-icon.component';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
@@ -14,7 +14,7 @@ import { CreateOrUpdatePlatformDialog } from './create-or-update-platform-dialog
declarations: [CreateOrUpdatePlatformDialog],
imports: [
CommonModule,
- GfSymbolIconModule,
+ GfAssetProfileIconComponent,
FormsModule,
MatButtonModule,
MatDialogModule,
diff --git a/apps/client/src/app/components/asset-profile-icon/asset-profile-icon.component.html b/apps/client/src/app/components/asset-profile-icon/asset-profile-icon.component.html
new file mode 100644
index 000000000..f0abad285
--- /dev/null
+++ b/apps/client/src/app/components/asset-profile-icon/asset-profile-icon.component.html
@@ -0,0 +1,8 @@
+@if (src) {
+
+}
diff --git a/apps/client/src/app/components/symbol-icon/symbol-icon.component.scss b/apps/client/src/app/components/asset-profile-icon/asset-profile-icon.component.scss
similarity index 100%
rename from apps/client/src/app/components/symbol-icon/symbol-icon.component.scss
rename to apps/client/src/app/components/asset-profile-icon/asset-profile-icon.component.scss
diff --git a/apps/client/src/app/components/symbol-icon/symbol-icon.component.ts b/apps/client/src/app/components/asset-profile-icon/asset-profile-icon.component.ts
similarity index 63%
rename from apps/client/src/app/components/symbol-icon/symbol-icon.component.ts
rename to apps/client/src/app/components/asset-profile-icon/asset-profile-icon.component.ts
index a6fa0901a..4d96ef83f 100644
--- a/apps/client/src/app/components/symbol-icon/symbol-icon.component.ts
+++ b/apps/client/src/app/components/asset-profile-icon/asset-profile-icon.component.ts
@@ -1,4 +1,6 @@
+import { CommonModule } from '@angular/common';
import {
+ CUSTOM_ELEMENTS_SCHEMA,
ChangeDetectionStrategy,
Component,
Input,
@@ -7,12 +9,15 @@ import {
import { DataSource } from '@prisma/client';
@Component({
- selector: 'gf-symbol-icon',
changeDetection: ChangeDetectionStrategy.OnPush,
- templateUrl: './symbol-icon.component.html',
- styleUrls: ['./symbol-icon.component.scss']
+ imports: [CommonModule],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ selector: 'gf-asset-profile-icon',
+ standalone: true,
+ styleUrls: ['./asset-profile-icon.component.scss'],
+ templateUrl: './asset-profile-icon.component.html'
})
-export class SymbolIconComponent implements OnChanges {
+export class GfAssetProfileIconComponent implements OnChanges {
@Input() dataSource: DataSource;
@Input() size: 'large';
@Input() symbol: string;
diff --git a/apps/client/src/app/components/symbol-icon/symbol-icon.component.html b/apps/client/src/app/components/symbol-icon/symbol-icon.component.html
deleted file mode 100644
index 0aebd0e5b..000000000
--- a/apps/client/src/app/components/symbol-icon/symbol-icon.component.html
+++ /dev/null
@@ -1,7 +0,0 @@
-
diff --git a/apps/client/src/app/components/symbol-icon/symbol-icon.module.ts b/apps/client/src/app/components/symbol-icon/symbol-icon.module.ts
deleted file mode 100644
index 8eee9ef0c..000000000
--- a/apps/client/src/app/components/symbol-icon/symbol-icon.module.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { CommonModule } from '@angular/common';
-import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
-
-import { SymbolIconComponent } from './symbol-icon.component';
-
-@NgModule({
- declarations: [SymbolIconComponent],
- exports: [SymbolIconComponent],
- imports: [CommonModule],
- schemas: [CUSTOM_ELEMENTS_SCHEMA]
-})
-export class GfSymbolIconModule {}
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 9ff61d0c2..e2981462f 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
@@ -61,7 +61,7 @@
) {
-
-
-
-
|
-
@if (element.Account?.Platform?.url) {
-
-
|
- | | | | |