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" />
@if (canExportActivities()) {
<span i18n
>Export {{ totalItems > 1 ? totalItems : '' }}
>Export {{ (totalItems ?? 0) > 1 ? totalItems : '' }}
{totalItems, plural, =1 {Activity} other {Activities}}</span
>
} @else {
@ -107,7 +107,7 @@
<ion-icon class="mr-2" name="trash-outline" />
@if (canDeleteActivities()) {
<span i18n
>Delete {{ totalItems > 1 ? totalItems : '' }}
>Delete {{ (totalItems ?? 0) > 1 ? totalItems : '' }}
{totalItems, plural, =1 {Activity} other {Activities}}</span
>
} @else {
@ -126,7 +126,7 @@
class="gf-table w-100"
mat-table
matSort
[dataSource]="dataSource()"
[dataSource]="dataSource() ?? []"
[matSortActive]="sortColumn"
[matSortDirection]="sortDirection"
[matSortDisabled]="sortDisabled"
@ -574,9 +574,9 @@
}
<mat-paginator
[class.d-none]="(isLoading() && !totalItems) || totalItems <= pageSize"
[class.d-none]="(totalItems ?? 0) <= pageSize"
[hidePageSize]="true"
[length]="totalItems"
[length]="totalItems ?? 0"
[pageIndex]="pageIndex"
[pageSize]="pageSize"
[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'
})
export class GfActivitiesTableComponent implements AfterViewInit, OnInit {
@Input() baseCurrency: string;
@Input() deviceType: string;
@Input() hasActivities: boolean;
@Input() hasPermissionToCreateActivity: boolean;
@Input() hasPermissionToDeleteActivity: boolean;
@Input() hasPermissionToExportActivities: boolean;
@Input() hasPermissionToFilterByType: boolean;
@Input() hasPermissionToImportActivities: boolean;
@Input() hasPermissionToOpenDetails = true;
@Input() hasPermissionToUpdateActivity: boolean;
@Input() locale = getLocale();
@Input() pageIndex: number;
@Input() pageSize = DEFAULT_PAGE_SIZE;
@Input() showActions = true;
@Input() sortColumn: string;
@Input() sortDirection: SortDirection;
@Input() sortDisabled = false;
@Input() totalItems = Number.MAX_SAFE_INTEGER;
@Input() public baseCurrency?: string;
@Input() public deviceType: string;
@Input() public hasActivities: boolean;
@Input() public hasPermissionToCreateActivity: boolean;
@Input() public hasPermissionToDeleteActivity: boolean;
@Input() public hasPermissionToExportActivities: boolean;
@Input() public hasPermissionToFilterByType?: boolean = false;
@Input() public hasPermissionToImportActivities: boolean;
@Input() public hasPermissionToOpenDetails = true;
@Input() public hasPermissionToUpdateActivity: boolean;
@Input() public locale?: string = getLocale();
@Input() public pageIndex: number;
@Input() public pageSize = DEFAULT_PAGE_SIZE;
@Input() public showActions = true;
@Input() public sortColumn: string;
@Input() public sortDirection: SortDirection;
@Input() public sortDisabled = false;
@Input() public totalItems?: number = Number.MAX_SAFE_INTEGER;
@Output() activitiesDeleted = new EventEmitter<void>();
@Output() activityClicked = new EventEmitter<AssetProfileIdentifier>();

Loading…
Cancel
Save