Browse Source
Bugfix/allow removing invalid Ghostfolio API key (#7470)
Allow removing invalid Ghostfolio API key
pull/7476/head
Thomas Kaul
1 week ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
10 additions and
3 deletions
-
apps/client/src/app/components/admin-settings/admin-settings.component.html
-
apps/client/src/app/components/admin-settings/admin-settings.component.ts
|
|
|
@ -162,7 +162,7 @@ |
|
|
|
|
|
|
|
<td *matCellDef="let element" class="px-1 text-right" mat-cell> |
|
|
|
@if (isGhostfolioDataProvider(element)) { |
|
|
|
@if (isGhostfolioApiKeyValid === true) { |
|
|
|
@if (hasGhostfolioApiKey) { |
|
|
|
<button |
|
|
|
class="mx-1 no-min-width px-2" |
|
|
|
mat-button |
|
|
|
@ -171,7 +171,11 @@ |
|
|
|
> |
|
|
|
<ion-icon name="ellipsis-horizontal" /> |
|
|
|
</button> |
|
|
|
<mat-menu #ghostfolioApiMenu="matMenu" xPosition="before"> |
|
|
|
<mat-menu |
|
|
|
#ghostfolioApiMenu="matMenu" |
|
|
|
class="no-max-width" |
|
|
|
xPosition="before" |
|
|
|
> |
|
|
|
<button mat-menu-item (click)="onRemoveGhostfolioApiKey()"> |
|
|
|
<span class="align-items-center d-flex"> |
|
|
|
<ion-icon class="mr-2" name="trash-outline" /> |
|
|
|
@ -179,7 +183,7 @@ |
|
|
|
</span> |
|
|
|
</button> |
|
|
|
</mat-menu> |
|
|
|
} @else if (isGhostfolioApiKeyValid === false) { |
|
|
|
} @else if (hasGhostfolioApiKey === false) { |
|
|
|
<button |
|
|
|
class="special" |
|
|
|
mat-flat-button |
|
|
|
|
|
|
|
@ -81,6 +81,7 @@ export class GfAdminSettingsComponent implements OnInit { |
|
|
|
'actions' |
|
|
|
]; |
|
|
|
public ghostfolioApiStatus: DataProviderGhostfolioStatusResponse; |
|
|
|
public hasGhostfolioApiKey: boolean; |
|
|
|
public isGhostfolioApiKeyValid: boolean; |
|
|
|
public isLoading = false; |
|
|
|
public readonly premiumDataProviderMailHref = `mailto:hi@ghostfol.io?subject=Ghostfolio Premium Data Provider&body=${[ |
|
|
|
@ -184,6 +185,8 @@ export class GfAdminSettingsComponent implements OnInit { |
|
|
|
PROPERTY_API_KEY_GHOSTFOLIO |
|
|
|
] as string; |
|
|
|
|
|
|
|
this.hasGhostfolioApiKey = !!ghostfolioApiKey; |
|
|
|
|
|
|
|
if (ghostfolioApiKey) { |
|
|
|
this.adminService |
|
|
|
.fetchGhostfolioDataProviderStatus(ghostfolioApiKey) |
|
|
|
|