From 362997324ed78d5cc0121cf8c5b3db196ae78337 Mon Sep 17 00:00:00 2001 From: Kenrick Tandrian <60643640+KenTandrian@users.noreply.github.com> Date: Sun, 16 Nov 2025 17:21:07 +0700 Subject: [PATCH] Task/enforce module boundaries for ui module (#5947) * feat(lib): move ConfirmationDialogType to common lib * fix(lib): move SubscriptionType to enums * feat(lib): move validateObjectForForm util to common lib * feat(lib): move GfDialogFooterComponent to ui lib * feat(lib): move GfDialogHeaderComponent to ui lib --- apps/api/src/app/subscription/subscription.service.ts | 2 +- .../app/components/access-table/access-table.component.ts | 2 +- .../account-detail-dialog.component.ts | 4 ++-- .../admin-market-data/admin-market-data.service.ts | 2 +- .../asset-profile-dialog/asset-profile-dialog.component.ts | 2 +- .../components/admin-overview/admin-overview.component.ts | 2 +- .../components/admin-platform/admin-platform.component.ts | 2 +- .../create-or-update-platform-dialog.component.ts | 2 +- .../components/admin-settings/admin-settings.component.ts | 2 +- .../src/app/components/admin-tag/admin-tag.component.ts | 2 +- .../create-or-update-tag-dialog.component.ts | 2 +- .../src/app/components/admin-users/admin-users.component.ts | 2 +- .../holding-detail-dialog.component.ts | 4 ++-- .../login-with-access-token-dialog.component.ts | 2 +- .../create-or-update-access-dialog.component.ts | 2 +- .../user-account-access/user-account-access.component.ts | 2 +- .../user-account-membership.component.ts | 2 +- .../user-account-settings.component.ts | 2 +- .../user-detail-dialog/user-detail-dialog.component.ts | 4 ++-- .../confirmation-dialog/confirmation-dialog.component.ts | 3 ++- .../confirmation-dialog/interfaces/interfaces.ts | 2 +- .../src/app/core/notification/interfaces/interfaces.ts | 2 +- .../src/app/core/notification/notification.service.ts | 2 +- .../create-or-update-account-dialog.component.ts | 2 +- .../create-or-update-activity-dialog.component.ts | 2 +- .../import-activities-dialog.component.ts | 4 ++-- .../common/src/lib/enums}/confirmation-dialog.type.ts | 0 libs/common/src/lib/enums/index.ts | 4 ++++ .../src/lib/{types => enums}/subscription-type.type.ts | 0 libs/common/src/lib/interfaces/system-message.interface.ts | 2 +- libs/common/src/lib/interfaces/user.interface.ts | 6 ++---- libs/common/src/lib/types/index.ts | 2 -- libs/common/src/lib/types/user-with-settings.type.ts | 2 +- .../src/app/util => libs/common/src/lib/utils}/form.util.ts | 0 libs/common/src/lib/utils/index.ts | 3 +++ .../src/lib/account-balances/account-balances.component.ts | 4 ++-- libs/ui/src/lib/accounts-table/accounts-table.component.ts | 2 +- .../src/lib/activities-table/activities-table.component.ts | 2 +- .../benchmark-detail-dialog.component.ts | 4 ++-- libs/ui/src/lib/benchmark/benchmark.component.ts | 2 +- .../ui/src/lib}/dialog-footer/dialog-footer.component.html | 0 .../ui/src/lib}/dialog-footer/dialog-footer.component.scss | 0 .../ui/src/lib}/dialog-footer/dialog-footer.component.ts | 0 libs/ui/src/lib/dialog-footer/index.ts | 1 + .../ui/src/lib}/dialog-header/dialog-header.component.html | 0 .../ui/src/lib}/dialog-header/dialog-header.component.scss | 0 .../ui/src/lib}/dialog-header/dialog-header.component.ts | 0 libs/ui/src/lib/dialog-header/index.ts | 1 + 48 files changed, 51 insertions(+), 45 deletions(-) rename {apps/client/src/app/core/notification/confirmation-dialog => libs/common/src/lib/enums}/confirmation-dialog.type.ts (100%) create mode 100644 libs/common/src/lib/enums/index.ts rename libs/common/src/lib/{types => enums}/subscription-type.type.ts (100%) rename {apps/client/src/app/util => libs/common/src/lib/utils}/form.util.ts (100%) create mode 100644 libs/common/src/lib/utils/index.ts rename {apps/client/src/app/components => libs/ui/src/lib}/dialog-footer/dialog-footer.component.html (100%) rename {apps/client/src/app/components => libs/ui/src/lib}/dialog-footer/dialog-footer.component.scss (100%) rename {apps/client/src/app/components => libs/ui/src/lib}/dialog-footer/dialog-footer.component.ts (100%) create mode 100644 libs/ui/src/lib/dialog-footer/index.ts rename {apps/client/src/app/components => libs/ui/src/lib}/dialog-header/dialog-header.component.html (100%) rename {apps/client/src/app/components => libs/ui/src/lib}/dialog-header/dialog-header.component.scss (100%) rename {apps/client/src/app/components => libs/ui/src/lib}/dialog-header/dialog-header.component.ts (100%) create mode 100644 libs/ui/src/lib/dialog-header/index.ts diff --git a/apps/api/src/app/subscription/subscription.service.ts b/apps/api/src/app/subscription/subscription.service.ts index 37ab1c0f6..0458005c9 100644 --- a/apps/api/src/app/subscription/subscription.service.ts +++ b/apps/api/src/app/subscription/subscription.service.ts @@ -5,6 +5,7 @@ import { DEFAULT_LANGUAGE_CODE, PROPERTY_STRIPE_CONFIG } from '@ghostfolio/common/config'; +import { SubscriptionType } from '@ghostfolio/common/enums'; import { parseDate } from '@ghostfolio/common/helper'; import { CreateStripeCheckoutSessionResponse, @@ -14,7 +15,6 @@ import { SubscriptionOfferKey, UserWithSettings } from '@ghostfolio/common/types'; -import { SubscriptionType } from '@ghostfolio/common/types/subscription-type.type'; import { Injectable, Logger } from '@nestjs/common'; import { Subscription } from '@prisma/client'; diff --git a/apps/client/src/app/components/access-table/access-table.component.ts b/apps/client/src/app/components/access-table/access-table.component.ts index 645d43253..1127e5629 100644 --- a/apps/client/src/app/components/access-table/access-table.component.ts +++ b/apps/client/src/app/components/access-table/access-table.component.ts @@ -1,5 +1,5 @@ -import { ConfirmationDialogType } from '@ghostfolio/client/core/notification/confirmation-dialog/confirmation-dialog.type'; import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; +import { ConfirmationDialogType } from '@ghostfolio/common/enums'; import { Access, User } from '@ghostfolio/common/interfaces'; import { publicRoutes } from '@ghostfolio/common/routes/routes'; diff --git a/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts b/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts index ceae50f01..d8f08ecc2 100644 --- a/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts +++ b/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts @@ -1,5 +1,3 @@ -import { GfDialogFooterComponent } from '@ghostfolio/client/components/dialog-footer/dialog-footer.component'; -import { GfDialogHeaderComponent } from '@ghostfolio/client/components/dialog-header/dialog-header.component'; import { GfInvestmentChartComponent } from '@ghostfolio/client/components/investment-chart/investment-chart.component'; import { DataService } from '@ghostfolio/client/services/data.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; @@ -18,6 +16,8 @@ import { internalRoutes } from '@ghostfolio/common/routes/routes'; import { OrderWithAccount } from '@ghostfolio/common/types'; import { GfAccountBalancesComponent } from '@ghostfolio/ui/account-balances'; import { GfActivitiesTableComponent } from '@ghostfolio/ui/activities-table'; +import { GfDialogFooterComponent } from '@ghostfolio/ui/dialog-footer'; +import { GfDialogHeaderComponent } from '@ghostfolio/ui/dialog-header'; import { GfHoldingsTableComponent } from '@ghostfolio/ui/holdings-table'; import { GfValueComponent } from '@ghostfolio/ui/value'; diff --git a/apps/client/src/app/components/admin-market-data/admin-market-data.service.ts b/apps/client/src/app/components/admin-market-data/admin-market-data.service.ts index 78d4bf955..3f60cb8c5 100644 --- a/apps/client/src/app/components/admin-market-data/admin-market-data.service.ts +++ b/apps/client/src/app/components/admin-market-data/admin-market-data.service.ts @@ -1,7 +1,7 @@ -import { ConfirmationDialogType } from '@ghostfolio/client/core/notification/confirmation-dialog/confirmation-dialog.type'; import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; import { AdminService } from '@ghostfolio/client/services/admin.service'; import { ghostfolioScraperApiSymbolPrefix } from '@ghostfolio/common/config'; +import { ConfirmationDialogType } from '@ghostfolio/common/enums'; import { getCurrencyFromSymbol, isDerivedCurrency, 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 9969a59ba..b2ef4f17b 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 @@ -3,7 +3,6 @@ import { NotificationService } from '@ghostfolio/client/core/notification/notifi import { AdminService } from '@ghostfolio/client/services/admin.service'; import { DataService } from '@ghostfolio/client/services/data.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; -import { validateObjectForForm } from '@ghostfolio/client/util/form.util'; import { ASSET_CLASS_MAPPING, PROPERTY_IS_DATA_GATHERING_ENABLED @@ -19,6 +18,7 @@ import { User } from '@ghostfolio/common/interfaces'; import { DateRange } from '@ghostfolio/common/types'; +import { validateObjectForForm } from '@ghostfolio/common/utils'; import { GfCurrencySelectorComponent } from '@ghostfolio/ui/currency-selector'; import { GfEntityLogoComponent } from '@ghostfolio/ui/entity-logo'; import { GfHistoricalMarketDataEditorComponent } from '@ghostfolio/ui/historical-market-data-editor'; 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 5d1138be8..0b4b36d06 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 @@ -1,4 +1,3 @@ -import { ConfirmationDialogType } from '@ghostfolio/client/core/notification/confirmation-dialog/confirmation-dialog.type'; import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; import { AdminService } from '@ghostfolio/client/services/admin.service'; import { CacheService } from '@ghostfolio/client/services/cache.service'; @@ -12,6 +11,7 @@ import { PROPERTY_SYSTEM_MESSAGE, ghostfolioPrefix } from '@ghostfolio/common/config'; +import { ConfirmationDialogType } from '@ghostfolio/common/enums'; import { getDateFnsLocale } from '@ghostfolio/common/helper'; import { Coupon, diff --git a/apps/client/src/app/components/admin-platform/admin-platform.component.ts b/apps/client/src/app/components/admin-platform/admin-platform.component.ts index 1dd150ac5..64e7ff7cf 100644 --- a/apps/client/src/app/components/admin-platform/admin-platform.component.ts +++ b/apps/client/src/app/components/admin-platform/admin-platform.component.ts @@ -1,9 +1,9 @@ -import { ConfirmationDialogType } from '@ghostfolio/client/core/notification/confirmation-dialog/confirmation-dialog.type'; import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; import { AdminService } from '@ghostfolio/client/services/admin.service'; import { DataService } from '@ghostfolio/client/services/data.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; import { CreatePlatformDto, UpdatePlatformDto } from '@ghostfolio/common/dtos'; +import { ConfirmationDialogType } from '@ghostfolio/common/enums'; import { GfEntityLogoComponent } from '@ghostfolio/ui/entity-logo'; import { diff --git a/apps/client/src/app/components/admin-platform/create-or-update-platform-dialog/create-or-update-platform-dialog.component.ts b/apps/client/src/app/components/admin-platform/create-or-update-platform-dialog/create-or-update-platform-dialog.component.ts index 23e6ca271..dfcf300c1 100644 --- a/apps/client/src/app/components/admin-platform/create-or-update-platform-dialog/create-or-update-platform-dialog.component.ts +++ b/apps/client/src/app/components/admin-platform/create-or-update-platform-dialog/create-or-update-platform-dialog.component.ts @@ -1,5 +1,5 @@ -import { validateObjectForForm } from '@ghostfolio/client/util/form.util'; import { CreatePlatformDto, UpdatePlatformDto } from '@ghostfolio/common/dtos'; +import { validateObjectForForm } from '@ghostfolio/common/utils'; import { GfEntityLogoComponent } from '@ghostfolio/ui/entity-logo'; import { diff --git a/apps/client/src/app/components/admin-settings/admin-settings.component.ts b/apps/client/src/app/components/admin-settings/admin-settings.component.ts index 899aadc6c..ec44b6e65 100644 --- a/apps/client/src/app/components/admin-settings/admin-settings.component.ts +++ b/apps/client/src/app/components/admin-settings/admin-settings.component.ts @@ -1,12 +1,12 @@ import { GfAdminPlatformComponent } from '@ghostfolio/client/components/admin-platform/admin-platform.component'; import { GfAdminTagComponent } from '@ghostfolio/client/components/admin-tag/admin-tag.component'; import { GfDataProviderStatusComponent } from '@ghostfolio/client/components/data-provider-status/data-provider-status.component'; -import { ConfirmationDialogType } from '@ghostfolio/client/core/notification/confirmation-dialog/confirmation-dialog.type'; import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; import { AdminService } from '@ghostfolio/client/services/admin.service'; import { DataService } from '@ghostfolio/client/services/data.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; import { PROPERTY_API_KEY_GHOSTFOLIO } from '@ghostfolio/common/config'; +import { ConfirmationDialogType } from '@ghostfolio/common/enums'; import { getDateFormatString } from '@ghostfolio/common/helper'; import { DataProviderGhostfolioStatusResponse, diff --git a/apps/client/src/app/components/admin-tag/admin-tag.component.ts b/apps/client/src/app/components/admin-tag/admin-tag.component.ts index 6b79b8fe6..a891baa45 100644 --- a/apps/client/src/app/components/admin-tag/admin-tag.component.ts +++ b/apps/client/src/app/components/admin-tag/admin-tag.component.ts @@ -1,8 +1,8 @@ -import { ConfirmationDialogType } from '@ghostfolio/client/core/notification/confirmation-dialog/confirmation-dialog.type'; import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; import { DataService } from '@ghostfolio/client/services/data.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; import { CreateTagDto, UpdateTagDto } from '@ghostfolio/common/dtos'; +import { ConfirmationDialogType } from '@ghostfolio/common/enums'; import { ChangeDetectionStrategy, diff --git a/apps/client/src/app/components/admin-tag/create-or-update-tag-dialog/create-or-update-tag-dialog.component.ts b/apps/client/src/app/components/admin-tag/create-or-update-tag-dialog/create-or-update-tag-dialog.component.ts index 487a4d498..323609a48 100644 --- a/apps/client/src/app/components/admin-tag/create-or-update-tag-dialog/create-or-update-tag-dialog.component.ts +++ b/apps/client/src/app/components/admin-tag/create-or-update-tag-dialog/create-or-update-tag-dialog.component.ts @@ -1,5 +1,5 @@ -import { validateObjectForForm } from '@ghostfolio/client/util/form.util'; import { CreateTagDto, UpdateTagDto } from '@ghostfolio/common/dtos'; +import { validateObjectForForm } from '@ghostfolio/common/utils'; import { ChangeDetectionStrategy, diff --git a/apps/client/src/app/components/admin-users/admin-users.component.ts b/apps/client/src/app/components/admin-users/admin-users.component.ts index 6b3335927..6c366a16c 100644 --- a/apps/client/src/app/components/admin-users/admin-users.component.ts +++ b/apps/client/src/app/components/admin-users/admin-users.component.ts @@ -1,6 +1,5 @@ import { UserDetailDialogParams } from '@ghostfolio/client/components/user-detail-dialog/interfaces/interfaces'; import { GfUserDetailDialogComponent } from '@ghostfolio/client/components/user-detail-dialog/user-detail-dialog.component'; -import { ConfirmationDialogType } from '@ghostfolio/client/core/notification/confirmation-dialog/confirmation-dialog.type'; import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; import { AdminService } from '@ghostfolio/client/services/admin.service'; import { DataService } from '@ghostfolio/client/services/data.service'; @@ -8,6 +7,7 @@ import { ImpersonationStorageService } from '@ghostfolio/client/services/imperso import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; import { DEFAULT_PAGE_SIZE } from '@ghostfolio/common/config'; +import { ConfirmationDialogType } from '@ghostfolio/common/enums'; import { getDateFnsLocale, getDateFormatString, diff --git a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts index caca0c2bc..55574d202 100644 --- a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts +++ b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts @@ -1,5 +1,3 @@ -import { GfDialogFooterComponent } from '@ghostfolio/client/components/dialog-footer/dialog-footer.component'; -import { GfDialogHeaderComponent } from '@ghostfolio/client/components/dialog-header/dialog-header.component'; import { DataService } from '@ghostfolio/client/services/data.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; import { @@ -22,6 +20,8 @@ import { internalRoutes } from '@ghostfolio/common/routes/routes'; import { GfAccountsTableComponent } from '@ghostfolio/ui/accounts-table'; import { GfActivitiesTableComponent } from '@ghostfolio/ui/activities-table'; import { GfDataProviderCreditsComponent } from '@ghostfolio/ui/data-provider-credits'; +import { GfDialogFooterComponent } from '@ghostfolio/ui/dialog-footer'; +import { GfDialogHeaderComponent } from '@ghostfolio/ui/dialog-header'; import { GfHistoricalMarketDataEditorComponent } from '@ghostfolio/ui/historical-market-data-editor'; import { translate } from '@ghostfolio/ui/i18n'; import { GfLineChartComponent } from '@ghostfolio/ui/line-chart'; diff --git a/apps/client/src/app/components/login-with-access-token-dialog/login-with-access-token-dialog.component.ts b/apps/client/src/app/components/login-with-access-token-dialog/login-with-access-token-dialog.component.ts index c0926150f..0e297bc29 100644 --- a/apps/client/src/app/components/login-with-access-token-dialog/login-with-access-token-dialog.component.ts +++ b/apps/client/src/app/components/login-with-access-token-dialog/login-with-access-token-dialog.component.ts @@ -1,8 +1,8 @@ -import { GfDialogHeaderComponent } from '@ghostfolio/client/components/dialog-header/dialog-header.component'; import { KEY_STAY_SIGNED_IN, SettingsStorageService } from '@ghostfolio/client/services/settings-storage.service'; +import { GfDialogHeaderComponent } from '@ghostfolio/ui/dialog-header'; import { CommonModule } from '@angular/common'; import { ChangeDetectionStrategy, Component, Inject } from '@angular/core'; diff --git a/apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.component.ts b/apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.component.ts index be0842467..9aa07feee 100644 --- a/apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.component.ts +++ b/apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.component.ts @@ -1,7 +1,7 @@ import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; import { DataService } from '@ghostfolio/client/services/data.service'; -import { validateObjectForForm } from '@ghostfolio/client/util/form.util'; import { CreateAccessDto, UpdateAccessDto } from '@ghostfolio/common/dtos'; +import { validateObjectForForm } from '@ghostfolio/common/utils'; import { ChangeDetectionStrategy, diff --git a/apps/client/src/app/components/user-account-access/user-account-access.component.ts b/apps/client/src/app/components/user-account-access/user-account-access.component.ts index 38d34a4e2..da2e8f508 100644 --- a/apps/client/src/app/components/user-account-access/user-account-access.component.ts +++ b/apps/client/src/app/components/user-account-access/user-account-access.component.ts @@ -1,10 +1,10 @@ import { GfAccessTableComponent } from '@ghostfolio/client/components/access-table/access-table.component'; -import { ConfirmationDialogType } from '@ghostfolio/client/core/notification/confirmation-dialog/confirmation-dialog.type'; import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; import { DataService } from '@ghostfolio/client/services/data.service'; import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; import { CreateAccessDto } from '@ghostfolio/common/dtos'; +import { ConfirmationDialogType } from '@ghostfolio/common/enums'; import { Access, User } from '@ghostfolio/common/interfaces'; import { hasPermission, permissions } from '@ghostfolio/common/permissions'; import { GfPremiumIndicatorComponent } from '@ghostfolio/ui/premium-indicator'; diff --git a/apps/client/src/app/components/user-account-membership/user-account-membership.component.ts b/apps/client/src/app/components/user-account-membership/user-account-membership.component.ts index 025ec0f7a..ae9183c13 100644 --- a/apps/client/src/app/components/user-account-membership/user-account-membership.component.ts +++ b/apps/client/src/app/components/user-account-membership/user-account-membership.component.ts @@ -1,7 +1,7 @@ -import { ConfirmationDialogType } from '@ghostfolio/client/core/notification/confirmation-dialog/confirmation-dialog.type'; import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; import { DataService } from '@ghostfolio/client/services/data.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; +import { ConfirmationDialogType } from '@ghostfolio/common/enums'; import { getDateFormatString } from '@ghostfolio/common/helper'; import { User } from '@ghostfolio/common/interfaces'; import { hasPermission, permissions } from '@ghostfolio/common/permissions'; diff --git a/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts b/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts index a36ff3229..32e3d132e 100644 --- a/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts +++ b/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts @@ -1,4 +1,3 @@ -import { ConfirmationDialogType } from '@ghostfolio/client/core/notification/confirmation-dialog/confirmation-dialog.type'; import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; import { DataService } from '@ghostfolio/client/services/data.service'; import { @@ -9,6 +8,7 @@ import { import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; import { WebAuthnService } from '@ghostfolio/client/services/web-authn.service'; +import { ConfirmationDialogType } from '@ghostfolio/common/enums'; import { downloadAsFile } from '@ghostfolio/common/helper'; import { User } from '@ghostfolio/common/interfaces'; import { hasPermission, permissions } from '@ghostfolio/common/permissions'; diff --git a/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.ts b/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.ts index 6dabf2f78..57ccf0f18 100644 --- a/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.ts +++ b/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.ts @@ -1,7 +1,7 @@ -import { GfDialogFooterComponent } from '@ghostfolio/client/components/dialog-footer/dialog-footer.component'; -import { GfDialogHeaderComponent } from '@ghostfolio/client/components/dialog-header/dialog-header.component'; import { AdminService } from '@ghostfolio/client/services/admin.service'; import { AdminUserResponse } from '@ghostfolio/common/interfaces'; +import { GfDialogFooterComponent } from '@ghostfolio/ui/dialog-footer'; +import { GfDialogHeaderComponent } from '@ghostfolio/ui/dialog-header'; import { GfValueComponent } from '@ghostfolio/ui/value'; import { CommonModule } from '@angular/common'; diff --git a/apps/client/src/app/core/notification/confirmation-dialog/confirmation-dialog.component.ts b/apps/client/src/app/core/notification/confirmation-dialog/confirmation-dialog.component.ts index 49c6dc5a3..a3bc053ee 100644 --- a/apps/client/src/app/core/notification/confirmation-dialog/confirmation-dialog.component.ts +++ b/apps/client/src/app/core/notification/confirmation-dialog/confirmation-dialog.component.ts @@ -1,8 +1,9 @@ +import { ConfirmationDialogType } from '@ghostfolio/common/enums'; + import { Component, HostListener } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; import { MatDialogModule, MatDialogRef } from '@angular/material/dialog'; -import { ConfirmationDialogType } from './confirmation-dialog.type'; import { ConfirmDialogParams } from './interfaces/interfaces'; @Component({ diff --git a/apps/client/src/app/core/notification/confirmation-dialog/interfaces/interfaces.ts b/apps/client/src/app/core/notification/confirmation-dialog/interfaces/interfaces.ts index 8788e54fe..449201a76 100644 --- a/apps/client/src/app/core/notification/confirmation-dialog/interfaces/interfaces.ts +++ b/apps/client/src/app/core/notification/confirmation-dialog/interfaces/interfaces.ts @@ -1,4 +1,4 @@ -import { ConfirmationDialogType } from '../confirmation-dialog.type'; +import { ConfirmationDialogType } from '@ghostfolio/common/enums'; export interface ConfirmDialogParams { confirmLabel?: string; diff --git a/apps/client/src/app/core/notification/interfaces/interfaces.ts b/apps/client/src/app/core/notification/interfaces/interfaces.ts index c58c7fa28..071597691 100644 --- a/apps/client/src/app/core/notification/interfaces/interfaces.ts +++ b/apps/client/src/app/core/notification/interfaces/interfaces.ts @@ -1,4 +1,4 @@ -import { ConfirmationDialogType } from '../confirmation-dialog/confirmation-dialog.type'; +import { ConfirmationDialogType } from '@ghostfolio/common/enums'; export interface AlertParams { discardFn?: () => void; diff --git a/apps/client/src/app/core/notification/notification.service.ts b/apps/client/src/app/core/notification/notification.service.ts index 9c31aa7bd..849f91288 100644 --- a/apps/client/src/app/core/notification/notification.service.ts +++ b/apps/client/src/app/core/notification/notification.service.ts @@ -1,3 +1,4 @@ +import { ConfirmationDialogType } from '@ghostfolio/common/enums'; import { translate } from '@ghostfolio/ui/i18n'; import { Injectable } from '@angular/core'; @@ -6,7 +7,6 @@ import { isFunction } from 'lodash'; import { GfAlertDialogComponent } from './alert-dialog/alert-dialog.component'; import { GfConfirmationDialogComponent } from './confirmation-dialog/confirmation-dialog.component'; -import { ConfirmationDialogType } from './confirmation-dialog/confirmation-dialog.type'; import { AlertParams, ConfirmParams, diff --git a/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts b/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts index 08ecbf15a..5e18f25cf 100644 --- a/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts +++ b/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts @@ -1,6 +1,6 @@ import { DataService } from '@ghostfolio/client/services/data.service'; -import { validateObjectForForm } from '@ghostfolio/client/util/form.util'; import { CreateAccountDto, UpdateAccountDto } from '@ghostfolio/common/dtos'; +import { validateObjectForForm } from '@ghostfolio/common/utils'; import { GfCurrencySelectorComponent } from '@ghostfolio/ui/currency-selector'; import { GfEntityLogoComponent } from '@ghostfolio/ui/entity-logo'; diff --git a/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts b/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts index 3aedb8d73..01b389789 100644 --- a/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts +++ b/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts @@ -7,6 +7,7 @@ import { LookupItem } from '@ghostfolio/common/interfaces'; import { hasPermission, permissions } from '@ghostfolio/common/permissions'; +import { validateObjectForForm } from '@ghostfolio/common/utils'; import { GfEntityLogoComponent } from '@ghostfolio/ui/entity-logo'; import { translate } from '@ghostfolio/ui/i18n'; import { GfSymbolAutocompleteComponent } from '@ghostfolio/ui/symbol-autocomplete'; @@ -48,7 +49,6 @@ import { EMPTY, Subject } from 'rxjs'; import { catchError, delay, takeUntil } from 'rxjs/operators'; import { DataService } from '../../../../services/data.service'; -import { validateObjectForForm } from '../../../../util/form.util'; import { CreateOrUpdateActivityDialogParams } from './interfaces/interfaces'; import { ActivityType } from './types/activity-type.type'; diff --git a/apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.component.ts b/apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.component.ts index a3d7d326d..582ab8e25 100644 --- a/apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.component.ts +++ b/apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.component.ts @@ -1,5 +1,3 @@ -import { GfDialogFooterComponent } from '@ghostfolio/client/components/dialog-footer/dialog-footer.component'; -import { GfDialogHeaderComponent } from '@ghostfolio/client/components/dialog-header/dialog-header.component'; import { GfFileDropDirective } from '@ghostfolio/client/directives/file-drop/file-drop.directive'; import { DataService } from '@ghostfolio/client/services/data.service'; import { ImportActivitiesService } from '@ghostfolio/client/services/import-activities.service'; @@ -11,6 +9,8 @@ import { import { Activity, PortfolioPosition } from '@ghostfolio/common/interfaces'; import { GfSymbolPipe } from '@ghostfolio/common/pipes'; import { GfActivitiesTableComponent } from '@ghostfolio/ui/activities-table'; +import { GfDialogFooterComponent } from '@ghostfolio/ui/dialog-footer'; +import { GfDialogHeaderComponent } from '@ghostfolio/ui/dialog-header'; import { StepperOrientation, diff --git a/apps/client/src/app/core/notification/confirmation-dialog/confirmation-dialog.type.ts b/libs/common/src/lib/enums/confirmation-dialog.type.ts similarity index 100% rename from apps/client/src/app/core/notification/confirmation-dialog/confirmation-dialog.type.ts rename to libs/common/src/lib/enums/confirmation-dialog.type.ts diff --git a/libs/common/src/lib/enums/index.ts b/libs/common/src/lib/enums/index.ts new file mode 100644 index 000000000..7384741de --- /dev/null +++ b/libs/common/src/lib/enums/index.ts @@ -0,0 +1,4 @@ +import { ConfirmationDialogType } from './confirmation-dialog.type'; +import { SubscriptionType } from './subscription-type.type'; + +export { ConfirmationDialogType, SubscriptionType }; diff --git a/libs/common/src/lib/types/subscription-type.type.ts b/libs/common/src/lib/enums/subscription-type.type.ts similarity index 100% rename from libs/common/src/lib/types/subscription-type.type.ts rename to libs/common/src/lib/enums/subscription-type.type.ts diff --git a/libs/common/src/lib/interfaces/system-message.interface.ts b/libs/common/src/lib/interfaces/system-message.interface.ts index 253bd5a27..617d40ea2 100644 --- a/libs/common/src/lib/interfaces/system-message.interface.ts +++ b/libs/common/src/lib/interfaces/system-message.interface.ts @@ -1,4 +1,4 @@ -import { SubscriptionType } from '@ghostfolio/common/types/subscription-type.type'; +import { SubscriptionType } from '@ghostfolio/common/enums'; export interface SystemMessage { message: string; diff --git a/libs/common/src/lib/interfaces/user.interface.ts b/libs/common/src/lib/interfaces/user.interface.ts index 2e0906895..e60f01915 100644 --- a/libs/common/src/lib/interfaces/user.interface.ts +++ b/libs/common/src/lib/interfaces/user.interface.ts @@ -1,7 +1,5 @@ -import { - AccountWithPlatform, - SubscriptionType -} from '@ghostfolio/common/types'; +import { SubscriptionType } from '@ghostfolio/common/enums'; +import { AccountWithPlatform } from '@ghostfolio/common/types'; import { Access, Tag } from '@prisma/client'; diff --git a/libs/common/src/lib/types/index.ts b/libs/common/src/lib/types/index.ts index 903d9c96a..781e50c55 100644 --- a/libs/common/src/lib/types/index.ts +++ b/libs/common/src/lib/types/index.ts @@ -18,7 +18,6 @@ import type { Market } from './market.type'; import type { OrderWithAccount } from './order-with-account.type'; import type { RequestWithUser } from './request-with-user.type'; import type { SubscriptionOfferKey } from './subscription-offer-key.type'; -import type { SubscriptionType } from './subscription-type.type'; import type { UserWithSettings } from './user-with-settings.type'; import type { ViewMode } from './view-mode.type'; @@ -43,7 +42,6 @@ export type { OrderWithAccount, RequestWithUser, SubscriptionOfferKey, - SubscriptionType, UserWithSettings, ViewMode }; diff --git a/libs/common/src/lib/types/user-with-settings.type.ts b/libs/common/src/lib/types/user-with-settings.type.ts index 18fc90a5c..3c6adfec0 100644 --- a/libs/common/src/lib/types/user-with-settings.type.ts +++ b/libs/common/src/lib/types/user-with-settings.type.ts @@ -1,5 +1,5 @@ +import { SubscriptionType } from '@ghostfolio/common/enums'; import { SubscriptionOffer, UserSettings } from '@ghostfolio/common/interfaces'; -import { SubscriptionType } from '@ghostfolio/common/types'; import { Access, Account, Settings, User } from '@prisma/client'; diff --git a/apps/client/src/app/util/form.util.ts b/libs/common/src/lib/utils/form.util.ts similarity index 100% rename from apps/client/src/app/util/form.util.ts rename to libs/common/src/lib/utils/form.util.ts diff --git a/libs/common/src/lib/utils/index.ts b/libs/common/src/lib/utils/index.ts new file mode 100644 index 000000000..2bdd03fdc --- /dev/null +++ b/libs/common/src/lib/utils/index.ts @@ -0,0 +1,3 @@ +import { validateObjectForForm } from './form.util'; + +export { validateObjectForForm }; diff --git a/libs/ui/src/lib/account-balances/account-balances.component.ts b/libs/ui/src/lib/account-balances/account-balances.component.ts index 679899af9..5fe47347e 100644 --- a/libs/ui/src/lib/account-balances/account-balances.component.ts +++ b/libs/ui/src/lib/account-balances/account-balances.component.ts @@ -1,10 +1,10 @@ /* eslint-disable @nx/enforce-module-boundaries */ -import { ConfirmationDialogType } from '@ghostfolio/client/core/notification/confirmation-dialog/confirmation-dialog.type'; import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; -import { validateObjectForForm } from '@ghostfolio/client/util/form.util'; import { CreateAccountBalanceDto } from '@ghostfolio/common/dtos'; +import { ConfirmationDialogType } from '@ghostfolio/common/enums'; import { DATE_FORMAT, getLocale } from '@ghostfolio/common/helper'; import { AccountBalancesResponse } from '@ghostfolio/common/interfaces'; +import { validateObjectForForm } from '@ghostfolio/common/utils'; import { CUSTOM_ELEMENTS_SCHEMA, diff --git a/libs/ui/src/lib/accounts-table/accounts-table.component.ts b/libs/ui/src/lib/accounts-table/accounts-table.component.ts index b96905981..c0995c39a 100644 --- a/libs/ui/src/lib/accounts-table/accounts-table.component.ts +++ b/libs/ui/src/lib/accounts-table/accounts-table.component.ts @@ -1,6 +1,6 @@ /* eslint-disable @nx/enforce-module-boundaries */ -import { ConfirmationDialogType } from '@ghostfolio/client/core/notification/confirmation-dialog/confirmation-dialog.type'; import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; +import { ConfirmationDialogType } from '@ghostfolio/common/enums'; import { getLocale } from '@ghostfolio/common/helper'; import { GfEntityLogoComponent } from '@ghostfolio/ui/entity-logo'; import { GfValueComponent } from '@ghostfolio/ui/value'; diff --git a/libs/ui/src/lib/activities-table/activities-table.component.ts b/libs/ui/src/lib/activities-table/activities-table.component.ts index d7b13a7e8..476fca5fb 100644 --- a/libs/ui/src/lib/activities-table/activities-table.component.ts +++ b/libs/ui/src/lib/activities-table/activities-table.component.ts @@ -1,10 +1,10 @@ /* eslint-disable @nx/enforce-module-boundaries */ -import { ConfirmationDialogType } from '@ghostfolio/client/core/notification/confirmation-dialog/confirmation-dialog.type'; import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; import { DEFAULT_PAGE_SIZE, TAG_ID_EXCLUDE_FROM_ANALYSIS } from '@ghostfolio/common/config'; +import { ConfirmationDialogType } from '@ghostfolio/common/enums'; import { getLocale } from '@ghostfolio/common/helper'; import { Activity, diff --git a/libs/ui/src/lib/benchmark/benchmark-detail-dialog/benchmark-detail-dialog.component.ts b/libs/ui/src/lib/benchmark/benchmark-detail-dialog/benchmark-detail-dialog.component.ts index bcac9c6b5..59c1e6e17 100644 --- a/libs/ui/src/lib/benchmark/benchmark-detail-dialog/benchmark-detail-dialog.component.ts +++ b/libs/ui/src/lib/benchmark/benchmark-detail-dialog/benchmark-detail-dialog.component.ts @@ -1,12 +1,12 @@ /* eslint-disable @nx/enforce-module-boundaries */ -import { GfDialogFooterComponent } from '@ghostfolio/client/components/dialog-footer/dialog-footer.component'; -import { GfDialogHeaderComponent } from '@ghostfolio/client/components/dialog-header/dialog-header.component'; import { DataService } from '@ghostfolio/client/services/data.service'; import { DATE_FORMAT } from '@ghostfolio/common/helper'; import { AdminMarketDataDetails, LineChartItem } from '@ghostfolio/common/interfaces'; +import { GfDialogFooterComponent } from '@ghostfolio/ui/dialog-footer'; +import { GfDialogHeaderComponent } from '@ghostfolio/ui/dialog-header'; import { CUSTOM_ELEMENTS_SCHEMA, diff --git a/libs/ui/src/lib/benchmark/benchmark.component.ts b/libs/ui/src/lib/benchmark/benchmark.component.ts index 4c1ca97cd..5793300c1 100644 --- a/libs/ui/src/lib/benchmark/benchmark.component.ts +++ b/libs/ui/src/lib/benchmark/benchmark.component.ts @@ -1,6 +1,6 @@ /* eslint-disable @nx/enforce-module-boundaries */ -import { ConfirmationDialogType } from '@ghostfolio/client/core/notification/confirmation-dialog/confirmation-dialog.type'; import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; +import { ConfirmationDialogType } from '@ghostfolio/common/enums'; import { getLocale, resolveMarketCondition } from '@ghostfolio/common/helper'; import { AssetProfileIdentifier, diff --git a/apps/client/src/app/components/dialog-footer/dialog-footer.component.html b/libs/ui/src/lib/dialog-footer/dialog-footer.component.html similarity index 100% rename from apps/client/src/app/components/dialog-footer/dialog-footer.component.html rename to libs/ui/src/lib/dialog-footer/dialog-footer.component.html diff --git a/apps/client/src/app/components/dialog-footer/dialog-footer.component.scss b/libs/ui/src/lib/dialog-footer/dialog-footer.component.scss similarity index 100% rename from apps/client/src/app/components/dialog-footer/dialog-footer.component.scss rename to libs/ui/src/lib/dialog-footer/dialog-footer.component.scss diff --git a/apps/client/src/app/components/dialog-footer/dialog-footer.component.ts b/libs/ui/src/lib/dialog-footer/dialog-footer.component.ts similarity index 100% rename from apps/client/src/app/components/dialog-footer/dialog-footer.component.ts rename to libs/ui/src/lib/dialog-footer/dialog-footer.component.ts diff --git a/libs/ui/src/lib/dialog-footer/index.ts b/libs/ui/src/lib/dialog-footer/index.ts new file mode 100644 index 000000000..822be3e98 --- /dev/null +++ b/libs/ui/src/lib/dialog-footer/index.ts @@ -0,0 +1 @@ +export * from './dialog-footer.component'; diff --git a/apps/client/src/app/components/dialog-header/dialog-header.component.html b/libs/ui/src/lib/dialog-header/dialog-header.component.html similarity index 100% rename from apps/client/src/app/components/dialog-header/dialog-header.component.html rename to libs/ui/src/lib/dialog-header/dialog-header.component.html diff --git a/apps/client/src/app/components/dialog-header/dialog-header.component.scss b/libs/ui/src/lib/dialog-header/dialog-header.component.scss similarity index 100% rename from apps/client/src/app/components/dialog-header/dialog-header.component.scss rename to libs/ui/src/lib/dialog-header/dialog-header.component.scss diff --git a/apps/client/src/app/components/dialog-header/dialog-header.component.ts b/libs/ui/src/lib/dialog-header/dialog-header.component.ts similarity index 100% rename from apps/client/src/app/components/dialog-header/dialog-header.component.ts rename to libs/ui/src/lib/dialog-header/dialog-header.component.ts diff --git a/libs/ui/src/lib/dialog-header/index.ts b/libs/ui/src/lib/dialog-header/index.ts new file mode 100644 index 000000000..9beb9d4ac --- /dev/null +++ b/libs/ui/src/lib/dialog-header/index.ts @@ -0,0 +1 @@ +export * from './dialog-header.component';