Browse Source

Task/reuse value component in tag component admin control page

pull/6467/head
Dmytro Skachko 4 weeks ago
committed by Thomas Kaul
parent
commit
5ce2e66cee
  1. 2
      CHANGELOG.md
  2. 6
      apps/client/src/app/components/admin-tag/admin-tag.component.html
  3. 8
      apps/client/src/app/components/admin-tag/admin-tag.component.ts

2
CHANGELOG.md

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

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

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

8
apps/client/src/app/components/admin-tag/admin-tag.component.ts

@ -1,8 +1,10 @@
import { UserService } from '@ghostfolio/client/services/user/user.service'; import { UserService } from '@ghostfolio/client/services/user/user.service';
import { CreateTagDto, UpdateTagDto } from '@ghostfolio/common/dtos'; import { CreateTagDto, UpdateTagDto } from '@ghostfolio/common/dtos';
import { ConfirmationDialogType } from '@ghostfolio/common/enums'; import { ConfirmationDialogType } from '@ghostfolio/common/enums';
import { getLocale } from '@ghostfolio/common/helper';
import { NotificationService } from '@ghostfolio/ui/notifications'; import { NotificationService } from '@ghostfolio/ui/notifications';
import { DataService } from '@ghostfolio/ui/services'; import { DataService } from '@ghostfolio/ui/services';
import { GfValueComponent } from '@ghostfolio/ui/value';
import { import {
ChangeDetectionStrategy, ChangeDetectionStrategy,
@ -10,7 +12,8 @@ import {
Component, Component,
OnDestroy, OnDestroy,
OnInit, OnInit,
ViewChild ViewChild,
Input
} from '@angular/core'; } from '@angular/core';
import { MatButtonModule } from '@angular/material/button'; import { MatButtonModule } from '@angular/material/button';
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
@ -36,6 +39,7 @@ import { CreateOrUpdateTagDialogParams } from './create-or-update-tag-dialog/int
@Component({ @Component({
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
imports: [ imports: [
GfValueComponent,
IonIcon, IonIcon,
MatButtonModule, MatButtonModule,
MatMenuModule, MatMenuModule,
@ -48,6 +52,8 @@ import { CreateOrUpdateTagDialogParams } from './create-or-update-tag-dialog/int
templateUrl: './admin-tag.component.html' templateUrl: './admin-tag.component.html'
}) })
export class GfAdminTagComponent implements OnDestroy, OnInit { export class GfAdminTagComponent implements OnDestroy, OnInit {
@Input() locale = getLocale();
@ViewChild(MatSort) sort: MatSort; @ViewChild(MatSort) sort: MatSort;
public dataSource = new MatTableDataSource<Tag>(); public dataSource = new MatTableDataSource<Tag>();

Loading…
Cancel
Save