Skip to content

Commit 70f06b0

Browse files
az108claudeCathy0123456789
authored
Development: Use real buttons and links instead of click-handler divs (#2529)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Catherine Kalra <catherine.kalra@tum.de>
1 parent fde6a7e commit 70f06b0

50 files changed

Lines changed: 606 additions & 257 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ export default [
268268
'prettier/prettier': ['error', { parser: 'angular' }],
269269
'@angular-eslint/template/alt-text': 'error',
270270
'@angular-eslint/template/button-has-type': 'error',
271-
'@angular-eslint/template/click-events-have-key-events': 'error',
271+
'@angular-eslint/template/click-events-have-key-events': ['error', { ignoreWithDirectives: ['jhiClickable'] }],
272272
'@angular-eslint/template/elements-content': 'off',
273273
'@angular-eslint/template/interactive-supports-focus': 'error',
274274
'@angular-eslint/template/label-has-associated-control': 'error',

src/main/webapp/app/interview/interview-booking/selectable-slot-card/selectable-slot-card.component.html

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
<div
2-
class="w-full rounded-lg p-2.5 cursor-pointer transition-all border"
1+
<button
2+
type="button"
3+
class="btn-bare w-full rounded-lg p-2.5 cursor-pointer transition-all border"
34
[class.border-primary-default]="selected()"
45
[class.bg-background-surface-alt]="selected()"
56
[class.hover:bg-background-surface-alt]="selected()"
67
[class.border-border-default]="!selected()"
78
[class.hover:bg-background-surface]="!selected()"
8-
tabindex="0"
9-
role="button"
109
(click)="onSelect()"
11-
(keydown.enter)="onSelect()"
1210
>
1311
<!-- Time Range -->
1412
<div class="text-sm font-semibold text-text">{{ timeRange() }}</div>
@@ -31,4 +29,4 @@
3129
}
3230
</div>
3331
</div>
34-
</div>
32+
</button>

src/main/webapp/app/interview/interview-process-detail/interviewee-section/interviewee-card/interviewee-card.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<div
22
class="flex flex-col lg:flex-row lg:items-center justify-between p-3 bg-background-default border rounded border-border-default min-h-[4rem] h-auto cursor-pointer hover:bg-background-surface transition-colors gap-3"
3+
jhiClickable
4+
role="link"
35
tabindex="0"
4-
role="button"
56
(click)="navigateToAssessment()"
6-
(keydown.enter)="navigateToAssessment()"
77
>
88
<div class="flex flex-col lg:flex-row lg:items-center gap-3 lg:gap-0 flex-1 min-w-0">
99
<!-- Identity Group (Name + Status) - Kept together for alignment -->

src/main/webapp/app/interview/interview-process-detail/interviewee-section/interviewee-card/interviewee-card.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { map } from 'rxjs';
77
import { IntervieweeDTO, IntervieweeDTOStateEnum } from 'app/generated/model/interviewee-dto';
88
import { ButtonComponent } from 'app/shared/components/atoms/button/button.component';
99
import { UserAvatarComponent } from 'app/shared/components/atoms/user-avatar/user-avatar.component';
10+
import { ClickableDirective } from 'app/shared/directives/clickable.directive';
1011
import TranslateDirective from 'app/shared/language/translate.directive';
1112
import { formatDate, formatTimeRange, getLocale } from 'app/shared/util/date-time.util';
1213
import { formatFullName } from 'app/shared/util/name.util';
@@ -18,7 +19,7 @@ import { formatFullName } from 'app/shared/util/name.util';
1819
@Component({
1920
selector: 'jhi-interviewee-card',
2021
standalone: true,
21-
imports: [TranslateModule, TranslateDirective, ButtonComponent, FontAwesomeModule, UserAvatarComponent],
22+
imports: [TranslateModule, TranslateDirective, ButtonComponent, FontAwesomeModule, UserAvatarComponent, ClickableDirective],
2223
templateUrl: './interviewee-card.component.html',
2324
})
2425
export class IntervieweeCardComponent {

src/main/webapp/app/interview/interview-process-detail/interviewee-section/interviewee-section.component.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,7 @@
5555

5656
<!-- Template for name column with checkbox -->
5757
<ng-template #nameTemplate let-row>
58-
<div
59-
class="flex items-center gap-3 cursor-pointer"
60-
tabindex="0"
61-
role="button"
62-
(click)="toggleSelection(row.applicationId)"
63-
(keydown.enter)="toggleSelection(row.applicationId)"
64-
>
58+
<div class="flex items-center gap-3 cursor-pointer" jhiClickable tabindex="0" (click)="toggleSelection(row.applicationId)">
6559
<jhi-checkbox [model]="row.selected" [errorEnabled]="false" (click)="$event.stopPropagation(); toggleSelection(row.applicationId)" />
6660
<jhi-user-avatar [fullName]="row.name" [avatarUrl]="row.avatar" loading="lazy" />
6761
<span class="font-medium text-text-primary">{{ row.name }}</span>

src/main/webapp/app/interview/interview-process-detail/interviewee-section/interviewee-section.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import TranslateDirective from 'app/shared/language/translate.directive';
2222
import { ConfirmDialog } from 'app/shared/components/atoms/confirm-dialog/confirm-dialog';
2323
import { CheckboxComponent } from 'app/shared/components/atoms/checkbox/checkbox.component';
2424
import { UserAvatarComponent } from 'app/shared/components/atoms/user-avatar/user-avatar.component';
25+
import { ClickableDirective } from 'app/shared/directives/clickable.directive';
2526

2627
import { CancelInterviewModalComponent } from '../cancel-interview-modal/cancel-interview-modal.component';
2728

@@ -55,6 +56,7 @@ interface ApplicantRow {
5556
CheckboxComponent,
5657
UserAvatarComponent,
5758
CancelInterviewModalComponent,
59+
ClickableDirective,
5860
],
5961
templateUrl: './interviewee-section.component.html',
6062
})

