Skip to content

Commit 7f4ab5f

Browse files
committed
fix(primeng): updated tables and tabs
1 parent 3be54f4 commit 7f4ab5f

13 files changed

Lines changed: 34 additions & 19 deletions

File tree

src/app/features/admin-institutions/components/admin-table/admin-table.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
<p-table
7373
[columns]="selectedColumnsComputed()"
7474
[value]="isLoading() ? skeletonData : tableData()"
75-
[autoLayout]="true"
7675
[scrollable]="true"
7776
[sortMode]="'single'"
7877
(onSort)="onSort($event)"

src/app/features/files/pages/file-detail/file-detail.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
}}"
66
/>
77

8-
<p-tabs [value]="selectedTab" (valueChange)="onTabChange(+$event)" class="ml-auto mr-4">
8+
<p-tabs [value]="selectedTab" (valueChange)="onTabChange($event)" class="ml-auto mr-4">
99
<p-tablist>
1010
<p-tab [value]="FileDetailTab.Details">{{ 'files.detail.tabs.details' | translate }}</p-tab>
1111
<p-tab [value]="FileDetailTab.Revisions">{{ 'files.detail.tabs.revisions' | translate }}</p-tab>

src/app/features/files/pages/file-detail/file-detail.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,12 @@ export class FileDetailComponent implements OnInit, OnDestroy {
345345
});
346346
}
347347

348-
onTabChange(index: FileDetailTab): void {
349-
this.selectedTab = index;
348+
onTabChange(event: string | number | undefined): void {
349+
const value = Number(event);
350+
351+
if (!isNaN(value)) {
352+
this.selectedTab = value;
353+
}
350354
}
351355

352356
handleEmailShare(): void {

src/app/features/meetings/pages/meeting-details/meeting-details.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
[totalRecords]="tableParams().totalRecords"
2020
paginatorDropdownAppendTo="body"
2121
[resizableColumns]="true"
22-
[autoLayout]="true"
2322
[scrollable]="true"
2423
[sortMode]="'single'"
2524
[lazy]="true"

src/app/features/my-projects/my-projects.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/>
99

1010
<div class="flex-column flex flex-1 w-full">
11-
<p-tabs [value]="selectedTab()" (valueChange)="onTabChange(+$event)" class="flex-1">
11+
<p-tabs [value]="selectedTab()" (valueChange)="onTabChange($event)" class="flex-1">
1212
@if (isMedium()) {
1313
<p-tablist class="pr-5 pl-5">
1414
@for (tab of tabOptions; track $index) {

src/app/features/my-projects/my-projects.component.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,16 @@ export class MyProjectsComponent implements OnInit {
147147
}
148148
}
149149

150-
onTabChange(tabIndex: number): void {
151-
this.actions.clearMyProjects();
152-
this.selectedTab.set(tabIndex);
153-
this.selectedProjectFilterOption.set(PROJECT_FILTER_OPTIONS[0].value);
154-
const current = this.queryService.getRawParams();
155-
this.queryService.handleTabSwitch(current, this.selectedTab());
150+
onTabChange(event: string | number | undefined): void {
151+
const value = Number(event);
152+
153+
if (!isNaN(value)) {
154+
this.actions.clearMyProjects();
155+
this.selectedTab.set(value);
156+
this.selectedProjectFilterOption.set(PROJECT_FILTER_OPTIONS[0].value);
157+
const current = this.queryService.getRawParams();
158+
this.queryService.handleTabSwitch(current, this.selectedTab());
159+
}
156160
}
157161

158162
onProjectFilterChange(): void {

src/app/features/preprints/pages/my-preprints/my-preprints.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
[totalRecords]="tableParams().totalRecords"
2525
paginatorDropdownAppendTo="body"
2626
[resizableColumns]="true"
27-
[autoLayout]="true"
2827
[scrollable]="true"
2928
[sortMode]="'single'"
3029
[lazy]="true"

src/app/features/project/overview/components/link-resource-dialog/link-resource-dialog.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
[totalRecords]="tableParams().totalRecords"
4646
paginatorDropdownAppendTo="body"
4747
[resizableColumns]="true"
48-
[autoLayout]="true"
4948
[scrollable]="tableParams().scrollable"
5049
[lazy]="true"
5150
[lazyLoadOnInit]="true"

src/app/features/settings/profile-settings/profile-settings.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<osf-sub-header [title]="'settings.profileSettings.title' | translate" [icon]="'fas fa-gear'" />
22

33
<div class="flex-column flex flex-1 w-full">
4-
<p-tabs [value]="selectedTab" (valueChange)="onTabChange(+$event)" class="flex-1">
4+
<p-tabs [value]="selectedTab" (valueChange)="onTabChange($event)" class="flex-1">
55
@if (isMedium()) {
66
<p-tablist class="pr-5 pl-5">
77
@for (item of tabOptions; track $index) {

src/app/features/settings/profile-settings/profile-settings.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ export class ProfileSettingsComponent {
4343

4444
selectedTab = this.tabOption.Name;
4545

46-
onTabChange(index: number): void {
47-
this.selectedTab = index;
46+
onTabChange(event: string | number | undefined): void {
47+
const value = Number(event);
48+
49+
if (!isNaN(value)) {
50+
this.selectedTab = value;
51+
}
4852
}
4953
}

0 commit comments

Comments
 (0)