Browse Source

Task/widen input types in activities table component (#8016)

Widen input types
pull/8020/head
Kenrick Tandrian 5 days ago
committed by GitHub
parent
commit
9378086206
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 10
      libs/ui/src/lib/activities-table/activities-table.component.html
  2. 36
      libs/ui/src/lib/activities-table/activities-table.component.ts

10
libs/ui/src/lib/activities-table/activities-table.component.html

@ -69,7 +69,7 @@
<ion-icon class="mr-2" name="cloud-download-outline" /> <ion-icon class="mr-2" name="cloud-download-outline" />
@if (canExportActivities()) { @if (canExportActivities()) {
<span i18n <span i18n
>Export {{ totalItems > 1 ? totalItems : '' }} >Export {{ (totalItems ?? 0) > 1 ? totalItems : '' }}
{totalItems, plural, =1 {Activity} other {Activities}}</span {totalItems, plural, =1 {Activity} other {Activities}}</span
> >
} @else { } @else {
@ -107,7 +107,7 @@
<ion-icon class="mr-2" name="trash-outline" /> <ion-icon class="mr-2" name="trash-outline" />
@if (canDeleteActivities()) { @if (canDeleteActivities()) {
<span i18n <span i18n
>Delete {{ totalItems > 1 ? totalItems : '' }} >Delete {{ (totalItems ?? 0) > 1 ? totalItems : '' }}
{totalItems, plural, =1 {Activity} other {Activities}}</span {totalItems, plural, =1 {Activity} other {Activities}}</span
> >
} @else { } @else {
@ -126,7 +126,7 @@
class="gf-table w-100" class="gf-table w-100"
mat-table mat-table
matSort matSort
[dataSource]="dataSource()" [dataSource]="dataSource() ?? []"
[matSortActive]="sortColumn" [matSortActive]="sortColumn"
[matSortDirection]="sortDirection" [matSortDirection]="sortDirection"
[matSortDisabled]="sortDisabled" [matSortDisabled]="sortDisabled"
@ -574,9 +574,9 @@
} }
<mat-paginator <mat-paginator
[class.d-none]="(isLoading() && !totalItems) || totalItems <= pageSize" [class.d-none]="(totalItems ?? 0) <= pageSize"
[hidePageSize]="true" [hidePageSize]="true"
[length]="totalItems" [length]="totalItems ?? 0"
[pageIndex]="pageIndex" [pageIndex]="pageIndex"
[pageSize]="pageSize" [pageSize]="pageSize"
[showFirstLastButtons]="true" [showFirstLastButtons]="true"

36
libs/ui/src/lib/activities-table/activities-table.component.ts

@ -100,24 +100,24 @@ import { GfValueComponent } from '../value/value.component';
templateUrl: './activities-table.component.html' templateUrl: './activities-table.component.html'
}) })
export class GfActivitiesTableComponent implements AfterViewInit, OnInit { export class GfActivitiesTableComponent implements AfterViewInit, OnInit {
@Input() baseCurrency: string; @Input() public baseCurrency?: string;
@Input() deviceType: string; @Input() public deviceType: string;
@Input() hasActivities: boolean; @Input() public hasActivities: boolean;
@Input() hasPermissionToCreateActivity: boolean; @Input() public hasPermissionToCreateActivity: boolean;
@Input() hasPermissionToDeleteActivity: boolean; @Input() public hasPermissionToDeleteActivity: boolean;
@Input() hasPermissionToExportActivities: boolean; @Input() public hasPermissionToExportActivities: boolean;
@Input() hasPermissionToFilterByType: boolean; @Input() public hasPermissionToFilterByType?: boolean = false;
@Input() hasPermissionToImportActivities: boolean; @Input() public hasPermissionToImportActivities: boolean;
@Input() hasPermissionToOpenDetails = true; @Input() public hasPermissionToOpenDetails = true;
@Input() hasPermissionToUpdateActivity: boolean; @Input() public hasPermissionToUpdateActivity: boolean;
@Input() locale = getLocale(); @Input() public locale?: string = getLocale();
@Input() pageIndex: number; @Input() public pageIndex: number;
@Input() pageSize = DEFAULT_PAGE_SIZE; @Input() public pageSize = DEFAULT_PAGE_SIZE;
@Input() showActions = true; @Input() public showActions = true;
@Input() sortColumn: string; @Input() public sortColumn: string;
@Input() sortDirection: SortDirection; @Input() public sortDirection: SortDirection;
@Input() sortDisabled = false; @Input() public sortDisabled = false;
@Input() totalItems = Number.MAX_SAFE_INTEGER; @Input() public totalItems?: number = Number.MAX_SAFE_INTEGER;
@Output() activitiesDeleted = new EventEmitter<void>(); @Output() activitiesDeleted = new EventEmitter<void>();
@Output() activityClicked = new EventEmitter<AssetProfileIdentifier>(); @Output() activityClicked = new EventEmitter<AssetProfileIdentifier>();

Loading…
Cancel
Save