Browse Source

Task/reuse value component in platform component of Admin Control panel (#6470)

* Reuse value component

* Update changelog

---------

Co-authored-by: Thomas Kaul <4159106+dtslvr@users.noreply.github.com>
pull/6432/merge
Winn Cook 4 days ago
committed by GitHub
parent
commit
3c886f134d
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 6
      apps/client/src/app/components/admin-platform/admin-platform.component.html
  3. 6
      apps/client/src/app/components/admin-platform/admin-platform.component.ts
  4. 2
      apps/client/src/app/components/admin-settings/admin-settings.component.html

1
CHANGELOG.md

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Reused the value component in the platform management of the admin control panel
- Reused the value component in the tag management of the admin control panel
- Upgraded `jsonpath` from version `1.1.1` to `1.2.1`

6
apps/client/src/app/components/admin-platform/admin-platform.component.html

@ -52,7 +52,11 @@
<ng-container i18n>Accounts</ng-container>
</th>
<td *matCellDef="let element" class="px-1 text-right" mat-cell>
{{ element.accountCount }}
<gf-value
class="d-inline-block justify-content-end"
[locale]="locale"
[value]="element.accountCount"
/>
</td>
</ng-container>

6
apps/client/src/app/components/admin-platform/admin-platform.component.ts

@ -1,14 +1,17 @@
import { UserService } from '@ghostfolio/client/services/user/user.service';
import { CreatePlatformDto, UpdatePlatformDto } from '@ghostfolio/common/dtos';
import { ConfirmationDialogType } from '@ghostfolio/common/enums';
import { getLocale } from '@ghostfolio/common/helper';
import { GfEntityLogoComponent } from '@ghostfolio/ui/entity-logo';
import { NotificationService } from '@ghostfolio/ui/notifications';
import { AdminService, DataService } from '@ghostfolio/ui/services';
import { GfValueComponent } from '@ghostfolio/ui/value';
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
Input,
OnDestroy,
OnInit,
ViewChild
@ -38,6 +41,7 @@ import { CreateOrUpdatePlatformDialogParams } from './create-or-update-platform-
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [
GfEntityLogoComponent,
GfValueComponent,
IonIcon,
MatButtonModule,
MatMenuModule,
@ -50,6 +54,8 @@ import { CreateOrUpdatePlatformDialogParams } from './create-or-update-platform-
templateUrl: './admin-platform.component.html'
})
export class GfAdminPlatformComponent implements OnDestroy, OnInit {
@Input() locale = getLocale();
@ViewChild(MatSort) sort: MatSort;
public dataSource = new MatTableDataSource<Platform>();

2
apps/client/src/app/components/admin-settings/admin-settings.component.html

@ -193,7 +193,7 @@
<div class="mb-5 row">
<div class="col">
<h2 class="text-center" i18n>Platforms</h2>
<gf-admin-platform />
<gf-admin-platform [locale]="user?.settings?.locale" />
</div>
</div>
<div class="row">

Loading…
Cancel
Save