src/main/webapp/app/interview/interview-process-detail/slots-section/assign-applicant-modal/assign-applicant-modal.component.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,7 @@ <h3 class="text-base font-semibold text-text-primary">{{ slotDate() }} | {{ slot
7676

7777
<ng-template #applicantTpl let-person>
7878
@let displayName = person.user?.name ?? ((person.user?.firstName ?? '') + ' ' + (person.user?.lastName ?? '')).trim();
79-
<div
80-
class="flex items-center gap-3 cursor-pointer"
81-
tabindex="0"
82-
role="button"
83-
(click)="selectApplicant(person)"
84-
(keydown.enter)="selectApplicant(person)"
85-
>
79+
<div class="flex items-center gap-3 cursor-pointer" jhiClickable tabindex="0" (click)="selectApplicant(person)">
8680
<jhi-checkbox [model]="isSelected(person)" [errorEnabled]="false" (click)="$event.stopPropagation(); selectApplicant(person)" />
8781
<jhi-user-avatar [fullName]="displayName" [avatarUrl]="person.user?.avatar" loading="lazy" />
8882
<span class="font-medium text-text-primary">{{ displayName }}</span>

src/main/webapp/app/interview/interview-process-detail/slots-section/assign-applicant-modal/assign-applicant-modal.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { isVirtualLocation } from 'app/shared/util/location.util';
1616
import { CheckboxComponent } from 'app/shared/components/atoms/checkbox/checkbox.component';
1717
import { DynamicTableComponent } from 'app/shared/components/organisms/dynamic-table/dynamic-table.component';
1818
import { UserAvatarComponent } from 'app/shared/components/atoms/user-avatar/user-avatar.component';
19+
import { ClickableDirective } from 'app/shared/directives/clickable.directive';
1920

2021
// Modal component for assigning an applicant to an interview slot.
2122
// Displays available interviewees and allows single selection for slot assignment.
@@ -32,6 +33,7 @@ import { UserAvatarComponent } from 'app/shared/components/atoms/user-avatar/use
3233
CheckboxComponent,
3334
DynamicTableComponent,
3435
UserAvatarComponent,
36+
ClickableDirective,
3537
],
3638
templateUrl: './assign-applicant-modal.component.html',
3739
})

src/main/webapp/app/interview/interview-processes-overview/interview-process-card/interview-process-card.component.html

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
<article
1+
<button
2+
type="button"
23
(click)="onCardClick()"
3-
(keydown.enter)="onCardClick()"
4-
tabindex="0"
5-
role="button"
6-
class="flex flex-row rounded-lg border border-border-default bg-background-default overflow-hidden cursor-pointer transition-all hover:bg-background-surface group"
4+
class="btn-bare flex flex-row rounded-lg border border-border-default bg-background-default overflow-hidden cursor-pointer transition-all hover:bg-background-surface group w-full text-left"
75
[class.opacity-80]="isClosed()"
86
>
97
<!-- Image -->
@@ -89,4 +87,4 @@ <h3 class="text-base font-semibold line-clamp-2 m-0 leading-tight text-text flex
8987
</div>
9088
</div>
9189
</div>
92-
</article>
90+
</button>

src/main/webapp/app/interview/interview-processes-overview/upcoming-interviews-widget/upcoming-interview-card/upcoming-interview-card.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<div
2-
(click)="navigateToAssessment($event)"
3-
(keydown.enter)="navigateToAssessment($event)"
2+
jhiClickable
43
role="link"
54
tabindex="0"
5+
(click)="navigateToAssessment($event)"
66
class="flex flex-col p-3 bg-background-default border rounded-lg border-border-default hover:bg-background-surface gap-2 group h-[8.5rem] w-full overflow-hidden cursor-pointer"
77
>
88
<!-- Row 1: Avatar + Name -->

0 commit comments

Comments
 (0)